Interface BallotConstrainerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates and removes ballot constrainers. The data for
create and update is provided via the BallotConstrainerForm .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasBallotConstrainer(Id ballotConstrainerId, Id aliasId) Adds anIdto aBallotConstrainerfor the purpose of creating compatibility.booleanTests if this user can create ballot constrainers.booleancanCreateBallotConstrainerWithRecordTypes(Type[] ballotConstrainerRecordTypes) Tests if this user can create a singleBallotConstrainerusing the desired record types.booleanTests if this user can delete ballot constrainers.booleanTests if this user can manageIdaliases for ballot constrainers.booleanTests if this user can update ballot constrainers.createBallotConstrainer(BallotConstrainerForm ballotConstrainerForm) Creates a newBallotConstrainer.voiddeleteBallotConstrainer(Id ballotConstrainerId) Deletes aBallotConstrainer.getBallotConstrainerFormForCreate(Type[] ballotConstrainerRecordTypes) Gets the ballot constrainer form for creating new ballot constrainers.getBallotConstrainerFormForUpdate(Id ballotConstrainerId) Gets the ballot constrainer form for updating an existing ballot constrainer.getPolls()Gets thePollsassociated with this session.Gets thePollsIdassociated with this session.voidupdateBallotConstrainer(BallotConstrainerForm ballotConstrainerForm) Updates an existing ballot constrainer.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getPollsId
Id getPollsId()Gets thePollsIdassociated with this session.- Returns:
- the
Polls Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getPolls
Gets thePollsassociated with this session.- Returns:
- the polls
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateBallotConstrainer
boolean canCreateBallotConstrainer()Tests if this user can create ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aBallotConstrainerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifBallotConstrainercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateBallotConstrainerWithRecordTypes
Tests if this user can create a singleBallotConstrainerusing the desired record types. WhileVotingRulesManager.getBallotConstrainerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificBallotConstrainer. Providing an empty array tests if aBallotConstrainercan be created with no records.- Parameters:
ballotConstrainerRecordTypes- array of ballot constrainer record types- Returns:
trueifBallotConstrainercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-ballotConstrainerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getBallotConstrainerFormForCreate
BallotConstrainerForm getBallotConstrainerFormForCreate(Type[] ballotConstrainerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the ballot constrainer form for creating new ballot constrainers. A new form should be requested for each create transaction.- Parameters:
ballotConstrainerRecordTypes- array of ballot constrainer record types- Returns:
- the ballot constrainer form
- Throws:
NullArgumentException-ballotConstrainerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createBallotConstrainer
BallotConstrainer createBallotConstrainer(BallotConstrainerForm ballotConstrainerForm) throws OperationFailedException, PermissionDeniedException Creates a newBallotConstrainer.- Parameters:
ballotConstrainerForm- the form for thisBallotConstrainer- Returns:
- the new
BallotConstrainer - Throws:
IllegalStateException-ballotConstrainerFormalready used for a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-ballotConstrainerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-ballotConstrainerFormdid not originate fromgetBallotConstrainerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateBallotConstrainers
boolean canUpdateBallotConstrainers()Tests if this user can update ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aBallotConstrainerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifBallotConstrainermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getBallotConstrainerFormForUpdate
BallotConstrainerForm getBallotConstrainerFormForUpdate(Id ballotConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the ballot constrainer form for updating an existing ballot constrainer. A new ballot constrainer form should be requested for each update transaction.- Parameters:
ballotConstrainerId- theIdof theBallotConstrainer- Returns:
- the ballot constrainer form
- Throws:
NotFoundException-ballotConstrainerIdis not foundNullArgumentException-ballotConstrainerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateBallotConstrainer
void updateBallotConstrainer(BallotConstrainerForm ballotConstrainerForm) throws OperationFailedException, PermissionDeniedException Updates an existing ballot constrainer.- Parameters:
ballotConstrainerForm- the form containing the elements to be updated- Throws:
IllegalStateException-ballotConstrainerFormalready used for an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-ballotConstrainerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-ballotConstrainerFormdid not originate fromgetBallotConstrainerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteBallotConstrainers
boolean canDeleteBallotConstrainers()Tests if this user can delete ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aBallotConstrainerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifBallotConstrainerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteBallotConstrainer
void deleteBallotConstrainer(Id ballotConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aBallotConstrainer.- Parameters:
ballotConstrainerId- theIdof theBallotConstrainerto remove- Throws:
NotFoundException-ballotConstrainerIdnot foundNullArgumentException-ballotConstrainerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageBallotConstrainerAliases
boolean canManageBallotConstrainerAliases()Tests if this user can manageIdaliases for ballot 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifBallotConstraineraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasBallotConstrainer
void aliasBallotConstrainer(Id ballotConstrainerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aBallotConstrainerfor the purpose of creating compatibility. The primaryIdof theBallotConstraineris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another ballot constrainer. it is reassigned to the given ballot constrainerId.- Parameters:
ballotConstrainerId- theIdof aBallotConstraineraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-ballotConstrainerIdnot foundNullArgumentException-ballotConstrainerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-