|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.cics.server.TcpipRequest
com.ibm.cics.server.HttpRequest
Usage:
This class provides the Java implementation of HTTP requests related to the following
CICS API WEB server commands:
This class extends class TcpipRequest so the TcpipRequest class related CICS API commands, listed below, are also available.
This class is a singleton class. The constructor is private and class method getHttpRequestInstance() has to be used to obtain the HttpRequest object.
The getHttpHeader() method returns the named HTTP header value. This is equivalent to CICS API command WEB READ HTTPHEADER.
The getFormField() method returns the named HTML form field value. This is equivalent to CICS API command WEB READ FORMFIELD.
The startBrowseHeader() method signals the start of a browse of the HTTP headers, getNextHeader() method is used to browse the HTTP headers and endBrowseHeader() signals the termination of the browse. These are equivalent to CICS API commands WEB STARTBROWSE HTTPHEADER, WEB READNEXT HTTPHEADER and WEB ENDBROWSE HTTPHEADER.
The startBrowseFormField() method signals the start of a browse of the HTTP form fields, getNextFormField() method is used to browse the form fields and endBrowseFormField() method signals the termination of the browse. These are equivalent to CICS API commands WEB STARTBROWSE FORMFIELD, WEB READNEXT FORMFIELD and WEB ENDBROWSE FORMFIELD.
The setter methods allow instance variables to be set in the HttpRequest object. These variables relate to the following options on the CICS API command WEB RECEIVE:
By default MAXLENGTH is set to 32K and NOTRUNCATE is not set. These values can be overriden by the setters.
Method getContent() will receive the clients request body. This is equivalent to CICS API command WEB RECEIVE INTO.
Depending on the size of the body sent by the client and the MAXLENGTH value the complete body may not be received. Method isBodyComplete() returns boolean true if the whole body was returned by the getContent() method. If the whole body was not returned by getContent() then isBodyTruncated() returns boolean true unless setNoTruncate() was used to specify NOTRUNCATE. If NOTRUNCATE was specified and the complete body was not returned by getContent() then isBodyPartial() returns boolean true and getContent() can be used to obtain the next portion of the body.
The HTTP body can also be received into a named container using method getContentAsContainer(). If the HTTP body is received into a named container any instance varibales set by the setter methods are ignored with the exception of CHARACTERSET.
The getter methods return the various CICS API command WEB EXTRACT values and the mediatype and characterset of the Http body sent by the client.
The isDataHttp() method returns a boolean which indicates the request type from the CICS API command WEB EXTRACT.
Field Summary | |
---|---|
static int |
NOTSET
|
Fields inherited from class com.ibm.cics.server.TcpipRequest |
---|
AUTOAUTH, AUTOREGISTER, BASICAUTH, CERTIFICAUTH, CLIENTAUTH, NOAUTHENTIC, NOSSL, NOTSUPPORTED, REQUIRED, SSL, SUPPORTED |
Fields inherited from interface com.ibm.cics.server.TidyUpOnTermination |
---|
COPYRIGHT, SCCSID |
Method Summary | |
---|---|
void |
drive_ibmJVMTidyUp()
Call the ibmJVMTidyUp method from a non-resettable JVM |
void |
endBrowseFormField()
Usage: Signal the end of the form field browse. |
void |
endBrowseHeader()
Usage: Signal the end of the HTTP header browse. |
java.lang.String |
getBodyCharset()
Usage: Returns the HTTP body characterset in which the HTTP body was encoded in by the client. |
byte[] |
getContent()
Usage: Returns the body of the HTTP request. |
byte[] |
getContent(java.lang.String hostCodePage,
java.lang.String characterset)
Usage: Returns the body of the HTTP request. |
Container |
getContentAsContainer(java.lang.String toContainer)
Usage: Stores the body of the HTTP request in a named container. |
Container |
getContentAsContainer(java.lang.String toContainer,
java.lang.String toChannel)
Usage: Stores the body of the HTTP request in a named container. |
java.lang.String |
getFormField(java.lang.String formField)
Usage: Returns the value of a field from the HTML form. |
java.lang.String |
getFormField(java.lang.String formField,
java.lang.String hostCodePage,
java.lang.String characterset)
Usage: Returns the value of a field from the HTML form. |
byte[] |
getFormFieldData(java.lang.String formField)
Usage: Returns the value of a field from the HTML form. |
byte[] |
getFormFieldData(java.lang.String formField,
java.lang.String hostCodePage,
java.lang.String characterset)
Usage: Returns the value of a field from the HTML form. |
java.lang.String |
getHeader(java.lang.String header)
Usage: Returns the contents of a HTTP header. |
java.lang.String |
getHost()
Usage: Returns the host string from the HTTP request. |
java.lang.String |
getHttpMethod()
Usage: Returns the HTTP method string on the request line of the inbound message. |
static HttpRequest |
getHttpRequestInstance()
Usage: Class method that returns the HttpRequest object. |
java.lang.String |
getHttpVersion()
Usage: Returns the HTTP version string on the request line of the inbound message. |
java.lang.String |
getMediaType()
Usage: Returns the media type of the HTTP body sent by the client. |
FormField |
getNextFormField()
Usage: Returns the next name-value pair from the HTML form to be browsed. |
HttpHeader |
getNextHeader()
Usage: Returns the next HTTP header name-value pair to be browsed. |
java.lang.String |
getPath()
Usage: Returns the PATH specified in the request line on the inbound message. |
int |
getPortNumber()
Usage: Returns the port number associated with the HTTP request. |
java.lang.String |
getQueryString()
Usage: Returns the query string on the request line of the HTTP request. |
java.lang.String |
getRequestType()
Usage: Returns the type of request received, either HTTPYES or HTTPNO. |
java.lang.String |
getScheme()
Usage: Returns the scheme from the HTTP request. |
java.lang.String |
getUrimap()
Usage: Returns the urimap associated with the HTTP request. |
boolean |
isBodyComplete()
Usage: Returns a boolean which indicates whether the body returned by getContent() was completely returned or the last portion of the body was returned by the last getContent() call. |
boolean |
isBodyPartial()
Usage: Returns a boolean which indicates whether the body returned by getContent() was a partial body or not. |
boolean |
isBodyTruncated()
Usage: Returns a boolean which indicates whether the body returned by getContent() was truncated or not. |
boolean |
isDataHttp()
Usage: Returns a boolean which indicates the request type. |
boolean |
isSchemeHttp()
Usage: Returns a boolean which indicates if the scheme is HTTP or not. |
boolean |
isSchemeHttps()
Usage: Returns a boolean which indicates if the scheme is HTTPS or not. |
void |
setCharacterset(java.lang.String characterset)
Usage: Sets WEB RECEIVE command option CHARACTERSET. |
void |
setClientCodePage(java.lang.String characterset)
Usage: Sets WEB RECEIVE command option CHARACTERSET. |
void |
setHostCodePage(java.lang.String hostCodePage)
Usage: Sets WEB RECEIVE command option HOSTCODEPAGE. |
void |
setMaxLength(int maxLength)
Usage: Sets WEB RECEIVE command option MAXLENGTH. |
void |
setNoServerConvert()
Usage: Sets WEB RECEIVE command option SERVERCONV to NOSRVCONVERT. |
void |
setNoTruncate()
Usage: Sets WEB RECEIVE command option NOTRUNCATE. |
void |
setServerConvert()
Usage: Sets WEB RECEIVE command option SERVERCONV to SRVCONVERT. |
void |
setTruncate()
Usage: Resets WEB RECEIVE command option NOTRUNCATE. |
void |
startBrowseFormField()
Usage: Signal the start of HTML form field browse from the first name-value pair. |
void |
startBrowseFormField(java.lang.String formField)
Usage: Signal the start of HTML form field browse from a specific name-value pair. |
void |
startBrowseFormField(java.lang.String formField,
java.lang.String hostCodePage,
java.lang.String characterset)
Usage: Signal the start of HTML form field browse from a specific name-value pair. |
void |
startBrowseHeader()
Usage: Signal the start of a browse of the HTTP headers from the first name-value pair. |
Methods inherited from class com.ibm.cics.server.TcpipRequest |
---|
getAuthenticate, getCertificateInfo, getCertificateInfo, getClientAddress, getClientHostAddress, getClientHostName, getMaxDataLen, getPrivacy, getServerAddress, getServerHostAddress, getServerHostName, getTcpipRequestInstance, getTcpipService, isClientAuth, isSSL |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NOTSET
Method Detail |
public static HttpRequest getHttpRequestInstance()
None
public java.lang.String getHttpMethod() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getHttpVersion() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getRequestType() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic boolean isDataHttp() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getPath() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getQueryString() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getHost() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic boolean isSchemeHttp() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic boolean isSchemeHttps() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getScheme() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getUrimap() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic int getPortNumber() throws InvalidRequestException
getPortNumber
in class TcpipRequest
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getHeader(java.lang.String header) throws InvalidRequestException
header
- contains the name of the HTTP header
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getFormField(java.lang.String formField) throws InvalidRequestException
formField
- contains the name of the form field
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getFormField(java.lang.String formField, java.lang.String hostCodePage, java.lang.String characterset) throws InvalidRequestException
formField
- contains the name of the form fieldhostCodePage
- contains the host codepage to be used when the forms data
is converted from the ASCII codepage it was received in, into the
EBCDIC codepage in which CICS will process itcharacterset
- contains the codepage in which the form is encoded
InvalidRequestException
- a INVREQ condition occurredpublic byte[] getFormFieldData(java.lang.String formField) throws InvalidRequestException
formField
- contains the name of the form field
InvalidRequestException
- a INVREQ condition occurredpublic byte[] getFormFieldData(java.lang.String formField, java.lang.String hostCodePage, java.lang.String characterset) throws InvalidRequestException
formField
- contains the name of the form fieldhostCodePage
- contains the host codepage to be used when the forms data
is converted from the ASCII codepage it was received in, into the
EBCDIC codepage in which CICS will process itcharacterset
- contains the codepage in which the form is encoded
InvalidRequestException
- a INVREQ condition occurredpublic void setServerConvert()
setServerConvert
in class TcpipRequest
None
public void setNoServerConvert()
setNoServerConvert
in class TcpipRequest
None
public void setClientCodePage(java.lang.String characterset)
setClientCodePage
in class TcpipRequest
characterset
- contains the codepage of the HTTP requests body.
None
public void setCharacterset(java.lang.String characterset)
setCharacterset
in class TcpipRequest
characterset
- contains the codepage of the HTTP requests body.
None
public void setHostCodePage(java.lang.String hostCodePage)
setHostCodePage
in class TcpipRequest
hostCodePage
- contains the codepage that the HTTP requests body will be converted into.
None
public void setNoTruncate()
setNoTruncate
in class TcpipRequest
None
public void setTruncate()
setTruncate
in class TcpipRequest
None
public void setMaxLength(int maxLength) throws LengthErrorException
setMaxLength
in class TcpipRequest
maxLength
- contains the maximum length value
LengthErrorException
- if maxLength is less than 1public byte[] getContent(java.lang.String hostCodePage, java.lang.String characterset) throws InvalidRequestException, RecordNotFoundException, NonHttpDataException
getContent
in class TcpipRequest
hostCodePage
- contains the host codepage to be used when the body
is converted from the ASCII codepage it was received in, into the
EBCDIC codepage in which CICS will process itcharacterset
- contains the codepage in which the HTTP body is encoded
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
NonHttpDataException
- WEB RECEIVE data is of type HTTPNOpublic byte[] getContent() throws InvalidRequestException, RecordNotFoundException, NonHttpDataException
getContent
in class TcpipRequest
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
NonHttpDataException
- WEB RECEIVE data is of type HTTPNOpublic Container getContentAsContainer(java.lang.String toContainer, java.lang.String toChannel) throws InvalidRequestException, RecordNotFoundException, ChannelErrorException, ContainerErrorException
getContentAsContainer
in class TcpipRequest
toContainer
- is the name if the container into which the HTTP body is to be storedtoChannel
- is the name of the channel that owns the container
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
ChannelErrorException
- a CHANNELERR condition occurred
ContainerErrorException
- a CONTAINERERR condition occurredpublic Container getContentAsContainer(java.lang.String toContainer) throws InvalidRequestException, RecordNotFoundException, ChannelErrorException, ContainerErrorException
getContentAsContainer
in class TcpipRequest
toContainer
- is the name if the container into which the HTTP body is to be stored
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
ChannelErrorException
- a CHANNELERR condition occurred
ContainerErrorException
- a CONTAINERERR condition occurredpublic boolean isBodyComplete()
isBodyComplete
in class TcpipRequest
None
public boolean isBodyTruncated()
isBodyTruncated
in class TcpipRequest
None
public boolean isBodyPartial()
isBodyPartial
in class TcpipRequest
None
public java.lang.String getBodyCharset() throws InvalidRequestException
getBodyCharset
in class TcpipRequest
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getMediaType() throws InvalidRequestException
getMediaType
in class TcpipRequest
InvalidRequestException
- a INVREQ condition occurredpublic void startBrowseHeader() throws InvalidRequestException, RecordNotFoundException, LogicException
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LogicException
- a ILLOGIC condition occurredpublic HttpHeader getNextHeader() throws InvalidRequestException, EndOfFileException
InvalidRequestException
- a INVREQ condition occurred
EndOfFileException
- a ENDFILE condition occurredpublic void endBrowseHeader() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic void startBrowseFormField() throws InvalidRequestException, RecordNotFoundException, LogicException
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LogicException
- a ILLOGIC condition occurredpublic void startBrowseFormField(java.lang.String formField) throws InvalidRequestException, RecordNotFoundException, LogicException
formField
- contains the name of the form field from which the browse
will start
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LogicException
- a ILLOGIC condition occurredpublic void startBrowseFormField(java.lang.String formField, java.lang.String hostCodePage, java.lang.String characterset) throws InvalidRequestException, RecordNotFoundException, LogicException
formField
- contains the name of the form field from which the browse
will starthostCodePage
- contains the host codepage to be used when the forms data
is converted from the ASCII codepage it was received in, into the
EBCDIC codepage in which CICS will process itcharacterset
- contains the codepage in whcih the form is encoded
InvalidRequestException
- a INVREQ condition occurred
RecordNotFoundException
- a NOTFND condition occurred
LogicException
- a ILLOGIC condition occurredpublic FormField getNextFormField() throws InvalidRequestException, EndOfFileException
InvalidRequestException
- a INVREQ condition occurred
EndOfFileException
- a ENDFILE condition occurredpublic void endBrowseFormField() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic final void drive_ibmJVMTidyUp()
drive_ibmJVMTidyUp
in interface TidyUpOnTermination
drive_ibmJVMTidyUp
in class TcpipRequest
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |