com.ibm.cics.server
Class Container

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

public class Container
extends java.lang.Object

This is the Java implementation of CICS Containers.

Version:
1.0
Author:
Tom Grieve

Field Summary
static int DATATYPE_BIT
          Constant for BIT type containers
static int DATATYPE_CHAR
          Constant for CHAR type containers
static int NOTSET
          Constant for state that has yet been set
 
Method Summary
 void delete()
          Delete the Container in CICS, and remove it from the owning Channel.
 byte[] get()
          Get the data from the Container.
 byte[] get(java.lang.String intoCodePage)
          Get the data from the Container.
 int getCCSID()
          Get the CCSID value of the data returned by getNoConvert().
 int getLength()
          Get the length of the data in the Container.
 int getLength(java.lang.String intoCodePage)
          Get the length of the data in the Container.
 int getLengthNoConvert()
          Get the length of the data in the Container without conversion.
 java.lang.String getName()
          Get the name of the Container as known to CICS.
 byte[] getNoConvert()
          Get the data from the Container without conversion.
 void put(byte[] byteArrayData)
          Put some byte[] array data into the Container.
 void put(byte[] byteArrayData, java.lang.String fromCodePage)
          Put some byte[] array data into the Container.
 void put(java.lang.String stringData)
          Put some String data into the Container.
 
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 for state that has yet been set

See Also:
Constant Field Values

DATATYPE_BIT

public static final int DATATYPE_BIT
Constant for BIT type containers

See Also:
Constant Field Values

DATATYPE_CHAR

public static final int DATATYPE_CHAR
Constant for CHAR type containers

See Also:
Constant Field Values
Method Detail

getName

public java.lang.String getName()
Get the name of the Container as known to CICS.

Returns:
The name of the Container.

get

public byte[] get()
           throws ContainerErrorException,
                  ChannelErrorException,
                  CCSIDErrorException,
                  CodePageErrorException
Get the data from the Container.

Returns:
byte[] array comprising the Container data.
Throws:
ContainerErrorException
ChannelErrorException
CCSIDErrorException
CodePageErrorException

get

public byte[] get(java.lang.String intoCodePage)
           throws ContainerErrorException,
                  ChannelErrorException,
                  CCSIDErrorException,
                  CodePageErrorException
Get the data from the Container.

Parameters:
intoCodePage - is the code-page in which the container data will be returned
Returns:
byte[] array comprising the Container data.
Throws:
ContainerErrorException
ChannelErrorException
CCSIDErrorException
CodePageErrorException

getNoConvert

public byte[] getNoConvert()
                    throws ContainerErrorException,
                           ChannelErrorException,
                           CCSIDErrorException,
                           CodePageErrorException
Get the data from the Container without conversion.

Returns:
byte[] array comprising the Container data.
Throws:
ContainerErrorException
ChannelErrorException
CCSIDErrorException
CodePageErrorException

getLength

public int getLength()
              throws ContainerErrorException,
                     ChannelErrorException,
                     CCSIDErrorException,
                     CodePageErrorException
Get the length of the data in the Container.

Returns:
The length of the data in the Container.
Throws:
ContainerErrorException
ChannelErrorException
CCSIDErrorException
CodePageErrorException

getLength

public int getLength(java.lang.String intoCodePage)
              throws ContainerErrorException,
                     ChannelErrorException,
                     CCSIDErrorException,
                     CodePageErrorException
Get the length of the data in the Container.

Parameters:
intoCodePage - is the code-page into which the container data will be converted when retrieved from the container.
Returns:
The length of the data in the Container.
Throws:
ContainerErrorException
ChannelErrorException
CCSIDErrorException
CodePageErrorException

getLengthNoConvert

public int getLengthNoConvert()
                       throws ContainerErrorException,
                              ChannelErrorException,
                              CCSIDErrorException,
                              CodePageErrorException
Get the length of the data in the Container without conversion.

Returns:
The length of the data in the Container.
Throws:
ContainerErrorException
ChannelErrorException
CCSIDErrorException
CodePageErrorException

getCCSID

public int getCCSID()
Get the CCSID value of the data returned by getNoConvert(). If getNoConvert has not been issued then value NOTSET is returned.

Returns:
The CCSID value of the data returned

put

public void put(byte[] byteArrayData)
         throws ContainerErrorException,
                ChannelErrorException,
                InvalidRequestException,
                CCSIDErrorException,
                CodePageErrorException
Put some byte[] array data into the Container. The first put() method issued creates the CICS container and determines that containers attributes. If this method creates the CICS container it will be created as a DATATYPE(BIT) container. Subsequent put() methods will replace the data in the container and if code-page information is supplied with the put(byte[] byteArratData, String fromCodePage) method an InvalidRequestException with RESP2 = 33 will be thrown.

Parameters:
byteArrayData - data to be put into the Container.
Throws:
ContainerErrorException
ChannelErrorException
InvalidRequestException
CCSIDErrorException
CodePageErrorException

put

public void put(byte[] byteArrayData,
                java.lang.String fromCodePage)
         throws ContainerErrorException,
                ChannelErrorException,
                InvalidRequestException,
                CCSIDErrorException,
                CodePageErrorException
Put some byte[] array data into the Container. The first put() method issued creates the CICS container and determines that containers attributes. If this method creates the CICS container it will be created as a DATATYPE(CHAR) and the fromCodePage will be associated with the container. Subsequent put() methods will replace the data in the container and data conversion may take place. If put(byte[] byteArratData, String fromCodePage) is used to replace the data in the container it will be converted if encoded in a different code-page to that associated with the container. If put(byte[] byteArrayData) or put(String stringData) is used to replace the data in the container that data will be assumed to be in the CICS LOCALCCSID code-page and if that is different to the code-page associated with the container, conversion will take place.

Parameters:
byteArrayData - data to be put into the Container.
fromCodePage - is the code-page in which the byteArrayData is encoded.
Throws:
ContainerErrorException
ChannelErrorException
InvalidRequestException
CCSIDErrorException
CodePageErrorException

put

public void put(java.lang.String stringData)
         throws ContainerErrorException,
                ChannelErrorException,
                InvalidRequestException,
                CCSIDErrorException,
                CodePageErrorException
Put some String data into the Container. The first put() method issued creates the CICS container and determines that containers attributes. If this method creates the CICS container it will be created as a DATATYPE(BIT) container. Subsequent put() methods will replace the data in the container and if code-page information is supplied with the put(byte[] byteArratData, String fromCodePage) method an InvalidRequestException with RESP2 = 33 will be thrown.

Parameters:
stringData - data to be put into the Container.
Throws:
ContainerErrorException
ChannelErrorException
InvalidRequestException
CCSIDErrorException
CodePageErrorException

delete

public void delete()
            throws ContainerErrorException,
                   ChannelErrorException,
                   InvalidRequestException
Delete the Container in CICS, and remove it from the owning Channel.

Throws:
ContainerErrorException
ChannelErrorException
InvalidRequestException