CICS® Transaction Gateway Programming Reference v7.2.0.1

com.ibm.ctg.client
Class Channel

java.lang.Object
  extended by com.ibm.ctg.client.Channel

public class Channel
extends java.lang.Object


Constructor Summary
Channel(java.lang.String channelName)
          Channel constructor creates a uniquely named object to hold a collection of application parameter data held in containers.
 
Method Summary
 void addContainer(Container container)
          Adds the provided container to the channel
 Container copyContainer(java.lang.String containerName, Channel sourceChannel)
          Copy a container from another channel
 Container copyContainer(java.lang.String containerName, Channel sourceChannel, java.lang.String newContainerName)
          Copy a container from another channel
 Container createContainer(java.lang.String containerName, byte[] data)
          Creates a container to hold binary data within the channel.
 Container createContainer(java.lang.String containerName, byte[] data, int CCSID)
          Creates a container to hold character data within the channel.
 Container createContainer(java.lang.String containerName, byte[] data, java.lang.String encoding)
          Creates a container to hold character data within the channel.
 Container createContainer(java.lang.String containerName, java.lang.String data)
          Creates a container to hold character data within the channel.
 Container createContainer(java.lang.String containerName, java.lang.String data, java.lang.String encoding)
          Deprecated.  
 void deleteContainer(java.lang.String name)
          Set the container to be deleted from the channel on the next CICS request.
 int getCCSID()
          Returns the default CCSID associated with the channel
 java.lang.String getCodePage()
          Returns the default code page associated with the channel
 Container getContainer(java.lang.String name)
          This method will examine the current containers within this channel looking for a container with the name supplied.
 java.util.Set<java.lang.String> getContainerNames()
           
 java.util.Collection<Container> getContainers()
          Get a collection of all of the containers held within the channel
 java.lang.String getName()
          Returns the name of the channel
 void markDeleted(java.lang.String name)
           
 Container moveContainer(java.lang.String containerName, Channel sourceChannel)
          Move a container from another channel
 Container moveContainer(java.lang.String containerName, Channel sourceChannel, java.lang.String newContainerName)
          Move a container from another channel
 void setCCSID(int ccsid)
          Sets the CCSID of the channel
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Channel

public Channel(java.lang.String channelName)
        throws ChannelException
Channel constructor creates a uniquely named object to hold a collection of application parameter data held in containers.

This channel object has methods to create, modify and delete containers held within the channel.

Parameters:
channelName - Unique name for this channel
Throws:
ChannelException - if the channel name includes invalid characters, or the name is null
Method Detail

createContainer

public Container createContainer(java.lang.String containerName,
                                 byte[] data)
                          throws ContainerException
Creates a container to hold binary data within the channel.

The contents of the container will be set to the data supplied. Data within this container will not be considered for codepage conversion. The data will be transfered to the CICS application exactly as supplied.

Parameters:
containerName - name for this container to be referenced by
data - data to be placed in the container referenced by containerName
Throws:
ContainerException - if the container name includes invalid characters, the name is null, or the container name already exists

createContainer

@Deprecated
public Container createContainer(java.lang.String containerName,
                                            java.lang.String data,
                                            java.lang.String encoding)
                          throws java.io.UnsupportedEncodingException,
                                 ContainerException
Deprecated. 

This method has been deprecated and any call to use it will result in an UnsupportedOperationException being thrown to the application. The method createContainer(String containerName, byte[] data, String encoding) should be used instead.

Throws:
java.io.UnsupportedEncodingException
ContainerException

createContainer

public Container createContainer(java.lang.String containerName,
                                 byte[] data,
                                 java.lang.String encoding)
                          throws java.io.UnsupportedEncodingException,
                                 ContainerException
Creates a container to hold character data within the channel.

The contents of the container will be set to the data supplied.

Parameters:
containerName - name for this container to be referenced by
data - byte data to be placed in the container referenced by containerName
encoding - specify the codepage of the String data supplied
Throws:
ContainerException - if the container name includes invalid characters, the name is null, or the container name already exists
java.io.UnsupportedEncodingException - if the encoding is not supported

createContainer

public Container createContainer(java.lang.String containerName,
                                 java.lang.String data)
                          throws java.io.UnsupportedEncodingException,
                                 ContainerException
Creates a container to hold character data within the channel.

The contents of the container will be set to the String data supplied.

Data within this container will be converted to the appropriate codepage specified in the CICS application.

Parameters:
containerName - name for this container to be referenced by
data - String data to be placed in the container referenced by containerName
Throws:
ContainerException - if the container name includes invalid characters, the name is null, or the container name already exists
java.io.UnsupportedEncodingException - if the encoding is not supported

createContainer

public Container createContainer(java.lang.String containerName,
                                 byte[] data,
                                 int CCSID)
                          throws java.io.UnsupportedEncodingException,
                                 ContainerException
Creates a container to hold character data within the channel.

The contents of the container will be set to the String data supplied.

Parameters:
containerName - name for this container to be referenced by
data - byte[] data to be placed in the container referenced by containerName
CCSID - specify the CCSID of the String data supplied
Throws:
ContainerException - if the container name includes invalid characters, the name is null, or the container name already exists
java.io.UnsupportedEncodingException - if the CCSID is not supported

copyContainer

public Container copyContainer(java.lang.String containerName,
                               Channel sourceChannel)
                        throws ContainerException
Copy a container from another channel

Copy a container from sourceChannel into this channel. The container containerName will be copied to this channel.

Parameters:
containerName - the container name to be copied
sourceChannel - reference to the channel that holds the container
Returns:
Container reference to the container copied.
Throws:
ContainerException - if the container is not found in sourceChannel, or already exists in this channel

copyContainer

public Container copyContainer(java.lang.String containerName,
                               Channel sourceChannel,
                               java.lang.String newContainerName)
                        throws ContainerException
Copy a container from another channel

Copy a container from sourceChannel into this channel. The container containerName will be copied to this channel with a new name newContainerName

Parameters:
containerName - the container name to be copied
sourceChannel - reference to the channel that holds the container
newContainerName - new container name within this channel
Returns:
Container reference to the container copied.
Throws:
ContainerException - if the container is not found in sourceChannel, already exists in this channel, or the newContainerName includes invalid characters or is null

moveContainer

public Container moveContainer(java.lang.String containerName,
                               Channel sourceChannel)
                        throws ContainerException
Move a container from another channel

Move a container from sourceChannel into this channel. The container will no longer exist in sourceChannel. The container containerName will be moved to this channel.

Parameters:
containerName - the container name to be moved
sourceChannel - reference to the channel that holds the container
Returns:
Container reference to the container moved.
Throws:
ContainerException - if the container is not found in sourceChannel, or already exists in this channel

moveContainer

public Container moveContainer(java.lang.String containerName,
                               Channel sourceChannel,
                               java.lang.String newContainerName)
                        throws ContainerException
Move a container from another channel

Move a container from sourceChannel into this channel. The container will no longer exist in sourceChannel. The container containerName will be moved to this channel with a new name newContainerName

Parameters:
containerName - the container name to be moved
sourceChannel - reference to the channel that holds the container
newContainerName - new container name within this channel
Returns:
Container reference to the container moved.
Throws:
ContainerException - if the container is not found in sourceChannel, already exists in this channel, or the newContainerName includes invalid characters or is null

getContainer

public Container getContainer(java.lang.String name)
                       throws ContainerNotFoundException
This method will examine the current containers within this channel looking for a container with the name supplied.

If a container with a matching name is found then a reference to that container is returned.

Parameters:
name - the container name to find
Returns:
Container reference to the container name
Throws:
ContainerNotFoundException - if the container name is not found

getContainers

public java.util.Collection<Container> getContainers()
Get a collection of all of the containers held within the channel

Returns:
Collection of Container objects

deleteContainer

public void deleteContainer(java.lang.String name)
                     throws ContainerException
Set the container to be deleted from the channel on the next CICS request.

The container will remain in the channel until the next reuest has been sent as CICS will need to be informed that this container has now been deleted. Once the request has completed this container will actually be deleted.

Parameters:
name - name of the container to delete
Throws:
ContainerException - if the container is not found in the channel

markDeleted

public void markDeleted(java.lang.String name)
                 throws ContainerException
Throws:
ContainerException

addContainer

public void addContainer(Container container)
                  throws ContainerException,
                         ContainerExistsException
Adds the provided container to the channel

Parameters:
container - The container to add to the channel
Throws:
ContainerException - If the container is not of the correct type
ContainerExistsException - If the container already exists in the channel

getContainerNames

public java.util.Set<java.lang.String> getContainerNames()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getName

public java.lang.String getName()
Returns the name of the channel

Returns:
The name of the channel

getCCSID

public int getCCSID()
Returns the default CCSID associated with the channel

Returns:
The default CCSID associated with the channel

getCodePage

public java.lang.String getCodePage()
Returns the default code page associated with the channel

Returns:
The default code page associated with the channel

setCCSID

public void setCCSID(int ccsid)
Sets the CCSID of the channel

Parameters:
ccsid - The CCSID this channel should set as its default.

©Copyright IBM Corp. 1994, 2009
Legal