Package org.infinispan.globalstate
Interface ScopedPersistentState
-
public interface ScopedPersistentStateScopedPersistentState represents state which needs to be persisted, scoped by name (e.g. the cache name). The default implementation of persistent state uses the standardPropertiesformat with the additional rule that order is preserved. In order to verify state consistency (e.g. across a cluster) a checksum of the state's data can be computed. State properties prefixed with the '@' character will not be included as part of the checksum computation (e.g. @timestamp)- Since:
- 8.1
- Author:
- Tristan Tarrant
-
-
Field Summary
Fields Modifier and Type Field Description static StringGLOBAL_SCOPE
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancontainsProperty(String key)Returns whether the state contains a propertyvoidforEach(BiConsumer<String,String> action)Performs the specified action on every entry of the stateintgetChecksum()Returns the checksum of the properties excluding those prefixed with @floatgetFloatProperty(String key)Retrieves a float state propertyintgetIntProperty(String key)Retrieves an integer state propertyStringgetProperty(String key)Retrieves a state propertyStringgetScope()Returns the name of this persistent state's scopevoidsetProperty(String format, float f)Sets a float state property.voidsetProperty(String key, int value)Sets an integer state property.voidsetProperty(String key, String value)Sets a state property.
-
-
-
Field Detail
-
GLOBAL_SCOPE
static final String GLOBAL_SCOPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getScope
String getScope()
Returns the name of this persistent state's scope
-
setProperty
void setProperty(String key, String value)
Sets a state property. Values will be unicode-escaped when written
-
setProperty
void setProperty(String key, int value)
Sets an integer state property.
-
setProperty
void setProperty(String format, float f)
Sets a float state property.
-
getIntProperty
int getIntProperty(String key)
Retrieves an integer state property
-
getFloatProperty
float getFloatProperty(String key)
Retrieves a float state property
-
forEach
void forEach(BiConsumer<String,String> action)
Performs the specified action on every entry of the state
-
getChecksum
int getChecksum()
Returns the checksum of the properties excluding those prefixed with @
-
containsProperty
boolean containsProperty(String key)
Returns whether the state contains a property
-
-