public interface KeyNotificationSession extends OsidSession
This session defines methods to receive asynchronous notifications on
adds/changes to Key
objects. 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.
The two views defined in this session correspond to the views in the
KeyLookupSession.
Modifier and Type | Method and Description |
---|---|
void |
acknowledgeKeyNotification(Id notificationId)
Acknowledge a key notification.
|
boolean |
canRegisterForKeyNotifications()
Tests if this user can register for
Key notifications. |
Agency |
getAgency()
Gets the
Agency associated with this session. |
Id |
getAgencyId()
Gets the
Agency Id associated with this
session. |
void |
registerForChangedKey(Id keyId)
Registers for notification of an updated key.
|
void |
registerForChangedKeys()
Registers for notification of updated keys.
|
void |
registerForDeletedKey(Id keyId)
Registers for notification of a deleted key.
|
void |
registerForDeletedKeys()
Registers for notification of deleted keys.
|
void |
registerForNewKeys()
Register for notifications of new keys.
|
void |
reliableKeyNotifications()
Reliable notifications are desired.
|
void |
unreliableKeyNotifications()
Unreliable notifications are desired.
|
void |
useFederatedAgencyView()
Federates the view for methods in this session.
|
void |
useIsolatedAgencyView()
Isolates the view for methods in this session.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getAgencyId()
Agency
Id
associated with this
session. Agency Id
associated with this sessionmandatory
- This method must be implemented. Agency getAgency() throws OperationFailedException, PermissionDeniedException
Agency
associated with this session. Agency
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canRegisterForKeyNotifications()
Key
notifications.
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 a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer notification
operations. false
if notification methods are not
authorized, true
otherwisemandatory
- This method must be implemented. void useFederatedAgencyView()
mandatory
- This method is must be implemented. void useIsolatedAgencyView()
mandatory
- This method is must be implemented. void reliableKeyNotifications()
acknowledgeKeyNotification()
.mandatory
- This method is must be implemented. void unreliableKeyNotifications()
mandatory
- This method is must be implemented. void acknowledgeKeyNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException
notificationId
- the Id
of the notificationOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForNewKeys() throws OperationFailedException, PermissionDeniedException
KeyReceiver.newKeys()
is invoked when a new Key
is created.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForChangedKeys() throws OperationFailedException, PermissionDeniedException
KeyReceiver.changedKeys()
is invoked when an key is changed.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForChangedKey(Id keyId) throws OperationFailedException, PermissionDeniedException
KeyReceiver.changedKeys()
is invoked when the specified key is
changed.keyId
- the Id
of the Key
to
monitorNullArgumentException
- keyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForDeletedKeys() throws OperationFailedException, PermissionDeniedException
KeyReceiver.deletedKeys()
is invoked when an key is removed
from this agency.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void registerForDeletedKey(Id keyId) throws OperationFailedException, PermissionDeniedException
KeyReceiver.deletedKeys()
is invoked when the specified key is
removed from this agency.keyId
- the Id
of the Key
to
monitorNullArgumentException
- keyId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.