public interface PollsAdminSession extends OsidSession
This session creates, updates, and deletes Polls.
The
data for create and update is provided by the consumer via the form
object. OsidForms
are requested for each create or update
and may not be reused.
Create and update operations differ in their usage. To create a
Polls,
a PollsForm
is requested using
getPollsFormForCreate()
specifying the desired record Types
or none if no record Types
are needed. The returned
PollsForm
will indicate that it is to be used with a create
operation and can be used to examine metdata or validate data prior to
creation. Once the PollsForm
is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each PollsForm
corresponds to an attempted transaction.
For updates, PollsForms
are requested to the
Polls
Id
that is to be updated using
getPollsFormForUpdate().
Similarly, the PollsForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The PollsForm
can
only be used once for a successful update and cannot be reused.
The delete operations delete Polls.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasPolls(Id pollsId,
Id aliasId)
Adds an
Id to a Polls for the purpose of
creating compatibility. |
boolean |
canCreatePolls()
Tests if this user can create
Polls. |
boolean |
canCreatePollsWithRecordTypes(Type[] pollsRecordTypes)
Tests if this user can create a single
Polls using the
desired record types. |
boolean |
canDeletePolls()
Tests if this user can delete
Polls. |
boolean |
canManagePollsAliases()
Tests if this user can manage
Id aliases for
Polls. |
boolean |
canUpdatePolls()
Tests if this user can update
Polls. |
Polls |
createPolls(PollsForm pollsForm)
Creates a new
Polls. |
void |
deletePolls(Id pollsId)
Deletes a
Polls. |
PollsForm |
getPollsFormForCreate(Type[] pollsRecordTypes)
Gets the polls form for creating new polls.
|
PollsForm |
getPollsFormForUpdate(Id pollsId)
Gets the polls form for updating an existing polls.
|
void |
updatePolls(PollsForm pollsForm)
Updates an existing polls.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreatePolls()
Polls.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Polls
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer create operations to
unauthorized users. false
if Polls
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreatePollsWithRecordTypes(Type[] pollsRecordTypes)
Polls
using the
desired record types. While VotingManager.getPollsRecordTypes()
can be used to examine which records are supported, this
method tests which record(s) are required for creating a specific
Polls.
Providing an empty array tests if a Polls
can be created with no records.pollsRecordTypes
- array of polls record types true
if Polls
creation using the
specified Types
is supported, false
otherwiseNullArgumentException
- pollsRecordTypes
is null
mandatory
- This method must be implemented. PollsForm getPollsFormForCreate(Type[] pollsRecordTypes) throws OperationFailedException, PermissionDeniedException
pollsRecordTypes
- array of polls record typesNullArgumentException
- pollsRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form with
requested record typesmandatory
- This method must be implemented. Polls createPolls(PollsForm pollsForm) throws OperationFailedException, PermissionDeniedException
Polls.
pollsForm
- the form for this Polls
Polls
IllegalStateException
- pollsForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- pollsForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- pollsForm
did not
originate from getPollsFormForCreate()
mandatory
- This method must be implemented. boolean canUpdatePolls()
Polls.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Polls
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer update operations to
unauthorized users. false
if Polls
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. PollsForm getPollsFormForUpdate(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
pollsId
- the Id
of the Polls
NotFoundException
- pollsId
is not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updatePolls(PollsForm pollsForm) throws OperationFailedException, PermissionDeniedException
pollsForm
- the form containing the elements to be updatedIllegalStateException
- pollsForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- pollsId
or
pollsForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- pollsForm
did not
originate from getPollsFormForUpdate()
mandatory
- This method must be implemented. boolean canDeletePolls()
Polls.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Polls
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer delete operations to
unauthorized users. false
if Polls
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deletePolls(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Polls.
pollsId
- the Id
of the Polls
to
removeNotFoundException
- pollsId
not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManagePollsAliases()
Id
aliases for
Polls.
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 Polls
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasPolls(Id pollsId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Polls
for the purpose of
creating compatibility. The primary Id
of the
Polls
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another polls, it is reassigned to the given polls
Id.
pollsId
- the Id
of a Polls
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- pollsId
not foundNullArgumentException
- pollsId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.