Class NonClusterConfigurationHelper
- java.lang.Object
- 
- com.atlassian.confluence.cluster.nonclustered.NonClusterConfigurationHelper
 
- 
- All Implemented Interfaces:
- ClusterConfigurationHelper,- ClusterConfigurationHelperInternal
 
 public class NonClusterConfigurationHelper extends Object implements ClusterConfigurationHelperInternal An implementation ofClusterConfigurationHelperfor use when clustering is not being used. Some methods may throw exceptions if they are used, soisClusteredInstance()should be used to check in advance if the other methods are appropriate to use.
- 
- 
Constructor SummaryConstructors Constructor Description NonClusterConfigurationHelper(com.atlassian.config.ApplicationConfig applicationConfig)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbootstrapCluster(BootstrapDatabaseAccessor.BootstrapDatabaseData bootstrapDatabaseData)Checks whether clustering is enabled, and bootstraps the cluster manager with an appropriate configurationvoidcreateCluster(String clusterName, File clusterHome, String networkInterfaceName, ClusterJoinConfig joinConfig)Creates a new cluster with the given name, on the specified network interface, as long as the given cluster does not exist.voidcreateClusterConfig()Creates and sets up the cluster config file in the shared home if it doesn't already exist.voidcreateSharedHome()Creates shared home directory if it does not exist already.List<NetworkInterface>getClusterableInterfaces()Return a list of interfaces suitable for clustered communication.Optional<String>getSharedBuildNumber()Get the build number stored in the confluence.cfg.xml file in the shared home folderOptional<Object>getSharedProperty(Object key)Get the value of a property stored in the confluence.cfg.xml config file (in the shared home folder)booleanisClusteredInstance()booleanisClusterHomeConfigured()Optional<ClusterJoinConfig>joinConfig()Returns the configured join config if setup has progressed that far.voidpopulateExistingClusterSetupConfig()Merges the config file in shared home into the current config file (in local home folder).voidsaveSetupConfigIntoSharedHome()This method need to be trigger when we finish setup.voidsaveSharedBuildNumber(String sharedBuildNumber)Store the build number into the confluence.cfg.xml file in the shared home foldervoidsaveSharedProperty(Object key, Object value)Save a property into the shared confluence.cfg.xml config file (in the shared home folder)Optional<File>sharedHome()Return the shared home directory if one has been configured.
 
- 
- 
- 
Method Detail- 
isClusteredInstancepublic boolean isClusteredInstance() - Specified by:
- isClusteredInstancein interface- ClusterConfigurationHelper
- Returns:
- true if the application is currently configured to be part of a cluster, otherwise false.
 
 - 
isClusterHomeConfiguredpublic boolean isClusterHomeConfigured() - Specified by:
- isClusterHomeConfiguredin interface- ClusterConfigurationHelper
- Returns:
- true if the application has the confluence.cluster.home property set, otherwise false.
 
 - 
createClusterpublic void createCluster(String clusterName, File clusterHome, String networkInterfaceName, ClusterJoinConfig joinConfig) throws ClusterException Description copied from interface:ClusterConfigurationHelperCreates a new cluster with the given name, on the specified network interface, as long as the given cluster does not exist.- Specified by:
- createClusterin interface- ClusterConfigurationHelper
- Throws:
- ClusterException- if an error setting up the cluster.
 
 - 
bootstrapClusterpublic void bootstrapCluster(BootstrapDatabaseAccessor.BootstrapDatabaseData bootstrapDatabaseData) Description copied from interface:ClusterConfigurationHelperChecks whether clustering is enabled, and bootstraps the cluster manager with an appropriate configuration- Specified by:
- bootstrapClusterin interface- ClusterConfigurationHelper
- Parameters:
- bootstrapDatabaseData- contains the build number and cluster upgrade state information to decide whether this node can join
 
 - 
getClusterableInterfacespublic List<NetworkInterface> getClusterableInterfaces() Description copied from interface:ClusterConfigurationHelperReturn a list of interfaces suitable for clustered communication. The list is ordered for suitable rendering in a UI.- Specified by:
- getClusterableInterfacesin interface- ClusterConfigurationHelper
- Returns:
- List of NetworkInterfaceobjects
 
 - 
sharedHomepublic Optional<File> sharedHome() Description copied from interface:ClusterConfigurationHelperReturn the shared home directory if one has been configured.- Specified by:
- sharedHomein interface- ClusterConfigurationHelper
- Returns:
- shared home directory
 
 - 
joinConfigpublic Optional<ClusterJoinConfig> joinConfig() Description copied from interface:ClusterConfigurationHelperReturns the configured join config if setup has progressed that far.- Specified by:
- joinConfigin interface- ClusterConfigurationHelper
- Returns:
- Join configuration
 
 - 
createSharedHomepublic void createSharedHome() Description copied from interface:ClusterConfigurationHelperInternalCreates shared home directory if it does not exist already.Shared home is created only if not clustering. - Specified by:
- createSharedHomein interface- ClusterConfigurationHelperInternal
 
 - 
saveSetupConfigIntoSharedHomepublic void saveSetupConfigIntoSharedHome() Description copied from interface:ClusterConfigurationHelperInternalThis method need to be trigger when we finish setup. If we setup Confluence Cluster then this method will write all necessary information so from second node won't go to setup again- Specified by:
- saveSetupConfigIntoSharedHomein interface- ClusterConfigurationHelperInternal
 
 - 
populateExistingClusterSetupConfigpublic void populateExistingClusterSetupConfig() Description copied from interface:ClusterConfigurationHelperInternalMerges the config file in shared home into the current config file (in local home folder). Does nothing if the cluster config file doesn't exist.- Specified by:
- populateExistingClusterSetupConfigin interface- ClusterConfigurationHelperInternal
 
 - 
createClusterConfigpublic void createClusterConfig() Description copied from interface:ClusterConfigurationHelperInternalCreates and sets up the cluster config file in the shared home if it doesn't already exist. Does nothing if the cluster config file already exists.- Specified by:
- createClusterConfigin interface- ClusterConfigurationHelperInternal
 
 - 
saveSharedPropertypublic void saveSharedProperty(Object key, Object value) Description copied from interface:ClusterConfigurationHelperInternalSave a property into the shared confluence.cfg.xml config file (in the shared home folder)- Specified by:
- saveSharedPropertyin interface- ClusterConfigurationHelperInternal
- Parameters:
- key- the key of the property
- value- the value of the property
 
 - 
getSharedPropertypublic Optional<Object> getSharedProperty(Object key) Description copied from interface:ClusterConfigurationHelperInternalGet the value of a property stored in the confluence.cfg.xml config file (in the shared home folder)- Specified by:
- getSharedPropertyin interface- ClusterConfigurationHelperInternal
- Parameters:
- key- the key of the property
- Returns:
- the value of the property
 
 - 
saveSharedBuildNumberpublic void saveSharedBuildNumber(String sharedBuildNumber) Description copied from interface:ClusterConfigurationHelperInternalStore the build number into the confluence.cfg.xml file in the shared home folder- Specified by:
- saveSharedBuildNumberin interface- ClusterConfigurationHelperInternal
- Parameters:
- sharedBuildNumber- the shared build number to be saved
 
 - 
getSharedBuildNumberpublic Optional<String> getSharedBuildNumber() Description copied from interface:ClusterConfigurationHelperInternalGet the build number stored in the confluence.cfg.xml file in the shared home folder- Specified by:
- getSharedBuildNumberin interface- ClusterConfigurationHelperInternal
- Returns:
- the shared build number
 
 
- 
 
-