Interface Agent
public interface Agent
An in-memory construct to represent the state of a capture agent, and when it was last heard from.
-
Method Summary
Modifier and TypeMethodDescriptionGets the capture agent's capability list.Gets the capture agent's full configuration list.Gets the time at which the agent last checked in.getName()Gets the name of the agent.getState()Gets the state of the agent.getUrl()Gets the url of the agent.voidsetConfiguration(Properties configuration) Sets the capture agent's configuration list.voidsetLastHeardFrom(Long time) Sets the time at which the agent last checked in.voidSets the state of the agent, and updates the time it was last heard from.voidSets the url of the agent.
-
Method Details
-
getName
String getName()Gets the name of the agent.- Returns:
- The name of the agent.
-
setState
Sets the state of the agent, and updates the time it was last heard from.- Parameters:
newState- The new state of the agent. This should defined from the constants inAgentState. This can be equal to the current one if the goal is to update the timestamp.- See Also:
-
getState
String getState()Gets the state of the agent.- Returns:
- The state of the agent. This should be defined from the constants in
AgentState. - See Also:
-
setUrl
Sets the url of the agent.- Parameters:
agentUrl- The url of the agent as determined by the referer header field of its request while registering
-
getUrl
String getUrl()Gets the url of the agent.- Returns:
- the url of the agent.
-
setLastHeardFrom
Sets the time at which the agent last checked in.- Parameters:
time- The number of milliseconds since 1970 when the agent last checked in.
-
getLastHeardFrom
Long getLastHeardFrom()Gets the time at which the agent last checked in.- Returns:
- The number of milliseconds since 1970 when the agent last checked in.
-
getCapabilities
Properties getCapabilities()Gets the capture agent's capability list.- Returns:
- The agent's capabilities, or null if there is an error.
-
getConfiguration
Properties getConfiguration()Gets the capture agent's full configuration list.- Returns:
- The agent's configuration, or null if there is an error.
-
setConfiguration
Sets the capture agent's configuration list.- Parameters:
configuration- The agent's configuration.
-