Class AgentImpl
java.lang.Object
org.opencastproject.capture.admin.impl.AgentImpl
- All Implemented Interfaces:
Agent
An in-memory construct to represent the state of a capture agent, and when it was last heard from.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe capabilities the agent has Capabilities are the devices this agent can record from, with a friendly name associated to determine their nature (e.g.protected LongThe time at which the agent last checked in with this service.protected StringThe name of the agent.protected StringThe roles allowed to schedule this agentprotected StringThe state of the agent.protected StringThe URL of the agent. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets 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.inthashCode()voidsetConfiguration(Properties configuration) Sets the capture agent's configuration list.voidsetLastHeardFrom(Long time) Sets the time at which the agent last checked in.voidsetOrganization(String organization) voidsetSchedulerRoles(Set<String> schedulerRoles) voidSets the state of the agent, and updates the time it was last heard from.voidSets the url of the agent.
-
Field Details
-
name
The name of the agent. -
state
The state of the agent. This should be defined from the constants in AgentState. -
url
The URL of the agent. This is determined from the referer header parameter when the agent is registered. -
organization
-
lastHeardFrom
The time at which the agent last checked in with this service. Note that this is an absolute timestamp (ie, milliseconds since 1970) rather than a relative timestamp (ie, it's been 3000 ms since it last checked in). -
schedulerRoles
The roles allowed to schedule this agent -
configurationString
The capabilities the agent has Capabilities are the devices this agent can record from, with a friendly name associated to determine their nature (e.g. PRESENTER --> dev/video0)
-
-
Constructor Details
-
AgentImpl
public AgentImpl()Required 0-arg constructor for JAXB, creates a blank agent. -
AgentImpl
public AgentImpl(String agentName, String organization, String agentState, String agentUrl, Properties configuration) Builds a representation of the agent.- Parameters:
agentName- The name of the agent.organization- The organization identifier to which this agent belongsagentState- The state of the agent. This should be defined from the constants in AgentStateconfiguration- The configuration of the agent.
-
-
Method Details
-
getName
Gets the name of the agent. -
setState
Sets the state of the agent, and updates the time it was last heard from.- Specified by:
setStatein interfaceAgent- 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
Gets the state of the agent.- Specified by:
getStatein interfaceAgent- Returns:
- The state of the agent. This should be defined from the constants in
AgentState. - See Also:
-
setUrl
Sets the url of the agent. -
getUrl
Gets the url of the agent. -
setLastHeardFrom
Sets the time at which the agent last checked in.- Specified by:
setLastHeardFromin interfaceAgent- Parameters:
time- The number of milliseconds since 1970 when the agent last checked in.- See Also:
-
getLastHeardFrom
Gets the time at which the agent last checked in.- Specified by:
getLastHeardFromin interfaceAgent- Returns:
- The number of milliseconds since 1970 when the agent last checked in.
- See Also:
-
getCapabilities
Gets the capture agent's capability list.- Specified by:
getCapabilitiesin interfaceAgent- Returns:
- The agent's capabilities, or null if there is an error.
- See Also:
-
getConfiguration
Gets the capture agent's full configuration list.- Specified by:
getConfigurationin interfaceAgent- Returns:
- The agent's configuration, or null if there is an error.
- See Also:
-
getSchedulerRoles
- Returns:
- the schedulerRoles
-
setSchedulerRoles
- Parameters:
schedulerRoles- the schedulerRoles to set
-
getOrganization
- Returns:
- the organization
-
setOrganization
- Parameters:
organization- the organization to set
-
setConfiguration
Sets the capture agent's configuration list.- Specified by:
setConfigurationin interfaceAgent- Parameters:
configuration- The agent's configuration.- See Also:
-
equals
-
hashCode
public int hashCode()
-