cisco.uc.cuae.legacy
Interface HttpServer

All Superinterfaces:
CuaeCommon, CuaeCommonServer, Http
All Known Implementing Classes:
BaseHttpServer, RemoteHttpServer

public interface HttpServer
extends Http, CuaeCommonServer

The HTTP Provider implements HTTP server capabilities for use by applications. This server functionality can be used with Cisco IP Phones, web browsers, or web client libraries found in other development environments. Generated from CUAE provider package Metreos.Providers.Http


Nested Class Summary
 
Nested classes/interfaces inherited from interface cisco.uc.cuae.legacy.Http
Http.GotRequestOptions, Http.SendResponseOptions, Http.SendResponseResult, Http.SessionEndOptions, Http.SessionEndResult, Http.SessionExpiredOptions
 
Nested classes/interfaces inherited from interface cisco.uc.cuae.legacy.CuaeCommon
CuaeCommon.CuaeResult
 
Nested classes/interfaces inherited from interface cisco.uc.cuae.legacy.CuaeCommon
CuaeCommon.CuaeResult
 
Method Summary
 Http.SendResponseResult sendResponse(java.lang.String sessionId, java.lang.String remoteHost, java.lang.Integer responseCode, java.lang.String content_Type, java.lang.String body, java.lang.String responsePhrase, Http.SendResponseOptions options)
          SendResponse will send an HTTP response to a pending HTTP request.
 Http.SessionEndResult sessionEnd(java.lang.String sessionId, Http.SessionEndOptions options)
          SessionEnd is used to indicate to the HTTP Provider that this HTTP session is no longer active.
 

Method Detail

sessionEnd

Http.SessionEndResult sessionEnd(java.lang.String sessionId,
                                 Http.SessionEndOptions options)
SessionEnd is used to indicate to the HTTP Provider that this HTTP session is no longer active. None. The HTTP Provider offers basic session-keeping features for applications. The HTTP Provider will correlate inbound HTTP requests with a running script if a RoutingGuid is present in either a header, cookie, or query parameter named metreosSessionId. Also, the HTTP Provider will fire a SessionExpired event if it determines that a particular session has become inactive. The SessionEnd action gives the developer a way to indicate to the provider to no longer maintain the latter session service, the firing of SessionExpired. The liberal and judicious use of this action improves the overall scalability and efficiency of the HTTP provider. One way to easily and effectively call SessionEnd is to use it in the InstanceDestruction event handler.

Parameters:
sessionId - The session Id for this method call
options - An object holding all the optional parameters

sendResponse

Http.SendResponseResult sendResponse(java.lang.String sessionId,
                                     java.lang.String remoteHost,
                                     java.lang.Integer responseCode,
                                     java.lang.String content_Type,
                                     java.lang.String body,
                                     java.lang.String responsePhrase,
                                     Http.SendResponseOptions options)
SendResponse will send an HTTP response to a pending HTTP request. One can specify custom action parameters for this action. Any custom action parameter is converted to a header in the HTTP response. For example, with this mechanism, one can send back a cookie by specifying a custom action parameter with the name Set-Cookie and the appropriate, cookie-formatted value. Many web development environments allow one to specify a numeric value for the Expires header, which is treated as an offset in minutes of the current time. The HTTP Provider does not support this simple, numeric notion. The value of the Expires header is passed through directly to the HTTP response, requiring the developer to format the Expires header in conformance with the HTTP specification. One can use the null () class to generate this properly formatted string. For instance, a value for the Expires header that would indicate to the web client that the page is expired already could be DateTime.MinValue.ToUniversalTime().ToString("r"). One must use the SendResponse action within 5 minutes of receiving GotRequest; otherwise, the HTTP provider will send back a response automatically to the client with a response code of 404 and the script will have lost its opportunity to respond to the request. In practical use, the SendResponse action is coupled with every occurrence of the GotRequest event, which is the event that corresponds to a pending HTTP request. The RemoteHost action parameter of SendResponse should always the same value as the RemoteHost event parameter of the GotRequest event in order for the response to be sent back to the correct request. If one is sending back Cisco IP Phone XML as the Body of the response, note that the Cisco IP Phone XML variable must be passed in as a C# parameter, and the variable must have the ToString() method invoked on it, for instance, myXmlVar.ToString(). The Cisco IP Phone XML variable can not be passed in directly to the Body action parameter; it must be converted to a string before it is sent to the HTTP Provider. Also, be sure to set the Content-Type variable to the value text/xml if you are communicating with a Cisco IP Phone.

Parameters:
sessionId - The session Id for this method call
remoteHost - The IP address and port of the remote client, of the form IP:PORT. This correct value for this field is obtainable from the RemoteHost event parameter from the GotRequest event.
responseCode - The numeric code of the HTTP response, such as 200 for OK or 404 for Not Found.
content_Type - Content-Type describes the format of the Body, such as text/xml or text/html.
body - The content of the response.
responsePhrase - The response phrase of the HTTP response which corresponds to the ResponseCode, such as OK for 200 or Not Found for 404.
options - An object holding all the optional parameters


Copyright © 2008. All Rights Reserved.