public class HazelcastStateRepository extends Object implements StateRepository
A state repository which stores the feature state in a Hazelcast distributed map.
The class provides a builder which can be used to configure the Hazelcast instance and map to be used:
StateRepository repository = HazelcastStateRepository.newBuilder().mapName("my_map")
.config(hazelcastConfig).build();
| Modifier and Type | Class and Description |
|---|---|
static class |
HazelcastStateRepository.Builder
Builder for a
HazelcastStateRepository. |
| Modifier and Type | Field and Description |
|---|---|
protected com.hazelcast.config.Config |
hazelcastConfig |
protected com.hazelcast.core.HazelcastInstance |
hazelcastInstance |
protected String |
mapName |
| Constructor and Description |
|---|
HazelcastStateRepository(com.hazelcast.config.Config hazelcastConfig,
String mapName) |
| Modifier and Type | Method and Description |
|---|---|
FeatureState |
getFeatureState(Feature feature) |
static HazelcastStateRepository.Builder |
newBuilder()
Creates a new builder for creating a
HazelcastStateRepository. |
static HazelcastStateRepository.Builder |
newBuilder(String mapName)
Creates a new builder for creating a
HazelcastStateRepository. |
void |
setFeatureState(FeatureState featureState) |
protected final com.hazelcast.core.HazelcastInstance hazelcastInstance
protected final com.hazelcast.config.Config hazelcastConfig
protected final String mapName
public HazelcastStateRepository(com.hazelcast.config.Config hazelcastConfig,
String mapName)
public FeatureState getFeatureState(Feature feature)
getFeatureState in interface StateRepositorypublic void setFeatureState(FeatureState featureState)
setFeatureState in interface StateRepositorypublic static HazelcastStateRepository.Builder newBuilder()
HazelcastStateRepository.public static HazelcastStateRepository.Builder newBuilder(String mapName)
HazelcastStateRepository.mapName - the Hazelcast map nameCopyright © 2017. All Rights Reserved.