Sun Adapter for Siebel EAI API

com.stc.connector.siebeleaiadapter.message
Interface ISiebelEAIHttpRequest

All Known Subinterfaces:
ISiebelEAIHttpRequestResponse

public interface ISiebelEAIHttpRequest

Object Type Definition for HTTP incoming requests for EAI transactions.

Version:
$Revision: 1.1 $

Method Summary
 int getHttpStatusCode()
          Retrieve the HTTP response status code designated for this request.
 java.lang.String getRequestData()
          Retrieve the request's data as a string, using the platform's default character set to construct the string content from the original (byte) content.
 java.lang.String getRequestData(java.lang.String charset)
          Retrieve the request's data as a string, using the specified character set to construct the string content from the original (byte) content.
 java.io.ByteArrayInputStream getRequestDataByteInputStream()
          Obtain a byte input stream object for the request's data.
 byte[] getRequestDataBytes()
          Retrieve the 'raw' bytes of the request data.
 java.io.Reader getRequestDataReader()
          Obtain a Reader (character stream) object for the request's data, using the default character set to translate the original (byte) content to character content.
 java.io.Reader getRequestDataReader(java.lang.String charset)
          Obtain a Reader (character stream) object for the request's data, using the specified character set to translate the original (byte) content to character content.
 void respond()
          Direct a HTTP response for the request to be sent now.
 void setHttpBadRequestStatusCode()
          Indicate that the HTTP response for the request should be status code 400, to indicate that the request is 'bad' (e.g., syntactically or structurally incorrect).
 void setHttpInternalErrorStatusCode()
          Indicate that the HTTP response for the request should be status code 500, to indicate the request could not be processed due to an internal error.
 void setHttpOkStatusCode()
          Indicate that the HTTP response for the request should be status code 200, to indicate a successful request.
 void setHttpServiceNotAvailableStatusCode()
          Indicate that the HTTP response for the request should be status code 503, to indicate a temporary inability to process the request.
 void setHttpStatusCode(int status)
          Indicate the HTTP response status code to send back for the request.
 

Method Detail

getRequestData

java.lang.String getRequestData()
Retrieve the request's data as a string, using the platform's default character set to construct the string content from the original (byte) content. The behaviour of this method is unspecified if the request's content is not valid in the default character set.

Returns:
the request data as a string. If there is no data, an empty string is returned.

getRequestData

java.lang.String getRequestData(java.lang.String charset)
                                throws java.io.UnsupportedEncodingException
Retrieve the request's data as a string, using the specified character set to construct the string content from the original (byte) content. The behaviour of this method is unspecified if the request's content is not valid in the specified character set.

Parameters:
charset - the name of a supported character set, for example, US-ASCII and UTF-8.
Returns:
the request data as a string. If there is no data, an empty string is returned.
Throws:
java.io.UnsupportedEncodingException - if the named charset is not supported.

getRequestDataReader

java.io.Reader getRequestDataReader()
Obtain a Reader (character stream) object for the request's data, using the default character set to translate the original (byte) content to character content. The behaviour of this method is unspecified if the request's content is not valid in the default character set.

Returns:
a character stream object piping the request data.

getRequestDataReader

java.io.Reader getRequestDataReader(java.lang.String charset)
                                    throws java.io.UnsupportedEncodingException
Obtain a Reader (character stream) object for the request's data, using the specified character set to translate the original (byte) content to character content. The behaviour of this method is unspecified if the request's content is not valid in the specified character set.

Parameters:
charset - the name of a supported character set, for example, US-ASCII and UTF-8.
Returns:
a character stream object piping the request data.
Throws:
java.io.UnsupportedEncodingException - if the named charset is not supported.

getRequestDataBytes

byte[] getRequestDataBytes()
Retrieve the 'raw' bytes of the request data.

Returns:
the request data as an array of bytes. If there is no data, an empty array (size 0) is returned.

getRequestDataByteInputStream

java.io.ByteArrayInputStream getRequestDataByteInputStream()
Obtain a byte input stream object for the request's data.

Returns:
a byte stream piping the request data.

setHttpStatusCode

void setHttpStatusCode(int status)
Indicate the HTTP response status code to send back for the request. Consult W3.org RFC 2616 for a list of defined status codes.

Parameters:
status - HTTP status code.
See Also:
HTTP/1.1 RFC 2616, Status Code and Reason Phrase

getHttpStatusCode

int getHttpStatusCode()
Retrieve the HTTP response status code designated for this request.

Returns:
HTTP status code as set by setHttpStatusCode(int) et al. If the status code has not been set, then implementations should return a default status code.

setHttpOkStatusCode

void setHttpOkStatusCode()
Indicate that the HTTP response for the request should be status code 200, to indicate a successful request.

See Also:
setHttpStatusCode(int)

setHttpServiceNotAvailableStatusCode

void setHttpServiceNotAvailableStatusCode()
Indicate that the HTTP response for the request should be status code 503, to indicate a temporary inability to process the request.

See Also:
setHttpStatusCode(int)

setHttpInternalErrorStatusCode

void setHttpInternalErrorStatusCode()
Indicate that the HTTP response for the request should be status code 500, to indicate the request could not be processed due to an internal error.

See Also:
setHttpStatusCode(int)

setHttpBadRequestStatusCode

void setHttpBadRequestStatusCode()
Indicate that the HTTP response for the request should be status code 400, to indicate that the request is 'bad' (e.g., syntactically or structurally incorrect).

See Also:
setHttpStatusCode(int)

respond

void respond()
Direct a HTTP response for the request to be sent now. Calling this method is optional: if it is not called, the response should be dispatched anyway when the service in which the OTD is involved, is completed.

If none of the setHttpStatusCode class of methods (setHttpStatusCode(int), setHttpOkStatusCode(), etc) are invoked prior to calling this method, then the implementation must assume a default status code for use in the generated response.


Sun Adapter for Siebel EAI API

Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.