com.atlassian.confluence.cluster
Interface ClusterManager

All Superinterfaces:
LockFactory, NameResolver
All Known Implementing Classes:
HazelcastClusterManager, NonClusterManager

public interface ClusterManager
extends NameResolver, LockFactory


Method Summary
 void configure(ClusterConfig config)
          Set a new cluster configuration.
 java.util.Collection<ClusterNodeInformation> getAllNodesInformation()
           
 ClusteredLock getClusteredLock(java.lang.String key)
          Deprecated. 5.6 Use ClusterLockService.getLockForName(String) instead.
 ClusterInformation getClusterInformation()
          Get information about the running cluster.
 ClusterInvariants getClusterInvariants()
          Get all attributes of the server that must be consistent between cluster nodes.
<T> com.atlassian.core.task.FifoBuffer<T>
getFifoBuffer(java.lang.String name)
          Get a distributed FIFO buffer
 java.util.Map<java.lang.Integer,NodeStatus> getNodeStatuses()
          Deprecated. since 5.5 Use getNodeStatusMap()
 java.util.Map<ClusterNodeInformation,NodeStatus> getNodeStatusMap()
          Gets status information from all members of the cluster.
 int getPermittedClusterNodes()
          Deprecated. Since 5.6. Use LicenseService.isLicensedForDataCenter() instead as licensing is now based on clustering capability, not the number of nodes.
 java.io.Serializable getPublishedObject(java.lang.String key)
          Retrieve an object which another node in the cluster has shared, return null if no such object exists
 ClusterNodeInformation getThisNodeInformation()
           Get the identity of this node in the cluster.
 boolean isClustered()
           
 boolean isClusterSupported()
          Check whether this Confluence distribution is capable of running in a cluster.
 boolean isConfigured()
           
 void publishEvent(ConfluenceEvent event)
          Publish an event as a ClusterEventWrapper to other nodes
 void publishObject(java.lang.String key, java.io.Serializable object)
          Share an object to the cluster under a particular key.
 void reconfigure(ClusterConfig config)
          Set a new cluster configuration and cycle the service
 void startCluster()
          Start the clustering service
 void stopCluster()
          Stop the clustering service
 
Methods inherited from interface com.atlassian.confluence.cluster.NameResolver
resolveName
 
Methods inherited from interface com.atlassian.confluence.concurrent.LockFactory
getLock
 

Method Detail

isClusterSupported

boolean isClusterSupported()
Check whether this Confluence distribution is capable of running in a cluster. This differs from isClustered() in that it will return true if the code to support clustering is present, even if this instance does not have a clustered license or a current clustering configuration.

Returns:
true if this Confluence installation is capable of running in a cluster

publishObject

void publishObject(java.lang.String key,
                   java.io.Serializable object)
Share an object to the cluster under a particular key. Note that once an object is published it will remain available for the duration of the cluster.

Parameters:
key -
object -

getPublishedObject

java.io.Serializable getPublishedObject(java.lang.String key)
Retrieve an object which another node in the cluster has shared, return null if no such object exists

Parameters:
key -
Returns:
a shared Object

isClustered

boolean isClustered()
Returns:
true if this instance is configured to allow clustering with other nodes. Note, this does not mean this instance is licensed to cluster.

getPermittedClusterNodes

@Deprecated
int getPermittedClusterNodes()
Deprecated. Since 5.6. Use LicenseService.isLicensedForDataCenter() instead as licensing is now based on clustering capability, not the number of nodes.

Returns:
if licensed for clustering, then returns Integer.MAX_VALUE, otherwise returns 0.

getClusterInformation

ClusterInformation getClusterInformation()
Get information about the running cluster.


getClusteredLock

@Deprecated
ClusteredLock getClusteredLock(java.lang.String key)
Deprecated. 5.6 Use ClusterLockService.getLockForName(String) instead.

Get a distributed lock -- getting the lock does *not* imply that it has been acquired. Call Lock.tryLock() or Lock.lock() on the returned object to acquire the lock.


getFifoBuffer

<T> com.atlassian.core.task.FifoBuffer<T> getFifoBuffer(java.lang.String name)
Get a distributed FIFO buffer


publishEvent

void publishEvent(ConfluenceEvent event)
Publish an event as a ClusterEventWrapper to other nodes


getThisNodeInformation

@Nullable
ClusterNodeInformation getThisNodeInformation()

Get the identity of this node in the cluster. ClusterNodeInformation implements equals().

Returns:
the identity of this node in the cluster. May return null if the node is not in a cluster.

getAllNodesInformation

java.util.Collection<ClusterNodeInformation> getAllNodesInformation()

configure

void configure(ClusterConfig config)
Set a new cluster configuration.

Parameters:
config -

isConfigured

boolean isConfigured()
Returns:
true if configure(ClusterConfig) has been called with a valid configuration, otherwise false.

reconfigure

void reconfigure(ClusterConfig config)
Set a new cluster configuration and cycle the service

Parameters:
config -

stopCluster

void stopCluster()
Stop the clustering service


startCluster

void startCluster()
Start the clustering service


getNodeStatuses

@Deprecated
java.util.Map<java.lang.Integer,NodeStatus> getNodeStatuses()
Deprecated. since 5.5 Use getNodeStatusMap()

Gets status information from all members of the cluster.

Returns:
a map of node IDs to node statuses

getNodeStatusMap

java.util.Map<ClusterNodeInformation,NodeStatus> getNodeStatusMap()
Gets status information from all members of the cluster.

Since:
5.6

getClusterInvariants

ClusterInvariants getClusterInvariants()
                                       throws ClusterException
Get all attributes of the server that must be consistent between cluster nodes. They are to be retrieved from another member in the cluster. If there are no other members currently active in the cluster, then return null.

Returns:
the cluster invariants of this server
Throws:
ClusterException - if the invariants can not be gathered for some reason


Copyright © 2003-2014 Atlassian. All Rights Reserved.