Interface SynchronyProcessManager
-
- All Known Implementing Classes:
DefaultSynchronyProcessManager
public interface SynchronyProcessManagerResponsible for starting up, stopping, or restarting the Synchrony process
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSynchronyProcessManager.ExternalProcessState
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Map<String,String>getConfiguration()Returns a map containing various configuration information.StringgetSynchronyProperty(SynchronyEnv env)Returns the configured environment value for the provided key.booleanisSynchronyClusterManuallyManaged()Returnstrueif external Synchrony cluster is used, andfalseif Confluence manages Synchrony cluster on its own.booleanisSynchronyOff()Returnstrueif synchrony is switched off (for example, by admin), andfalseotherwise.default booleanisSynchronyStartingUp()Determines if the Synchrony that Confluence uses to connect to is in the process of starting up.io.atlassian.util.concurrent.Promise<Boolean>restart()Shuts down and then starts up the Synchrony process.voidsetSynchronyOff(boolean off)Sets flag to the database, which indicates if synchrony should run as external process, and represents results of the admin actions.io.atlassian.util.concurrent.Promise<Boolean>startup()Starts the Synchrony process and returns aPromise<Boolean>which indicates a if startup was successful or not.booleanstop()Terminates the Synchrony process.
-
-
-
Method Detail
-
isSynchronyClusterManuallyManaged
boolean isSynchronyClusterManuallyManaged()
Returnstrueif external Synchrony cluster is used, andfalseif Confluence manages Synchrony cluster on its own. External Synchrony cluster can run only for Confluence DC, whensynchrony.service.urlenvironmental variable is set.- Returns:
trueif external Synchrony cluster is used, andfalseif Confluence manage Synchrony cluster on its own.
-
isSynchronyOff
boolean isSynchronyOff()
Returnstrueif synchrony is switched off (for example, by admin), andfalseotherwise. This method only checks on/off settings, and ignores state returned byisSynchronyClusterManuallyManaged()- Returns:
trueif synchrony is switched off, andfalseotherwise.
-
setSynchronyOff
void setSynchronyOff(boolean off)
Sets flag to the database, which indicates if synchrony should run as external process, and represents results of the admin actions.- Parameters:
off-trueif Synchrony should be disabled, andfalseif Synchrony should be enabled.
-
startup
io.atlassian.util.concurrent.Promise<Boolean> startup()
Starts the Synchrony process and returns aPromise<Boolean>which indicates a if startup was successful or not. If the promise resolves to true, the Synchrony process should be ready to serve requests.- Returns:
- a promise which resolves to a boolean indicating if startup was successful or not.
-
stop
boolean stop()
Terminates the Synchrony process.
-
getSynchronyProperty
String getSynchronyProperty(SynchronyEnv env)
Returns the configured environment value for the provided key.- Parameters:
env- the key that will be looked up- Returns:
- the configured environment property
-
restart
io.atlassian.util.concurrent.Promise<Boolean> restart()
Shuts down and then starts up the Synchrony process. This is effectively the same as callingstop()and thenstartup(). However, this method waits forExternalProcess.isAlive()to return false in between stopping and starting.- Returns:
- a promise which resolves to a boolean indicating if restart was successful or not.
-
getConfiguration
Map<String,String> getConfiguration()
Returns a map containing various configuration information.
-
isSynchronyStartingUp
default boolean isSynchronyStartingUp()
Determines if the Synchrony that Confluence uses to connect to is in the process of starting up.- Returns:
- true iff Synchrony is starting up and has not encountered an error.
-
-