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 java.lang.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.
|
java.math.BigDecimal |
getBigDecimal(java.lang.String fieldName)
Returns the field specified by the parameter as a
BigDecimal . |
boolean |
getBoolean(java.lang.String fieldName)
Returns the field specified by the parameter as a
boolean . |
byte |
getByte(java.lang.String fieldName)
Returns the field specified by the parameter as a
byte . |
byte[] |
getBytes(java.lang.String fieldName)
Returns the field specified by the parameter as a
byte array. |
java.util.Date |
getDate(java.lang.String fieldName)
Returns the field specified by the parameter as a
java.util.Date . |
double |
getDouble(java.lang.String fieldName)
Returns the field specified by the parameter as a
double . |
float |
getFloat(java.lang.String fieldName)
Returns the field specified by the parameter as a
float . |
int |
getInt(java.lang.String fieldName)
Returns the field specified by the parameter as an integer.
|
long |
getLong(java.lang.String fieldName)
Returns the field specified by the parameter as a
long . |
short |
getShort(java.lang.String fieldName)
Returns the field specified by the parameter as a
short . |
java.sql.Date |
getSqlDate(java.lang.String fieldName)
Returns the field specified by the parameter as a
java.sql.Date . |
java.lang.String |
getString(java.lang.String fieldName)
Returns the field specified by the parameter as a
String . |
java.lang.String |
getTransactionName()
Retrieves the IMS transaction name related to this message.
|
void |
setBigDecimal(java.lang.String fieldName,
java.math.BigDecimal value)
Sets the field indicated by the fieldName parameter to the specified
BigDecimal value. |
void |
setBoolean(java.lang.String fieldName,
boolean value)
Sets the field indicated by the fieldName parameter to the specified
boolean value. |
void |
setByte(java.lang.String fieldName,
byte value)
Sets the field indicated by the fieldName parameter to the specified
byte
value. |
void |
setBytes(java.lang.String fieldName,
byte[] value)
Sets the field indicated by the fieldName parameter to the specified
byte array value. |
void |
setDate(java.lang.String fieldName,
java.util.Date value)
Sets the field indicated by the fieldName parameter to the specified
java.util.Date value. |
void |
setDouble(java.lang.String fieldName,
double value)
Sets the field indicated by the fieldName parameter to the specified
double value. |
void |
setFloat(java.lang.String fieldName,
float value)
Sets the field indicated by the fieldName parameter to the specified
float value. |
void |
setInt(java.lang.String fieldName,
int value)
Sets the field indicated by the fieldName parameter to the specified
integer value.
|
void |
setLong(java.lang.String fieldName,
long value)
Sets the field indicated by the fieldName parameter to the specified long
value.
|
void |
setShort(java.lang.String fieldName,
short value)
Sets the field indicated by the fieldName parameter to the specified
short value. |
void |
setSqlDate(java.lang.String fieldName,
java.sql.Date value)
Sets the field indicated by the fieldName parameter to the specified
java.sql.Date value. |
void |
setString(java.lang.String fieldName,
java.lang.String value)
Sets the field indicated by the fieldName parameter to the specified
String value. |
void |
setTransactionName(java.lang.String transactionName)
Sets the IMS transaction code name.
|
static final java.lang.String END_CONVERSATION_BLANKS
java.lang.String getTransactionName() throws DLIException
DLIException
TMException
- if an error occurs during processingvoid setTransactionName(java.lang.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 codeTMException
- if an error occurs during processingDLIException
java.lang.String getString(java.lang.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(java.lang.String fieldName, java.lang.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(java.lang.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(java.lang.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 failurejava.math.BigDecimal getBigDecimal(java.lang.String fieldName) throws DLIException
BigDecimal
.fieldName
- the name of the input or output message fieldBigDecimal
DLIException
- if the field name is not found in the segmentvoid setBigDecimal(java.lang.String fieldName, java.math.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(java.lang.String fieldName) throws DLIException
fieldName
- the name of the input or output message fieldint
DLIException
- if the field name is not found in the segmentvoid setInt(java.lang.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(java.lang.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(java.lang.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(java.lang.String fieldName) throws DLIException
long
.fieldName
- the name of the input or output message fieldlong
DLIException
- if the field name is not found in the segmentvoid setLong(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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 failurejava.util.Date getDate(java.lang.String fieldName) throws DLIException
java.util.Date
.fieldName
- the name of the input or output message fieldjava.util.Date
DLIException
- if the field name is not found in the segmentvoid setDate(java.lang.String fieldName, java.util.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 failurejava.sql.Date getSqlDate(java.lang.String fieldName) throws DLIException
java.sql.Date
.fieldName
- the name of the input or output message fieldjava.sql.Date
DLIException
- if the field name is not found in the segmentvoid setSqlDate(java.lang.String fieldName, java.sql.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
DLIException
void 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