public interface ProvisionReturnSession extends 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.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canCreateProvisionReturns()
Tests if this user can return
Provisions. |
boolean |
canCreateProvisionReturnWithRecordTypes(Type[] provisionReturnRecordTypes)
Tests if this user can create a single
ProvisionReturn
using the desired record types. |
boolean |
canDeleteProvisionReturns()
Tests if this user can delete
ProvisionReturns. |
boolean |
canUpdateProvisionReturns()
Tests if this user can update
ProvisionReturns. |
ProvisionReturn |
createProvisionReturn(ProvisionReturnForm provisionReturnForm)
Creates a new
ProvisionReturn. |
void |
deleteProvisionReturn(Id provisionReturnId)
Deletes a
ProvisionReturn. |
Broker |
getBroker()
Gets the
Broker associated with this session. |
Id |
getBrokerId()
Gets the
Broker Id associated with this
session. |
ProvisionReturnForm |
getProvisionReturnFormForCreate(Id provisionId,
Type[] provisionReturnRecordTypes)
Gets the provision return form for creating new provisions.
|
ProvisionReturnForm |
getProvisionReturnFormForUpdate(Id provisionReturnId)
Gets the provision form for updating an existing provision return.
|
void |
updateProvisionReturn(ProvisionReturnForm provisionReturnForm)
Updates an existing provision return.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getBrokerId()
Broker Id associated with this
session. Broker Id associated with this sessionmandatory - This method must be implemented. Broker getBroker() throws OperationFailedException, PermissionDeniedException
Broker associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateProvisionReturns()
Provisions. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Provision will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may opt not to offer return operations to
an unauthorized user. false if Provision return is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateProvisionReturnWithRecordTypes(Type[] provisionReturnRecordTypes)
ProvisionReturn
using the desired record types. While
ProvisioningManager.getProvisionRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Provision.
Providing an empty array tests if a Provision can be
created with no records.provisionReturnRecordTypes - array of provision return record
types true if ProvisionReturn creation
using the specified record Types is supported,
false otherwiseNullArgumentException -
provisionReturnRecordTypes is null mandatory - This method must be implemented. ProvisionReturnForm getProvisionReturnFormForCreate(Id provisionId, Type[] provisionReturnRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
provisionId - the Id for the provisionprovisionReturnRecordTypes - array of provision return record
typesNotFoundException - provisionId is not
foundNullArgumentException - provisionId or
provisionReturnRecordTypes is null
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. ProvisionReturn createProvisionReturn(ProvisionReturnForm provisionReturnForm) throws OperationFailedException, PermissionDeniedException
ProvisionReturn. provisionReturnForm - the form for this ProvisionReturn
ProvisionReturn IllegalStateException - provisionForm is
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - provisionReturnForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - provisionReturnForm
did not oroginate from
getProvisionFormForCreate() mandatory - This method must be implemented. boolean canUpdateProvisionReturns()
ProvisionReturns. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known updating a ProvisionReturn
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 ProvisionReturn
modification is not authorized, true otherwisemandatory - This method must be implemented. ProvisionReturnForm getProvisionReturnFormForUpdate(Id provisionReturnId) throws NotFoundException, OperationFailedException
provisionReturnId - the Id of the
ProvisionReturn NotFoundException - provisionReturnId is
not foundNullArgumentException - provisionReturnId
is null OperationFailedException - unable to complete requestmandatory - This method must be implemented. void updateProvisionReturn(ProvisionReturnForm provisionReturnForm) throws NotFoundException, OperationFailedException, PermissionDeniedException
provisionReturnForm - the form containing the elements to be
updatedInvalidArgumentException - the form contains an invalid
valueNotFoundException - provisionReturnId is
not foundNullArgumentException - provisionReturnForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - provisionReturnForm
did not originate from
getProvisionReturnFormForUpdate() mandatory - This method must be implemented. boolean canDeleteProvisionReturns()
ProvisionReturns. A
return of true does not guarantee successful authorization. A return
of false indicates that it is known deleting a ProvisionReturn
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 Provision deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteProvisionReturn(Id provisionReturnId) throws NotFoundException, OperationFailedException, PermissionDeniedException
ProvisionReturn. The delete operation deletes
the provision return data but does not undo the returned status of the
provision.provisionReturnId - the Id of the
ProvisionReturn to removeNotFoundException - provisionReturnId
not foundNullArgumentException - provisionReturnId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.