java.lang.Object
org.elasticsearch.cluster.AbstractNamedDiffable<Metadata.Custom>
org.elasticsearch.license.LicensesMetadata
- All Implemented Interfaces:
Diffable<Metadata.Custom>,Metadata.Custom,NamedDiffable<Metadata.Custom>,NamedWriteable,VersionedNamedWriteable,Writeable,ChunkedToXContent
public class LicensesMetadata
extends AbstractNamedDiffable<Metadata.Custom>
implements Metadata.Custom
Contains metadata about registered licenses
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LicenseWhen license is explicitly removed by a user, LICENSE_TOMBSTONE is used as a placeholder in the license metadata.static final StringFields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionLicensesMetadata(StreamInput streamInput) LicensesMetadata(License license, TrialLicenseVersion trialLicenseVersion) -
Method Summary
Modifier and TypeMethodDescriptioncontext()booleanstatic LicenseextractLicense(LicensesMetadata licensesMetadata) static LicensesMetadatafromXContent(org.elasticsearch.xcontent.XContentParser parser) inthashCode()static NamedDiff<Metadata.Custom> readDiffFrom(StreamInput streamInput) toString()Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params ignored) voidwriteTo(StreamOutput streamOutput) Methods inherited from class org.elasticsearch.cluster.AbstractNamedDiffable
diff, get, readDiffFromMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
isFragment, toXContentChunkedV7Methods inherited from interface org.elasticsearch.cluster.metadata.Metadata.Custom
isRestorable
-
Field Details
-
TYPE
- See Also:
-
LICENSE_TOMBSTONE
When license is explicitly removed by a user, LICENSE_TOMBSTONE is used as a placeholder in the license metadata. This enables us to distinguish between the scenario when a cluster never had a license (null) and when a license was removed explicitly (LICENSE_TOMBSTONE). We rely on this to decide whether to generate a unsigned trial license or not. we should only generate a license if no license ever existed in the cluster state
-
-
Constructor Details
-
LicensesMetadata
-
LicensesMetadata
- Throws:
IOException
-
-
Method Details
-
getLicense
-
toString
-
equals
-
hashCode
public int hashCode() -
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable- Specified by:
getWriteableNamein interfaceVersionedNamedWriteable
-
getMinimalSupportedVersion
- Specified by:
getMinimalSupportedVersionin interfaceVersionedNamedWriteable
-
context
- Specified by:
contextin interfaceMetadata.Custom
-
fromXContent
public static LicensesMetadata fromXContent(org.elasticsearch.xcontent.XContentParser parser) throws IOException - Throws:
IOException
-
toXContentChunked
public Iterator<? extends org.elasticsearch.xcontent.ToXContent> toXContentChunked(org.elasticsearch.xcontent.ToXContent.Params ignored) - Specified by:
toXContentChunkedin interfaceChunkedToXContent
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
readDiffFrom
- Throws:
IOException
-
extractLicense
-