Interface SynchronyProcessManager
-
- All Known Implementing Classes:
DefaultSynchronyProcessManager
public interface SynchronyProcessManager
Responsible for starting up, stopping, or restarting the Synchrony process
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SynchronyProcessManager.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.String
getSynchronyProperty(SynchronyEnv env)
Returns the configured environment value for the provided key.boolean
isSynchronyClusterManuallyManaged()
Returnstrue
if external Synchrony cluster is used, andfalse
if Confluence manages Synchrony cluster on its own.boolean
isSynchronyOff()
Returnstrue
if synchrony is switched off (for example, by admin), andfalse
otherwise.default boolean
isSynchronyStartingUp()
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.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.io.atlassian.util.concurrent.Promise<Boolean>
startup()
Starts the Synchrony process and returns aPromise<Boolean>
which indicates a if startup was successful or not.boolean
stop()
Terminates the Synchrony process.
-
-
-
Method Detail
-
isSynchronyClusterManuallyManaged
boolean isSynchronyClusterManuallyManaged()
Returnstrue
if external Synchrony cluster is used, andfalse
if Confluence manages Synchrony cluster on its own. External Synchrony cluster can run only for Confluence DC, whensynchrony.service.url
environmental variable is set.- Returns:
true
if external Synchrony cluster is used, andfalse
if Confluence manage Synchrony cluster on its own.
-
isSynchronyOff
boolean isSynchronyOff()
Returnstrue
if synchrony is switched off (for example, by admin), andfalse
otherwise. This method only checks on/off settings, and ignores state returned byisSynchronyClusterManuallyManaged()
- Returns:
true
if synchrony is switched off, andfalse
otherwise.
-
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
-true
if Synchrony should be disabled, andfalse
if 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.
-
-