public interface RequestAdminSession extends OsidSession
This session creates, updates, and deletes Requests.
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. Once a Request
is created, it has
not been submitted. submitRequest
submits a Request
for processing. Constraints on update and delete may vary between
creation and submission.
Create and update operations differ in their usage. To create a
Request,
a RequestForm
is requested using
getRequestFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed. The
returned RequestForm
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 RequestForm
is submiited
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each RequestForm
corresponds to an attempted transaction.
For updates, RequestForms
are requested to the
Request
Id
that is to be updated using
getRequestFormForUpdate().
Similarly, the RequestForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The RequestForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Requests.
To unmap a
Request
from the current Distributor,
the
RequestDistributorAssignmentSession
should be used. These
delete operations attempt to remove the Request
itself thus
removing it from all known Distributor
catalogs.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasRequest(Id requestId,
Id aliasId)
Adds an
Id to a Request for the purpose
of creating compatibility. |
boolean |
canCancelRequests()
Tests if this user can cancel
Requests. |
void |
cancelRequest(Id requestId)
Cancels a
Request. |
boolean |
canCreateRequests()
Tests if this user can create
Requests. |
boolean |
canCreateRequestWithRecordTypes(Type[] requestRecordTypes)
Tests if this user can create a single
Request using
the desired record types. |
boolean |
canDeleteRequests()
Tests if this user can delete
Requests. |
boolean |
canManageRequestAliases()
Tests if this user can manage
Id aliases for
Requests. |
boolean |
canUpdateRequests()
Tests if this user can update
Requests. |
Request |
createRequest(RequestForm requestForm)
Creates a new
Request. |
void |
deleteRequest(Id requestId)
Deletes a
Request. |
Distributor |
getDistributor()
Gets the
Distributor associated with this session. |
Id |
getDistributorId()
Gets the
Distributor Id associated with
this session. |
RequestForm |
getRequestFormForCreate(Id resourceId,
Id queueId,
Type[] requestRecordTypes)
Gets the request form for creating new requests.
|
RequestForm |
getRequestFormForUpdate(Id requestId)
Gets the request form for updating an existing request.
|
void |
submitRequest(Id requestId)
Submits a
Request. |
void |
updateRequest(RequestForm requestForm)
Updates an existing request.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDistributorId()
Distributor
Id
associated with
this session. Distributor Id
associated with this sessionmandatory
- This method must be implemented. Distributor getDistributor() throws OperationFailedException, PermissionDeniedException
Distributor
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateRequests()
Requests.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Request
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 Request
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateRequestWithRecordTypes(Type[] requestRecordTypes)
Request
using
the desired record types. While
ProvisioningManager.getRequestRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Request.
Providing
an empty array tests if a Request
can be created with
no records.requestRecordTypes
- array of request record types true
if Request
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- requestRecordTypes
is null
mandatory
- This method must be implemented. RequestForm getRequestFormForCreate(Id resourceId, Id queueId, Type[] requestRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
resourceId
- the Id
for the resourcequeueId
- the Id
for the queuerequestRecordTypes
- array of request record typesNotFoundException
- resourceId
or
queueId
is not foundNullArgumentException
- resourceId, queueId,
or requestRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Request createRequest(RequestForm requestForm) throws OperationFailedException, PermissionDeniedException
Request.
requestForm
- the form for this Request
Request
IllegalStateException
- requestForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- requestForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- requestForm
did
not originate from getRequestFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateRequests()
Requests.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Request
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 Request
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. RequestForm getRequestFormForUpdate(Id requestId) throws NotFoundException, OperationFailedException, PermissionDeniedException
requestId
- the Id
of the Request
NotFoundException
- requestId
is not
foundNullArgumentException
- requestId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateRequest(RequestForm requestForm) throws OperationFailedException, PermissionDeniedException
requestForm
- the form containing the elements to be updatedIllegalStateException
- requestForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- requestForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- requestForm
did
not originate from getRequestFormForUpdate()
mandatory
- This method must be implemented. void submitRequest(Id requestId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Request.
requestId
- the Id
of the Request
to submitNotFoundException
- requestId
not foundNullArgumentException
- requestId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCancelRequests()
Requests.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known canceling a Request
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer cancel operations to
an unauthorized user. false
if Request
cancelation is
not authorized, true
otherwisemandatory
- This method must be implemented. void cancelRequest(Id requestId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Request.
requestId
- the Id
of the Request
to removeNotFoundException
- requestId
not foundNullArgumentException
- requestId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canDeleteRequests()
Requests.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Request
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 Request
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteRequest(Id requestId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Request.
requestId
- the Id
of the Request
to removeNotFoundException
- requestId
not foundNullArgumentException
- requestId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageRequestAliases()
Id
aliases for
Requests.
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 Request
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasRequest(Id requestId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Request
for the purpose
of creating compatibility. The primary Id
of the
Request
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another request, it is reassigned to the given
request Id.
requestId
- the Id
of a Request
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- requestId
not foundNullArgumentException
- requestId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.