Interface RacePollsAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface RacePollsAssignmentSession extends OsidSession

This session provides methods to re-assign Races to Polls objects A Race may appear in multiple Polls objects and removing the last reference to a Race is the equivalent of deleting it. Each Polls may have its own authorizations governing who is allowed to operate on it.

Moving or adding a reference of a Race to another Polls is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignRaces

      boolean canAssignRaces()
      Tests if this user can alter race/polls 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.
    • canAssignRacesToPolls

      boolean canAssignRacesToPolls(Id pollsId)
      Tests if this user can alter race/polls 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.
      Parameters:
      pollsId - the Id of the Polls
      Returns:
      false if mapping is not authorized, true otherwise
      Throws:
      NullArgumentException - pollsId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignablePollsIds

      IdList getAssignablePollsIds(Id pollsId) throws OperationFailedException
      Gets a list of polls including and under the given polls node in which any race can be assigned.
      Parameters:
      pollsId - the Id of the Polls
      Returns:
      list of assignable polls Ids
      Throws:
      NullArgumentException - pollsId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • getAssignablePollsIdsForRace

      IdList getAssignablePollsIdsForRace(Id pollsId, Id raceId) throws OperationFailedException
      Gets a list of polls including and under the given polls node in which a specific race can be assigned.
      Parameters:
      pollsId - the Id of the Polls
      raceId - the Id of the Race
      Returns:
      list of assignable polls Ids
      Throws:
      NullArgumentException - polls or raceId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • assignRaceToPolls

      Adds an existing Race to a Polls .
      Parameters:
      raceId - the Id of the Race
      pollsId - the Id of the Polls
      Throws:
      AlreadyExistsException - raceId is already assigned to pollsId
      NotFoundException - raceId or pollsId not found
      NullArgumentException - raceId or pollsId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignRaceFromPolls

      void unassignRaceFromPolls(Id raceId, Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Race from a Polls .
      Parameters:
      raceId - the Id of the Race
      pollsId - the Id of the Polls
      Throws:
      NotFoundException - raceId or pollsId not found or raceId not assigned to pollsId
      NullArgumentException - raceId or pollsId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignRaceToPolls

      void reassignRaceToPolls(Id raceId, Id fromPollsId, Id toPollsId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Race from one Polls to another. Mappings to other Polls are unaffected.
      Parameters:
      raceId - the Id of the Race
      fromPollsId - the Id of the current Polls
      toPollsId - the Id of the destination Polls
      Throws:
      AlreadyExistsException - raceId already assigned to toPollsId
      NotFoundException - raceId, fromPollsId , or toPollsId not found or raceId not mapped to fromPollsId
      NullArgumentException - raceId, fromPollsId , or toPollsId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.