Interface CommunicationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to process communications. Notifications are cancelled when this session is closed.
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(Id communiqueId) Sends a nonce response indicating that operations should continue or abort.getResponseForm(Id communiqueId) Gets the response form for submitting form-based responses.voidRegister for notifications of new communiques.voidrespondViaForm(ResponseForm responseForm) Responds to a communique requiring form input.voidrespondViaOption(Id responseOptionId) Responds to a communique requiring a response option.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
-
registerForCommuniques
Register for notifications of new communiques.CommunicationReceiver.newCommunique()is invoked when a newCommuniqueis sent.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
acknowledge
Sends a nonce response indicating that operations should continue or abort.- Parameters:
communiqueId- theIdof a communique- Throws:
IllegalStateException-Communique.respondViaOption()orCommunique.respondViaForm()istrue, or a response was already suppliedInvalidArgumentException-communiqueIdnot validNullArgumentException-communiqueIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
respondViaOption
void respondViaOption(Id responseOptionId) throws OperationFailedException, PermissionDeniedException Responds to a communique requiring a response option.- Parameters:
responseOptionId- theIdof a response option- Throws:
IllegalStateException-Communique.respondViaOption()isfalse or a response was already suppliedInvalidArgumentException-responseOptionIdnot validNullArgumentException-responseOptionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getResponseForm
ResponseForm getResponseForm(Id communiqueId) throws OperationFailedException, PermissionDeniedException Gets the response form for submitting form-based responses.- Parameters:
communiqueId- theIdof a communique- Returns:
- a response form
- Throws:
IllegalStateException-Communique.respondViaForm()isfalseInvalidArgumentException-communiqueIdnot validNullArgumentException-communiqueIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
respondViaForm
void respondViaForm(ResponseForm responseForm) throws OperationFailedException, PermissionDeniedException Responds to a communique requiring form input.- Parameters:
responseForm- a response form- Throws:
IllegalStateException-responseFormalready used in a response transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-responseFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-responseFormdid not originate fromgetResponseForm()- Compliance:
mandatory- This method must be implemented.
-