Class 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
    • Constructor Detail

      • ClusteredStore

        public ClusteredStore()
    • Method Detail

      • postConstruct

        @PostConstruct
        public void postConstruct()
      • collect

        public void collect​(fish.payara.monitoring.collect.MonitoringDataCollector collector)
        Specified by:
        collect in interface fish.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 from
        key - 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:
      • 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