com.atlassian.confluence.cluster
Class DefaultClusterConfigurationHelper

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

@ParametersAreNonnullByDefault
public class DefaultClusterConfigurationHelper
extends Object
implements ClusterConfigurationHelper

An implementation of ClusterConfigurationHelper which assumes that a cluster of some sort is being used. The specifics of the underlying clustering technology are handled by the ClusterManager. If no cluster is being used, then this class is not appropriate, and NonClusterConfigurationHelper should be used instead.


Field Summary
static String CLUSTER
           
static String CLUSTER_ADDRESS
           
static String CLUSTER_HOME
           
static String CLUSTER_INTERFACE
           
static String CLUSTER_NAME
           
static String CLUSTER_TOUCH_TIME
           
static String CLUSTER_TTL
           
 
Constructor Summary
DefaultClusterConfigurationHelper(com.atlassian.config.ApplicationConfig applicationConfig, ClusterManager clusterManager, SharedDataManager clusterSharedDataManager, LicenseService licenseService, ClusterTouchFile clusterTouchFile)
           
 
Method Summary
 void bootstrapCluster()
          Checks whether clustering is enabled, and bootstraps the cluster manager with an appropriate configuration
 void createCluster(String clusterName, File clusterHome)
          Deprecated. 
 void createCluster(String clusterName, File clusterHome, InetAddress clusterAddress)
          Creates a new cluster with the given name as long as the given cluster does not exist.
 void createCluster(String clusterName, File clusterHome, InetAddress clusterAddress, String networkInterfaceName)
          Creates a new cluster with the given name, on the specified network interface, as long as the given cluster does not exist.
 void createCluster(String clusterName, File clusterHome, String networkInterfaceName)
          Deprecated. 
 List<NetworkInterface> getClusterableInterfaces()
          Return a list of interfaces suitable for clustered communication.
 int getPermittedClusterNodes()
           
 com.atlassian.fugue.Option<File> getSharedHome()
          Return the shared home directory if one has been configured.
 boolean isClusteredInstance()
           
 boolean isLicensedClusterNodesExceeded()
           
 void joinCluster(String clusterName, File clusterHome)
          Deprecated. 
 void joinCluster(String clusterName, File clusterHome, InetAddress clusterAddress)
          Join the named cluster, as long as it exists and the licensed member count is not exceeded.
 void joinCluster(String clusterName, File clusterHome, InetAddress clusterAddress, 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 joinCluster(String clusterName, File clusterHome, String networkInterfaceName)
          Deprecated. 
 void publishConfiguration()
          Publish the configuration of this instance to the shared cluster cache, where it can be loaded by subsequent nodes during setup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLUSTER

public static final String CLUSTER
See Also:
Constant Field Values

CLUSTER_NAME

public static final String CLUSTER_NAME
See Also:
Constant Field Values

CLUSTER_ADDRESS

public static final String CLUSTER_ADDRESS
See Also:
Constant Field Values

CLUSTER_INTERFACE

public static final String CLUSTER_INTERFACE
See Also:
Constant Field Values

CLUSTER_TTL

public static final String CLUSTER_TTL
See Also:
Constant Field Values

CLUSTER_HOME

public static final String CLUSTER_HOME
See Also:
Constant Field Values

CLUSTER_TOUCH_TIME

public static final String CLUSTER_TOUCH_TIME
See Also:
Constant Field Values
Constructor Detail

DefaultClusterConfigurationHelper

public DefaultClusterConfigurationHelper(com.atlassian.config.ApplicationConfig applicationConfig,
                                         ClusterManager clusterManager,
                                         SharedDataManager clusterSharedDataManager,
                                         LicenseService licenseService,
                                         ClusterTouchFile clusterTouchFile)
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:
Always returns false as the licensing model has changed.

joinCluster

@Deprecated
public void joinCluster(String clusterName,
                                   File clusterHome)
                 throws ClusterException
Deprecated. 

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(String clusterName,
                        File clusterHome,
                        InetAddress clusterAddress)
                 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

@Deprecated
public void joinCluster(String clusterName,
                                   File clusterHome,
                                   String networkInterfaceName)
                 throws ClusterException
Deprecated. 

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.

joinCluster

public void joinCluster(String clusterName,
                        File clusterHome,
                        InetAddress clusterAddress,
                        @Nullable
                        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

@Deprecated
public void createCluster(String clusterName,
                                     File clusterHome)
                   throws ClusterException
Deprecated. 

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(String clusterName,
                          File clusterHome,
                          InetAddress clusterAddress)
                   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

@Deprecated
public void createCluster(String clusterName,
                                     File clusterHome,
                                     String networkInterfaceName)
                   throws ClusterException
Deprecated. 

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.

createCluster

public void createCluster(String clusterName,
                          File clusterHome,
                          InetAddress clusterAddress,
                          @Nullable
                          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:
if licensed for clustering, then returns Integer.MAX_VALUE, otherwise returns 0.

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 List<NetworkInterface> 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

getSharedHome

public com.atlassian.fugue.Option<File> getSharedHome()
Description copied from interface: ClusterConfigurationHelper
Return the shared home directory if one has been configured.

Specified by:
getSharedHome in interface ClusterConfigurationHelper
Returns:
shared home directory


Copyright © 2003–2015 Atlassian. All rights reserved.