Interface ResourceAgentAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface ResourceAgentAssignmentSession extends OsidSession

This session provides methods to re-assign Resource to Agents . A Resource may be associated with multiple Agents . An Agent may map to only one Resource .

  • Method Details

    • getBinId

      Id getBinId()
      Gets the Bin Id associated with this session.
      Returns:
      the Bin Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBin

      Gets the Bin associated with this session.
      Returns:
      the Bin associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canAssignAgents

      boolean canAssignAgents()
      Tests if this user can alter resource/agent mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignAgentsToResource

      boolean canAssignAgentsToResource(Id resourceId)
      Tests if this user can alter resource/agent mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known location methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      resourceId - the Id of the Resource
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - resourceId is null
      Compliance:
      mandatory - This method must be implemented.
    • assignAgentToResource

      void assignAgentToResource(Id agentId, Id resourceId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing Agent to a Resource .
      Parameters:
      agentId - the Id of the Agent
      resourceId - the Id of the Resource
      Throws:
      AlreadyExistsException - agentId is already assigned to resourceId
      NotFoundException - agentId or resourceId not found
      NullArgumentException - agentId or resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignAgentFromResource

      void unassignAgentFromResource(Id agentId, Id resourceId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes an Agent from a Resource .
      Parameters:
      agentId - the Id of the Agent
      resourceId - the Id of the Resource
      Throws:
      NotFoundException - agentId or resourceId not found or agentId not assigned to resourceId
      NullArgumentException - agentId or resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignAgentToResource

      void reassignAgentToResource(Id agentId, Id fromResourceId, Id toResourceId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves an Agent from one Resource to another.
      Parameters:
      agentId - the Id of the Agent
      fromResourceId - the Id of the current Resource
      toResourceId - the Id of the destination Resource
      Throws:
      AlreadyExistsException - agentId already assigned to toBinId
      NotFoundException - agentId, fromResourceId , or toResourceId not found or agentId not mapped to fromResourceId
      NullArgumentException - agentId, fromResourceId , or toResourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.