Interface FunctionNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive asynchronous notifications on
adds/changes to Function 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
FunctionLookupSession .
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeFunctionNotification(Id notificationId) Acknowledge a function notification.booleanTests if this user can register forFunctionnotifications.getVault()Gets theVaultassociated with this session.Gets theVaultIdassociated with this session.voidregisterForChangedFunction(Id functionId) Registers for notification of an updated function.voidRegisters for notification of updated functions.voidregisterForDeletedFunction(Id functionId) Registers for notification of a deleted function.voidRegisters for notification of deleted functions.voidRegister for notifications of new functions.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
-
getVaultId
Id getVaultId()Gets theVaultIdassociated with this session.- Returns:
- the
Vault Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getVault
Gets theVaultassociated with this session.- Returns:
- the
Vaultassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForFunctionNotifications
boolean canRegisterForFunctionNotifications()Tests if this user can register forFunctionnotifications. 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.
-
useFederatedVaultView
void useFederatedVaultView()Federates the view for methods in this session. A federated view will include functions in vaults which are children of this vault in the vault hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedVaultView
void useIsolatedVaultView()Isolates the view for methods in this session. An isolated view restricts notifications to this vault only.- Compliance:
mandatory- This method is must be implemented.
-
reliableFunctionNotifications
void reliableFunctionNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeFunctionNotification().- Compliance:
mandatory- This method is must be implemented.
-
unreliableFunctionNotifications
void unreliableFunctionNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method is must be implemented.
-
acknowledgeFunctionNotification
void acknowledgeFunctionNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a function notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewFunctions
Register for notifications of new functions.FunctionReceiver.newFunctions()is invoked when a new Function is created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedFunctions
Registers for notification of updated functions.FunctionReceiver.changedFunctions()is invoked when a function is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedFunction
void registerForChangedFunction(Id functionId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated function.FunctionReceiver.changedFunctions()is invoked when the specified function is changed.- Parameters:
functionId- theIdof theFunctionto monitor- Throws:
NullArgumentException-functionId is nullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedFunctions
Registers for notification of deleted functions.FunctionReceiver.deletedFunctions()is invoked when a function is removed from this vault.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedFunction
void registerForDeletedFunction(Id functionId) throws OperationFailedException, PermissionDeniedException Registers for notification of a deleted function.FunctionReceiver.changedFunctions()is invoked when the specified function is removed from this vault.- Parameters:
functionId- theIdof theFunctionto monitor- Throws:
NullArgumentException-functionId is nullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-