public interface AddressBookAdminSession extends OsidSession
This session creates, updates, and deletes AddressBooks.
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
AddressBook, an AddressBookForm is requested
using getAddressBookFormForCreate() specifying the desired
record Types or none if no record Types are
needed. The returned AddressBookForm 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 the AddressBookForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
AddressBookForm corresponds to an attempted transaction.
For updates, AddressBookForms are requested to the
AddressBook Id that is to be updated using
getAddressBookFormForUpdate(). Similarly, the
AddressBookForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
AddressBookForm can only be used once for a successful update and
cannot be reused.
The delete operations delete AddressBooks.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasAddressBook(Id addressBookId,
Id aliasId)
Adds an
Id to an AddressBook for the
purpose of creating compatibility. |
boolean |
canCreateAddressBooks()
Tests if this user can create
AddressBooks. |
boolean |
canCreateAddressBookWithRecordTypes(Type[] addressBookRecordTypes)
Tests if this user can create a single
AddressBook
using the desired record types. |
boolean |
canDeleteAddressBooks()
Tests if this user can delete
AddressBooks A return of
true does not guarantee successful authorization. |
boolean |
canManageAddressBookAliases()
Tests if this user can manage
Id aliases for
AddressBooks. |
boolean |
canUpdateAddressBooks()
Tests if this user can update
AddressBooks. |
AddressBook |
createAddressBook(AddressBookForm addressBookForm)
Creates a new
AddressBook. |
void |
deleteAddressBook(Id addressBookId)
Deletes an
AddressBook. |
AddressBookForm |
getAddressBookFormForCreate(Type[] addressBookRecordTypes)
Gets the address book form for creating new address books.
|
AddressBookForm |
getAddressBookFormForUpdate(Id addressBookId)
Gets the address book form for updating an existing address book.
|
void |
updateAddressBook(AddressBookForm addressBookForm)
Updates an existing address book.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateAddressBooks()
AddressBooks. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an AddressBook will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false if AddressBook creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateAddressBookWithRecordTypes(Type[] addressBookRecordTypes)
AddressBook
using the desired record types. While
ContactManager.getAddressBookRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific AddressBook.
Providing an empty array tests if an AddressBook can be
created with no records.addressBookRecordTypes - array of address book types true if AddressBook creation
using the specified record Types is supported,
false otherwiseNullArgumentException - addressBookRecordTypes
is null mandatory - This method must be implemented. AddressBookForm getAddressBookFormForCreate(Type[] addressBookRecordTypes) throws OperationFailedException, PermissionDeniedException
addressBookRecordTypes - array of address book typesNullArgumentException - addressBookRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. AddressBook createAddressBook(AddressBookForm addressBookForm) throws OperationFailedException, PermissionDeniedException
AddressBook. addressBookForm - the form for this AddressBook AddressBook IllegalStateException - addressBookForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - addressBookForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - addressBookForm
did not originate from getAddressBookFormForCreate()
mandatory - This method must be implemented. boolean canUpdateAddressBooks()
AddressBooks. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an AddressBook will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false if AddressBook
modification is not authorized, true otherwisemandatory - This method must be implemented. AddressBookForm getAddressBookFormForUpdate(Id addressBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
addressBookId - the Id of the AddressBook
NotFoundException - addressBookId is not
foundNullArgumentException - addressBookId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateAddressBook(AddressBookForm addressBookForm) throws OperationFailedException, PermissionDeniedException
addressBookForm - the form containing the elements to be updatedIllegalStateException - addressBookForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - addressBookId or
addressBookForm is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - addressBookForm
did not originate from getAddressBookFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteAddressBooks()
AddressBooks A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an AddressBook will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer delete operations to
unauthorized users. false if AddressBook deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteAddressBook(Id addressBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
AddressBook. addressBookId - the Id of the AddressBook
to removeNotFoundException - addressBookId not
foundNullArgumentException - addressBookId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageAddressBookAliases()
Id aliases for
AddressBooks. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if AddressBook aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasAddressBook(Id addressBookId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an AddressBook for the
purpose of creating compatibility. The primary Id of
the AddressBook is determined by the provider. The new
Id performs as an alias to the primary Id.
If the alias is a pointer to another addressBook, it is
reassigned to the given address book Id. addressBookId - the Id of an AddressBook
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - addressBookId not
foundNullArgumentException - addressBookId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.