Package org.osid.communication

The Open Service Interface Definitions for the org.osid.communication service.

See: Description

Package org.osid.communication Description

The Open Service Interface Definitions for the org.osid.communication service.

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);
                  } 
              }   
          }
      
              
      
 



Copyright © 2010,2014 Ingenescus. All Rights Reserved.

This Work is being provided by the copyright holder(s) subject to the following license. By obtaining, using and/or copying this Work, you agree that you have read, understand, and will comply with the following terms and conditions.

Permission to use, copy and distribute unmodified versions of this Work, for any purpose, without fee or royalty is hereby granted, provided that you include the above copyright notices and the terms of this license on ALL copies of the Work or portions thereof.

You may nodify or create Derivatives of this Work only for your internal purposes. You shall not distribute or transfer any such Derivative of this Work to any location or to any third party. For the purposes of this license, "Derivative" shall mean any derivative of the Work as defined in the United States Copyright Act of 1976, such as a translation or modification.

This Work and the information contained herein is provided on an "AS IS" basis WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS IN THE WORK.

The export of software employing encryption technology may require a specific license from the United States Government. It is the responsibility of any person or organization contemplating export to obtain such a license before exporting this Work.