Interface RaceConstrainerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface RaceConstrainerAdminSession extends OsidSession

This session creates and removes race constrainers. The data for create and update is provided via the RaceConstrainerForm .

  • Method Details

    • getPollsId

      Id getPollsId()
      Gets the Polls Id associated with this session.
      Returns:
      the Polls Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getPolls

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

      boolean canCreateRaceConstrainer()
      Tests if this user can create race constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a RaceConstrainer will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if RaceConstrainer creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateRaceConstrainerWithRecordTypes

      boolean canCreateRaceConstrainerWithRecordTypes(Type[] raceConstrainerRecordTypes)
      Tests if this user can create a single RaceConstrainer using the desired record types. While VotingRulesManager.getRaceConstrainerRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific RaceConstrainer . Providing an empty array tests if a RaceConstrainer can be created with no records.
      Parameters:
      raceConstrainerRecordTypes - array of race constrainer record types
      Returns:
      true if RaceConstrainer creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - raceConstrainerRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getRaceConstrainerFormForCreate

      RaceConstrainerForm getRaceConstrainerFormForCreate(Type[] raceConstrainerRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the race constrainer form for creating new race constrainers. A new form should be requested for each create transaction.
      Parameters:
      raceConstrainerRecordTypes - array of race constrainer record types
      Returns:
      the race constrainer form
      Throws:
      NullArgumentException - raceConstrainerRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createRaceConstrainer

      RaceConstrainer createRaceConstrainer(RaceConstrainerForm raceConstrainerForm) throws OperationFailedException, PermissionDeniedException
      Creates a new RaceConstrainer .
      Parameters:
      raceConstrainerForm - the form for this RaceConstrainer
      Returns:
      the new RaceConstrainer
      Throws:
      IllegalStateException - raceConstrainerForm already used for a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - raceConstrainerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - raceConstrainerForm did not originate from getRaceConstrainerFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateRaceConstrainers

      boolean canUpdateRaceConstrainers()
      Tests if this user can update race constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a RaceConstrainer will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if RaceConstrainer modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getRaceConstrainerFormForUpdate

      RaceConstrainerForm getRaceConstrainerFormForUpdate(Id raceConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the race constrainer form for updating an existing race constrainer. A new race constrainer form should be requested for each update transaction.
      Parameters:
      raceConstrainerId - the Id of the RaceConstrainer
      Returns:
      the race constrainer form
      Throws:
      NotFoundException - raceConstrainerId is not found
      NullArgumentException - raceConstrainerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateRaceConstrainer

      void updateRaceConstrainer(RaceConstrainerForm raceConstrainerForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing race constrainer.
      Parameters:
      raceConstrainerForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - raceConstrainerForm already used for an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - raceConstrainerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - raceConstrainerForm did not originate from getRaceConstrainerFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteRaceConstrainers

      boolean canDeleteRaceConstrainers()
      Tests if this user can delete race constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a RaceConstrainer will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if RaceConstrainer deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteRaceConstrainer

      void deleteRaceConstrainer(Id raceConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a RaceConstrainer .
      Parameters:
      raceConstrainerId - the Id of the RaceConstrainer to remove
      Throws:
      NotFoundException - raceConstrainerId not found
      NullArgumentException - raceConstrainerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageRaceConstrainerAliases

      boolean canManageRaceConstrainerAliases()
      Tests if this user can manage Id aliases for race constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if RaceConstrainer aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasRaceConstrainer

      void aliasRaceConstrainer(Id raceConstrainerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds a Id to a RaceConstrainer for the purpose of creating compatibility. The primary Id of the RaceConstrainer is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another race constrainer. it is reassigned to the given race constrainer Id .
      Parameters:
      raceConstrainerId - the Id of a RaceConstrainer
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - raceConstrainerId not found
      NullArgumentException - raceConstrainerId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.