Interface SynchronyProcessManager

  • All Known Implementing Classes:
    DefaultSynchronyProcessManager

    public interface SynchronyProcessManager
    Responsible for starting up, stopping, or restarting the Synchrony process
    • Method Detail

      • isSynchronyClusterManuallyManaged

        boolean isSynchronyClusterManuallyManaged()
        Returns true if external Synchrony cluster is used, and false if Confluence manages Synchrony cluster on its own. External Synchrony cluster can run only for Confluence DC, when synchrony.service.url environmental variable is set.
        Returns:
        true if external Synchrony cluster is used, and false if Confluence manage Synchrony cluster on its own.
      • isSynchronyOff

        boolean isSynchronyOff()
        Returns true if synchrony is switched off (for example, by admin), and false otherwise. This method only checks on/off settings, and ignores state returned by isSynchronyClusterManuallyManaged()
        Returns:
        true if synchrony is switched off, and false 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, and false if Synchrony should be enabled.
      • startup

        io.atlassian.util.concurrent.Promise<Boolean> startup()
        Starts the Synchrony process and returns a Promise<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 calling stop() and then startup(). However, this method waits for ExternalProcess.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.