Class Container

java.lang.Object
com.ibm.cics.server.API
com.ibm.cics.server.Container

public class Container extends API

This is the Java implementation of CICS Containers.

Applications should use methods on the Channel class to obtain Containers.

For example:


 Task t = Task.getTask();
 Channel custData = t.createChannel("Customer_Data");
 Container custRec = custData.createContainer("Customer_Record");
 

The string supplied to the createContainer() method is the name by which the Container object is known to CICS. The name is padded with spaces to 16 characters, if necessary, to conform to CICS naming conventions. If a container of the same name already exists in the channel, a ContainerErrorException is thrown.

A JCICS program that is passed a channel can access all the Container objects by using a Channel object without receiving the channel explicitly.

When a Channel object is instantiated, its getContainerNames() method returns a list of names of all the containers currently existing on this channel. When you have a container name, the container object can be obtained with the getContainer(java.lang.String,boolean) method. Use 'false' for the boolean parameter where no further checking for existence is required.

For example:


 Task t = Task.getTask();
 Channel chl = t.getCurrentChannel();

 if (chl != null)
 {
     List<String> names = chl.getContainerNames();

     for (String name : names)
     {
         Container custData = chl.getContainer(name, false);
         // Process the container...
     }
 }
 
See Also:
Since CICS TS version:
3.1
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Constant for BIT type containers
    static final int
    Constant for CHAR type containers
    static final int
    The maximum allowable length for a container name.
    static final int
    Constant for state that has yet been set
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    append(byte[] byteArrayData)
    Appends a byte[] to the end of the data in the Container.
    void
    append(byte[] byteArrayData, String sourceCodePage)
    Appends a byte[] to the end of the data in the Container.
    void
    appendString(String stringData)
    Appends a String to the end of the data in the Container.
    void
    Delete the Container in CICS, and remove it from the owning Channel.
    boolean
    Does the container exist in CICS yet ?
    byte[]
    get()
    Get the data from the Container.
    int
    get(byte[] destination, int sourceOffset, int length)
    Get a specified length of data at the given source offset from the Container into a pre-existing byte array.
    int
    get(byte[] destination, int destinationOffset, int theSourceOffset, int length)
    Get a specified length of data at the given source offset from the Container into the given destination offset in a pre-existing byte array.
    byte[]
    get(int sourceOffset, int length)
    Get a specified length of data at the given source offset from the Container
    byte[]
    get(String targetCodePage)
    Get the data from the Container.
    byte[]
    get(String targetCodePage, int sourceOffset, int length)
    Get a specified length of data at the given source offset from the Container, converting the data from the source code page into the given destination code page.
    int
    Get the CCSID value of the data returned by getNoConvert().
    int
    Get the datatype of this container.
    int
    Get the length of the data in the Container.
    int
    getLength(String targetCodePage)
    Get the length of the data in the Container.
    int
    Get the length of the data in the Container without conversion.
    Get the name of the Container as known to CICS.
    byte[]
    Get the data from the Container without conversion.
    int
    getNoConvert(byte[] destination, int sourceOffset, int length)
    Get a specified length of data at the given source offset from the Container into a pre-existing byte array.
    int
    getNoConvert(byte[] destination, int destinationOffset, int theSourceOffset, int length)
    Get a specified length of data at the given source offset from the Container into the given destination offset in a pre-existing byte array.
    byte[]
    getNoConvert(int offset, int length)
    Get a specified length of data at the given source offset from the Container, without code page conversion.
    Get the data from a CICS Container and return it as a String.
    void
    prepend(byte[] byteArrayData)
    Prepends a byte[] to the start of the data in the Container.
    void
    prepend(byte[] byteArrayData, String sourceCodePage)
    Prepends a byte[] to the start of the data in the Container.
    void
    prependString(String stringData)
    Prepends a String to the start of the data in the Container.
    void
    put(byte[] byteArrayData)
    Puts byte[] array data into the Container.
    void
    put(byte[] byteArrayData, String sourceCodePage)
    Puts byte[] array data into the Container.
    void
    putString(String stringData)
    Puts String data into the Container.

    Methods inherited from class com.ibm.cics.server.API

    getCICSServerApiVersion

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait