Interface ProvisionableBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ProvisionableAdminSession
This session creates, updates, and deletes Provisionables 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
Provisionable , a ProvisionableForm is requested using
getProvisionableFormsForCreate() specifying the desired pool, resource,
and record Types or none if no record Types are needed.
Each of the returned ProvisionableForms 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 ProvisionableForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
ProvisionableForm corresponds to an attempted transaction.
The ProvisionableForms returned from
getProvisionableFormsForCreate() may be linked to the originating request
transaction through the peer Ids of the ProvisionableForm
. In the case where there may be duplicates, any ProvisionableForm
of the same peer Ids may be used for a create operation.
Once a batch of ProvisionableForms are submitted for create, a
CreateResponse is returned for each ProvisionableForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createProvisionables() ,
errors specific to an individual ProvisionableForm are indicated
in the corresponding CreateResponse . CreateResponses may
be linked to the originating ProvisionableForm through the
ProvisionableForm Id .
For updates, ProvisionableForms are requested to the
Provisionable Id that is to be updated using
getProvisionableFormsForUpdate() where the reference Id in the
ProvisionableForm may be used to link the request transaction.
Similarly, the ProvisionableForm has metadata about the data that
can be updated and it can perform validation before submitting the update.
The ProvisionableForm can only be used once for a successful
update and cannot be reused.
Once a batch of ProvisionableForms are submitted for update,
an UpdateResponse is returned for each ProvisionableForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateProvisionables() ,
errors specific to an individual ProvisionableForm are indicated
in the corresponding UpdateResponse . UpdateResponses may
be linked to the originating ProvisionableForm through the
ProvisionableForm Id .
The delete operations delete Provisionables in bulk. To unmap
a Provisionable from the current Distributor , the
ProvisionableDistributorAssignmentSession should be used. These delete
operations attempt to remove the Provisionable itself thus
removing it from all known Distributor catalogs. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasProvisionables(AliasRequestList aliasRequests) Adds anIdto aProvisionablefor the purpose of creating compatibility.createProvisionables(ProvisionableBatchFormList provisionableForms) Creates a new set ofProvisionables.Deletes allProvisionablesin thisDistributor.Deletes provisionables expired before the given date.deleteProvisionables(IdList provisionableIds) Deletes provisionables for the givenIds.deleteProvisionablesForPool(Id poolId) Deletes all provisionables for the given pool.deleteProvisionablesForResource(Id resourceId) Deletes all provisionables for the given resource.getProvisionableFormsForCreate(ProvisionablePeerList peers, Type[] provisionableRecordTypes) Gets the provisionable forms for creating a bunch of new provisionables.getProvisionableFormsForUpdate(IdList provisionableIds) Gets the provisionable forms for updating an existing set of provisionables.updateProvisionables(ProvisionableBatchFormList provisionableForms) Updates existing provisionables.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 ProvisionableAdminSession
aliasProvisionable, canCreateProvisionables, canCreateProvisionableWithRecordTypes, canDeleteProvisionables, canManageProvisionableAliases, canUpdateProvisionables, createProvisionable, deleteProvisionable, getDistributor, getDistributorId, getProvisionableFormForCreate, getProvisionableFormForUpdate, updateProvisionableModifier and TypeMethodDescriptionvoidaliasProvisionable(Id provisionableId, Id aliasId) Adds anIdto aProvisionablefor the purpose of creating compatibility.booleanTests if this user can create provisionables.booleancanCreateProvisionableWithRecordTypes(Type[] provisionableRecordTypes) Tests if this user can create a singleProvisionableusing the desired record types.booleanTests if this user can delete provisionables.booleanTests if this user can manageIdaliases forProvisionables.booleanTests if this user can update provisionables.createProvisionable(ProvisionableForm provisionableForm) Creates a newProvisionable.voiddeleteProvisionable(Id provisionableId) Deletes aProvisionable.Gets theDistributorassociated with this session.Gets theDistributorIdassociated with this session.getProvisionableFormForCreate(Id resourceId, Id poolId, Type[] provisionableRecordTypes) Gets the provisionable form for creating new provisionables.getProvisionableFormForUpdate(Id provisionableId) Gets the provisionable form for updating an existing provisionable.voidupdateProvisionable(ProvisionableForm provisionableForm) Updates an existing provisionable.
-
Method Details
-
getProvisionableFormsForCreate
ProvisionableBatchFormList getProvisionableFormsForCreate(ProvisionablePeerList peers, Type[] provisionableRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the provisionable forms for creating a bunch of new provisionables. AProvisionableFormis returned for each pool and resource pair.- Parameters:
peers- the relationship peersprovisionableRecordTypes- array of provisionable record types to be included in each create operation or an empty list if none- Returns:
- the provisionable forms
- Throws:
NotFoundException- aresourceIdorpoolIdis not foundNullArgumentException-peersorprovisionableRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request transaction forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createProvisionables
CreateResponseList createProvisionables(ProvisionableBatchFormList provisionableForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofProvisionables. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
provisionableForms- the provisionable forms- Returns:
- the create responses
- Throws:
NullArgumentException-provisionableFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getProvisionableFormsForUpdate
ProvisionableBatchFormList getProvisionableFormsForUpdate(IdList provisionableIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the provisionable forms for updating an existing set of provisionables. A new provisionable form should be requested for each update transaction.- Parameters:
provisionableIds- theIdsof theProvisionable- Returns:
- the provisionable form
- Throws:
NotFoundException- aprovisionableIdis not foundNullArgumentException-provisionableIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProvisionables
UpdateResponseList updateProvisionables(ProvisionableBatchFormList provisionableForms) throws OperationFailedException, PermissionDeniedException Updates existing provisionables. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
provisionableForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-provisionableFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllProvisionables
DeleteResponseList deleteAllProvisionables() throws OperationFailedException, PermissionDeniedExceptionDeletes allProvisionablesin thisDistributor.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProvisionables
DeleteResponseList deleteProvisionables(IdList provisionableIds) throws OperationFailedException, PermissionDeniedException Deletes provisionables for the givenIds.- Parameters:
provisionableIds- theIdsof the provisionables to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-provisionableIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProvisionablesForResource
DeleteResponseList deleteProvisionablesForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes all provisionables for the given resource.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProvisionablesForPool
DeleteResponseList deleteProvisionablesForPool(Id poolId) throws OperationFailedException, PermissionDeniedException Deletes all provisionables for the given pool.- Parameters:
poolId- anIdof a pool- Returns:
- the delete responses
- Throws:
NullArgumentException-poolIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveProvisionablesByDate
DeleteResponseList deleteIneffectiveProvisionablesByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes provisionables 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.
-
aliasProvisionables
AliasResponseList aliasProvisionables(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aProvisionablefor the purpose of creating compatibility. The primaryIdof theProvisionableis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another provisionable, it is reassigned to the given provisionableId.- 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.
-