Interface AddressBatchAdminSession
- All Superinterfaces:
AddressAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
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 .
-
Method Summary
Modifier and TypeMethodDescriptionaliasAddresses(AliasRequestList aliasRequests) Adds anIdto anAddressfor the purpose of creating compatibility.createAddresses(AddressBatchFormList addressForms) Creates a new set ofAddresses.deleteAddresses(IdList addressIds) Deletes addresses for the givenIds.Deletes allAddressesin thisAddressBook.getAddressFormsForCreate(long number, Type[] addressRecordTypes) Gets the address forms for creating a bunch of new addresses.getAddressFormsForUpdate(IdList addressIds) Gets the address forms for updating an existing set of addresses.updateAddresses(AddressBatchFormList addressForms) Updates existing addresses.Methods inherited from interface AddressAdminSession
aliasAddress, canCreateAddresses, canCreateAddressWithRecordTypes, canDeleteAddresses, canManageAddressAliases, canUpdateAddresses, createAddress, deleteAddress, getAddressBook, getAddressBookId, getAddressFormForCreate, getAddressFormForUpdate, updateAddressModifier and TypeMethodDescriptionvoidaliasAddress(Id addressId, Id aliasId) Adds anIdto anAddressfor the purpose of creating compatibility.booleanTests if this user can createAddresses.booleancanCreateAddressWithRecordTypes(Type[] addressRecordTypes) Tests if this user can create a singleAddressusing the desired record types.booleanTests if this user can deleteAddressesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forAddresses.booleanTests if this user can updateAddresses.createAddress(AddressForm addressForm) Creates a newAddress.voiddeleteAddress(Id addressId) Deletes anAddress.Gets theAddressBookassociated with this session.Gets theAddressBookIdassociated with this session.getAddressFormForCreate(Type[] addressRecordTypes) Gets the address form for creating new addresses.getAddressFormForUpdate(Id addressId) Gets the address form for updating an existing address.voidupdateAddress(AddressForm addressForm) Updates an existing address.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.
-
Method Details
-
getAddressFormsForCreate
AddressBatchFormList getAddressFormsForCreate(long number, Type[] addressRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the address forms for creating a bunch of new addresses.- Parameters:
number- the number of forms to retrieveaddressRecordTypes- array of address record types to be included in each create operation or an empty list if none- Returns:
- the address forms
- Throws:
NullArgumentException-addressRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createAddresses
CreateResponseList createAddresses(AddressBatchFormList addressForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofAddresses. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
addressForms- the address forms- Returns:
- the create responses
- Throws:
NullArgumentException-addressFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAddressFormsForUpdate
AddressBatchFormList getAddressFormsForUpdate(IdList addressIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the address forms for updating an existing set of addresses. A new address form should be requested for each update transaction.- Parameters:
addressIds- theIdsof theAddress- Returns:
- the address form
- Throws:
NotFoundException- anaddressIdis not foundNullArgumentException-addressIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAddresses
UpdateResponseList updateAddresses(AddressBatchFormList addressForms) throws OperationFailedException, PermissionDeniedException Updates existing addresses. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
addressForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-addressFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllAddresses
Deletes allAddressesin thisAddressBook.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAddresses
DeleteResponseList deleteAddresses(IdList addressIds) throws OperationFailedException, PermissionDeniedException Deletes addresses for the givenIds.- Parameters:
addressIds- theIdsof the addresses to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-addressIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasAddresses
AliasResponseList aliasAddresses(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anAddressfor the purpose of creating compatibility. The primaryIdof theAddressis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another address, it is reassigned to the given addressId.- 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.
-