Package fish.payara.nucleus.store
Class ClusteredStore
- java.lang.Object
-
- fish.payara.nucleus.store.ClusteredStore
-
- All Implemented Interfaces:
fish.payara.monitoring.collect.MonitoringDataSource
,EventListener
@Service(name="payara-cluster-store") @RunLevel(10) public class ClusteredStore extends Object implements EventListener, fish.payara.monitoring.collect.MonitoringDataSource
Very Simple Store interface to Hazelcast- Author:
- steve
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.api.event.EventListener
EventListener.Event<T>
-
-
Constructor Summary
Constructors Constructor Description ClusteredStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
collect(fish.payara.monitoring.collect.MonitoringDataCollector collector)
boolean
containsKey(String storeName, Serializable key)
Checks to see if a a key already exists in Hazelcast.void
event(EventListener.Event event)
Process a Glassfish/Payara eventSerializable
get(String storeName, Serializable key)
Gets the value from Hazelcast with the specified key in the given store.UUID
getInstanceId()
Map<Serializable,Serializable>
getMap(String storeName)
Gets all the key/value pairs in a given Hazelcast store.boolean
isEnabled()
Returns true if Hazelcast is enabledvoid
postConstruct()
boolean
remove(String storeName, Serializable key)
Removes a key/value pair of a Hazelcast store.boolean
set(String storeName, Serializable key, Serializable value)
Stores a value in Hazelcast
-
-
-
Method Detail
-
postConstruct
@PostConstruct public void postConstruct()
-
collect
public void collect(fish.payara.monitoring.collect.MonitoringDataCollector collector)
- Specified by:
collect
in interfacefish.payara.monitoring.collect.MonitoringDataSource
-
getInstanceId
public UUID getInstanceId()
-
isEnabled
public boolean isEnabled()
Returns true if Hazelcast is enabled- Returns:
-
set
public boolean set(String storeName, Serializable key, Serializable value)
Stores a value in Hazelcast- Parameters:
storeName
- The name of the store to put the value into. This will be created if it does not already exist.key
-value
-- Returns:
- true if the operation succeeded, false otherwise
-
remove
public boolean remove(String storeName, Serializable key)
Removes a key/value pair of a Hazelcast store. The store will be created if it does not already exist.- Parameters:
storeName
- The name of the store to remove fromkey
- The key to remove- Returns:
- true if the operation succeeded, false otherwise
-
containsKey
public boolean containsKey(String storeName, Serializable key)
Checks to see if a a key already exists in Hazelcast. The store will be created if it does not already exist.- Parameters:
storeName
-key
-- Returns:
-
get
public Serializable get(String storeName, Serializable key)
Gets the value from Hazelcast with the specified key in the given store. The store will be created if it does not already exist.- Parameters:
storeName
-key
-- Returns:
-
event
public void event(EventListener.Event event)
Description copied from interface:EventListener
Process a Glassfish/Payara event- Specified by:
event
in interfaceEventListener
-
getMap
public Map<Serializable,Serializable> getMap(String storeName)
Gets all the key/value pairs in a given Hazelcast store.Part of MicroProfile Config
- Parameters:
storeName
- The store name to lookup- Returns:
- Since:
- 4.1.2.173
-
-