OSID Logo
OSID Specifications
contact package
Version 3.0.0
Release Candidate Preview
Interfaceosid.contact.AddressAdminSession
Implementsosid.OsidSession
Description

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.

MethodgetAddressBookId
Description

Gets the AddressBook Id associated with this session.

Returnosid.id.Idthe AddressBook Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetAddressBook
Description

Gets the AddressBook associated with this session.

Returnosid.contact.AddressBookthe address book
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateAddresses
Description

Tests if this user can create 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.

Returnboolean false if Address creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateAddressWithRecordTypes
Description

Tests if this user can create a single 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.

Parametersosid.type.Type[]addressRecordTypesarray of address record types
Returnboolean true if Address creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT addressRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetAddressFormForCreate
Description

Gets the address form for creating new addresses. A new form should be requested for each create transaction.

Parametersosid.type.Type[]addressRecordTypesarray of address record types
Returnosid.contact.AddressFormthe address form
ErrorsNULL_ARGUMENT addressRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateAddress
Description

Creates a new Address.

Parametersosid.contact.AddressFormaddressFormthe form for this Address
Returnosid.contact.Addressthe new Address
ErrorsILLEGAL_STATE addressForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT addressForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED addressForm did not originate from getAddressFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateAddresses
Description

Tests if this user can update 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.

Returnboolean false if Address modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetAddressFormForUpdate
Description

Gets the address form for updating an existing address. A new address form should be requested for each update transaction.

Parametersosid.id.IdaddressIdthe Id of the Address
Returnosid.contact.AddressFormthe address form
ErrorsNOT_FOUND addressId is not found
NULL_ARGUMENT addressId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateAddress
Description

Updates an existing address.

Parametersosid.contact.AddressFormaddressFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE addressForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT addressId or addressForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED addressForm did not originate from getAddressFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteAddresses
Description

Tests if this user can delete 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.

Returnboolean false if Address deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteAddress
Description

Deletes an Address.

Parametersosid.id.IdaddressIdthe Id of the Address to remove
ErrorsNOT_FOUND addressId not found
NULL_ARGUMENT addressId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageAddressAliases
Description

Tests if this user can manage 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.

Returnboolean false if Address aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasAddress
Description

Adds an 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.

Parametersosid.id.IdaddressIdthe Id of an Address
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND addressId not found
NULL_ARGUMENT addressId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.