|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object anon.infoservice.HttpResponseStructure
public final class HttpResponseStructure
This class stores the HTTP response for the requests which reaches the InfoService. Every response will have an HTTP header, which prevents proxies to store the response in their cache.
Field Summary | |
---|---|
static java.lang.String |
HTML_BAD_REQUEST
|
static java.lang.String |
HTML_INTERNAL_SERVER_ERROR
|
static java.lang.String |
HTML_NOT_FOUND
|
static java.lang.String |
HTTP_11_STRING
|
static java.lang.String |
HTTP_CRLF_STRING
|
static int |
HTTP_ENCODING_GZIP
|
static java.lang.String |
HTTP_ENCODING_GZIP_STRING
|
static int |
HTTP_ENCODING_PLAIN
|
static int |
HTTP_ENCODING_ZLIB
|
static java.lang.String |
HTTP_ENCODING_ZLIB_STRING
|
static java.lang.String |
HTTP_HEADER_CACHE_CONTROL_STRING
|
static java.lang.String |
HTTP_HEADER_CACHE_CONTROL_STRINGS
|
static java.lang.String |
HTTP_HEADER_DATE_STRING
|
static java.lang.String |
HTTP_HEADER_ENCODING_STRING
|
static java.lang.String |
HTTP_HEADER_EXPIRES_STRING
|
static java.lang.String |
HTTP_HEADER_LENGTH_STRING
|
static java.lang.String |
HTTP_HEADER_PRAGMA_STRING
|
static java.lang.String |
HTTP_HEADER_TYPE_STRING
|
static int |
HTTP_RETURN_ACCEPTED
|
static java.lang.String |
HTTP_RETURN_ACCEPTED_STRING
|
static int |
HTTP_RETURN_BAD_REQUEST
This constant is used, when HTTP BAD REQUEST (400) shall be returned. |
static java.lang.String |
HTTP_RETURN_BAD_REQUEST_STRING
|
static int |
HTTP_RETURN_INTERNAL_SERVER_ERROR
This constant is used, when HTTP INTERNAL SERVER ERROR (500) shall be returned. |
static java.lang.String |
HTTP_RETURN_INTERNAL_SERVER_ERROR_STRING
|
static int |
HTTP_RETURN_NOT_FOUND
This constant is used, when HTTP NOT FOUND (404) shall be returned. |
static java.lang.String |
HTTP_RETURN_NOT_FOUND_STRING
|
static int |
HTTP_RETURN_OK
This constant is used, when HTTP OK (200) shall be returned. |
static java.lang.String |
HTTP_RETURN_OK_STRING
|
static int |
HTTP_TYPE_APPLICATION_JNLP
This constant is used, when the content part is a JNLP file. |
static java.lang.String |
HTTP_TYPE_APPLICATION_JNLP_STRING
|
static int |
HTTP_TYPE_NO_TYPE
This constant is used, when no content type shall be specified in the HTTP header. |
static int |
HTTP_TYPE_TEXT_HTML
This constant is used, when the content part is in the HTML format. |
static java.lang.String |
HTTP_TYPE_TEXT_HTML_STRING
|
static int |
HTTP_TYPE_TEXT_PLAIN
This constant is used, when the content part is plain text. |
static java.lang.String |
HTTP_TYPE_TEXT_PLAIN_STRING
|
static int |
HTTP_TYPE_TEXT_XML
This constant is used, when the content part is in the XML format. |
static java.lang.String |
HTTP_TYPE_TEXT_XML_STRING
|
private byte[] |
m_httpReturnData
Stores the whole HTTP response, including HTTP code, header and data. |
Constructor Summary | |
---|---|
HttpResponseStructure(org.w3c.dom.Document a_xmlDocument)
Creates a new HTTP response with HTTP return code OK (200) and the specified XML data in the content part. |
|
HttpResponseStructure(org.w3c.dom.Document a_xmlDocument,
int a_supportedEncodings)
Creates a new HTTP response with HTTP return code OK (200) and the specified XML data in the content part. |
|
HttpResponseStructure(int a_returnCode)
Creates a new HTTP response, which only consists of the return code specified and sometimes a describing HTML message. |
|
HttpResponseStructure(int a_httpDataType,
int a_httpEncoding,
byte[] a_httpData)
Creates a new HTTP response with HTTP return code OK (200) and the content type and content data specified. |
|
HttpResponseStructure(int a_httpDataType,
int a_httpEncoding,
java.lang.String a_httpData)
Creates a new HTTP response with HTTP return code OK (200) and the content type and content data specified. |
|
HttpResponseStructure(int a_httpDataType,
int a_httpEncoding,
java.lang.String a_httpData,
boolean a_onlyHeader)
Creates a new HTTP response with HTTP return code OK (200) and the content type and content data specified. |
|
HttpResponseStructure(int httpReturnCode,
java.lang.String httpData)
|
Method Summary | |
---|---|
private byte[] |
createHttpMessage(int a_httpReturnCode,
int a_httpDataType,
int a_httpEncoding,
byte[] a_httpData,
boolean a_onlyHeader)
Creates the whole HTTP response, including HTTP return code, HTTP header and the specified content. |
private byte[] |
createHttpMessage(int a_httpReturnCode,
int a_httpDataType,
int a_httpEncoding,
byte[] a_httpData,
boolean a_onlyHeader,
java.text.DateFormat dateFormat)
Creates the whole HTTP response, including HTTP return code, HTTP header and the specified content. |
byte[] |
getResponseData()
Returns the data of this HTTP response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int HTTP_RETURN_OK
public static final int HTTP_RETURN_ACCEPTED
public static final int HTTP_RETURN_BAD_REQUEST
public static final int HTTP_RETURN_NOT_FOUND
public static final int HTTP_RETURN_INTERNAL_SERVER_ERROR
public static final int HTTP_TYPE_TEXT_PLAIN
public static final int HTTP_TYPE_TEXT_HTML
public static final int HTTP_TYPE_TEXT_XML
public static final int HTTP_TYPE_APPLICATION_JNLP
public static final int HTTP_ENCODING_PLAIN
public static final int HTTP_ENCODING_ZLIB
public static final int HTTP_ENCODING_GZIP
public static final int HTTP_TYPE_NO_TYPE
public static final java.lang.String HTTP_11_STRING
public static final java.lang.String HTTP_CRLF_STRING
public static final java.lang.String HTTP_RETURN_OK_STRING
public static final java.lang.String HTTP_RETURN_ACCEPTED_STRING
public static final java.lang.String HTTP_RETURN_BAD_REQUEST_STRING
public static final java.lang.String HTTP_RETURN_NOT_FOUND_STRING
public static final java.lang.String HTTP_RETURN_INTERNAL_SERVER_ERROR_STRING
public static final java.lang.String HTTP_HEADER_TYPE_STRING
public static final java.lang.String HTTP_HEADER_ENCODING_STRING
public static final java.lang.String HTTP_HEADER_LENGTH_STRING
public static final java.lang.String HTTP_HEADER_DATE_STRING
public static final java.lang.String HTTP_HEADER_EXPIRES_STRING
public static final java.lang.String HTTP_HEADER_CACHE_CONTROL_STRING
public static final java.lang.String HTTP_HEADER_PRAGMA_STRING
public static final java.lang.String HTTP_HEADER_CACHE_CONTROL_STRINGS
public static final java.lang.String HTTP_ENCODING_ZLIB_STRING
public static final java.lang.String HTTP_ENCODING_GZIP_STRING
public static final java.lang.String HTTP_TYPE_APPLICATION_JNLP_STRING
public static final java.lang.String HTTP_TYPE_TEXT_PLAIN_STRING
public static final java.lang.String HTTP_TYPE_TEXT_HTML_STRING
public static final java.lang.String HTTP_TYPE_TEXT_XML_STRING
public static final java.lang.String HTML_NOT_FOUND
public static final java.lang.String HTML_BAD_REQUEST
public static final java.lang.String HTML_INTERNAL_SERVER_ERROR
private byte[] m_httpReturnData
Constructor Detail |
---|
public HttpResponseStructure(int a_returnCode)
public HttpResponseStructure(org.w3c.dom.Document a_xmlDocument)
a_xmlDocument
- The XML data for the body of the HTTP response.public HttpResponseStructure(org.w3c.dom.Document a_xmlDocument, int a_supportedEncodings)
a_xmlDocument
- The XML data for the body of the HTTP response.public HttpResponseStructure(int a_httpDataType, int a_httpEncoding, java.lang.String a_httpData)
a_httpDataType
- The content type of the data, see the HTTP_TYPE constants in this
class.a_httpData
- The content data for the HTTP response.public HttpResponseStructure(int a_httpDataType, int a_httpEncoding, byte[] a_httpData)
a_httpDataType
- The content type of the data, see the HTTP_TYPE constants in this
class.a_httpData
- The content data for the HTTP response.public HttpResponseStructure(int a_httpDataType, int a_httpEncoding, java.lang.String a_httpData, boolean a_onlyHeader)
a_httpDataType
- The content type of the data, see the HTTP_TYPE constants in this
class.a_httpData
- The content data for the HTTP response.a_onlyHeader
- If this is true, only the matching HTTP header (including content type
and content length) is included in the response, but not the data
itself. It is needed as response for the HTTP HEAD command. If this
parameter is set to false, the full response including header and
data is created.public HttpResponseStructure(int httpReturnCode, java.lang.String httpData)
Method Detail |
---|
public byte[] getResponseData()
private byte[] createHttpMessage(int a_httpReturnCode, int a_httpDataType, int a_httpEncoding, byte[] a_httpData, boolean a_onlyHeader)
a_httpReturnCode
- The HTTP return code for the response, see the HTTP_RETURN constants
in this class.a_httpDataType
- The content type, which shall be set in the HTTP header of the
response. See the HTTP_TYPE constants in this class. If
HTTP_TYPE_NO_TYPE is specified here, the content type will not be set
in the HTTP header.a_httpData
- The content for the HTTP response. The data should be in the specified
content type. If null is specified here, no content will be in the HTTP
response (response will consist of HTTP return code and header only) and
the content lenght field in the header is not set. In any other case, the
content length will be the length of this data structure.a_onlyHeader
- If this is true, only the matching HTTP header (including content type
and content length, if available) is included in the response, but not
the content data itself. It is needed as response for the HTTP HEAD
command. If this parameter is set to false, the full response including
header and data is created.
private byte[] createHttpMessage(int a_httpReturnCode, int a_httpDataType, int a_httpEncoding, byte[] a_httpData, boolean a_onlyHeader, java.text.DateFormat dateFormat)
a_httpReturnCode
- The HTTP return code for the response, see the HTTP_RETURN constants
in this class.a_httpDataType
- The content type, which shall be set in the HTTP header of the
response. See the HTTP_TYPE constants in this class. If
HTTP_TYPE_NO_TYPE is specified here, the content type will not be set
in the HTTP header.a_httpData
- The content for the HTTP response. The data should be in the specified
content type. If null is specified here, no content will be in the HTTP
response (response will consist of HTTP return code and header only) and
the content lenght field in the header is not set. In any other case, the
content length will be the length of this data structure.a_onlyHeader
- If this is true, only the matching HTTP header (including content type
and content length, if available) is included in the response, but not
the content data itself. It is needed as response for the HTTP HEAD
command. If this parameter is set to false, the full response including
header and data is created.dateFormat
- The DatFormatfor headers that contains the actual date. if null is specified
the default format "EEE, dd MMM yyyy HH:mm:ss zzz" is used.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |