Class ClusterServiceImpl

java.lang.Object
org.apache.unomi.services.impl.cluster.ClusterServiceImpl
All Implemented Interfaces:
ClusterService

public class ClusterServiceImpl extends Object implements ClusterService
Implementation of the persistence service interface
  • Constructor Details

    • ClusterServiceImpl

      public ClusterServiceImpl()
  • Method Details

    • setBundleWatcher

      public void setBundleWatcher(BundleWatcher bundleWatcher)
      Sets the bundle watcher used to retrieve server information
      Parameters:
      bundleWatcher - the bundle watcher
    • setPersistenceService

      public void setPersistenceService(PersistenceService persistenceService)
      For unit tests and backward compatibility - directly sets the persistence service
      Parameters:
      persistenceService - the persistence service to set
    • setPublicAddress

      public void setPublicAddress(String publicAddress)
    • setInternalAddress

      public void setInternalAddress(String internalAddress)
    • setNodeStatisticsUpdateFrequency

      public void setNodeStatisticsUpdateFrequency(long nodeStatisticsUpdateFrequency)
    • setNodeId

      public void setNodeId(String nodeId)
    • getNodeSystemStatistics

      public Map<String,Map<String,Serializable>> getNodeSystemStatistics()
    • init

      public void init()
    • initializeScheduledTasks

      public void initializeScheduledTasks()
      Initializes scheduled tasks for cluster management. This method can be called later if schedulerService wasn't available during init.
    • destroy

      public void destroy()
    • getClusterNodes

      public List<ClusterNode> getClusterNodes()
      Description copied from interface: ClusterService
      Retrieves the list of available nodes for this context server instance.
      Specified by:
      getClusterNodes in interface ClusterService
      Returns:
      a list of ClusterNode
    • purge

      public void purge(Date date)
      Description copied from interface: ClusterService
      Removes all data before the specified date from the context server.
      Specified by:
      purge in interface ClusterService
      Parameters:
      date - the Date before which all data needs to be removed
    • purge

      public void purge(String scope)
      Description copied from interface: ClusterService
      Removes all data associated with the provided scope.
      Specified by:
      purge in interface ClusterService
      Parameters:
      scope - the scope for which we want to remove data
    • isPersistenceServiceAvailable

      public boolean isPersistenceServiceAvailable()
      Check if a persistence service is available. This can be used to quickly check before performing operations.
      Returns:
      true if a persistence service is available (either directly set or via tracker)