public interface AddressBatchAdminSession extends AddressAdminSession
This session creates, updates, and deletes Addresses
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 an
Address,
an AddressForm
is requested using
getAddressFormsForCreate()
specifying the desired record
Types
or none if no record Types
are needed.
Each of the returned AddressForms
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 an AddressForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
AddressForm
corresponds to an attempted transaction.
The AddressForms
returned from
getAddressFormsForCreate()
may be linked to the originating
request through the peer Ids
of the AddressForm.
In the case where there may be duplicates, any AddressForm
of the same peer Ids
may be used for a create
operation.
Once a batch of AddressForms
are submitted for create,
a CreateResponse
is returned for each AddressForm,
although the ordering is not defined. Only errors that pertain to
the entire create operation are returned from createAddresses(),
errors specific to an individual AddressForm
are
indicated in the corresponding CreateResponse.
CreateResponses
may be linked to the originating
AddressForm
through the AddressForm
Id
.
For updates, AddressForms
are requested to the
Address
Id
that is to be updated using
getAddressFormsForUpdate()
where the reference Id
in the AddressForm
may be used to link the request.
Similarly, the AddressForm
has metadata about the data that
can be updated and it can perform validation before submitting the update.
The AddressForm
can only be used once for a successful
update and cannot be reused.
Once a batch of AddressForms
are submitted for update,
an UpdateResponse
is returned for each AddressForm,
although the ordering is not defined. Only errors that pertain to
the entire update operation are returned from updateAddresses(),
errors specific to an individual AddressForm
are
indicated in the corresponding UpdateResponse.
UpdateResponses
may be linked to the originating
AddressForm
through the AddressForm
Id.
The delete operations delete Addresses
in bulk. To
unmap an Address
from the current AddressBook,
the AddressAddressBookAssignmentSession
should be
used. These delete operations attempt to remove the Address
itself thus removing it from all known AddressBook
catalogs. Bulk delete operations return the results in
DeleteResponses.
Modifier and Type | Method and Description |
---|---|
AliasResponseList |
aliasAddresses(AliasRequestList aliasRequests)
Adds an
Id to an Address for the purpose
of creating compatibility. |
CreateResponseList |
createAddresses(AddressBatchFormList addressForms)
Creates a new set of
Addresses. |
DeleteResponseList |
deleteAddresses(IdList addressIds)
Deletes addresses for the given
Ids. |
DeleteResponseList |
deleteAllAddresses()
Deletes all
Addresses in this AddressBook
. |
AddressBatchFormList |
getAddressFormsForCreate(long number,
Type[] addressRecordTypes)
Gets the address forms for creating a bunch of new addresses.
|
AddressBatchFormList |
getAddressFormsForUpdate(IdList addressIds)
Gets the address forms for updating an existing set of addresses.
|
UpdateResponseList |
updateAddresses(AddressBatchFormList addressForms)
Updates existing addresses.
|
aliasAddress, canCreateAddresses, canCreateAddressWithRecordTypes, canDeleteAddresses, canManageAddressAliases, canUpdateAddresses, createAddress, deleteAddress, getAddressBook, getAddressBookId, getAddressFormForCreate, getAddressFormForUpdate, updateAddress
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
AddressBatchFormList getAddressFormsForCreate(long number, Type[] addressRecordTypes) throws OperationFailedException, PermissionDeniedException
number
- the number of forms to retrieveaddressRecordTypes
- array of address record types to be
included in each create operation or an empty list if noneNullArgumentException
- addressRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to request forms with
given record typesmandatory
- This method must be implemented. CreateResponseList createAddresses(AddressBatchFormList addressForms) throws OperationFailedException, PermissionDeniedException
Addresses.
This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse
.addressForms
- the address formsNullArgumentException
- addressForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AddressBatchFormList getAddressFormsForUpdate(IdList addressIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
addressIds
- the Ids
of the Address
NotFoundException
- an addressId
is not
foundNullArgumentException
- addressIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. UpdateResponseList updateAddresses(AddressBatchFormList addressForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse
.addressForms
- the form containing the elements to be updatedNullArgumentException
- addressForms
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAllAddresses() throws OperationFailedException, PermissionDeniedException
Addresses
in this AddressBook
.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DeleteResponseList deleteAddresses(IdList addressIds) throws OperationFailedException, PermissionDeniedException
Ids.
addressIds
- the Ids
of the addresses to deleteNullArgumentException
- addressIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. AliasResponseList aliasAddresses(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
Id
to an Address
for the purpose
of creating compatibility. The primary Id
of the
Address
is determined by the provider. The new Id
is an alias to the primary Id.
If the alias is
a pointer to another address, it is reassigned to the given address
Id.
aliasRequests
- the alias requestsNullArgumentException
- aliasRequests
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.