com.atlassian.confluence.cluster
Class DefaultClusterConfigurationHelper

java.lang.Object
  extended by com.atlassian.confluence.cluster.DefaultClusterConfigurationHelper
All Implemented Interfaces:
ClusterConfigurationHelper

public class DefaultClusterConfigurationHelper
extends java.lang.Object
implements ClusterConfigurationHelper


Field Summary
static java.lang.String CLUSTER
           
static java.lang.String CLUSTER_ADDRESS
           
static java.lang.String CLUSTER_INTERFACE
           
static java.lang.String CLUSTER_NAME
           
static java.lang.String CLUSTER_TTL
           
 
Constructor Summary
DefaultClusterConfigurationHelper()
           
 
Method Summary
 void bootstrapCluster()
          Checks whether clustering is enabled, and bootstraps the cluster manager with an appropriate configuration
 void createCluster(java.lang.String clusterName)
          Creates a new cluster with the given name as long as the given cluster does not exist.
 void createCluster(java.lang.String clusterName, java.lang.String networkInterfaceName)
          Creates a new cluster with the given name, on the specified network interface, as long as the given cluster does not exist.
 java.util.List getClusterableInterfaces()
          Return a list of interfaces suitable for clustered communication.
 int getPermittedClusterNodes()
           
 boolean isClusteredInstance()
           
 boolean isLicensedClusterNodesExceeded()
           
 void joinCluster(java.lang.String clusterName)
          Join the named cluster, as long as it exists and the licensed member count is not exceeded.
 void joinCluster(java.lang.String clusterName, java.lang.String networkInterfaceName)
          Join the named cluster, on the specified network interface, as long as it exists and the licensed member count is not exceeded.
 void publishConfiguration()
          Publish the configuration of this instance to the shared cluster cache, where it can be loaded by subsequent nodes during setup.
 void setApplicationConfig(com.atlassian.config.ApplicationConfig applicationConfig)
           
 void setCacheConfigLoader(CacheConfigurationLoader cacheConfigLoader)
           
 void setClusterManager(ClusterManager clusterManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLUSTER

public static final java.lang.String CLUSTER
See Also:
Constant Field Values

CLUSTER_NAME

public static final java.lang.String CLUSTER_NAME
See Also:
Constant Field Values

CLUSTER_ADDRESS

public static final java.lang.String CLUSTER_ADDRESS
See Also:
Constant Field Values

CLUSTER_INTERFACE

public static final java.lang.String CLUSTER_INTERFACE
See Also:
Constant Field Values

CLUSTER_TTL

public static final java.lang.String CLUSTER_TTL
See Also:
Constant Field Values
Constructor Detail

DefaultClusterConfigurationHelper

public DefaultClusterConfigurationHelper()
Method Detail

isClusteredInstance

public boolean isClusteredInstance()
Specified by:
isClusteredInstance in interface ClusterConfigurationHelper
Returns:
true if the application is currently configured to be part of a cluster, otherwise false.

isLicensedClusterNodesExceeded

public boolean isLicensedClusterNodesExceeded()
Specified by:
isLicensedClusterNodesExceeded in interface ClusterConfigurationHelper
Returns:
true if the cluster which this node belongs to has more members than is allowed by the license, otherwise false.

joinCluster

public void joinCluster(java.lang.String clusterName)
                 throws ClusterException
Description copied from interface: ClusterConfigurationHelper
Join the named cluster, as long as it exists and the licensed member count is not exceeded.

Specified by:
joinCluster in interface ClusterConfigurationHelper
Throws:
ClusterException - if an error joining the cluster.

joinCluster

public void joinCluster(java.lang.String clusterName,
                        java.lang.String networkInterfaceName)
                 throws ClusterException
Description copied from interface: ClusterConfigurationHelper
Join the named cluster, on the specified network interface, as long as it exists and the licensed member count is not exceeded.

Specified by:
joinCluster in interface ClusterConfigurationHelper
Throws:
ClusterException - if an error joining the cluster.

createCluster

public void createCluster(java.lang.String clusterName)
                   throws ClusterException
Description copied from interface: ClusterConfigurationHelper
Creates a new cluster with the given name as long as the given cluster does not exist.

Specified by:
createCluster in interface ClusterConfigurationHelper
Throws:
ClusterException - if an error setting up the cluster.

createCluster

public void createCluster(java.lang.String clusterName,
                          java.lang.String networkInterfaceName)
                   throws ClusterException
Description copied from interface: ClusterConfigurationHelper
Creates a new cluster with the given name, on the specified network interface, as long as the given cluster does not exist.

Specified by:
createCluster in interface ClusterConfigurationHelper
Throws:
ClusterException - if an error setting up the cluster.

bootstrapCluster

public void bootstrapCluster()
                      throws ClusterException
Description copied from interface: ClusterConfigurationHelper
Checks whether clustering is enabled, and bootstraps the cluster manager with an appropriate configuration

Specified by:
bootstrapCluster in interface ClusterConfigurationHelper
Throws:
ClusterException - if there was an error configuring the cluster manager, or if the licensed nodes were exceeded by joining the cluster.

getPermittedClusterNodes

public int getPermittedClusterNodes()
Specified by:
getPermittedClusterNodes in interface ClusterConfigurationHelper
Returns:
the number of clustered nodes permitted by the license on this instance of Confluence.

publishConfiguration

public void publishConfiguration()
Description copied from interface: ClusterConfigurationHelper
Publish the configuration of this instance to the shared cluster cache, where it can be loaded by subsequent nodes during setup.

Specified by:
publishConfiguration in interface ClusterConfigurationHelper

getClusterableInterfaces

public java.util.List getClusterableInterfaces()
Description copied from interface: ClusterConfigurationHelper
Return a list of interfaces suitable for clustered communication. The list is ordered for suitable rendering in a UI.

Specified by:
getClusterableInterfaces in interface ClusterConfigurationHelper
Returns:
List of NetworkInterface objects

setClusterManager

public void setClusterManager(ClusterManager clusterManager)

setApplicationConfig

public void setApplicationConfig(com.atlassian.config.ApplicationConfig applicationConfig)

setCacheConfigLoader

public void setCacheConfigLoader(CacheConfigurationLoader cacheConfigLoader)


Copyright © 2003-2011 Atlassian. All Rights Reserved.