Interface AddressAddressBookAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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
).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignAddressToAddressBook(Id addressId, Id addressBookId) Adds an existingAddressto anAddressBook.booleanTests if this user can alter address/address book mappings.booleancanAssignAddressesToAddressBook(Id addressBookId) Tests if this user can alter address/address book mappings.getAssignableAddressBookIds(Id addressBookId) Gets a list of address books including and under the given address book node in which any address can be assigned.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.voidreassignAddressToAddressBook(Id addressId, Id fromAddressBookId, Id toAddressBookId) Moves anAddressfrom oneAddressBookto another.voidunassignAddressFromAddressBook(Id addressId, Id addressBookId) Removes anAddressfrom anAddressBook.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
-
canAssignAddresses
boolean canAssignAddresses()Tests if this user can alter address/address book mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignAddressesToAddressBook
Tests if this user can alter address/address book mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
addressBookId- theIdof theAddressBook- Returns:
falseif mapping is not authorized,trueotherwise- Throws:
NullArgumentException-addressBookIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableAddressBookIds
Gets a list of address books including and under the given address book node in which any address can be assigned.- Parameters:
addressBookId- theIdof theAddressBook- Returns:
- list of assignable address book
Ids - Throws:
NullArgumentException-addressBookIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableAddressBookIdsForAddress
IdList getAssignableAddressBookIdsForAddress(Id addressBookId, Id addressId) throws OperationFailedException Gets a list of address books including and under the given address book node in which a specific address can be assigned.- Parameters:
addressBookId- theIdof theAddressBookaddressId- theIdof theAddress- Returns:
- list of assignable address book
Ids - Throws:
NullArgumentException-addressBookIdoraddressIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignAddressToAddressBook
void assignAddressToAddressBook(Id addressId, Id addressBookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingAddressto anAddressBook.- Parameters:
addressId- theIdof theAddressaddressBookId- theIdof theAddressBook- Throws:
AlreadyExistsException-addressIdis already assigned toaddressBookIdNotFoundException-addressIdoraddressBookIdnot foundNullArgumentException-addressIdoraddressBookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignAddressFromAddressBook
void unassignAddressFromAddressBook(Id addressId, Id addressBookId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes anAddressfrom anAddressBook.- Parameters:
addressId- theIdof theAddressaddressBookId- theIdof theAddressBook- Throws:
NotFoundException-addressIdoraddressBookIdnot found oraddressIdnot assigned toaddressBookIdNullArgumentException-addressIdoraddressBookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignAddressToAddressBook
void reassignAddressToAddressBook(Id addressId, Id fromAddressBookId, Id toAddressBookId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves anAddressfrom oneAddressBookto another. Mappings to otherAddressBooksare unaffected.- Parameters:
addressId- theIdof theAddressfromAddressBookId- theIdof the currentAddressBooktoAddressBookId- theIdof the destinationAddressBook- Throws:
AlreadyExistsException-addressIdalready assigned totoAddressBookIdNotFoundException-addressId, fromAddressBookId, ortoAddressBookIdnot found oraddressIdnot mapped tofromAddressBookIdNullArgumentException-addressId, fromAddressBookId, ortoAddressBookIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-