Class AgentImpl

java.lang.Object
org.opencastproject.capture.admin.impl.AgentImpl
All Implemented Interfaces:
org.opencastproject.capture.admin.api.Agent

@Entity public class AgentImpl extends Object implements org.opencastproject.capture.admin.api.Agent
An in-memory construct to represent the state of a capture agent, and when it was last heard from.
  • Field Details

    • name

      protected String name
      The name of the agent.
    • state

      protected String state
      The state of the agent. This should be defined from the constants in AgentState.
    • url

      protected String url
      The URL of the agent. This is determined from the referer header parameter when the agent is registered.
    • organization

      protected String organization
    • lastHeardFrom

      protected Long 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

      protected Set<String> schedulerRoles
      The roles allowed to schedule this agent
    • configurationString

      protected String 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 belongs
      agentState - The state of the agent. This should be defined from the constants in AgentState
      configuration - The configuration of the agent.
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.getName()
    • setState

      public void setState(String newState)
      Specified by:
      setState in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.setState(java.lang.String)
    • getState

      public String getState()
      Specified by:
      getState in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.getState()
    • setUrl

      public void setUrl(String agentUrl)
      Specified by:
      setUrl in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.setUrl(java.lang.String)
    • getUrl

      public String getUrl()
      Specified by:
      getUrl in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.getUrl()
    • setLastHeardFrom

      public void setLastHeardFrom(Long time)
      Specified by:
      setLastHeardFrom in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.setLastHeardFrom(java.lang.Long)
    • getLastHeardFrom

      public Long getLastHeardFrom()
      Specified by:
      getLastHeardFrom in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.getLastHeardFrom()
    • getCapabilities

      public Properties getCapabilities()
      Specified by:
      getCapabilities in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.getCapabilities()
    • getConfiguration

      public Properties getConfiguration()
      Specified by:
      getConfiguration in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.getConfiguration()
    • getSchedulerRoles

      public Set<String> getSchedulerRoles()
      Returns:
      the schedulerRoles
    • setSchedulerRoles

      public void setSchedulerRoles(Set<String> schedulerRoles)
      Parameters:
      schedulerRoles - the schedulerRoles to set
    • getOrganization

      public String getOrganization()
      Returns:
      the organization
    • setOrganization

      public void setOrganization(String organization)
      Parameters:
      organization - the organization to set
    • setConfiguration

      public void setConfiguration(Properties configuration)
      Specified by:
      setConfiguration in interface org.opencastproject.capture.admin.api.Agent
      See Also:
      • Agent.setConfiguration(java.util.Properties)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also: