Class ClusterServiceImpl
java.lang.Object
org.apache.unomi.services.impl.cluster.ClusterServiceImpl
- All Implemented Interfaces:
ClusterService
Implementation of the persistence service interface
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Retrieves the list of available nodes for this context server instance.voidinit()voidInitializes scheduled tasks for cluster management.booleanCheck if a persistence service is available.voidRemoves all data associated with the provided scope.voidRemoves all data before the specified date from the context server.voidsetBundleWatcher(BundleWatcher bundleWatcher) Sets the bundle watcher used to retrieve server informationvoidsetInternalAddress(String internalAddress) voidvoidsetNodeStatisticsUpdateFrequency(long nodeStatisticsUpdateFrequency) voidsetPersistenceService(PersistenceService persistenceService) For unit tests and backward compatibility - directly sets the persistence servicevoidsetPublicAddress(String publicAddress)
-
Constructor Details
-
ClusterServiceImpl
public ClusterServiceImpl()
-
-
Method Details
-
setBundleWatcher
Sets the bundle watcher used to retrieve server information- Parameters:
bundleWatcher- the bundle watcher
-
setPersistenceService
For unit tests and backward compatibility - directly sets the persistence service- Parameters:
persistenceService- the persistence service to set
-
setPublicAddress
-
setInternalAddress
-
setNodeStatisticsUpdateFrequency
public void setNodeStatisticsUpdateFrequency(long nodeStatisticsUpdateFrequency) -
setNodeId
-
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
Description copied from interface:ClusterServiceRetrieves the list of available nodes for this context server instance.- Specified by:
getClusterNodesin interfaceClusterService- Returns:
- a list of
ClusterNode
-
purge
Description copied from interface:ClusterServiceRemoves all data before the specified date from the context server.- Specified by:
purgein interfaceClusterService- Parameters:
date- the Date before which all data needs to be removed
-
purge
Description copied from interface:ClusterServiceRemoves all data associated with the provided scope.- Specified by:
purgein interfaceClusterService- 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)
-