public class ClusterStateService extends GeneralTaskRunnable
ClusterStateService
monitors the state of Server instances
that are part of the current Site. It also monitors the state of remote
Sites via the same mechanism.
This functionality is used as part of making "internal request routing"
requests.
Note: This service will monitor all provided Sites regardless of whether they are
the same Site as the current Server.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_PERIOD
default StateInfo check time 10 milliseconds
|
static int |
DEFAULT_TIMEOUT
individual server wait default time out 10 milliseconds
|
static Debug |
sessionDebug
Service Globals
|
headTask, nextTask, previousTask
Modifier | Constructor and Description |
---|---|
protected |
ClusterStateService(String localServerId,
int timeout,
long period,
Map<String,String> serverMembers,
Map<String,String> siteMembers)
Constructs an instance for the cluster service
|
Modifier and Type | Method and Description |
---|---|
boolean |
addElement(Object obj)
Implements for GeneralTaskRunnable.
|
protected Set<String> |
getDownServersAndSites()
Get Server and Site IDs which are in a Down State.
|
protected String |
getLocalServerId()
Get our Local Server Id
|
long |
getRunPeriod()
Implements for GeneralTaskRunnable
|
protected Map<String,com.iplanet.dpro.session.service.cluster.ClusterStateService.StateInfo> |
getServers()
Get Servers within Cluster
|
protected com.iplanet.dpro.session.service.cluster.ClusterStateService.StateInfo[] |
getServerSelectionList()
Get the Server Selection List, common to all Servers
in Cluster.
|
boolean |
isEmpty()
Implements for GeneralTaskRunnable.
|
protected boolean |
isLocalServerId(String serverId)
Is Specified ServerId our Local Server Id?
|
boolean |
isSiteUp(String siteId)
Indicates the state of a given Site ID.
|
boolean |
removeElement(Object obj)
Implements for GeneralTaskRunnable.
|
void |
run()
Monitoring logic used by background thread
|
String |
toString() |
cancel, getHeadTask, isScheduled, next, previous, scheduledExecutionTime, setHeadTask, setNext, setPrevious
public static Debug sessionDebug
public static final int DEFAULT_TIMEOUT
public static final long DEFAULT_PERIOD
protected ClusterStateService(String localServerId, int timeout, long period, Map<String,String> serverMembers, Map<String,String> siteMembers) throws Exception
localServerId
- id of the server instance in which this ClusterStateService instance is runningtimeout
- timeout for waiting on an individual server (millisec)period
- checking cycle period (millisecs)serverMembers
- map of Server ID to URL for all cluster Server members.siteMembers
- Mapping of Site ID to URL for all Sites.Exception
- If there was an unexpected error initialising the ClusterStateService.protected Map<String,com.iplanet.dpro.session.service.cluster.ClusterStateService.StateInfo> getServers()
protected Set<String> getDownServersAndSites()
protected com.iplanet.dpro.session.service.cluster.ClusterStateService.StateInfo[] getServerSelectionList()
protected String getLocalServerId()
protected boolean isLocalServerId(String serverId)
serverId
- public boolean isSiteUp(String siteId)
isUp(String)
however, it actively validates that the ID provided is a Site ID.public long getRunPeriod()
public boolean addElement(Object obj)
obj
- Element to be added to this TaskRunnablepublic boolean removeElement(Object obj)
obj
- Element to be removed from this TaskRunnablepublic boolean isEmpty()
public void run()
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.