public interface BallotConstrainerAdminSession extends OsidSession
This session creates and removes ballot constrainers. The data for
create and update is provided via the BallotConstrainerForm.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasBallotConstrainer(Id ballotConstrainerId,
Id aliasId)
Adds an
Id to a BallotConstrainer for
the purpose of creating compatibility. |
boolean |
canCreateBallotConstrainer()
Tests if this user can create ballot constrainers.
|
boolean |
canCreateBallotConstrainerWithRecordTypes(Type[] ballotConstrainerRecordTypes)
Tests if this user can create a single
BallotConstrainer
using the desired record types. |
boolean |
canDeleteBallotConstrainers()
Tests if this user can delete ballot constrainers.
|
boolean |
canManageBallotConstrainerAliases()
Tests if this user can manage
Id aliases for ballot
constrainers. |
boolean |
canUpdateBallotConstrainers()
Tests if this user can update ballot constrainers.
|
BallotConstrainer |
createBallotConstrainer(BallotConstrainerForm ballotConstrainerForm)
Creates a new
BallotConstrainer. |
void |
deleteBallotConstrainer(Id ballotConstrainerId)
Deletes a
BallotConstrainer. |
BallotConstrainerForm |
getBallotConstrainerFormForCreate(Type[] ballotConstrainerRecordTypes)
Gets the ballot constrainer form for creating new ballot constrainers.
|
BallotConstrainerForm |
getBallotConstrainerFormForUpdate(Id ballotConstrainerId)
Gets the ballot constrainer form for updating an existing ballot
constrainer.
|
Polls |
getPolls()
Gets the
Polls associated with this session. |
Id |
getPollsId()
Gets the
Polls Id associated with this
session. |
void |
updateBallotConstrainer(BallotConstrainerForm ballotConstrainerForm)
Updates an existing ballot constrainer.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getPollsId()
Polls Id associated with this
session. Polls Id associated with this sessionmandatory - This method must be implemented. Polls getPolls() throws OperationFailedException, PermissionDeniedException
Polls associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateBallotConstrainer()
BallotConstrainer
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. false if BallotConstrainer
creation is not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateBallotConstrainerWithRecordTypes(Type[] ballotConstrainerRecordTypes)
BallotConstrainer
using the desired record types. While
VotingRulesManager.getBallotConstrainerRecordTypes() can be
used to examine which records are supported, this method tests which
record(s) are required for creating a specific
BallotConstrainer. Providing an empty array tests if a
BallotConstrainer can be created with no records.ballotConstrainerRecordTypes - array of ballot constrainer
record types true if BallotConstrainer
creation using the specified record Types is
supported, false otherwiseNullArgumentException -
ballotConstrainerRecordTypes is null mandatory - This method must be implemented. BallotConstrainerForm getBallotConstrainerFormForCreate(Type[] ballotConstrainerRecordTypes) throws OperationFailedException, PermissionDeniedException
ballotConstrainerRecordTypes - array of ballot constrainer
record typesNullArgumentException -
ballotConstrainerRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. BallotConstrainer createBallotConstrainer(BallotConstrainerForm ballotConstrainerForm) throws OperationFailedException, PermissionDeniedException
BallotConstrainer. ballotConstrainerForm - the form for this
BallotConstrainer BallotConstrainer IllegalStateException - ballotConstrainerForm
already used for a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - ballotConstrainerForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - ballotConstrainerForm
did not originate from
getBallotConstrainerFormForCreate() mandatory - This method must be implemented. boolean canUpdateBallotConstrainers()
BallotConstrainer
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. false if BallotConstrainer
modification is not authorized, true otherwisemandatory - This method must be implemented. BallotConstrainerForm getBallotConstrainerFormForUpdate(Id ballotConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ballotConstrainerId - the Id of the
BallotConstrainer NotFoundException - ballotConstrainerId
is not foundNullArgumentException - ballotConstrainerId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateBallotConstrainer(BallotConstrainerForm ballotConstrainerForm) throws OperationFailedException, PermissionDeniedException
ballotConstrainerForm - the form containing the elements to be
updatedIllegalStateException - ballotConstrainerForm
already used for an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - ballotConstrainerForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - ballotConstrainerForm
did not originate from
getBallotConstrainerFormForUpdate() mandatory - This method must be implemented. boolean canDeleteBallotConstrainers()
BallotConstrainer
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. false if BallotConstrainer
deletion is not authorized, true otherwisemandatory - This method must be implemented. void deleteBallotConstrainer(Id ballotConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
BallotConstrainer. ballotConstrainerId - the Id of the
BallotConstrainer to removeNotFoundException - ballotConstrainerId
not foundNullArgumentException - ballotConstrainerId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageBallotConstrainerAliases()
Id aliases 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 a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if BallotConstrainer
aliasing is not authorized, true otherwisemandatory - This method must be implemented. void aliasBallotConstrainer(Id ballotConstrainerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a BallotConstrainer for
the purpose of creating compatibility. The primary Id
of the BallotConstrainer is determined by the provider.
The new Id performs as an alias to the primary
Id . If the alias is a pointer to another ballot constrainer.
it is reassigned to the given ballot constrainer Id. ballotConstrainerId - the Id of a
BallotConstrainer aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - ballotConstrainerId
not foundNullArgumentException - ballotConstrainerId
or aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.