java.lang.Object
org.elasticsearch.license.License
- All Implemented Interfaces:
org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject
Data structure for license. Use
License.Builder to build a license.
Provides serialization/deserialization & validation methods for license object-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classstatic enumstatic enumDecouples operation mode of a license from the license type value.Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NodeFeaturestatic final Comparator<License> static final StringXContent param name to deserialize license(s) with no signaturestatic final StringXContent param name to deserialize licenses according to a specific license versionstatic final StringXContent param name to deserialize license(s) with an additionalstatusfield, indicating whether a particular license is 'active' or 'expired' and no signature and in a human readable formatstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final StringSet forRestApiVersion.V_7requests only XContent param name to map the "enterprise" license type to "platinum" for backwards compatibility with older clientsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Method Summary
Modifier and TypeMethodDescriptionstatic License.Builderbuilder()booleanlongThe expiration date as it appears in the license.static LicensefromSource(BytesReference bytes, org.elasticsearch.xcontent.XContentType xContentType) static LicensefromXContent(org.elasticsearch.xcontent.XContentParser parser) inthashCode()static booleanisAutoGeneratedLicense(String signature) Returns true if the license was auto-generated (by license plugin), false otherwiselongissuedTo()issuer()intmaxNodes()intstatic Licenselongorg.elasticsearch.xcontent.XContentBuildertoInnerXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) toString()org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) type()uid()booleanverified()intversion()voidwriteTo(StreamOutput out) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
INDEPENDENT_TRIAL_VERSION_FEATURE
-
VERSION_START
public static final int VERSION_START- See Also:
-
VERSION_NO_FEATURE_TYPE
public static final int VERSION_NO_FEATURE_TYPE- See Also:
-
VERSION_START_DATE
public static final int VERSION_START_DATE- See Also:
-
VERSION_CRYPTO_ALGORITHMS
public static final int VERSION_CRYPTO_ALGORITHMS- See Also:
-
VERSION_ENTERPRISE
public static final int VERSION_ENTERPRISE- See Also:
-
VERSION_CURRENT
public static final int VERSION_CURRENT- See Also:
-
REST_VIEW_MODE
XContent param name to deserialize license(s) with an additionalstatusfield, indicating whether a particular license is 'active' or 'expired' and no signature and in a human readable format- See Also:
-
LICENSE_SPEC_VIEW_MODE
XContent param name to deserialize license(s) with no signature- See Also:
-
LICENSE_VERSION_MODE
XContent param name to deserialize licenses according to a specific license version- See Also:
-
XCONTENT_HIDE_ENTERPRISE
Set forRestApiVersion.V_7requests only XContent param name to map the "enterprise" license type to "platinum" for backwards compatibility with older clients- See Also:
-
LATEST_ISSUE_DATE_FIRST
-
-
Method Details
-
version
public int version()- Returns:
- version of the license
-
uid
- Returns:
- a unique identifier for a license
-
type
- Returns:
- type of the license [trial, subscription, internal]
-
issueDate
public long issueDate()- Returns:
- the issueDate in milliseconds
-
startDate
public long startDate()- Returns:
- the startDate in milliseconds
-
expiryDate
public long expiryDate()The expiration date as it appears in the license. For most uses, preferLicenseUtils.getExpiryDate(License), as in rare cases the effective expiration date may differ from the expiration date specified in the license.- Returns:
- the expiry date in milliseconds
-
maxNodes
public int maxNodes()- Returns:
- the maximum number of nodes this license has been issued for, or
-1if this license is not node based.
-
maxResourceUnits
public int maxResourceUnits()- Returns:
- the maximum number of "resource units" this license has been issued for, or
-1if this license is not resource based. A "resource unit" is a measure of computing power (RAM/CPU), the definition of which is maintained outside of the license format, or this class.
-
issuedTo
- Returns:
- a string representing the entity this licenses has been issued to
-
issuer
- Returns:
- a string representing the entity responsible for issuing this license (internal)
-
signature
- Returns:
- a string representing the signature of the license used for license verification
-
operationMode
- Returns:
- the operation mode of the license as computed from the license type
-
verified
public boolean verified() -
readLicense
- Throws:
IOException
-
writeTo
- Throws:
IOException
-
toString
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
toInnerXContent
public org.elasticsearch.xcontent.XContentBuilder toInnerXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Throws:
IOException
-
fromXContent
public static License fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
isAutoGeneratedLicense
Returns true if the license was auto-generated (by license plugin), false otherwise -
fromSource
public static License fromSource(BytesReference bytes, org.elasticsearch.xcontent.XContentType xContentType) throws IOException - Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
builder
-