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
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.Builder
builder()
static ProjectStateRegistry.Builder
builder
(ClusterState original) static ProjectStateRegistry.Builder
builder
(ProjectStateRegistry projectRegistry) The minimal version of the recipient this object can be sent to.static Settings
getProjectSettings
(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.Returns the name of the writeable objectstatic NamedDiff
<ClusterState.Custom> int
size()
Iterator
<? extends ToXContent> toXContentChunked
(ToXContent.Params params) Serialize thisClusterState.Custom
for diagnostic purposes, exposed by thevoid
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.cluster.AbstractNamedDiffable
diff, get, readDiffFrom
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
isFragment, toXContentChunked, toXContentChunkedV8
Methods inherited from interface org.elasticsearch.cluster.ClusterState.Custom
isPrivate
Methods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
supportsVersion
-
Field Details
-
TYPE
- See Also:
-
EMPTY
-
-
Constructor Details
-
ProjectStateRegistry
- Throws:
IOException
-
-
Method Details
-
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
-
toXContentChunked
Description copied from interface:ClusterState.Custom
Serialize thisClusterState.Custom
for 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:
toXContentChunked
in interfaceChunkedToXContent
- Specified by:
toXContentChunked
in interfaceClusterState.Custom
- Returns:
- iterator over chunks of
ToXContent
-
readDiffFrom
- Throws:
IOException
-
getWriteableName
Description copied from interface:VersionedNamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
- Specified by:
getWriteableName
in interfaceVersionedNamedWriteable
-
getMinimalSupportedVersion
Description copied from interface:VersionedNamedWriteable
The minimal version of the recipient this object can be sent to. SeeVersionedNamedWriteable.supportsVersion(TransportVersion)
for the default serialization check.- Specified by:
getMinimalSupportedVersion
in interfaceVersionedNamedWriteable
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
size
public int size() -
builder
-
builder
-
builder
-