Interface DistributorBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, DistributorAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Distributors 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
Distributor , a DistributorForm is requested using
getDistributorFormsForCreate() specifying the desired record
Types or none if no record Types are needed. Each of the returned
DistributorForms 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 DistributorForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each DistributorForm corresponds
to an attempted transaction.
The DistributorForms returned from
getDistributorFormsForCreate() may be linked to the originating request
through the peer Ids of the DistributorForm . In the case
where there may be duplicates, any DistributorForm of the same
peer Ids may be used for a create operation.
Once a batch of DistributorForms are submitted for create, a
CreateResponse is returned for each DistributorForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createDistributors() ,
errors specific to an individual DistributorForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating DistributorForm through the
DistributorForm Id .
For updates, DistributorForms are requested to the
Distributor Id that is to be updated using
getDistributorFormsForUpdate() where the reference Id in the
DistributorForm may be used to link the request. Similarly, the
DistributorForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
DistributorForm can only be used once for a successful update and cannot
be reused.
Once a batch of DistributorForms are submitted for update, an
UpdateResponse is returned for each DistributorForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateDistributors() ,
errors specific to an individual DistributorForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating DistributorForm through the
DistributorForm Id .
The delete operations delete Distributors in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasDistributors(AliasRequestList aliasRequests) Adds anIdto aDistributorfor the purpose of creating compatibility.createDistributors(DistributorBatchFormList distributorForms) Creates a new set ofDistributors.Deletes allDistributors.deleteDistributors(IdList distributorIds) Deletes distributors for the givenIds.getDistributorFormsForCreate(long number, Type[] distributorRecordTypes) Gets the distributor forms for creating a bunch of new distributors.getDistributorFormsForUpdate(IdList distributorIds) Gets the distributor forms for updating an existing set of distributors.updateDistributors(DistributorBatchFormList distributorForms) Updates existing distributors.Methods inherited from interface DistributorAdminSession
aliasDistributor, canCreateDistributors, canCreateDistributorWithRecordTypes, canDeleteDistributors, canManageDistributorAliases, canUpdateDistributors, createDistributor, deleteDistributor, getDistributorFormForCreate, getDistributorFormForUpdate, updateDistributorModifier and TypeMethodDescriptionvoidaliasDistributor(Id distributorId, Id aliasId) Adds anIdto aDistributorfor the purpose of creating compatibility.booleanTests if this user can createDistributors.booleancanCreateDistributorWithRecordTypes(Type[] distributorRecordTypes) Tests if this user can create a singleDistributorusing the desired record types.booleanTests if this user can deleteDistributors.booleanTests if this user can manageIdaliases forDistributors.booleanTests if this user can updateDistributors.createDistributor(DistributorForm distributorForm) Creates a newDistributor.voiddeleteDistributor(Id distributorId) Deletes aDistributor.getDistributorFormForCreate(Type[] distributorRecordTypes) Gets the distributor form for creating new distributors.getDistributorFormForUpdate(Id distributorId) Gets the distributor form for updating an existing distributor.voidupdateDistributor(DistributorForm distributorForm) Updates an existing distributorMethods 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
-
getDistributorFormsForCreate
DistributorBatchFormList getDistributorFormsForCreate(long number, Type[] distributorRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the distributor forms for creating a bunch of new distributors.- Parameters:
number- the number of forms to retrievedistributorRecordTypes- array of distributor record types to be included in each create operation or an empty list if none- Returns:
- the distributor forms
- Throws:
NullArgumentException-distributorRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createDistributors
CreateResponseList createDistributors(DistributorBatchFormList distributorForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofDistributors. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
distributorForms- the distributor forms- Returns:
- the create responses
- Throws:
NullArgumentException-distributorFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getDistributorFormsForUpdate
DistributorBatchFormList getDistributorFormsForUpdate(IdList distributorIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the distributor forms for updating an existing set of distributors. A new distributor form should be requested for each update transaction.- Parameters:
distributorIds- theIdsof theDistributor- Returns:
- the distributor form
- Throws:
NotFoundException- adistributorIdis not foundNullArgumentException-distributorIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDistributors
UpdateResponseList updateDistributors(DistributorBatchFormList distributorForms) throws OperationFailedException, PermissionDeniedException Updates existing distributors. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
distributorForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-distributorFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllDistributors
DeleteResponseList deleteAllDistributors() throws OperationFailedException, PermissionDeniedExceptionDeletes allDistributors.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteDistributors
DeleteResponseList deleteDistributors(IdList distributorIds) throws OperationFailedException, PermissionDeniedException Deletes distributors for the givenIds.- Parameters:
distributorIds- theIdsof the distributors to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-distributorIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasDistributors
AliasResponseList aliasDistributors(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aDistributorfor the purpose of creating compatibility. The primaryIdof theDistributoris determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another distributor, it is reassigned to the given distributorId.- 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.
-