public class TcpipRequest extends API implements com.ibm.cics.ras.server.TidyUpOnTermination
This class provides the Java implementation of TCPIP requests related to the following CICS API commands:
This class acts like a singleton. The constructor is protected and class method getTcpipRequestInstance() has to be used to obtain the TcpipRequest object.
The getCertificateInfo() method returns the full certificate. This is equivalent to CICS API command EXTRACT CERTIFICATE
The setter methods allow instance variables to be set in the TcpipRequest 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 overridden 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 by getContentAsCountainer(). If the HTTP body is received into a named container any instance variables set by the setter methods are ignored with the exception of CHARACTERSET.
The get*() methods return the various CICS API command EXTRACT TCPIP values and the madiaType and character-set of the HTTP body sent be the client.
The isSSL() and isClientAuth() methods return boolean values that can be used to determine the SSLTYPE returned from CICS API command WEB EXTRACT SSLTYPE.
com.ibm.cics.server.API
for general restrictions on using the JCICS API.
Modifier and Type | Field and Description |
---|---|
static int |
AUTOAUTH
Constant - Auto auth Authentication
|
static int |
AUTOREGISTER
Constant - Auto register Authentication
|
static int |
BASICAUTH
Constant - Basic Authentication
|
static int |
CERTIFICAUTH
Constant - Certificate Authentication
|
static int |
CLIENTAUTH
Constant - Client Authenticated SSL
|
static int |
IPV4
Constant - IPV4
|
static int |
IPV6
Constant - IPV6
|
static int |
NOAUTHENTIC
Constant - No Authentication
|
static int |
NOSSL
Constant - No SSL
|
static int |
NOTAPPLIC
Constant - NOTAPPLIC
|
static java.lang.Integer |
NOTSET
Constant - NOT SET
|
static int |
NOTSUPPORTED
Constant - Privacy supported
|
static int |
REQUIRED
Constant - Privacy required
|
static int |
SSL
Constant - SSL
|
static int |
SUPPORTED
Constant - Privacy not supported
|
Modifier and Type | Method and Description |
---|---|
void |
drive_ibmJVMTidyUp()
Method to drive the static ibmJVMTidyUp method in a
non-resettable JVM
|
int |
getAuthenticate()
Usage:
Returns an integer which indicates the authentication requested for the client using the transaction. |
java.lang.String |
getBodyCharset()
Usage:
Returns the HTTP body character-set in which the HTTP body was encoded in by the client. |
CertificateInfo |
getCertificateInfo()
Usage:
Returns the owner certificate. |
CertificateInfo |
getCertificateInfo(int ownerIssuer)
Usage:
Returns the requested certificate, either the owner or the issuer certificate. |
java.lang.String |
getClientAddress()
Usage:
Returns the client's TCPIP address. |
byte[] |
getClientHostAddress()
Usage:
Returns the client's TCPIP address in a Java byte array. |
byte[] |
getClientHostAddress6()
Usage:
Returns the client's IPv6 TCPIP address in a Java byte array. |
java.lang.String |
getClientHostName()
Usage:
Returns the client's name as known by the Domain Name Server. |
int |
getClientIpFamily()
Usage:
Returns an integer which indicates the format of the IP address of 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. |
int |
getMaxDataLen()
Usage:
Returns an maximum data length value for the socket. |
java.lang.String |
getMediaType()
Usage:
Returns the media type of the HTTP body sent by the client. |
int |
getPortNumber()
Usage:
Returns the TCPIP port number associated with the transaction. |
int |
getPrivacy()
Usage:
Returns an integer which indicates the privacy requested for the client using the transaction. |
java.lang.String |
getServerAddress()
Usage:
Returns the server's TCPIP address. |
byte[] |
getServerHostAddress()
Usage:
Returns the server's TCPIP address in a Java byte array. |
byte[] |
getServerHostAddress6()
Usage:
Returns the server's IPv6 TCPIP address in a Java byte array. |
java.lang.String |
getServerHostName()
Usage:
Returns the server's name as known by the Domain Name Server. |
int |
getServerIpFamily()
Usage:
Returns an integer which indicates the format of the IP address of the server. |
static TcpipRequest |
getTcpipRequestInstance()
Usage:
Class method that returns the TcpipRequest object. |
java.lang.String |
getTcpipService()
Usage:
Returns the name of the TCPIP service associated with the transaction. |
boolean |
isBodyComplete()
Usage:
Returns a boolean which indicates whether the body returned by getContent() method was complete or not. |
boolean |
isBodyPartial()
Usage:
Returns a boolean which indicates whether the body returned by getContent() method was a partial body or not. |
boolean |
isBodyTruncated()
Usage:
Returns a boolean which indicates whether the body returned by getContent() method was truncated or not. |
boolean |
isClientAuth()
Usage:
Returns a boolean which indicates whether the Secure Sockets Layer (SSL) is client authorised or not. |
boolean |
isSSL()
Usage:
Returns a boolean which indicates whether the Secure Sockets Layer (SSL) is being used. |
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. |
public static final java.lang.Integer NOTSET
public static final int NOTAPPLIC
public static final int IPV4
public static final int IPV6
public static final int SSL
public static final int NOSSL
public static final int CLIENTAUTH
public static final int NOAUTHENTIC
public static final int BASICAUTH
public static final int CERTIFICAUTH
public static final int AUTOREGISTER
public static final int AUTOAUTH
public static final int SUPPORTED
public static final int REQUIRED
public static final int NOTSUPPORTED
public static TcpipRequest getTcpipRequestInstance()
public CertificateInfo getCertificateInfo() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic CertificateInfo getCertificateInfo(int ownerIssuer) throws InvalidRequestException
ownerIssuer
- indicates whether the owner or issuer certificate is requiredInvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getClientHostName() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getServerHostName() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getClientAddress() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getServerAddress() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic byte[] getClientHostAddress() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic byte[] getServerHostAddress() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic byte[] getClientHostAddress6() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic byte[] getServerHostAddress6() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic int getClientIpFamily() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic int getServerIpFamily() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic boolean isSSL() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic boolean isClientAuth() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getTcpipService() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic int getPortNumber() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic int getAuthenticate() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic int getPrivacy() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic int getMaxDataLen() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic void setServerConvert()
public void setNoServerConvert()
public void setClientCodePage(java.lang.String characterset)
characterset
- contains the code-page of the HTTP requests body.public void setCharacterset(java.lang.String characterset)
characterset
- contains the code-page of the HTTP requests body.public void setHostCodePage(java.lang.String hostCodePage)
hostCodePage
- contains the code-page that the HTTP requests body will be converted into.public void setNoTruncate()
public void setTruncate()
public void setMaxLength(int maxLength) throws LengthErrorException
maxLength
- contains the maximum length valueLengthErrorException
- maxLength not greater than 0public byte[] getContent(java.lang.String hostCodePage, java.lang.String characterset) throws InvalidRequestException, RecordNotFoundException, NonHttpDataException
hostCodePage
- is the code-page to be used to convert from the ASCII
code-page in which it was received in, into the EBCDIC code-page in which
CICS will process itcharacterset
- is the code-page in which the HTTP body is encodedInvalidRequestException
- a INVREQ condition occurredRecordNotFoundException
- a NOTFND condition occurredNonHttpDataException
- is present in this class because
HttpRequest subclass extends TcpipRequest
however TcpipRequest will not throw it!public byte[] getContent() throws InvalidRequestException, RecordNotFoundException, NonHttpDataException
InvalidRequestException
- a INVREQ condition occurredRecordNotFoundException
- a NOTFND condition occurredNonHttpDataException
- is present in this class because
HttpRequest subclass extends TcpipRequest
however TcpipRequest will not throw it!public Container getContentAsContainer(java.lang.String toContainer, java.lang.String toChannel) throws InvalidRequestException, RecordNotFoundException, ChannelErrorException, ContainerErrorException
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 containerInvalidRequestException
- a INVREQ condition occurredRecordNotFoundException
- a NOTFND condition occurredChannelErrorException
- a CHANNELERR condition occurredContainerErrorException
- a CONTAINERERR condition occurredpublic Container getContentAsContainer(java.lang.String toContainer) throws InvalidRequestException, RecordNotFoundException, ChannelErrorException, ContainerErrorException
toContainer
- is the name if the container into which the HTTP body is to be storedInvalidRequestException
- a INVREQ condition occurredRecordNotFoundException
- a NOTFND condition occurredChannelErrorException
- a CHANNELERR condition occurredContainerErrorException
- a CONTAINERERR condition occurredpublic boolean isBodyComplete()
public boolean isBodyTruncated()
public boolean isBodyPartial()
public java.lang.String getBodyCharset() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic java.lang.String getMediaType() throws InvalidRequestException
InvalidRequestException
- a INVREQ condition occurredpublic void drive_ibmJVMTidyUp()
drive_ibmJVMTidyUp
in interface com.ibm.cics.ras.server.TidyUpOnTermination