com.ibm.cics.server
Class HttpSession

java.lang.Object
  extended by com.ibm.cics.server.HttpSession

public class HttpSession
extends java.lang.Object

Usage:
This class provides the Java implementation of HTTP client requests related to the following CICS API commands:

The constructors accept either a URIMAP or a HOST string, SCHEME string and the optional PORTNUMBER value as parameters.

The setter methods allow instance variables to be set in the HttpSession object. These variables relate to the following options on the CICS API command WEB OPEN:

Method open() opens a session with a host on a remote server. The method uses the values set in the HttpSession constructor and any optional values set by the setters to open the session. This is equivalent to CICS API command WEB OPEN.

Method close() closes the session with the host on the remote server. This is equivalent to CICS API command WEB CLOSE.

If the client session has successfully been opened by the open() method getter methods can be used to obtain the following information about the open session that was saved when the session was opened or was obtained using the CICS API command WEB EXTRACT SESSTOKEN:

Version:
05/05/29
Author:
Adrian Bull

Field Summary
static int HOSTNAME
          Constant - HOSTNAME
static int IPV4
          Constant - IPV4
static int IPV6
          Constant - IPV6
static int NOTAPPLIC
          Constant - NOTAPPLIC
static int NOTSET
          Constant - NOT SET
 
Constructor Summary
HttpSession(java.lang.String urimap)
          Usage:
Sets WEB OPEN command option URIMAP.
HttpSession(java.lang.String hostName, java.lang.String scheme)
          Usage:
Sets WEB OPEN command option HOST and SCHEME.
HttpSession(java.lang.String hostName, java.lang.String scheme, int portNumber)
          Usage:
Sets WEB OPEN command option HOST, SCHEME and PORTNUMBER.
 
Method Summary
 void close()
          Usage:
Close a session with a host on a remote server.
 java.lang.String getHost()
          Usage:
Obtain this sessions host information.
 int getHostType()
          Usage:
Obtain this sessions hosttype information.
 int getHttpReleaseNumber()
          Usage:
Obtain this sessions HTTPRNUM value.
 int getHttpVersionNumber()
          Usage:
Obtain this sessions HTTPVNUM value.
 java.lang.String getPath()
          Usage:
Obtain this sessions path information.
 int getPortNumber()
          Usage:
Obtain this sessions port number.
 java.lang.String getScheme()
          Usage:
Obtain this sessions scheme information.
 java.lang.String getUrimap()
          Usage:
Obtain this sessions URIMAP information.
 java.lang.String getVersion()
          Usage:
Obtain this sessions version information.
 void open()
          Usage:
Open a session with a host on a remote server.
 void setCertificate(java.lang.String certificate)
          Usage:
Sets WEB OPEN command option CERTIFICATE.
 void setCiphers(java.lang.String ciphers, short numberCiphers)
          Usage:
Sets WEB OPEN command options CIPHER and NUMCIPHERS.
 void setCodePage(java.lang.String codePage)
          Usage:
Sets WEB OPEN command option CODEPAGE.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOTSET

public static final int NOTSET
Constant - NOT SET

See Also:
Constant Field Values

NOTAPPLIC

public static final int NOTAPPLIC
Constant - NOTAPPLIC

See Also:
Constant Field Values

IPV4

public static final int IPV4
Constant - IPV4

See Also:
Constant Field Values

IPV6

public static final int IPV6
Constant - IPV6

See Also:
Constant Field Values

HOSTNAME

public static final int HOSTNAME
Constant - HOSTNAME

See Also:
Constant Field Values
Constructor Detail

HttpSession

public HttpSession(java.lang.String urimap)
Usage:
Sets WEB OPEN command option URIMAP.

Parameters:
urimap - is the name of the URIMAP to be used by the open() method

HttpSession

public HttpSession(java.lang.String hostName,
                   java.lang.String scheme)
Usage:
Sets WEB OPEN command option HOST and SCHEME.

Parameters:
hostName - is the name of the HOST to be used by the open() method
scheme - should either be HTTP or HTTPS

HttpSession

public HttpSession(java.lang.String hostName,
                   java.lang.String scheme,
                   int portNumber)
Usage:
Sets WEB OPEN command option HOST, SCHEME and PORTNUMBER.

Parameters:
hostName - is the name of the HOST to be used by the open() method
scheme - should either be HTTP or HTTPS
portNumber - is the value of the PORTNUMBER to be used by the open() method
Method Detail

setCodePage

public void setCodePage(java.lang.String codePage)
Usage:
Sets WEB OPEN command option CODEPAGE.

Parameters:
codePage - is the EBCDIC code page to be used by the open() method

setCertificate

public void setCertificate(java.lang.String certificate)
Usage:
Sets WEB OPEN command option CERTIFICATE.

Parameters:
certificate - is the CERTIFICATE value to be used by the open() method

setCiphers

public void setCiphers(java.lang.String ciphers,
                       short numberCiphers)
Usage:
Sets WEB OPEN command options CIPHER and NUMCIPHERS.

Parameters:
ciphers - is the CIPHER value to be used by the open() method
numberCiphers - is the NUMCHIPERS value to be used by the open() method

open

public void open()
          throws InvalidRequestException,
                 RecordNotFoundException,
                 IOErrorException,
                 NotAuthorisedException,
                 LengthErrorException,
                 TimedOutException
Usage:
Open a session with a host on a remote server. This is equivalent to CICS API command WEB OPEN. The HttpSession constructor has saved the basic HttpSession values in the HttpSession object and any additional optional values should have been saved using the setter methods of this object before this method is used to open the session.

Throws:
InvalidRequestException - a INVREQ condition occurred
RecordNotFoundException - a NOTFND condition occurred
IOErrorException - a IOERR condition occurred
NotAuthorisedException - a NOTAUTH condition occurred
LengthErrorException - a LENGERR condition occurred
TimedOutException - a TIMEDOUT condition occurred

getHttpVersionNumber

public int getHttpVersionNumber()
Usage:
Obtain this sessions HTTPVNUM value. This value is only available after method open() has successfully opened the session. If this method is invoked before method open() or after method close() a NOTSET value will be returned.

Returns:
The HTTPVNUM value returned by the CICS API command WEB OPEN

getHttpReleaseNumber

public int getHttpReleaseNumber()
Usage:
Obtain this sessions HTTPRNUM value. This value is only available after method open() has successfully opened the session. If this method is invoked before method open() or after method close() a NOTSET value will be returned.

Returns:
The HTTPRNUM value returned by the CICS API command WEB OPEN

close

public void close()
           throws InvalidRequestException,
                  NotOpenException
Usage:
Close a session with a host on a remote server. This is equivalent to CICS API command WEB CLOSE.

Throws:
InvalidRequestException - a INVREQ condition occurred
NotOpenException - a NOTOPEN condition occurred

getHost

public java.lang.String getHost()
                         throws NotOpenException
Usage:
Obtain this sessions host information. This is equivalent to CICS API command WEB EXTRACT SESSTOKEN HOST.

Returns:
Host information returned by CICS API command WEB EXTRACT SESSTOKEN HOST
Throws:
NotOpenException - a NOTOPEN condition occurred

getHostType

public int getHostType()
                throws NotOpenException
Usage:
Obtain this sessions hosttype information. This is equivalent to CICS API command WEB EXTRACT SESSTOKEN HOSTTYPE.

Returns:
Host information returned by CICS API command WEB EXTRACT SESSTOKEN HOSTTYPE
Throws:
NotOpenException - a NOTOPEN condition occurred

getPath

public java.lang.String getPath()
                         throws NotOpenException
Usage:
Obtain this sessions path information. This is equivalent to CICS API command WEB EXTRACT SESSTOKEN PATH.

Returns:
Path information returned by CICS API command WEB EXTRACT SESSTOKEN PATH
Throws:
NotOpenException - a NOTOPEN condition occurred

getScheme

public java.lang.String getScheme()
                           throws NotOpenException
Usage:
Obtain this sessions scheme information. This is equivalent to CICS API command WEB EXTRACT SESSTOKEN SCHEME.

Returns:
Scheme information returned by CICS API command WEB EXTRACT SESSTOKEN SCHEME
Throws:
NotOpenException - a NOTOPEN condition occurred

getVersion

public java.lang.String getVersion()
                            throws NotOpenException
Usage:
Obtain this sessions version information. This is equivalent to CICS API command WEB EXTRACT SESSTOKEN VERSION.

Returns:
Version information returned by CICS API command WEB EXTRACT SESSTOKEN VERSION
Throws:
NotOpenException - a NOTOPEN condition occurred

getUrimap

public java.lang.String getUrimap()
                           throws NotOpenException
Usage:
Obtain this sessions URIMAP information. This is equivalent to CICS API command WEB EXTRACT SESSTOKEN URIMAP.

Returns:
URIMAP information returned by CICS API command WEB EXTRACT SESSTOKEN URIMAP
Throws:
NotOpenException - a NOTOPEN condition occurred

getPortNumber

public int getPortNumber()
                  throws NotOpenException
Usage:
Obtain this sessions port number. This is equivalent to CICS API command WEB EXTRACT SESSTOKEN PORTNUMBER.

Returns:
portNumber information returned by CICS API command WEB EXTRACT SESSTOKEN PORTNUMBER
Throws:
NotOpenException - a NOTOPEN condition occurred