com.ibm.cics.server
Class TSQ

java.lang.Object
  extended by com.ibm.cics.server.API
      extended by com.ibm.cics.server.Resource
          extended by com.ibm.cics.server.RemotableResource
              extended by com.ibm.cics.server.TSQ
All Implemented Interfaces:
java.io.Serializable

public class TSQ
extends RemotableResource

This Class provides the Java interface to CICS Temporary Storage Queues (TSQs).

See Also:
Serialized Form
Since CICS TS version:
1.3
Since package version:
1.0

Constructor Summary
TSQ()
          Construct a TSQ bean.
 
Method Summary
 void delete()
          Delete a Temporary Storage Queue (TSQ).
 java.lang.String getName()
          Return the name of the TSQ as a string, using the platform's default character encoding to convert from the internal byte[] format in which the name is stored.
 byte[] getQueueName()
          Return the queueName of the TSQ.
 TSQType getType()
          Return the type of the TSQ.
 int readItem(int item, ItemHolder holder)
          Read a specified item from a TSQ.
 int readNextItem(ItemHolder holder)
          Read the next item from a TSQ.
 void rewriteItem(int item, byte[] data)
          Rewrite an existing item.
 void rewriteItemConditional(int item, byte[] data)
          Rewrite an existing item.
 void setName(java.lang.String name)
          Sets the name of the TSQ.
 void setQueueName(byte[] queueName)
          Sets the queueName of the TSQ.
 void setType(TSQType type)
          Sets the type of the TSQ.
 int writeItem(byte[] data)
          Simplest version of WRITEQ TS.
 int writeItemConditional(byte[] data)
          Write an item to a TSQ.
 
Methods inherited from class com.ibm.cics.server.RemotableResource
getSysId, setSysId
 
Methods inherited from class com.ibm.cics.server.Resource
getDescription, setDescription
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TSQ

public TSQ()
Construct a TSQ bean.

Since CICS TS version:
1.3
Since package version:
1.0
Method Detail

delete

public void delete()
            throws InvalidRequestException,
                   IOErrorException,
                   ISCInvalidRequestException,
                   NotAuthorisedException,
                   InvalidQueueIdException,
                   InvalidSystemIdException
Delete a Temporary Storage Queue (TSQ).

Throws:
InvalidRequestException - An INVREQ occurred.
IOErrorException - An IOERR occurred.
ISCInvalidRequestException - An ISCINVREQ occurred.
NotAuthorisedException - A NOTAUTH occurred.
InvalidQueueIdException - A QIDERR occurred.
InvalidSystemIdException - A SYSIDERR occurred.
Since CICS TS version:
1.3
Since package version:
1.0

getName

public java.lang.String getName()
Return the name of the TSQ as a string, using the platform's default character encoding to convert from the internal byte[] format in which the name is stored.

Overrides:
getName in class Resource
Returns:
String the TSQ name
Since CICS TS version:
1.3
Since package version:
1.0

getQueueName

public byte[] getQueueName()
Return the queueName of the TSQ.

Returns:
byte[] the TSQ queueName
Since CICS TS version:
1.3
Since package version:
1.0

getType

public TSQType getType()
Return the type of the TSQ.

Returns:
TSQType the type of the TSQ
Since CICS TS version:
1.3
Since package version:
1.0

readItem

public int readItem(int item,
                    ItemHolder holder)
             throws InvalidRequestException,
                    IOErrorException,
                    ISCInvalidRequestException,
                    ItemErrorException,
                    LengthErrorException,
                    NotAuthorisedException,
                    InvalidQueueIdException,
                    InvalidSystemIdException
Read a specified item from a TSQ.

Parameters:
item - The number of the item to read.
holder - The holder for the data to be returned.
Returns:
The number of items in the queue.
Throws:
InvalidRequestException - An INVREQ occurred.
IOErrorException - An IOERR occurred.
ISCInvalidRequestException - An ISCINVREQ occurred.
ItemErrorException - An ITEMERROR occurred.
LengthErrorException - A LENGERR occurred.
NotAuthorisedException - A NOTAUTH occurred.
InvalidQueueIdException - A QIDERR occurred.
InvalidSystemIdException - A SYSIDERR occurred.
Since CICS TS version:
1.3
Since package version:
1.0

readNextItem

public int readNextItem(ItemHolder holder)
                 throws InvalidRequestException,
                        IOErrorException,
                        ISCInvalidRequestException,
                        ItemErrorException,
                        LengthErrorException,
                        NotAuthorisedException,
                        InvalidQueueIdException,
                        InvalidSystemIdException
Read the next item from a TSQ.

Parameters:
holder - The holder for the data to be returned.
Returns:
The number of items in the queue.
Throws:
InvalidRequestException - An INVREQ occurred.
IOErrorException - An IOERR occurred.
ISCInvalidRequestException - An ISCINVREQ occurred.
ItemErrorException - An ITEMERROR occurred.
LengthErrorException - A LENGERR occurred.
NotAuthorisedException - A NOTAUTH occurred.
InvalidQueueIdException - A QIDERR occurred.
InvalidSystemIdException - A SYSIDERR occurred.
Since CICS TS version:
1.3
Since package version:
1.0

rewriteItem

public void rewriteItem(int item,
                        byte[] data)
                 throws InvalidRequestException,
                        IOErrorException,
                        ISCInvalidRequestException,
                        ItemErrorException,
                        LengthErrorException,
                        NotAuthorisedException,
                        InvalidQueueIdException,
                        InvalidSystemIdException
Rewrite an existing item. If there is insufficient space in the TS dataset, the task will be suspended.

Parameters:
item - The number of the item to be rewritten.
data - A Java byte array containing the data to rewrite.
Throws:
InvalidRequestException - An INVREQ occurred.
IOErrorException - An IOERR occurred.
ISCInvalidRequestException - An ISCINVREQ occurred.
ItemErrorException - An ITEMERROR occurred.
LengthErrorException - A LENGERR occurred.
NotAuthorisedException - A NOTAUTH occurred.
InvalidQueueIdException - A QIDERR occurred.
InvalidSystemIdException - A SYSIDERR occurred.
Since CICS TS version:
1.3
Since package version:
1.0

rewriteItemConditional

public void rewriteItemConditional(int item,
                                   byte[] data)
                            throws InvalidRequestException,
                                   IOErrorException,
                                   ISCInvalidRequestException,
                                   ItemErrorException,
                                   LengthErrorException,
                                   NoSpaceException,
                                   NotAuthorisedException,
                                   InvalidQueueIdException,
                                   InvalidSystemIdException
Rewrite an existing item. If there is insufficient space in the TS dataset, a NoSpaceException will be thrown.

Parameters:
item - The number of the item to be rewritten.
data - A Java byte array containing the data to rewrite.
Throws:
InvalidRequestException - An INVREQ occurred.
IOErrorException - An IOERR occurred.
ISCInvalidRequestException - An ISCINVREQ occurred.
ItemErrorException - An ITEMERROR occurred.
LengthErrorException - A LENGERR occurred.
NoSpaceException - A NOSPACE occurred.
NotAuthorisedException - A NOTAUTH occurred.
InvalidQueueIdException - A QIDERR occurred.
InvalidSystemIdException - A SYSIDERR occurred.
Since CICS TS version:
1.3
Since package version:
1.0

setName

public void setName(java.lang.String name)
             throws java.lang.NullPointerException
Sets the name of the TSQ.

Overrides:
setName in class Resource
Parameters:
name - the name of the TSQ as a string. This string is padded with blanks and converted to bytes using the platform's default character encoding. Over-length queue names will be truncated.
Throws:
java.lang.NullPointerException - queueName is null
Since CICS TS version:
1.3
Since package version:
1.0

setQueueName

public void setQueueName(byte[] queueName)
                  throws java.lang.NullPointerException
Sets the queueName of the TSQ.

Parameters:
queueName - the queueName of the TSQ. If the queueName passed in is shorter than 16 bytes it is padded to the correct length with spaces. Over-length queueNames will be truncated.
Throws:
java.lang.NullPointerException - queueName is null
Since CICS TS version:
1.3
Since package version:
1.0

setType

public void setType(TSQType type)
Sets the type of the TSQ.

Parameters:
type - the type of the TSQ.
Since CICS TS version:
1.3
Since package version:
1.0

writeItem

public int writeItem(byte[] data)
              throws InvalidRequestException,
                     IOErrorException,
                     ISCInvalidRequestException,
                     ItemErrorException,
                     LengthErrorException,
                     NotAuthorisedException,
                     InvalidSystemIdException
Simplest version of WRITEQ TS. If there is insufficient space in the TS data-set, the task will be suspended.

Parameters:
data - A Java byte array containing the data to be written to the TSQ.
Returns:
The item number assigned to the new item.
Throws:
InvalidRequestException - An INVREQ occurred.
IOErrorException - An IOERR occurred.
ISCInvalidRequestException - An ISCINVREQ occurred.
ItemErrorException - An ITEMERROR occurred.
LengthErrorException - A LENGERR occurred.
NotAuthorisedException - A NOTAUTH occurred.
InvalidSystemIdException - A SYSIDERR occurred.
Since CICS TS version:
1.3
Since package version:
1.0

writeItemConditional

public int writeItemConditional(byte[] data)
                         throws InvalidRequestException,
                                IOErrorException,
                                ISCInvalidRequestException,
                                ItemErrorException,
                                LengthErrorException,
                                NoSpaceException,
                                NotAuthorisedException,
                                InvalidSystemIdException
Write an item to a TSQ. If there is insufficient space in the TS data set, a NoSpaceException will be thrown.

Parameters:
data - A Java byte array containing the data to rewrite.
Returns:
The item number assigned to the new item.
Throws:
InvalidRequestException - An INVREQ occurred.
IOErrorException - An IOERR occurred.
ISCInvalidRequestException - An ISCINVREQ occurred.
ItemErrorException - An ITEMERROR occurred.
LengthErrorException - A LENGERR occurred.
NoSpaceException - A NOSPACE occurred.
NotAuthorisedException - A NOTAUTH occurred.
InvalidSystemIdException - A SYSIDERR occurred.
Since CICS TS version:
1.3
Since package version:
1.0