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 -
Method Summary
Modifier and TypeMethodDescriptionReturns a map containing various configuration information.Returns the configured environment value for the provided key.boolean
Returnstrue
if external Synchrony cluster is used, andfalse
if Confluence manages Synchrony cluster on its own.boolean
Returnstrue
if synchrony is switched off (for example, by admin), andfalse
otherwise.default boolean
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 Details
-
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
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
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.
-