public interface AddressAdminSession extends OsidSession
This session creates, updates, and deletes Addresses.
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
getAddressFormForCreate()
specifying the desired
relationship peers and record Types
or none if no record
Types
are needed. The returned AddressForm
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
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.
For updates, AddressForms
are requested to the
Address
Id
that is to be updated using
getAddressFormForUpdate().
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.
The delete operations delete Addresses.
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.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasAddress(Id addressId,
Id aliasId)
Adds an
Id to an Address for the purpose
of creating compatibility. |
boolean |
canCreateAddresses()
Tests if this user can create
Addresses. |
boolean |
canCreateAddressWithRecordTypes(Type[] addressRecordTypes)
Tests if this user can create a single
Address using
the desired record types. |
boolean |
canDeleteAddresses()
Tests if this user can delete
Addresses A return of
true does not guarantee successful authorization. |
boolean |
canManageAddressAliases()
Tests if this user can manage
Id aliases for
Addresses. |
boolean |
canUpdateAddresses()
Tests if this user can update
Addresses. |
Address |
createAddress(AddressForm addressForm)
Creates a new
Address. |
void |
deleteAddress(Id addressId)
Deletes an
Address. |
AddressBook |
getAddressBook()
Gets the
AddressBook associated with this session. |
Id |
getAddressBookId()
Gets the
AddressBook Id associated with
this session. |
AddressForm |
getAddressFormForCreate(Type[] addressRecordTypes)
Gets the address form for creating new addresses.
|
AddressForm |
getAddressFormForUpdate(Id addressId)
Gets the address form for updating an existing address.
|
void |
updateAddress(AddressForm addressForm)
Updates an existing address.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getAddressBookId()
AddressBook
Id
associated with
this session. AddressBook Id
associated with this sessionmandatory
- This method must be implemented. AddressBook getAddressBook() throws OperationFailedException, PermissionDeniedException
AddressBook
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateAddresses()
Addresses.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Address
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 Address
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateAddressWithRecordTypes(Type[] addressRecordTypes)
Address
using
the desired record types. While
ContactManager.getAddressRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Address.
Providing an
empty array tests if an Address
can be created with no
records.addressRecordTypes
- array of address record types true
if Address
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- addressRecordTypes
is null
mandatory
- This method must be implemented. AddressForm getAddressFormForCreate(Type[] addressRecordTypes) throws OperationFailedException, PermissionDeniedException
addressRecordTypes
- array of address record typesNullArgumentException
- addressRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Address createAddress(AddressForm addressForm) throws OperationFailedException, PermissionDeniedException
Address.
addressForm
- the form for this Address
Address
IllegalStateException
- addressForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- addressForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- addressForm
did
not originate from getAddressFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateAddresses()
Addresses.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Address
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 Address
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. AddressForm getAddressFormForUpdate(Id addressId) throws NotFoundException, OperationFailedException, PermissionDeniedException
addressId
- the Id
of the Address
NotFoundException
- addressId
is not
foundNullArgumentException
- addressId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateAddress(AddressForm addressForm) throws OperationFailedException, PermissionDeniedException
addressForm
- the form containing the elements to be updatedIllegalStateException
- addressForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- addressId
or
addressForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- addressForm
did
not originate from getAddressFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteAddresses()
Addresses
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Address
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 Address
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteAddress(Id addressId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Address.
addressId
- the Id
of the Address
to removeNotFoundException
- addressId
not foundNullArgumentException
- addressId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageAddressAliases()
Id
aliases for
Addresses.
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 Address
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasAddress(Id addressId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an Address
for the purpose
of creating compatibility. The primary Id
of the
Address
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another address, it is reassigned to the given
address Id.
addressId
- the Id
of an Address
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- addressId
not foundNullArgumentException
- addressId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.