OSID Logo
OSID Specifications
communication package
Version 3.0.0
Release Candidate Preview
Packageosid.communication
TitleCommunication Open Service Interface Definitions
Version3.0.0
Description

The Communication OSID is a supplementary service to provide a means for an OSID Provider to communicate diectly to an application for the purposes of completing transactions or sending out of band messages. Communiques may be sent for informational purposes or in times when a response is necessary for an OSID Provider to proceed with operations.

An OSID Provider may orchestrate a Communication OSID to request additional information from a user in reaction to an incomplete transaction or failure. OSID Consumers are not required to use the Communication OSID. Where this service is not consumed, an OSID Provider must proceed with operation or return an error.

The communication is present when a CommunicationSession has been retrieved and ends when the CommunicationSession is closed. The presence of a CommunicationSession signals to the OSID Provider that it may communicate with the OSID Consumer and block operation until a response is submitted.

The Communication OSID provides no management or logging operations. It is intended to support out of band application communication that may be the result of a dynamic condition or a query managed via the Inquiry OSID and the Rules Check OSID.

Example

                         
                         
                         CommunicationSession session = communicationMgr.getCommunicationSession(myReceiver);
                         session.registerForCommuniques();
                         
                             class myReceiver implements CommunicationReceiver {
                                 newCommunique(Communqiue msg) {
                                     org.osid.id.Id response;
                         
                                     if (msg.level == CommuniqueLevel.ALERT || 
                                         msg.level == CommuniqueLevel.FAILURE) {
                                        response = displayAlertBox(msg);
                                     } else {
                                         showInLogWindow(msg.getMessage());
                                         if (msg.getResponses().len > 0) {
                                             response = getUserResponse(msg.getResponses());
                                         }
                                     }
                         
                                     if (response != null) {
                                         session.respond(response);
                                     } 
                                 }   
                             }