public class AgentPresenceManager extends Object implements StatusMessageListener, ClusterMembershipListener
| Modifier and Type | Class and Description |
|---|---|
static class |
AgentPresenceManager.AgentPresenceState |
| Constructor and Description |
|---|
AgentPresenceManager(AgentInfo agentInfo,
AgentMessagingLayer agentMessagingLayer) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAgentPresenceListener(AgentPresenceListener l) |
boolean |
agentExists(String agentName)
This method returns true as soon as the AgentPresenceManager is aware
of the existence of the given agent by name.
|
boolean |
isAgentConnected(AgentPropertyPredicate agentPredicate)
This method returns true when the given agent is fully connected, OPERATIONAL
and ready to receive commands.
|
boolean |
isAgentConnected(String agentName)
This method returns true when the given agent is fully connected, OPERATIONAL
and ready to receive commands.
|
List<AgentInfo> |
listConnectedAgents() |
void |
membersJoined(List<String> joined) |
void |
membersLeft(List<String> left) |
void |
onStatusMessage(StatusMessage s)
Called when a status message is received.
|
void |
processConnectionDisconnectionEvent(AgentPresenceManager.AgentPresenceState state,
AgentInfo... agentInfos) |
void |
removeAgentPresenceListener(AgentPresenceListener l) |
boolean |
waitForAgent(AgentPropertyPredicate predicate,
long timeout,
TimeUnit unit)
Deprecated.
use method waitForAgentPredicate
|
boolean |
waitForAgent(String name,
long timeout,
TimeUnit unit)
Deprecated.
use method waitForConnectedAgent
|
boolean |
waitForAgentDisconnection(String name,
long timeout,
TimeUnit unit)
Deprecated.
Use method waitForDisconnectedAgent
|
void |
waitForAgentPredicate(AgentPropertyPredicate predicate,
long timeout,
TimeUnit unit) |
void |
waitForConnectedAgent(String name,
long timeout,
TimeUnit unit) |
void |
waitForDisconnectedAgent(String name,
long timeout,
TimeUnit unit) |
void |
waitForFirstContact(long timeout,
TimeUnit unit) |
public AgentPresenceManager(AgentInfo agentInfo, AgentMessagingLayer agentMessagingLayer)
public void onStatusMessage(StatusMessage s)
StatusMessageListeneronStatusMessage in interface StatusMessageListeners - Status bus message to be processed.public List<AgentInfo> listConnectedAgents()
public final void waitForFirstContact(long timeout,
TimeUnit unit)
public void membersLeft(List<String> left)
membersLeft in interface ClusterMembershipListenerpublic void membersJoined(List<String> joined)
membersJoined in interface ClusterMembershipListenerpublic void processConnectionDisconnectionEvent(AgentPresenceManager.AgentPresenceState state, AgentInfo... agentInfos)
public void addAgentPresenceListener(AgentPresenceListener l)
public void removeAgentPresenceListener(AgentPresenceListener l)
public boolean agentExists(String agentName)
#isAgentConnected(String) instead.agentName - The name of the agentpublic boolean isAgentConnected(String agentName)
agentName - The name of the Agent.public boolean isAgentConnected(AgentPropertyPredicate agentPredicate)
agentPredicate - The predicate to select the Agent.@Deprecated public final boolean waitForAgent(String name, long timeout, TimeUnit unit) throws InterruptedException
name - The name of the Agenttimeout - The time to wait for the agent to become available.unit - The TimeUnit for the timeout.InterruptedExceptionpublic final void waitForConnectedAgent(String name, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutException@Deprecated public final boolean waitForAgent(AgentPropertyPredicate predicate, long timeout, TimeUnit unit) throws InterruptedException
predicate - The predicate to be mettimeout - The time to wait for the agent to become available.unit - The TimeUnit for the timeout.InterruptedExceptionpublic final void waitForAgentPredicate(AgentPropertyPredicate predicate, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutException@Deprecated public final boolean waitForAgentDisconnection(String name, long timeout, TimeUnit unit) throws InterruptedException
name - The name of the Agenttimeout - The time to wait for the agent to become available.unit - The TimeUnit for the timeout.InterruptedExceptionpublic final void waitForDisconnectedAgent(String name, long timeout, TimeUnit unit) throws InterruptedException, TimeoutException
InterruptedExceptionTimeoutExceptionCopyright © 2024 LSST. All rights reserved.