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
-
-
Field Summary
Fields Modifier and Type Field Description static StringKARAF_CELLAR_CLUSTER_NODE_CONFIGURATIONstatic StringKARAF_CLUSTER_CONFIGURATION_INTERNAL_ENDPOINTSstatic StringKARAF_CLUSTER_CONFIGURATION_PUBLIC_ENDPOINTS
-
Constructor Summary
Constructors Constructor Description ClusterServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()List<ClusterNode>getClusterNodes()Retrieves the list of available nodes for this context server instance.Map<String,Map<String,Serializable>>getNodeSystemStatistics()voidinit()booleanisClusterConfigPIDAllowed(org.apache.karaf.cellar.core.Group group, String category, String pid, org.apache.karaf.cellar.core.event.EventType type)Check if a configuration is allowed.voidpurge(String scope)Removes all data associated with the provided scope.voidpurge(Date date)Removes all data before the specified date from the context server.voidsendEvent(Serializable eventObject)This function will send an event to the nodes of the cluster The function takes a Serializable to avoid dependency on any clustering frameworkvoidsetInternalAddress(String internalAddress)voidsetKarafCellarClusterManager(org.apache.karaf.cellar.core.ClusterManager karafCellarClusterManager)voidsetKarafCellarEventProducer(org.apache.karaf.cellar.core.event.EventProducer karafCellarEventProducer)voidsetKarafCellarGroupManager(org.apache.karaf.cellar.core.GroupManager karafCellarGroupManager)voidsetKarafCellarGroupName(String karafCellarGroupName)voidsetNodeStatisticsUpdateFrequency(long nodeStatisticsUpdateFrequency)voidsetOsgiConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin osgiConfigurationAdmin)voidsetPersistenceService(PersistenceService persistenceService)voidsetPublicAddress(String publicAddress)voidsetSchedulerService(SchedulerService schedulerService)
-
-
-
Field Detail
-
KARAF_CELLAR_CLUSTER_NODE_CONFIGURATION
public static final String KARAF_CELLAR_CLUSTER_NODE_CONFIGURATION
- See Also:
- Constant Field Values
-
KARAF_CLUSTER_CONFIGURATION_PUBLIC_ENDPOINTS
public static final String KARAF_CLUSTER_CONFIGURATION_PUBLIC_ENDPOINTS
- See Also:
- Constant Field Values
-
KARAF_CLUSTER_CONFIGURATION_INTERNAL_ENDPOINTS
public static final String KARAF_CLUSTER_CONFIGURATION_INTERNAL_ENDPOINTS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setPersistenceService
public void setPersistenceService(PersistenceService persistenceService)
-
setKarafCellarClusterManager
public void setKarafCellarClusterManager(org.apache.karaf.cellar.core.ClusterManager karafCellarClusterManager)
-
setKarafCellarEventProducer
public void setKarafCellarEventProducer(org.apache.karaf.cellar.core.event.EventProducer karafCellarEventProducer)
-
setKarafCellarGroupManager
public void setKarafCellarGroupManager(org.apache.karaf.cellar.core.GroupManager karafCellarGroupManager)
-
setKarafCellarGroupName
public void setKarafCellarGroupName(String karafCellarGroupName)
-
setOsgiConfigurationAdmin
public void setOsgiConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin osgiConfigurationAdmin)
-
setPublicAddress
public void setPublicAddress(String publicAddress)
-
setInternalAddress
public void setInternalAddress(String internalAddress)
-
setNodeStatisticsUpdateFrequency
public void setNodeStatisticsUpdateFrequency(long nodeStatisticsUpdateFrequency)
-
setSchedulerService
public void setSchedulerService(SchedulerService schedulerService)
-
getNodeSystemStatistics
public Map<String,Map<String,Serializable>> getNodeSystemStatistics()
-
init
public void init()
-
destroy
public void destroy()
-
getClusterNodes
public List<ClusterNode> 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
public void purge(Date date)
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
public void purge(String scope)
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
-
sendEvent
public void sendEvent(Serializable eventObject)
Description copied from interface:ClusterServiceThis function will send an event to the nodes of the cluster The function takes a Serializable to avoid dependency on any clustering framework- Specified by:
sendEventin interfaceClusterService- Parameters:
eventObject- this object will be cast to a org.apache.karaf.cellar.core.event.Event object
-
isClusterConfigPIDAllowed
public boolean isClusterConfigPIDAllowed(org.apache.karaf.cellar.core.Group group, String category, String pid, org.apache.karaf.cellar.core.event.EventType type)Check if a configuration is allowed.- Parameters:
group- the cluster group.category- the configuration category constant.pid- the configuration PID.type- the cluster event type.- Returns:
- true if the cluster event type is allowed, false else.
-
-