public interface IOMessage
IOMessage interface represents a message either
coming from or going to an IMS message queue. It provides a mapping between
the data contained in the message and access functions that operate on the
class. Client applications can reference individual fields of the message by
field name utilizing a wide range of data conversion functions.| Modifier and Type | Field and Description |
|---|---|
static String |
END_CONVERSATION_BLANKS
Constant to indicates the end of a transaction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Resets all character data fields to blanks, and sets all non-character fields
to 0x40 (if EBCDIC) or 0x20 (if ASCII).
|
int |
getActualLength()
Returns the actual length (LL) of the IOMessage instance which
may differ from the length in the metadata.
|
BigDecimal |
getBigDecimal(String fieldName)
Returns the field specified by the parameter as a
BigDecimal. |
boolean |
getBoolean(String fieldName)
Returns the field specified by the parameter as a
boolean. |
byte |
getByte(String fieldName)
Returns the field specified by the parameter as a
byte. |
byte[] |
getBytes(String fieldName)
Returns the field specified by the parameter as a
byte array. |
Date |
getDate(String fieldName)
Returns the field specified by the parameter as a
java.util.Date. |
double |
getDouble(String fieldName)
Returns the field specified by the parameter as a
double. |
float |
getFloat(String fieldName)
Returns the field specified by the parameter as a
float. |
int |
getInt(String fieldName)
Returns the field specified by the parameter as an integer.
|
long |
getLong(String fieldName)
Returns the field specified by the parameter as a
long. |
short |
getShort(String fieldName)
Returns the field specified by the parameter as a
short. |
Date |
getSqlDate(String fieldName)
Returns the field specified by the parameter as a
java.sql.Date. |
String |
getString(String fieldName)
Returns the field specified by the parameter as a
String. |
String |
getTransactionName()
Retrieves the IMS transaction name related to this message.
|
void |
setBigDecimal(String fieldName,
BigDecimal value)
Sets the field indicated by the fieldName parameter to the specified
BigDecimal value. |
void |
setBoolean(String fieldName,
boolean value)
Sets the field indicated by the fieldName parameter to the specified
boolean value. |
void |
setByte(String fieldName,
byte value)
Sets the field indicated by the fieldName parameter to the specified
byte
value. |
void |
setBytes(String fieldName,
byte[] value)
Sets the field indicated by the fieldName parameter to the specified
byte array value. |
void |
setDate(String fieldName,
Date value)
Sets the field indicated by the fieldName parameter to the specified
java.util.Date value. |
void |
setDouble(String fieldName,
double value)
Sets the field indicated by the fieldName parameter to the specified
double value. |
void |
setFloat(String fieldName,
float value)
Sets the field indicated by the fieldName parameter to the specified
float value. |
void |
setInt(String fieldName,
int value)
Sets the field indicated by the fieldName parameter to the specified
integer value.
|
void |
setLong(String fieldName,
long value)
Sets the field indicated by the fieldName parameter to the specified long
value.
|
void |
setShort(String fieldName,
short value)
Sets the field indicated by the fieldName parameter to the specified
short value. |
void |
setSqlDate(String fieldName,
Date value)
Sets the field indicated by the fieldName parameter to the specified
java.sql.Date value. |
void |
setString(String fieldName,
String value)
Sets the field indicated by the fieldName parameter to the specified
String value. |
void |
setTransactionName(String transactionName)
Sets the IMS transaction code name.
|
static final String END_CONVERSATION_BLANKS
String getTransactionName() throws DLIException
DLIExceptioncom.ibm.ims.dli.tm.TMException - if an error occurs during processingvoid setTransactionName(String transactionName) throws DLIException
The following code example shows how to end a conversational transaction:
IOMessage ioMsg = application.getIOMessage("msg_url");
ioMsg.setTrancodeName(IOMessage.END_CONVERSATION);
The following code example shows how to use this method for deferred program switching:
spaMessage.setTrancodeName("newTran");
messageQueue.insert(spaMessage, MessageQueue.DEFAULT_DESTINATION);
transactionName - the name of the IMS transaction codecom.ibm.ims.dli.tm.TMException - if an error occurs during processingDLIExceptionString getString(String fieldName) throws DLIException
String.fieldName - the name of the input or output message fieldDLIException - if the field name is not found in the segmentvoid setString(String fieldName, String value) throws DLIException
String value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failureboolean getBoolean(String fieldName) throws DLIException
boolean.fieldName - the name of the input or output message fieldDLIException - if the field name is not found in the segmentvoid setBoolean(String fieldName, boolean value) throws DLIException
boolean value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failureBigDecimal getBigDecimal(String fieldName) throws DLIException
BigDecimal.fieldName - the name of the input or output message fieldBigDecimalDLIException - if the field name is not found in the segmentvoid setBigDecimal(String fieldName, BigDecimal value) throws DLIException
BigDecimal value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failureint getInt(String fieldName) throws DLIException
fieldName - the name of the input or output message fieldintDLIException - if the field name is not found in the segmentvoid setInt(String fieldName, int value) throws DLIException
fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failureshort getShort(String fieldName) throws DLIException
short.fieldName - the name of the input or output message fieldDLIException - if the field name is not found in the segmentvoid setShort(String fieldName, short value) throws DLIException
short value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failurelong getLong(String fieldName) throws DLIException
long.fieldName - the name of the input or output message fieldlongDLIException - if the field name is not found in the segmentvoid setLong(String fieldName, long value) throws DLIException
fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failurefloat getFloat(String fieldName) throws DLIException
float.fieldName - the name of the input or output message fieldDLIException - if the field name is not found in the segmentvoid setFloat(String fieldName, float value) throws DLIException
float value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failuredouble getDouble(String fieldName) throws DLIException
double.fieldName - the name of the input or output message fieldDLIException - if the field name is not found in the segmentvoid setDouble(String fieldName, double value) throws DLIException
double value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failurebyte getByte(String fieldName) throws DLIException
byte.fieldName - the name of the input or output message fieldDLIException - if the field name is not found in the segmentvoid setByte(String fieldName, byte value) throws DLIException
byte
value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failurebyte[] getBytes(String fieldName) throws DLIException
byte array.fieldName - the name of the input or output message fieldbyte arrayDLIException - if the field name is not found in the segmentvoid setBytes(String fieldName, byte[] value) throws DLIException
byte array value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failureDate getDate(String fieldName) throws DLIException
java.util.Date.fieldName - the name of the input or output message fieldjava.util.DateDLIException - if the field name is not found in the segmentvoid setDate(String fieldName, Date value) throws DLIException
java.util.Date value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failureDate getSqlDate(String fieldName) throws DLIException
java.sql.Date.fieldName - the name of the input or output message fieldjava.sql.DateDLIException - if the field name is not found in the segmentvoid setSqlDate(String fieldName, Date value) throws DLIException
java.sql.Date value.fieldName - the name of the input or output message fieldvalue - the new value for the fieldDLIException - if the field name is not found in the segment or if there
is a conversion failureint getActualLength()
throws DLIException
DLIExceptionvoid clear()
throws DLIException
Calling this method can cause potential problems for ZONEDDECIMAL and
PACKEDDECIMAL fields. Any getter method call to these fields will throw a
DLIException since the method will look for a sign trailing byte and encounter
the blank value which is invalid. To avoid this problem, ensure that following
a clear() method call, a setter method is issued to any
PACKEDDECIMAL or ZONEDDECIMAL field before a getter method is issued.
DLIException(c) Copyright IBM Corporation 2008, 2017.