public interface ContactAddressBookAssignmentSession extends OsidSession
This session provides methods to re-assign Contacts to
AddressBooks. A Contact may map to multiple
AddressBooks and removing the last reference to a
Contact 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 a Contact to another
AddressBook is not a copy operation (eg: does not change its
Id ).
| Modifier and Type | Method and Description |
|---|---|
void |
assignContactToAddressBook(Id contactId,
Id addressBookId)
Adds an existing
Contact to an AddressBook. |
boolean |
canAssignContacts()
Tests if this user can alter contact/address book mappings.
|
boolean |
canAssignContactsToAddressBook(Id addressBookId)
Tests if this user can alter contact/address book mappings.
|
IdList |
getAssignableAddressBookIds(Id addressBookId)
Gets a list of address books including and under the given address
book node in which any contact can be assigned.
|
IdList |
getAssignableAddressBookIdsForContact(Id addressBookId,
Id contactId)
Gets a list of address books including and under the given address
book node in which a specific contact can be assigned.
|
void |
reassignContactToAddressBook(Id contactId,
Id fromAddressBookId,
Id toAddressBookId)
Moves a
Contact from one AddressBook to
another. |
void |
unassignContactFromAddressBook(Id contactId,
Id addressBookId)
Removes a
Contact from an AddressBook. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canAssignContacts()
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 canAssignContactsToAddressBook(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 getAssignableAddressBookIdsForContact(Id addressBookId, Id contactId) throws OperationFailedException
addressBookId - the Id of the AddressBook
contactId - the Id of the Contact Ids NullArgumentException - addressBookId or
contactId is null OperationFailedException - unable to complete requestmandatory - This method must be implemented. void assignContactToAddressBook(Id contactId, Id addressBookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Contact to an AddressBook.
contactId - the Id of the Contact addressBookId - the Id of the AddressBook
AlreadyExistsException - contactId is
already assigned to addressBookId NotFoundException - contactId or
addressBookId not foundNullArgumentException - contactId or
addressBookId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void unassignContactFromAddressBook(Id contactId, Id addressBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Contact from an AddressBook. contactId - the Id of the Contact addressBookId - the Id of the AddressBook
NotFoundException - contactId or
addressBookId not found or contactId
not assigned to addressBookId NullArgumentException - contactId or
addressBookId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void reassignContactToAddressBook(Id contactId, Id fromAddressBookId, Id toAddressBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Contact from one AddressBook to
another. Mappings to other AddressBooks are unaffected.contactId - the Id of the Contact fromAddressBookId - the Id of the current
AddressBook toAddressBookId - the Id of the destination
AddressBook NotFoundException - contactId,
fromAddressBookId, or toAddressBookId
not found or contactId not mapped to
fromAddressBookId NullArgumentException - contactId,
fromAddressBookId, or toAddressBookId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.