Interface RequestAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
RequestBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasRequest(Id requestId, Id aliasId) Adds anIdto aRequestfor the purpose of creating compatibility.booleanTests if this user can cancelRequests.voidcancelRequest(Id requestId) Cancels aRequest.booleanTests if this user can createRequests.booleancanCreateRequestWithRecordTypes(Type[] requestRecordTypes) Tests if this user can create a singleRequestusing the desired record types.booleanTests if this user can deleteRequests.booleanTests if this user can manageIdaliases forRequests.booleanTests if this user can updateRequests.createRequest(RequestForm requestForm) Creates a newRequest.voiddeleteRequest(Id requestId) Deletes aRequest.Gets theDistributorassociated with this session.Gets theDistributorIdassociated with this session.getRequestFormForCreate(Id resourceId, Id queueId, Type[] requestRecordTypes) Gets the request form for creating new requests.getRequestFormForUpdate(Id requestId) Gets the request form for updating an existing request.voidsubmitRequest(Id requestId) Submits aRequest.voidupdateRequest(RequestForm requestForm) Updates an existing request.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
-
getDistributorId
Id getDistributorId()Gets theDistributorIdassociated with this session.- Returns:
- the
Distributor Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getDistributor
Gets theDistributorassociated with this session.- Returns:
- the distributor
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRequests
boolean canCreateRequests()Tests if this user can createRequests. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRequestwill 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:
falseifRequestcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRequestWithRecordTypes
Tests if this user can create a singleRequestusing the desired record types. WhileProvisioningManager.getRequestRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRequest. Providing an empty array tests if aRequestcan be created with no records.- Parameters:
requestRecordTypes- array of request record types- Returns:
trueifRequestcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-requestRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRequestFormForCreate
RequestForm getRequestFormForCreate(Id resourceId, Id queueId, Type[] requestRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request form for creating new requests. A new form should be requested for each create transaction.- Parameters:
resourceId- theIdfor the resourcequeueId- theIdfor the queuerequestRecordTypes- array of request record types- Returns:
- the request form
- Throws:
NotFoundException-resourceIdorqueueIdis not foundNullArgumentException-resourceId, queueId, orrequestRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRequest
Request createRequest(RequestForm requestForm) throws OperationFailedException, PermissionDeniedException Creates a newRequest.- Parameters:
requestForm- the form for thisRequest- Returns:
- the new
Request - Throws:
IllegalStateException-requestFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-requestFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-requestFormdid not originate fromgetRequestFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRequests
boolean canUpdateRequests()Tests if this user can updateRequests. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRequestwill 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:
falseifRequestmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRequestFormForUpdate
RequestForm getRequestFormForUpdate(Id requestId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request form for updating an existing request. A new request form should be requested for each update transaction.- Parameters:
requestId- theIdof theRequest- Returns:
- the request form
- Throws:
NotFoundException-requestIdis not foundNullArgumentException-requestIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRequest
void updateRequest(RequestForm requestForm) throws OperationFailedException, PermissionDeniedException Updates an existing request.- Parameters:
requestForm- the form containing the elements to be updated- Throws:
IllegalStateException-requestFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-requestFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-requestFormdid not originate fromgetRequestFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
submitRequest
void submitRequest(Id requestId) throws NotFoundException, OperationFailedException, PermissionDeniedException Submits aRequest.- Parameters:
requestId- theIdof theRequestto submit- Throws:
NotFoundException-requestIdnot foundNullArgumentException-requestIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCancelRequests
boolean canCancelRequests()Tests if this user can cancelRequests. A return of true does not guarantee successful authorization. A return of false indicates that it is known canceling aRequestwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer cancel operations to an unauthorized user.- Returns:
falseifRequestcancelation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
cancelRequest
void cancelRequest(Id requestId) throws NotFoundException, OperationFailedException, PermissionDeniedException Cancels aRequest.- Parameters:
requestId- theIdof theRequestto remove- Throws:
NotFoundException-requestIdnot foundNullArgumentException-requestIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canDeleteRequests
boolean canDeleteRequests()Tests if this user can deleteRequests. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRequestwill 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:
falseifRequestdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRequest
void deleteRequest(Id requestId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRequest.- Parameters:
requestId- theIdof theRequestto remove- Throws:
NotFoundException-requestIdnot foundNullArgumentException-requestIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRequestAliases
boolean canManageRequestAliases()Tests if this user can manageIdaliases forRequests. 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:
falseifRequestaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRequest
void aliasRequest(Id requestId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRequestfor the purpose of creating compatibility. The primaryIdof theRequestis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another request, it is reassigned to the given requestId.- Parameters:
requestId- theIdof aRequestaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-requestIdnot foundNullArgumentException-requestIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-