Interface ClusterMonitor
-
- All Known Implementing Classes:
MultiServerClusterMonitor
,SingleServerClusterMonitor
public interface ClusterMonitor
API for querying status of servers in cluster. Extracted from SessionService class as part of first-pass refactoring to improve SessionService adherence to SRP.- Since:
- 13.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
checkServerUp(String serverId)
Indicates if the specified server is up.String
getCurrentHostServer(SessionID sessionId)
Identify the host (aka home or authoritative) server for the provided session.boolean
isSiteUp(String siteId)
Indicates if the specified site is up.void
shutdown()
Signals that the ClusterMonitor instance should shutdown.
-
-
-
Method Detail
-
isSiteUp
boolean isSiteUp(String siteId)
Indicates if the specified site is up.- Parameters:
siteId
- A possibly null Site Id.- Returns:
- True if the Site is up, False if it failed to respond to a query.
-
checkServerUp
boolean checkServerUp(String serverId)
Indicates if the specified server is up.- Parameters:
serverId
- server id- Returns:
- true if server is up, false otherwise
-
getCurrentHostServer
String getCurrentHostServer(SessionID sessionId) throws SessionException
Identify the host (aka home or authoritative) server for the provided session. If the currently assigned host server for the session is found to be down, this method uses a deterministic algorithm to select a new one from those known to the clustering servive based on the session's STORAGE_KEY. This is the key method of "internal request routing".- Parameters:
sessionId
- SessionID for which the home server is to be found- Returns:
- server id for the server instance determined to be the current host
- Throws:
SessionException
-
shutdown
void shutdown()
Signals that the ClusterMonitor instance should shutdown. Once called the instance will not receive any further calls.
-
-