Interface ContactEnablerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates and removes contact enablers. The data for create
and update is provided via the ContactEnablerForm .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasContactEnabler(Id contactEnablerId, Id aliasId) Adds anIdto aContactEnablerfor the purpose of creating compatibility.booleanTests if this user can create contact enablers.booleancanCreateContactEnablerWithRecordTypes(Type[] contactEnablerRecordTypes) Tests if this user can create a singleContactEnablerusing the desired record types.booleanTests if this user can delete contact enablers.booleanTests if this user can manageIdaliases for contact enablers.booleanTests if this user can update contact enablers.createContactEnabler(ContactEnablerForm contactEnablerForm) Creates a newContactEnabler.voiddeleteContactEnabler(Id contactEnablerId) Deletes aContactEnabler.Gets theAddressBookassociated with this session.Gets theAddressBookIdassociated with this session.getContactEnablerFormForCreate(Type[] contactEnablerRecordTypes) Gets the contact enabler form for creating new contact enablers.getContactEnablerFormForUpdate(Id contactEnablerId) Gets the contact enabler form for updating an existing contact enabler.voidupdateContactEnabler(ContactEnablerForm contactEnablerForm) Updates an existing contact enabler.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
-
getAddressBookId
Id getAddressBookId()Gets theAddressBookIdassociated with this session.- Returns:
- the
AddressBook Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getAddressBook
Gets theAddressBookassociated with this session.- Returns:
- the address book
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateContactEnabler
boolean canCreateContactEnabler()Tests if this user can create contact enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aContactEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifContactEnablercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateContactEnablerWithRecordTypes
Tests if this user can create a singleContactEnablerusing the desired record types. WhileContactRulesManager.getContactEnablerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificContactEnabler. Providing an empty array tests if aContactEnablercan be created with no records.- Parameters:
contactEnablerRecordTypes- array of contact enabler record types- Returns:
trueifContactEnablercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-contactEnablerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getContactEnablerFormForCreate
ContactEnablerForm getContactEnablerFormForCreate(Type[] contactEnablerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the contact enabler form for creating new contact enablers. A new form should be requested for each create transaction.- Parameters:
contactEnablerRecordTypes- array of contact enabler record types- Returns:
- the contact enabler form
- Throws:
NullArgumentException-contactEnablerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createContactEnabler
ContactEnabler createContactEnabler(ContactEnablerForm contactEnablerForm) throws OperationFailedException, PermissionDeniedException Creates a newContactEnabler.- Parameters:
contactEnablerForm- the form for thisContactEnabler- Returns:
- the new
ContactEnabler - Throws:
IllegalStateException-contactEnablerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-contactEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-contactEnablerFormdid not originate fromgetContactEnablerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateContactEnablers
boolean canUpdateContactEnablers()Tests if this user can update contact enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aContactEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifContactEnablermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getContactEnablerFormForUpdate
ContactEnablerForm getContactEnablerFormForUpdate(Id contactEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the contact enabler form for updating an existing contact enabler. A new contact enabler form should be requested for each update transaction.- Parameters:
contactEnablerId- theIdof theContactEnabler- Returns:
- the contact enabler form
- Throws:
NotFoundException-contactEnablerIdis not foundNullArgumentException-contactEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateContactEnabler
void updateContactEnabler(ContactEnablerForm contactEnablerForm) throws OperationFailedException, PermissionDeniedException Updates an existing contact enabler.- Parameters:
contactEnablerForm- the form containing the elements to be updated- Throws:
IllegalStateException-contactEnablerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-contactEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-contactEnablerFormdid not originate fromgetContactEnablerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteContactEnablers
boolean canDeleteContactEnablers()Tests if this user can delete contact enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aContactEnablerwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifContactEnablerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteContactEnabler
void deleteContactEnabler(Id contactEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aContactEnabler.- Parameters:
contactEnablerId- theIdof theContactEnablerto remove- Throws:
NotFoundException-contactEnablerIdnot foundNullArgumentException-contactEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageContactEnablerAliases
boolean canManageContactEnablerAliases()Tests if this user can manageIdaliases for contact enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifContactEnableraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasContactEnabler
void aliasContactEnabler(Id contactEnablerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aContactEnablerfor the purpose of creating compatibility. The primaryIdof theContactEnableris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another contact enabler. it is reassigned to the given contact enablerId.- Parameters:
contactEnablerId- theIdof aContactEnableraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-contactEnablerIdnot foundNullArgumentException-contactEnablerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-