com.ibm.mq.headers
Class MQMD1
- java.lang.Object
-
- com.ibm.mq.jmqi.JmqiObject
-
- com.ibm.mq.headers.internal.Header
-
- com.ibm.mq.headers.MQMD1
-
- All Implemented Interfaces:
- MQChainable, MQData, MQHeader
- Direct Known Subclasses:
- MQMD
public class MQMD1 extends com.ibm.mq.headers.internal.Header implements MQChainable
MQMD version 1 (message descriptor) header class. This has a specialized use as the MsgDesc member of an MQXQH (transmission queue) header. Instances of MQMD1 cannot be set to version 2, but an MQMD instance can be created from an MQMD1 instance.In addition to being able to read or write its content from a message body or byte stream, this class can get or set field values from the MQMD portion of an MQMessage object using the copyFrom or copyTo methods.
struct tagMQMD { MQCHAR4 StrucId; // Structure identifier MQLONG Version; // Structure version number MQLONG Report; // Options for report messages MQLONG MsgType; // Message type MQLONG Expiry; // Message lifetime MQLONG Feedback; // Feedback or reason code MQLONG Encoding; // Numeric encoding of message data MQLONG CodedCharSetId; // Character set identifier of message data MQCHAR8 Format; // Format name of message data MQLONG Priority; // Message priority MQLONG Persistence; // Message persistence MQBYTE24 MsgId; // Message identifier MQBYTE24 CorrelId; // Correlation identifier MQLONG BackoutCount; // Backout counter MQCHAR48 ReplyToQ; // Name of reply queue MQCHAR48 ReplyToQMgr; // Name of reply queue manager MQCHAR12 UserIdentifier; // User identifier MQBYTE32 AccountingToken; // Accounting token MQCHAR32 ApplIdentityData; // Application data relating to identity MQLONG PutApplType; // Type of application that put the message MQCHAR28 PutApplName; // Name of application that put the message MQCHAR8 PutDate; // Date when message was put MQCHAR8 PutTime; // Time when message was put MQCHAR4 ApplOriginData; // Application data relating to origin }
- See Also:
MQMD
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.mq.headers.MQHeader
MQHeader.Field
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZE
size of an MQMD1 Header in bytes
-
Constructor Summary
Constructors Constructor and Description MQMD1()
Constructs an MQMD1 instance with default field values.MQMD1(java.io.DataInput message)
Constructs an MQMD1 instance populated from an byte stream representing an MQ Message as stored in the queue.MQMD1(java.io.DataInput message, int encoding, int characterSet)
Constructs an MQMD1 instance populated from a DataInput source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
copyFrom(MQMD md)
duplicate the content of an MQMD header into this headervoid
copyTo(MQMD md)
duplicate the content of this header into an MQMD headerjava.lang.String
format()
byte[]
getAccountingToken()
gets the Accounting tokenjava.lang.String
getApplIdentityData()
gets the Application data relating to identityjava.lang.String
getApplOriginData()
gets the Application data relating to originint
getBackoutCount()
gets the Backout counterint
getCodedCharSetId()
Get the Character set identifier of data that follows.byte[]
getCorrelId()
gets the Correlation identifierint
getEncoding()
Get the numeric encoding of the data that follows.int
getExpiry()
gets the Message lifetimeint
getFeedback()
gets the Feedback or reason codejava.lang.String
getFormat()
gets the Format name of message databyte[]
getMsgId()
gets the Message identifierint
getMsgType()
gets the Message typeint
getPersistence()
gets the Message persistenceint
getPriority()
get the Message priorityjava.lang.String
getPutApplName()
gets the Name of application that put the messageint
getPutApplType()
gets the Type of application that put the messagejava.lang.String
getPutDate()
gets the Date when message was putlong
getPutDateTime()
gets the Date and Time when message was putjava.lang.String
getPutTime()
gets the Time when message was putjava.lang.String
getReplyToQ()
gets the Name of reply queuejava.lang.String
getReplyToQMgr()
gets the Name of reply queue managerint
getReport()
gets the Options for report messagesjava.lang.String
getStrucId()
Get the structure identifier; the value will be MQMD_STRUC_IDjava.lang.String
getUserIdentifier()
gets the User identifierint
getVersion()
Get the Structure version numberboolean
hasExtensionContent()
indicates whether the header has extension contentint
nextCharacterSet()
void
nextCharacterSet(int value)
Sets the CCSID of the next header or message content.int
nextEncoding()
void
nextEncoding(int value)
Sets the numeric encoding of the next header or message content.java.lang.String
nextFormat()
void
nextFormat(java.lang.String value)
Sets the format of the next header or message content.void
setAccountingToken(byte[] value)
sets the Accounting tokenvoid
setApplIdentityData(java.lang.String value)
sets the Application data relating to identityvoid
setApplOriginData(java.lang.String value)
sets the Application data relating to originvoid
setBackoutCount(int value)
sets the Backout countervoid
setCodedCharSetId(int value)
Set the Character set identifier of data that follows.void
setCorrelId(byte[] value)
sets the Correlation identifiervoid
setEncoding(int value)
Set the numeric encoding of the data that follows.void
setExpiry(int value)
sets the Message lifetimevoid
setFeedback(int value)
sets the Feedback or reason codevoid
setFormat(java.lang.String value)
sets the Format name of message datavoid
setMsgId(byte[] value)
sets the Message identifiervoid
setMsgType(int value)
sets the Message typevoid
setPersistence(int value)
sets the Message persistencevoid
setPriority(int value)
sets the Message priorityvoid
setPutApplName(java.lang.String value)
sets the Name of application that put the messagevoid
setPutApplType(int value)
sets the Type of application that put the messagevoid
setPutDate(java.lang.String value)
sets the Date when message was putvoid
setPutDateTime(long millis)
sets the Date and Time when message was putvoid
setPutTime(java.lang.String value)
sets the Time when message was putvoid
setReplyToQ(java.lang.String value)
sets the Name of reply queuevoid
setReplyToQMgr(java.lang.String value)
sets the Name of reply queue managervoid
setReport(int value)
sets the Options for report messagesvoid
setUserIdentifier(java.lang.String value)
sets the User identifier-
Methods inherited from class com.ibm.mq.headers.internal.Header
characterSet, encoding, fields, getBytesValue, getCharValue, getCharValue, getIntValue, getJmqiEnv, getStringValue, getValue, headerType, read, read, read, setBytesValue, setCharValue, setCharValue, setIntValue, setStringValue, setValue, size, store, store, toString, type, validate, write, write
-
-
-
-
Field Detail
-
SIZE
public static final int SIZE
size of an MQMD1 Header in bytes- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MQMD1
public MQMD1()
Constructs an MQMD1 instance with default field values.
-
MQMD1
public MQMD1(java.io.DataInput message) throws MQDataException, java.io.IOException
Constructs an MQMD1 instance populated from an byte stream representing an MQ Message as stored in the queue.This is not suitable for application to an MQMessage object - create an empty MQMD1 object and use the copyfrom(com.ibm.mq.MQMD) method in this instance
- Parameters:
message
- the message to read- Throws:
MQDataException
- if the message content does not yield a valid MQMD1 stucturejava.io.IOException
- if there is a problem reading the message content
-
MQMD1
public MQMD1(java.io.DataInput message, int encoding, int characterSet) throws MQDataException, java.io.IOException
Constructs an MQMD1 instance populated from a DataInput source.- Parameters:
message
- the MQMessage or other DataInput source to readencoding
- the initial numeric encoding of the data in the messagecharacterSet
- the initial CCSID of the data in the message- Throws:
MQDataException
- if the message content does not yield a valid MQMD1 stucturejava.io.IOException
- if there is a problem reading the message content
-
-
Method Detail
-
getStrucId
public java.lang.String getStrucId()
Get the structure identifier; the value will be MQMD_STRUC_ID- Returns:
- the structure identifier
-
getVersion
public int getVersion()
Get the Structure version number- Returns:
- the Structure version number
-
getReport
public int getReport()
gets the Options for report messages- Returns:
- the Options for report messages
-
setReport
public void setReport(int value)
sets the Options for report messages- Parameters:
value
- the Options for report messages
-
getMsgType
public int getMsgType()
gets the Message type- Returns:
- the Message type
-
setMsgType
public void setMsgType(int value)
sets the Message type- Parameters:
value
- the Message type
-
getExpiry
public int getExpiry()
gets the Message lifetime- Returns:
- the Message lifetime
-
setExpiry
public void setExpiry(int value)
sets the Message lifetime- Parameters:
value
- the Message lifetime
-
getFeedback
public int getFeedback()
gets the Feedback or reason code- Returns:
- the Feedback or reason code
-
setFeedback
public void setFeedback(int value)
sets the Feedback or reason code- Parameters:
value
- the Feedback or reason code
-
getEncoding
public int getEncoding()
Get the numeric encoding of the data that follows.- Returns:
- the numeric encoding. A combination of MQENC_* values.
-
setEncoding
public void setEncoding(int value)
Set the numeric encoding of the data that follows.- Parameters:
value
- the numeric encoding. A combination of MQENC_* values.
-
getCodedCharSetId
public int getCodedCharSetId()
Get the Character set identifier of data that follows.- Returns:
- the Character set identifier.
-
setCodedCharSetId
public void setCodedCharSetId(int value)
Set the Character set identifier of data that follows.- Parameters:
value
- the Character set identifier.
-
getFormat
public java.lang.String getFormat()
gets the Format name of message data- Returns:
- the Format name of message data
-
setFormat
public void setFormat(java.lang.String value)
sets the Format name of message data- Parameters:
value
- the Format name of message data
-
getPriority
public int getPriority()
get the Message priority- Returns:
- the Message priority
-
setPriority
public void setPriority(int value)
sets the Message priority- Parameters:
value
- the Message priority
-
getPersistence
public int getPersistence()
gets the Message persistence- Returns:
- the Message persistence
-
setPersistence
public void setPersistence(int value)
sets the Message persistence- Parameters:
value
- the Message persistence
-
getMsgId
public byte[] getMsgId()
gets the Message identifier- Returns:
- the Message identifier
-
setMsgId
public void setMsgId(byte[] value)
sets the Message identifier- Parameters:
value
- the Message identifier
-
getCorrelId
public byte[] getCorrelId()
gets the Correlation identifier- Returns:
- the Correlation identifier
-
setCorrelId
public void setCorrelId(byte[] value)
sets the Correlation identifier- Parameters:
value
- the Correlation identifier
-
getBackoutCount
public int getBackoutCount()
gets the Backout counter- Returns:
- the Backout counter
-
setBackoutCount
public void setBackoutCount(int value)
sets the Backout counter- Parameters:
value
- the Backout counter
-
getReplyToQ
public java.lang.String getReplyToQ()
gets the Name of reply queue- Returns:
- the Name of reply queue
-
setReplyToQ
public void setReplyToQ(java.lang.String value)
sets the Name of reply queue- Parameters:
value
- the Name of reply queue
-
getReplyToQMgr
public java.lang.String getReplyToQMgr()
gets the Name of reply queue manager- Returns:
- the Name of reply queue manager
-
setReplyToQMgr
public void setReplyToQMgr(java.lang.String value)
sets the Name of reply queue manager- Parameters:
value
- the Name of reply queue manager
-
getUserIdentifier
public java.lang.String getUserIdentifier()
gets the User identifier- Returns:
- the User identifier
-
setUserIdentifier
public void setUserIdentifier(java.lang.String value)
sets the User identifier- Parameters:
value
- the User identifier
-
getAccountingToken
public byte[] getAccountingToken()
gets the Accounting token- Returns:
- the Accounting token
-
setAccountingToken
public void setAccountingToken(byte[] value)
sets the Accounting token- Parameters:
value
- the Accounting token
-
getApplIdentityData
public java.lang.String getApplIdentityData()
gets the Application data relating to identity- Returns:
- the Application data relating to identity
-
setApplIdentityData
public void setApplIdentityData(java.lang.String value)
sets the Application data relating to identity- Parameters:
value
- the Application data relating to identity
-
getPutApplType
public int getPutApplType()
gets the Type of application that put the message- Returns:
- the Type of application that put the message
-
setPutApplType
public void setPutApplType(int value)
sets the Type of application that put the message- Parameters:
value
- the Type of application that put the message
-
getPutApplName
public java.lang.String getPutApplName()
gets the Name of application that put the message- Returns:
- the Name of application that put the message
-
setPutApplName
public void setPutApplName(java.lang.String value)
sets the Name of application that put the message- Parameters:
value
- the Name of application that put the message
-
getPutDate
public java.lang.String getPutDate()
gets the Date when message was put- Returns:
- the Date when message was put
-
setPutDate
public void setPutDate(java.lang.String value)
sets the Date when message was put- Parameters:
value
- the Date when message was put
-
getPutTime
public java.lang.String getPutTime()
gets the Time when message was put- Returns:
- the Time when message was put
-
setPutTime
public void setPutTime(java.lang.String value)
sets the Time when message was put- Parameters:
value
- the Time when message was put
-
getPutDateTime
public long getPutDateTime()
gets the Date and Time when message was put- Returns:
- the Date and Time when message was put, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT
-
setPutDateTime
public void setPutDateTime(long millis)
sets the Date and Time when message was put- Parameters:
millis
- the Date and Time when message was put, represented as the number of milliseconds since January 1, 1970, 00:00:00 GMT
-
getApplOriginData
public java.lang.String getApplOriginData()
gets the Application data relating to origin- Returns:
- the Application data relating to origin
-
setApplOriginData
public void setApplOriginData(java.lang.String value)
sets the Application data relating to origin- Parameters:
value
- the Application data relating to origin
-
nextEncoding
public int nextEncoding()
- Specified by:
nextEncoding
in interfaceMQChainable
- Returns:
- the numeric encoding of the next header or message content.
- See Also:
MQChainable.nextEncoding()
-
nextEncoding
public void nextEncoding(int value)
Description copied from interface:MQChainable
Sets the numeric encoding of the next header or message content.- Specified by:
nextEncoding
in interfaceMQChainable
- See Also:
MQChainable.nextEncoding(int)
-
nextCharacterSet
public int nextCharacterSet()
- Specified by:
nextCharacterSet
in interfaceMQChainable
- Returns:
- the CCSID of the next header or message content.
- See Also:
MQChainable.nextCharacterSet()
-
nextCharacterSet
public void nextCharacterSet(int value)
Description copied from interface:MQChainable
Sets the CCSID of the next header or message content.- Specified by:
nextCharacterSet
in interfaceMQChainable
- See Also:
MQChainable.nextCharacterSet(int)
-
nextFormat
public java.lang.String nextFormat()
- Specified by:
nextFormat
in interfaceMQChainable
- Returns:
- the format of the next header or message content.
- See Also:
MQChainable.nextFormat()
-
nextFormat
public void nextFormat(java.lang.String value)
Description copied from interface:MQChainable
Sets the format of the next header or message content.- Specified by:
nextFormat
in interfaceMQChainable
- See Also:
MQChainable.nextFormat(java.lang.String)
-
format
public java.lang.String format()
- Specified by:
format
in interfaceMQChainable
- Returns:
- the format associated with this header object or message content.
- See Also:
MQChainable.format()
-
hasExtensionContent
public boolean hasExtensionContent()
indicates whether the header has extension content- Returns:
- true or false as appropriate
-
copyFrom
public void copyFrom(MQMD md)
duplicate the content of an MQMD header into this header- Parameters:
md
- - the header to copy
-
copyTo
public void copyTo(MQMD md) throws MQDataException
duplicate the content of this header into an MQMD header- Parameters:
md
- - the header to copy into- Throws:
MQDataException
-
-