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 String
KARAF_CELLAR_CLUSTER_NODE_CONFIGURATION
static String
KARAF_CLUSTER_CONFIGURATION_INTERNAL_ENDPOINTS
static String
KARAF_CLUSTER_CONFIGURATION_PUBLIC_ENDPOINTS
-
Constructor Summary
Constructors Constructor Description ClusterServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
List<ClusterNode>
getClusterNodes()
Retrieves the list of available nodes for this context server instance.Map<String,Map<String,Serializable>>
getNodeSystemStatistics()
void
init()
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.void
purge(String scope)
Removes all data associated with the provided scope.void
purge(Date date)
Removes all data before the specified date from the context server.void
sendEvent(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 frameworkvoid
setInternalAddress(String internalAddress)
void
setKarafCellarClusterManager(org.apache.karaf.cellar.core.ClusterManager karafCellarClusterManager)
void
setKarafCellarEventProducer(org.apache.karaf.cellar.core.event.EventProducer karafCellarEventProducer)
void
setKarafCellarGroupManager(org.apache.karaf.cellar.core.GroupManager karafCellarGroupManager)
void
setKarafCellarGroupName(String karafCellarGroupName)
void
setNodeStatisticsUpdateFrequency(long nodeStatisticsUpdateFrequency)
void
setOsgiConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin osgiConfigurationAdmin)
void
setPersistenceService(PersistenceService persistenceService)
void
setPublicAddress(String publicAddress)
void
setSchedulerService(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:ClusterService
Retrieves the list of available nodes for this context server instance.- Specified by:
getClusterNodes
in interfaceClusterService
- 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 interfaceClusterService
- 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 interfaceClusterService
- Parameters:
scope
- the scope for which we want to remove data
-
sendEvent
public void sendEvent(Serializable eventObject)
Description copied from interface:ClusterService
This 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:
sendEvent
in 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.
-
-