|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface HttpRequest
Interface providing the means to analyse the incoming HTTP request. The object
implementing the HttpRequest interface is a Temporary Entry Point Object.
| Method Summary | |
|---|---|
void |
cancelProcessing()
This method indicates to the SCWS that the applet does not want to be invoked with any data fragments related to this HTTP request any more. |
short |
findAndCopyKeywordValue(byte[] headerKeywordName,
short nameOffs,
short nameLength,
byte[] buffer,
short bufferOffs,
short maxLength)
Find and copy the value of a header. |
short |
findAndCopyKeywordValue(short keywordId,
byte[] buffer,
short bufferOffs,
short maxLength)
Find and copy the value of a header or the value of a keyword/value part of the URI indicated by a keywordId. |
int |
getContentLength()
Returns the length of the HTTP request body if this is known from the header field Content-Length. |
short |
getContentType()
Returns the content-type keyword of the HTTP request |
short |
getRequestHttpVersion()
Returns the version of the HTTP protocol of the current request. |
short |
getRequestID()
This method returns a unique identifier (per card session) for the HTTP request object. |
boolean |
isComplete()
This method provides information if the HTTP request was completely received. |
boolean |
isFirst()
This method provides information if the HTTP request is starting. |
short |
readContent(int requestOffset,
byte[] data,
short offset,
short len)
This method copies up to len bytes of the
incoming HTTP request body to data. |
short |
readContentType(byte[] data,
short offs,
short len)
Reads the content type given in the HTTP request (e.g. |
| Method Detail |
|---|
short findAndCopyKeywordValue(byte[] headerKeywordName,
short nameOffs,
short nameLength,
byte[] buffer,
short bufferOffs,
short maxLength)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException
headerKeywordName - buffer that contains the name of the requested headernameOffs - offset within headerKeywordNamenameLength - length of data within headerKeywordNamebuffer - buffer where the value shall be copiedbufferOffs - offset where the value shall be copiedmaxLength - maximum length of the value that shall be copied
bufferOffs+length of the copied value or KEYWORD_NOT_FOUND in case the keyword is not found
java.lang.NullPointerException - if headerKeywordName or buffer is equal to null
java.lang.ArrayIndexOutOfBoundsException - if the copy operation would cause access out of bounds
short findAndCopyKeywordValue(short keywordId,
byte[] buffer,
short bufferOffs,
short maxLength)
throws ScwsException,
java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException
keywordId. The supported keywords are
defined in ScwsConstants Interface.
keywordId - value of the request header name or part of the URIbuffer - buffer where the value shall be copiedbufferOffs - offset where the value shall be copiedmaxLength - maximum length of the value that shall be copied
bufferOffs+length of the copied value or KEYWORD_NOT_FOUND in case the keyword is not found
ScwsException - with reason UNKNOWN_KEYWORD_ID if the keywordId is not recognized
java.lang.NullPointerException - if buffer is equal to null
java.lang.ArrayIndexOutOfBoundsException - if the copy operation would cause access out of boundsScwsConstantsint getContentLength()
Content-Length. If chunked transfer encoding is used this method shall return -1. Chunked
transfer encoding is indicated in the header field Transfer-Encoding according to
HTTP V1.1 [RFC2616].
short getRequestHttpVersion()
KEYWORD_NOT_FOUND in case the content type
header field is not present, or CONTENT_TYPE_UNKNOWN in case the content type doesn't
match one of the possible content type keywords defined in ScwsConstants.short getContentType()
ScwsConstants
short readContentType(byte[] data,
short offs,
short len)
throws java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException
data - buffer to hold the content type from the request.offs - start in the buffer to hold the content type.len - maximum length of the content type to be copied
offs+length of the copied value.
java.lang.NullPointerException - if data is equal to null
java.lang.ArrayIndexOutOfBoundsException - if the read operation would
cause access out of bounds
short readContent(int requestOffset,
byte[] data,
short offset,
short len)
throws ScwsException,
java.lang.NullPointerException,
java.lang.ArrayIndexOutOfBoundsException
len bytes of the
incoming HTTP request body to data.
If chunked transfer encoding is not used: If chunked transfer encoding is used or the request does not fit into the
The complete HTTP request body is contained in the HTTP request buffer
at the time of invocation of the doXXX() method of the interface ScwsExtension.
This method copies len bytes to data
starting at requestOffset in the HTTP request buffer.
If requestOffset + len exceeds the length
of the HTTP request then the ScwsException with reason
code UNREACHABLE_OFFSET will be thrown.
HttpRequest buffer:
The HTTP request has (in general) not been completely received by the
SCWS at the time of invocation of the doXXX() method of the interface ScwsExtension.
This method copies len bytes to data starting at
requestOffset in the HTTP request buffer which contains
new HTTP request data which were not yet made available to the Applet in
any previous invocation of the doXXX() method of the interface ScwsExtension.
If there are less than len bytes
in the HTTP request buffer then this method will return offset
+ length of the copied value.
requestOffset - Offset within the HTTP request buffer to start reading the request
content. If the entire HTTP request fits into the buffer this is also the absolute
offset into the HTTP request, otherwise it is the offset into the current subset of the HTTP request.data - byte array where request content shall be copied.offset - offset within buffer.len - maximum length of the content to be copied.
offset+length of the copied value.
ScwsException - with reason UNREACHABLE_OFFSET if the requested offset could not be reached.
java.lang.NullPointerException - if data is equal to null
java.lang.ArrayIndexOutOfBoundsException - if the read operation would
cause access out of bounds
boolean isComplete()
boolean isFirst()
short getRequestID()
void cancelProcessing()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||