public interface AddressAddressBookAssignmentSession extends OsidSession
This session provides methods to re-assign Addresses
to
AddressBooks.
An Address
may map to multiple
AddressBooks
and removing the last reference to an
Address
is the equivalent of deleting it. Each AddressBook
may have its own authorizations governing who is allowed to
operate on it.
Adding a reference of an Address
to another
AddressBook
is not a copy operation (eg: does not change its
Id
).
Modifier and Type | Method and Description |
---|---|
void |
assignAddressToAddressBook(Id addressId,
Id addressBookId)
Adds an existing
Address to an AddressBook. |
boolean |
canAssignAddresses()
Tests if this user can alter address/address book mappings.
|
boolean |
canAssignAddressesToAddressBook(Id addressBookId)
Tests if this user can alter address/address book mappings.
|
IdList |
getAssignableAddressBookIds(Id addressBookId)
Gets a list of address books including and under the given address
book node in which any address can be assigned.
|
IdList |
getAssignableAddressBookIdsForAddress(Id addressBookId,
Id addressId)
Gets a list of address books including and under the given address
book node in which a specific address can be assigned.
|
void |
reassignAddressToAddressBook(Id addressId,
Id fromAddressBookId,
Id toAddressBookId)
Moves an
Address from one AddressBook to
another. |
void |
unassignAddressFromAddressBook(Id addressId,
Id addressBookId)
Removes an
Address from an AddressBook. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canAssignAddresses()
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users. false
if mapping is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canAssignAddressesToAddressBook(Id addressBookId)
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users.addressBookId
- the Id
of the AddressBook
false
if mapping is not authorized, true
otherwiseNullArgumentException
- addressBookId
is
null
mandatory
- This method must be implemented. IdList getAssignableAddressBookIds(Id addressBookId) throws OperationFailedException
addressBookId
- the Id
of the AddressBook
Ids
NullArgumentException
- addressBookId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. IdList getAssignableAddressBookIdsForAddress(Id addressBookId, Id addressId) throws OperationFailedException
addressBookId
- the Id
of the AddressBook
addressId
- the Id
of the Address
Ids
NullArgumentException
- addressBookId
or
addressId
is null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void assignAddressToAddressBook(Id addressId, Id addressBookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Address
to an AddressBook.
addressId
- the Id
of the Address
addressBookId
- the Id
of the AddressBook
AlreadyExistsException
- addressId
is
already assigned to addressBookId
NotFoundException
- addressId
or
addressBookId
not foundNullArgumentException
- addressId
or
addressBookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void unassignAddressFromAddressBook(Id addressId, Id addressBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Address
from an AddressBook.
addressId
- the Id
of the Address
addressBookId
- the Id
of the AddressBook
NotFoundException
- addressId
or
addressBookId
not found or addressId
not assigned to addressBookId
NullArgumentException
- addressId
or
addressBookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void reassignAddressToAddressBook(Id addressId, Id fromAddressBookId, Id toAddressBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Address
from one AddressBook
to
another. Mappings to other AddressBooks
are unaffected.addressId
- the Id
of the Address
fromAddressBookId
- the Id
of the current
AddressBook
toAddressBookId
- the Id
of the destination
AddressBook
NotFoundException
- addressId,
fromAddressBookId,
or toAddressBookId
not found or addressId
not mapped to
fromAddressBookId
NullArgumentException
- addressId,
fromAddressBookId,
or toAddressBookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.