Class DefaultSynchronyMonitor
- java.lang.Object
-
- com.atlassian.confluence.plugins.synchrony.bootstrap.DefaultSynchronyMonitor
-
- All Implemented Interfaces:
SynchronyMonitor
@Component public class DefaultSynchronyMonitor extends Object implements SynchronyMonitor
-
-
Constructor Summary
Constructors Constructor Description DefaultSynchronyMonitor(com.atlassian.confluence.plugins.synchrony.config.SynchronyConfigurationManager configurationManager, com.atlassian.confluence.plugins.synchrony.bootstrap.SynchronyExecutorServiceProvider executorServiceProvider, com.atlassian.sal.api.net.RequestFactory<?> requestFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelHeartbeat()
Cancels polling the Synchrony heartbeat rest endpoint if a poll is currently in progress, useful when Synchrony is shutdown before it is able to resolve a successful heartbeat result.boolean
isSynchronyUp()
Determines if the Synchrony that Confluence uses to connect to is currently running or not.io.atlassian.util.concurrent.Promise<Boolean>
pollHeartbeat()
Ping the Synchrony heartbeat rest endpoint, until the result is a 200 OK or a timeout is reached.
-
-
-
Constructor Detail
-
DefaultSynchronyMonitor
@Autowired public DefaultSynchronyMonitor(com.atlassian.confluence.plugins.synchrony.config.SynchronyConfigurationManager configurationManager, com.atlassian.confluence.plugins.synchrony.bootstrap.SynchronyExecutorServiceProvider executorServiceProvider, com.atlassian.sal.api.net.RequestFactory<?> requestFactory)
-
-
Method Detail
-
isSynchronyUp
public boolean isSynchronyUp()
Description copied from interface:SynchronyMonitor
Determines if the Synchrony that Confluence uses to connect to is currently running or not.- Specified by:
isSynchronyUp
in interfaceSynchronyMonitor
- Returns:
- true iff Synchrony is running and responding to requests.
-
pollHeartbeat
public io.atlassian.util.concurrent.Promise<Boolean> pollHeartbeat()
Description copied from interface:SynchronyMonitor
Ping the Synchrony heartbeat rest endpoint, until the result is a 200 OK or a timeout is reached.- Specified by:
pollHeartbeat
in interfaceSynchronyMonitor
- Returns:
- a Promise with value true iff Synchrony responds with a successful heartbeat within the timeout.
-
cancelHeartbeat
public void cancelHeartbeat()
Description copied from interface:SynchronyMonitor
Cancels polling the Synchrony heartbeat rest endpoint if a poll is currently in progress, useful when Synchrony is shutdown before it is able to resolve a successful heartbeat result.- Specified by:
cancelHeartbeat
in interfaceSynchronyMonitor
-
-