Interface VoteEnablerPollsAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface VoteEnablerPollsAssignmentSession extends OsidSession

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

Adding a reference of a VoteEnabler to another Polls is not a copy operation (eg: does not change its Id ).

  • Method Details

    • canAssignVoteEnablers

      boolean canAssignVoteEnablers()
      Tests if this user can alter vote enabler/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. T his 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.
    • canAssignVoteEnablerToPolls

      boolean canAssignVoteEnablerToPolls(Id pollsId)
      Tests if this user can alter vote enabler/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. T his 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 enabler 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.
    • getAssignablePollsIdsForVoteEnabler

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

      void assignVoteEnablerToPolls(Id voteEnablerId, Id pollsId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing VoteEnabler to a Polls .
      Parameters:
      voteEnablerId - the Id of the VoteEnabler
      pollsId - the Id of the Polls
      Throws:
      AlreadyExistsException - voteEnablerId is already assigned to pollsId
      NotFoundException - voteEnablerId or pollsId not found
      NullArgumentException - voteEnablerId or pollsId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignVoteEnablerFromPolls

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

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