Module org.elasticsearch.server
Class ProjectStateRegistry
java.lang.Object
org.elasticsearch.cluster.AbstractNamedDiffable<ClusterState.Custom>
org.elasticsearch.cluster.project.ProjectStateRegistry
- All Implemented Interfaces:
ClusterState.Custom,Diffable<ClusterState.Custom>,NamedDiffable<ClusterState.Custom>,NamedWriteable,VersionedNamedWriteable,Writeable,ChunkedToXContent
public class ProjectStateRegistry
extends AbstractNamedDiffable<ClusterState.Custom>
implements ClusterState.Custom, NamedDiffable<ClusterState.Custom>
Represents a registry for managing and retrieving project-specific state in the cluster state.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ProjectStateRegistry.Builderbuilder()static ProjectStateRegistry.Builderbuilder(ClusterState original) static ProjectStateRegistry.Builderbuilder(ProjectStateRegistry projectRegistry) diff(ClusterState.Custom previousState) Returns serializable object representing differences between this and previousStatebooleanstatic ProjectStateRegistryget(ClusterState clusterState) The minimal version of the recipient this object can be sent to.getProjectSettings(ProjectId projectId) static SettingsgetProjectSettings(ProjectId projectId, ClusterState clusterState) Retrieves the settings for a specific project based on its project ID from the specified cluster state without creating a new object.longReturns the name of the writeable objectinthashCode()booleanhasProject(ProjectId projectId) booleanisProjectMarkedForDeletion(ProjectId projectId) static NamedDiff<ClusterState.Custom> intsize()toString()Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params) Serialize thisClusterState.Customfor diagnostic purposes, exposed by thevoidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.cluster.AbstractNamedDiffable
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, toXContentChunked, toXContentChunkedV8Methods inherited from interface org.elasticsearch.cluster.ClusterState.Custom
isPrivateMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
supportsVersion
-
Field Details
-
TYPE
- See Also:
-
EMPTY
-
-
Constructor Details
-
ProjectStateRegistry
- Throws:
IOException
-
-
Method Details
-
get
-
hasProject
-
getProjectSettings
Retrieves the settings for a specific project based on its project ID from the specified cluster state without creating a new object. If you need a full state of the project rather than just its setting, please useClusterState.projectState(ProjectId)- Parameters:
projectId- id of the projectclusterState- cluster state- Returns:
- the settings for the specified project, or an empty settings object if no settings are found
-
getProjectSettings
-
getProjectsMarkedForDeletion
-
isProjectMarkedForDeletion
-
toXContentChunked
Description copied from interface:ClusterState.CustomSerialize thisClusterState.Customfor diagnostic purposes, exposed by theGET _cluster/state
API etc. The XContent representation does not need to be 100% faithful since we never reconstruct a cluster state from its XContent representation, but the more faithful it is the more useful it is for diagnostics.- Specified by:
toXContentChunkedin interfaceChunkedToXContent- Specified by:
toXContentChunkedin interfaceClusterState.Custom- Returns:
- iterator over chunks of
ToXContent
-
readDiffFrom
- Throws:
IOException
-
diff
Description copied from interface:DiffableReturns serializable object representing differences between this and previousState- Specified by:
diffin interfaceDiffable<ClusterState.Custom>- Overrides:
diffin classAbstractNamedDiffable<ClusterState.Custom>
-
getWriteableName
Description copied from interface:VersionedNamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable- Specified by:
getWriteableNamein interfaceVersionedNamedWriteable
-
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteableThe minimal version of the recipient this object can be sent to. SeeVersionedNamedWriteable.supportsVersion(TransportVersion)for the default serialization check.- Specified by:
getMinimalSupportedVersionin interfaceVersionedNamedWriteable
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
size
public int size() -
getProjectsMarkedForDeletionGeneration
public long getProjectsMarkedForDeletionGeneration() -
toString
-
equals
-
hashCode
public int hashCode() -
builder
-
builder
-
builder
-