public interface CustomerBatchAdminSession extends CustomerAdminSession
This session creates, updates, and deletes Customers
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
Customer,
a CustomerForm
is requested using
getCustomerFormsForCreate()
specifying the resource and desired
record Types
or none if no record Types
are
needed. Each of the returned CustomerForms
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 CustomerForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
CustomerForm
corresponds to an attempted transaction.
The CustomerForms
returned from
getCustomerFormsForCreate()
may be linked to the originating
request through the peer Ids
of the CustomerForm.
In the case where there may be duplicates, any CustomerForm
of the same peer Ids
may be used for a create
operation.
Once a batch of CustomerForms
are submitted for create,
a CreateResponse
is returned for each CustomerForm,
although the ordering is not defined. Only errors that pertain to
the entire create operation are returned from createCustomers(),
errors specific to an individual CustomerForm
are
indicated in the corresponding CreateResponse.
CreateResponses
may be linked to the originating
CustomerForm
through the CustomerForm
Id
.
For updates, CustomerForms
are requested to the
Customer
Id
that is to be updated using
getCustomerFormsForUpdate()
where the reference Id
in the CustomerForm
may be used to link the request.
Similarly, the CustomerForm
has metadata about the data
that can be updated and it can perform validation before submitting the
update. The CustomerForm
can only be used once for a
successful update and cannot be reused.
Once a batch of CustomerForms
are submitted for update,
an UpdateResponse
is returned for each CustomerForm,
although the ordering is not defined. Only errors that pertain to
the entire update operation are returned from updateCustomers(),
errors specific to an individual CustomerForm
are
indicated in the corresponding UpdateResponse.
UpdateResponses
may be linked to the originating
CustomerForm
through the CustomerForm
Id.
The delete operations delete Customers
in bulk. To
unmap a Customer
from the current Business,
the CustomerBusinessAssignmentSession
should be used. These
delete operations attempt to remove the Customer
itself
thus removing it from all known Business
catalogs. Bulk
delete operations return the results in DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasCustomers(AliasRequestList aliasRequests)
Adds an
Id to a Customer for the purpose
of creating compatibility. |
CreateResponseList |
createCustomers(CustomerBatchFormList customerForms)
Creates a new set of
Customers. |
DeleteResponseList |
deleteAllCustomers()
Deletes all
Customers in this Business . |
DeleteResponseList |
deleteCustomers(IdList customerIds)
Deletes customers for the given
Ids. |
DeleteResponseList |
deleteCustomersForResource(Id resourceId)
Deletes customers for the given resource.
|
DeleteResponseList |
deleteIneffectiveCustomersByDate(DateTime date)
Deletes customers expired before the given date.
|
CustomerBatchFormList |
getCustomerFormsForCreate(IdList resourceIds,
Type[] customerRecordTypes)
Gets the customer forms for creating a bunch of new customers.
|
CustomerBatchFormList |
getCustomerFormsForUpdate(IdList customerIds)
Gets the customer forms for updating an existing set of customers.
|
UpdateResponseList |
updateCustomers(CustomerBatchFormList customerForms)
Updates existing customers.
|
aliasCustomer, canCreateCustomers, canCreateCustomerWithRecordTypes, canDeleteCustomers, canManageCustomerAliases, canUpdateCustomers, createCustomer, deleteCustomer, getBusiness, getBusinessId, getCustomerFormForCreate, getCustomerFormForUpdate, updateCustomer
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
CustomerBatchFormList getCustomerFormsForCreate(IdList resourceIds, Type[] customerRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
resourceIds
- a list of resource Ids
customerRecordTypes
- array of customer record types to be
included in each create operation or an empty list if noneNotFoundException
- a resource is not foundNullArgumentException
- resourceIds
or
customerRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createCustomers(CustomerBatchFormList customerForms) throws OperationFailedException, PermissionDeniedException
Customers.
This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.customerForms
- the customer formsNullArgumentException
- customerForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CustomerBatchFormList getCustomerFormsForUpdate(IdList customerIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
customerIds
- the Ids
of the Customer
NotFoundException
- a customerId
is not
foundNullArgumentException
- customerIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateCustomers(CustomerBatchFormList customerForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.customerForms
- the form containing the elements to be updatedNullArgumentException
- customerForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllCustomers() throws OperationFailedException, PermissionDeniedException
Customers
in this Business
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteCustomers(IdList customerIds) throws OperationFailedException, PermissionDeniedException
Ids.
customerIds
- the Ids
of the customers to deleteNullArgumentException
- customerIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteCustomersForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException
resourceId
- the Id
of a resourceNullArgumentException
- customerIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteIneffectiveCustomersByDate(DateTime date) throws OperationFailedException, PermissionDeniedException
date
- a dateNullArgumentException
- date
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasCustomers(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to a Customer
for the purpose
of creating compatibility. The primary Id
of the
Customer
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is
a pointer to another customer, it is reassigned to the given customer
Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.