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 TypeMethodDescriptionvoid
destroy()
Retrieves the list of available nodes for this context server instance.void
init()
void
Initializes scheduled tasks for cluster management.boolean
Check if a persistence service is available.void
Removes all data associated with the provided scope.void
Removes all data before the specified date from the context server.void
setBundleWatcher
(BundleWatcher bundleWatcher) Sets the bundle watcher used to retrieve server informationvoid
setInternalAddress
(String internalAddress) void
void
setNodeStatisticsUpdateFrequency
(long nodeStatisticsUpdateFrequency) void
setPersistenceService
(PersistenceService persistenceService) For unit tests and backward compatibility - directly sets the persistence servicevoid
setPublicAddress
(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:ClusterService
Retrieves the list of available nodes for this context server instance.- Specified by:
getClusterNodes
in interfaceClusterService
- Returns:
- a list of
ClusterNode
-
purge
Description copied from interface:ClusterService
Removes all data before the specified date from the context server.- Specified by:
purge
in interfaceClusterService
- Parameters:
date
- the Date before which all data needs to be removed
-
purge
Description copied from interface:ClusterService
Removes all data associated with the provided scope.- Specified by:
purge
in 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)
-