To define what is to be retrieved by the
Task.retrieve() method,
use a
java.util.BitSet object. The
com.ibm.cics.server.RetrieveBits class
defines the bits which can be set in the
BitSet object; they
are:
- RetrieveBits.DATA
- RetrieveBits.RTRANSID
- RetrieveBits.RTERMID
- RetrieveBits.QUEUE
These correspond to the options on the EXEC CICS RETRIEVE command.
The
Task.retrieve() method retrieves up to four
different pieces of information in a single invocation, depending on the settings
of the
RetrieveBits. The DATA, RTRANSID, RTERMID and QUEUE
data are placed in a
RetrievedData object, which is held
in a
RetrievedDataHolder object. The following example retrieves
the data and transid:
BitSet bs = new BitSet();
bs.set(RetrieveBits.DATA, true);
bs.set(RetrieveBits.RTRANSID, true);
RetrievedDataHolder rdh = new RetrievedDataHolder();
t.retrieve(bs, rdh);
byte[] inData = rdh.value.data;
String transid = rdh.value.transId;