Interface ProvisionBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ProvisionAdminSession
This session creates, updates, and deletes Provisions in bulk.
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
Provision , a ProvisionForm is requested using
getProvisionFormsForCreate() specifying the desired provisionable,
request, broker, record Types or none if no record Types
are needed. Each of the returned ProvisionForms 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 a ProvisionForm
is submiited to a create operation, it cannot be reused with another
create operation unless the first operation was unsuccessful. Each
ProvisionForm corresponds to an attempted transaction.
The ProvisionForms returned from
getProvisionFormsForCreate() may be linked to the originating request
through the peer Ids of the ProvisionForm . In the case
where there may be duplicates, any ProvisionForm of the same peer
Ids may be used for a create operation.
Once a batch of ProvisionForms are submitted for create, a
CreateResponse is returned for each ProvisionForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createProvisions() ,
errors specific to an individual ProvisionForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating ProvisionForm through the
ProvisionForm Id .
For updates, ProvisionForms are requested to the
Provision Id that is to be updated using
getProvisionFormsForUpdate() where the reference Id in the
ProvisionForm may be used to link the request. Similarly, the
ProvisionForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The ProvisionForm
can only be used once for a successful update and cannot be reused.
Once a batch of ProvisionForms are submitted for update, an
UpdateResponse is returned for each ProvisionForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateProvisions() ,
errors specific to an individual ProvisionForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating ProvisionForm through the
ProvisionForm Id .
The delete operations delete Provisions in bulk. To unmap a
Provision from the current Distributor , the
ProvisionDistributorAssignmentSession should be used. These delete
operations attempt to remove the Provision itself thus removing it
from all known Distributor catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasProvisions(AliasRequestList aliasRequests) Adds anIdto aProvisionfor the purpose of creating compatibility.createProvisions(ProvisionBatchFormList provisionForms) Creates a new set ofProvisions.Deletes allProvisionsin thisDistributor.Deletes provisions expired before the given date.deleteProvisions(IdList provisionIds) Deletes provisions for the givenIds.deleteProvisionsForBroker(Id brokerId) Deletes provisions for the given broker.deleteProvisionsForProvisionable(Id provisionableId) Deletes provisions for the given provisionable.deleteProvisionsForRecipient(Id resourceId) Deletes provisions for the given recipient.deleteProvisionsForRequest(Id requestId) Deletes provisions for the given request.getProvisionFormsForCreate(long peers, Type[] provisionRecordTypes) Gets the provision forms for creating a bunch of new provisions.getProvisionFormsForUpdate(IdList provisionIds) Gets the provision forms for updating an existing set of provisions.updateProvisions(ProvisionBatchFormList provisionForms) Updates existing provisions.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.Methods inherited from interface ProvisionAdminSession
aliasProvision, canCreateProvisions, canCreateProvisionWithRecordTypes, canDeleteProvisions, canManageProvisionAliases, canUpdateProvisions, createProvision, deleteProvision, getDistributor, getDistributorId, getProvisionFormForCreate, getProvisionFormForUpdate, updateProvisionModifier and TypeMethodDescriptionvoidaliasProvision(Id provisionId, Id aliasId) Adds anIdto aProvisionfor the purpose of creating compatibility.booleanTests if this user can createProvisions.booleancanCreateProvisionWithRecordTypes(Type[] provisionRecordTypes) Tests if this user can create a singleProvisionusing the desired record types.booleanTests if this user can deleteProvisions.booleanTests if this user can manageIdaliases forProvisions.booleanTests if this user can updateProvisions.createProvision(ProvisionForm provisionForm) Creates a newProvision.voiddeleteProvision(Id provisionId) Deletes aProvision.Gets theDistributorassociated with this session.Gets theDistributorIdassociated with this session.getProvisionFormForCreate(Id brokerId, Id provisionableId, Id resourceId, Type[] provisionRecordTypes) Gets the provision form for creating new provisions.getProvisionFormForUpdate(Id provisionId) Gets the provision form for updating an existing provision.voidupdateProvision(ProvisionForm provisionForm) Updates an existing provision.
-
Method Details
-
getProvisionFormsForCreate
ProvisionBatchFormList getProvisionFormsForCreate(long peers, Type[] provisionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the provision forms for creating a bunch of new provisions. A form is returned for each supplied provisionable, request, and broker.- Parameters:
peers- a list of provision peersprovisionRecordTypes- array of provision record types to be included in each create operation or an empty list if none- Returns:
- the provision forms
- Throws:
NotFoundException- aprovisionableId,requestId, orbrokerIdis not foundNullArgumentException-peersorprovisionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createProvisions
CreateResponseList createProvisions(ProvisionBatchFormList provisionForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofProvisions. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
provisionForms- the provision forms- Returns:
- the create responses
- Throws:
NullArgumentException-provisionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getProvisionFormsForUpdate
ProvisionBatchFormList getProvisionFormsForUpdate(IdList provisionIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the provision forms for updating an existing set of provisions. A new provision form should be requested for each update transaction.- Parameters:
provisionIds- theIdsof theProvision- Returns:
- the provision form
- Throws:
NotFoundException- aprovisionIdis not foundNullArgumentException-provisionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProvisions
UpdateResponseList updateProvisions(ProvisionBatchFormList provisionForms) throws OperationFailedException, PermissionDeniedException Updates existing provisions. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
provisionForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-provisionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllProvisions
Deletes allProvisionsin thisDistributor.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProvisions
DeleteResponseList deleteProvisions(IdList provisionIds) throws OperationFailedException, PermissionDeniedException Deletes provisions for the givenIds.- Parameters:
provisionIds- theIdsof the provisions to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-provisionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProvisionsForBroker
DeleteResponseList deleteProvisionsForBroker(Id brokerId) throws OperationFailedException, PermissionDeniedException Deletes provisions for the given broker.- Parameters:
brokerId- theIdof a broker- Returns:
- the delete responses
- Throws:
NullArgumentException-brokerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProvisionsForProvisionable
DeleteResponseList deleteProvisionsForProvisionable(Id provisionableId) throws OperationFailedException, PermissionDeniedException Deletes provisions for the given provisionable.- Parameters:
provisionableId- theIdof a provisionable- Returns:
- the delete responses
- Throws:
NullArgumentException-provisionableIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProvisionsForRecipient
DeleteResponseList deleteProvisionsForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes provisions for the given recipient.- Parameters:
resourceId- theIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProvisionsForRequest
DeleteResponseList deleteProvisionsForRequest(Id requestId) throws OperationFailedException, PermissionDeniedException Deletes provisions for the given request.- Parameters:
requestId- theIdof a request- Returns:
- the delete responses
- Throws:
NullArgumentException-requestIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveProvisionsByDate
DeleteResponseList deleteIneffectiveProvisionsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes provisions expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasProvisions
AliasResponseList aliasProvisions(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aProvisionfor the purpose of creating compatibility. The primaryIdof theProvisionis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another provision, it is reassigned to the given provisionId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-