Interface VotePollsAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface VotePollsAssignmentSession extends OsidSession

This session provides methods to re-assign Votes to Polls . A Vote may map to multiple Polls objects and removing the last reference to a Vote 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 Vote to another Polls is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignVotes

      boolean canAssignVotes()
      Tests if this user can alter vote/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.
    • canAssignVotesToPolls

      boolean canAssignVotesToPolls(Id pollsId)
      Tests if this user can alter vote/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 vote 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.
    • getAssignablePollsIdsForVote

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

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

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

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