Interface ProvisionReturnSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes ProvisionReturns .
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
ProvisionReturns , a ProvisionReturnForm is requested using
getProvisionReturnFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
ProvisionReturnForm 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 ProvisionReturnForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each ProvisionReturnForm
corresponds to an attempted transaction.
For updates, ProvisionReturnForms are requested to the
ProvisionReturn Id that is to be updated using
getProvisionReturnFormForUpdate() . Similarly, the
ProvisionReturnForm has metadata about the data that can be updated and
it can perform validation before submitting the update. The
ProvisionReturnForm can only be used once for a successful update and
cannot be reused.
The delete operations delete ProvisionReturns . To unmap a
ProvisionReturn from the current Distributor , the
RProvisionReturnDistributorAssignmentSession should be used. These delete
operations attempt to remove the ProvisionReturn 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 TypeMethodDescriptionbooleanTests if this user can returnProvisions.booleancanCreateProvisionReturnWithRecordTypes(Type[] provisionReturnRecordTypes) Tests if this user can create a singleProvisionReturnusing the desired record types.booleanTests if this user can deleteProvisionReturns.booleanTests if this user can updateProvisionReturns.createProvisionReturn(ProvisionReturnForm provisionReturnForm) Creates a newProvisionReturn.voiddeleteProvisionReturn(Id provisionReturnId) Deletes aProvisionReturn.Gets theBrokerassociated with this session.Gets theBrokerIdassociated with this session.getProvisionReturnFormForCreate(Id provisionId, Type[] provisionReturnRecordTypes) Gets the provision return form for creating new provisions.getProvisionReturnFormForUpdate(Id provisionReturnId) Gets the provision form for updating an existing provision return.voidupdateProvisionReturn(ProvisionReturnForm provisionReturnForm) Updates an existing provision return.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
-
getBrokerId
Id getBrokerId()Gets theBrokerIdassociated with this session.- Returns:
- the
Broker Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBroker
Gets theBrokerassociated with this session.- Returns:
- the broker
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateProvisionReturns
boolean canCreateProvisionReturns()Tests if this user can returnProvisions. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aProvisionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer return operations to an unauthorized user.- Returns:
falseifProvisionreturn is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProvisionReturnWithRecordTypes
Tests if this user can create a singleProvisionReturnusing the desired record types. WhileProvisioningManager.getProvisionRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificProvision. Providing an empty array tests if aProvisioncan be created with no records.- Parameters:
provisionReturnRecordTypes- array of provision return record types- Returns:
trueifProvisionReturncreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-provisionReturnRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProvisionReturnFormForCreate
ProvisionReturnForm getProvisionReturnFormForCreate(Id provisionId, Type[] provisionReturnRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the provision return form for creating new provisions. A new form should be requested for each return transaction.- Parameters:
provisionId- theIdfor the provisionprovisionReturnRecordTypes- array of provision return record types- Returns:
- the provision return form
- Throws:
NotFoundException-provisionIdis not foundNullArgumentException-provisionIdorprovisionReturnRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createProvisionReturn
ProvisionReturn createProvisionReturn(ProvisionReturnForm provisionReturnForm) throws OperationFailedException, PermissionDeniedException Creates a newProvisionReturn.- Parameters:
provisionReturnForm- the form for thisProvisionReturn- Returns:
- the new
ProvisionReturn - Throws:
IllegalStateException-provisionFormis already used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-provisionReturnFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-provisionReturnFormdid not oroginate fromgetProvisionFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProvisionReturns
boolean canUpdateProvisionReturns()Tests if this user can updateProvisionReturns. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aProvisionReturnwill 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:
falseifProvisionReturnmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProvisionReturnFormForUpdate
ProvisionReturnForm getProvisionReturnFormForUpdate(Id provisionReturnId) throws NotFoundException, OperationFailedException Gets the provision form for updating an existing provision return. A new provision return form should be requested for each update transaction.- Parameters:
provisionReturnId- theIdof theProvisionReturn- Returns:
- the provision return form
- Throws:
NotFoundException-provisionReturnIdis not foundNullArgumentException-provisionReturnIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
updateProvisionReturn
void updateProvisionReturn(ProvisionReturnForm provisionReturnForm) throws NotFoundException, OperationFailedException, PermissionDeniedException Updates an existing provision return.- Parameters:
provisionReturnForm- the form containing the elements to be updated- Throws:
InvalidArgumentException- the form contains an invalid valueNotFoundException-provisionReturnIdis not foundNullArgumentException-provisionReturnFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-provisionReturnFormdid not originate fromgetProvisionReturnFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProvisionReturns
boolean canDeleteProvisionReturns()Tests if this user can deleteProvisionReturns. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aProvisionReturnwill 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:
falseifProvisiondeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteProvisionReturn
void deleteProvisionReturn(Id provisionReturnId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aProvisionReturn. The delete operation deletes the provision return data but does not undo the returned status of the provision.- Parameters:
provisionReturnId- theIdof theProvisionReturnto remove- Throws:
NotFoundException-provisionReturnIdnot foundNullArgumentException-provisionReturnIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-