Package org.togglz.hazelcast
Class HazelcastStateRepository
- java.lang.Object
-
- org.togglz.hazelcast.HazelcastStateRepository
-
- All Implemented Interfaces:
StateRepository
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();- Author:
- Camiel de Vleeschauwer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHazelcastStateRepository.BuilderBuilder for aHazelcastStateRepository.
-
Field Summary
Fields Modifier and Type Field Description protected com.hazelcast.client.config.ClientConfighazelcastClientConfigprotected com.hazelcast.config.ConfighazelcastConfigprotected com.hazelcast.core.HazelcastInstancehazelcastInstanceprotected StringmapName
-
Constructor Summary
Constructors Constructor Description HazelcastStateRepository(com.hazelcast.client.config.ClientConfig hazelcastClientConfig, String mapName)HazelcastStateRepository(com.hazelcast.config.Config hazelcastConfig, String mapName)HazelcastStateRepository(com.hazelcast.core.HazelcastInstance hazelcastInstance, String mapName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FeatureStategetFeatureState(Feature feature)static HazelcastStateRepository.BuildernewBuilder()Creates a new builder for creating aHazelcastStateRepository.static HazelcastStateRepository.BuildernewBuilder(String mapName)Creates a new builder for creating aHazelcastStateRepository.voidsetFeatureState(FeatureState featureState)
-
-
-
Field Detail
-
hazelcastInstance
protected final com.hazelcast.core.HazelcastInstance hazelcastInstance
-
hazelcastConfig
protected final com.hazelcast.config.Config hazelcastConfig
-
hazelcastClientConfig
protected final com.hazelcast.client.config.ClientConfig hazelcastClientConfig
-
mapName
protected final String mapName
-
-
Constructor Detail
-
HazelcastStateRepository
public HazelcastStateRepository(com.hazelcast.config.Config hazelcastConfig, String mapName)
-
HazelcastStateRepository
public HazelcastStateRepository(com.hazelcast.client.config.ClientConfig hazelcastClientConfig, String mapName)
-
HazelcastStateRepository
public HazelcastStateRepository(com.hazelcast.core.HazelcastInstance hazelcastInstance, String mapName)
-
-
Method Detail
-
getFeatureState
public FeatureState getFeatureState(Feature feature)
- Specified by:
getFeatureStatein interfaceStateRepository
-
setFeatureState
public void setFeatureState(FeatureState featureState)
- Specified by:
setFeatureStatein interfaceStateRepository
-
newBuilder
public static HazelcastStateRepository.Builder newBuilder()
Creates a new builder for creating aHazelcastStateRepository.
-
newBuilder
public static HazelcastStateRepository.Builder newBuilder(String mapName)
Creates a new builder for creating aHazelcastStateRepository.- Parameters:
mapName- the Hazelcast map name
-
-