Interface ContactNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on adds/changes
to Contacts . This session is intended for consumers needing to
synchronize their state with this service without the use of polling.
Notifications are cancelled when this session is closed.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeContactNotification(Id notificationId) Acknowledge a contact notification.booleanTests if this user can register forContactnotifications.Gets theAddressBookassociated with this session.Gets theAddressBookIdassociated with this session.voidregisterForChangedContact(Id contactId) Registers for notification of an updated contact.voidRegisters for notification of updated contacts.voidregisterForChangedContactsByGenusType(Type contactGenusType) Register for notifications of changed contacts for the given contact genusType.voidregisterForChangedContactsForAddress(Id addressId) Register for notifications of changed contacts for the given addressId.voidregisterForChangedContactsForReference(Id referenceId) Register for notifications of changed contacts for the given referenceId.voidregisterForDeletedContact(Id contactId) Registers for notification of a deleted contact.voidRegisters for notification of deleted contacts.voidregisterForDeletedContactsByGenusType(Type contactGenusType) Register for notifications of deleted contacts for the given contact genusType.voidregisterForDeletedContactsForAddress(Id addressId) Register for notifications of deleted contacts for the given addressId.voidregisterForDeletedContactsForReference(Id referenceId) Register for notifications of deleted contacts for the given referenceId.voidRegister for notifications of new contacts.voidregisterForNewContactsByGenusType(Type contactGenusType) Register for notifications of new contacts for the given genusType.voidregisterForNewContactsForAddress(Id addressId) Register for notifications of new contacts for the given referenceId.voidregisterForNewContactsForReference(Id referenceId) Register for notifications of new contacts for the given referenceId.voidReliable notifications are desired.voidUnreliable notifications are desired.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.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.
-
canRegisterForContactNotifications
boolean canRegisterForContactNotifications()Tests if this user can register forContactnotifications. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer notification operations.- Returns:
falseif notification methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useFederatedAddressBookView
void useFederatedAddressBookView()Federates the view for methods in this session. A federated view will include contacts in address books which are children of this address book in the address book hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedAddressBookView
void useIsolatedAddressBookView()Isolates the view for methods in this session. An isolated view restricts retrievals to this address book only.- Compliance:
mandatory- This method is must be implemented.
-
reliableContactNotifications
void reliableContactNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeContactNotification().- Compliance:
mandatory- This method is must be implemented.
-
unreliableContactNotifications
void unreliableContactNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method is must be implemented.
-
acknowledgeContactNotification
void acknowledgeContactNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a contact notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewContacts
Register for notifications of new contacts.ContactReceiver.newContacts()is invoked when a newContactis created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewContactsByGenusType
void registerForNewContactsByGenusType(Type contactGenusType) throws OperationFailedException, PermissionDeniedException Register for notifications of new contacts for the given genusType.ContactReceiver.newContacts()is invoked when a newContactis created.- Parameters:
contactGenusType- the contact genus type to monitor- Throws:
NullArgumentException-contactGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewContactsForReference
void registerForNewContactsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Register for notifications of new contacts for the given referenceId.ContactReceiver.newContacts()is invoked when a newContactis created.- Parameters:
referenceId- theIdof the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewContactsForAddress
void registerForNewContactsForAddress(Id addressId) throws OperationFailedException, PermissionDeniedException Register for notifications of new contacts for the given referenceId.ContactReceiver.newContacts()is invoked when a newContactis created.- Parameters:
addressId- theIdof the address to monitor- Throws:
NullArgumentException-addressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedContacts
Registers for notification of updated contacts.ContactReceiver.changedContacts()is invoked when a contact is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedContactsByGenusType
void registerForChangedContactsByGenusType(Type contactGenusType) throws OperationFailedException, PermissionDeniedException Register for notifications of changed contacts for the given contact genusType.ContactReceiver.changedContacts()is invoked when aContactfor the genus type is changed.- Parameters:
contactGenusType- the contact genus type to monitor- Throws:
NullArgumentException-contactGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedContactsForReference
void registerForChangedContactsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Register for notifications of changed contacts for the given referenceId.ContactReceiver.changedContacts()is invoked when aContactfor the reference is changed.- Parameters:
referenceId- theIdof the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedContactsForAddress
void registerForChangedContactsForAddress(Id addressId) throws OperationFailedException, PermissionDeniedException Register for notifications of changed contacts for the given addressId.ContactReceiver.changedContacts()is invoked when aContactfor the address is changed.- Parameters:
addressId- theIdof the address to monitor- Throws:
NullArgumentException-addressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedContact
void registerForChangedContact(Id contactId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated contact.ContactReceiver.changedContact()is invoked when the specified contact is changed.- Parameters:
contactId- theIdof theContactto monitor- Throws:
NullArgumentException-contactIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedContacts
Registers for notification of deleted contacts.ContactReceiver.deletedContacts()is invoked when a contact is deleted.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedContactsByGenusType
void registerForDeletedContactsByGenusType(Type contactGenusType) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted contacts for the given contact genusType.ContactReceiver.deletedContacts()is invoked when aContactfor the genus type is deleted.- Parameters:
contactGenusType- the contact genus type to monitor- Throws:
NullArgumentException-contactGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedContactsForReference
void registerForDeletedContactsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted contacts for the given referenceId.ContactReceiver.deletedContacts()is invoked when aContactfor the reference is deleted.- Parameters:
referenceId- theIdof the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedContactsForAddress
void registerForDeletedContactsForAddress(Id addressId) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted contacts for the given addressId.ContactReceiver.deletedContacts()is invoked when aContactfor the address is deleted.- Parameters:
addressId- theIdof the address to monitor- Throws:
NullArgumentException-addressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedContact
void registerForDeletedContact(Id contactId) throws OperationFailedException, PermissionDeniedException Registers for notification of a deleted contact.ContactReceiver.deletedContacts()is invoked when the specified contact is deleted.- Parameters:
contactId- theIdof theContactto monitor- Throws:
NullArgumentException-contactIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-