Package 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
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ibm.mq.headers.MQHeader
MQHeader.Field -
Field Summary
FieldsFields inherited from class com.ibm.mq.headers.internal.Header
DEFAULT_CCSID, DEFAULT_ENCODING, delegateFields inherited from class com.ibm.mq.jmqi.JmqiObject
COMP_JM, COMP_JN, COMP_JO -
Constructor Summary
ConstructorsConstructorDescriptionMQMD1()Constructs an MQMD1 instance with default field values.Constructs an MQMD1 instance populated from an byte stream representing an MQ Message as stored in the queue.Constructs an MQMD1 instance populated from a DataInput source. -
Method Summary
Modifier and TypeMethodDescriptionvoidduplicate the content of an MQMD header into this headervoidduplicate the content of this header into an MQMD headerformat()byte[]gets the Accounting tokengets the Application data relating to identitygets the Application data relating to originintgets the Backout counterintGet the Character set identifier of data that follows.byte[]gets the Correlation identifierintGet the numeric encoding of the data that follows.intgets the Message lifetimeintgets the Feedback or reason codegets the Format name of message databyte[]getMsgId()gets the Message identifierintgets the Message typeintgets the Message persistenceintget the Message prioritygets the Name of application that put the messageintgets the Type of application that put the messagegets the Date when message was putlonggets the Date and Time when message was putgets the Time when message was putgets the Name of reply queuegets the Name of reply queue managerintgets the Options for report messagesGet the structure identifier; the value will be MQMD_STRUC_IDgets the User identifierintGet the Structure version numberbooleanindicates whether the header has extension contentintvoidnextCharacterSet(int value) Sets the CCSID of the next header or message content.intvoidnextEncoding(int value) Sets the numeric encoding of the next header or message content.voidnextFormat(String value) Sets the format of the next header or message content.voidsetAccountingToken(byte[] value) sets the Accounting tokenvoidsetApplIdentityData(String value) sets the Application data relating to identityvoidsetApplOriginData(String value) sets the Application data relating to originvoidsetBackoutCount(int value) sets the Backout countervoidsetCodedCharSetId(int value) Set the Character set identifier of data that follows.voidsetCorrelId(byte[] value) sets the Correlation identifiervoidsetEncoding(int value) Set the numeric encoding of the data that follows.voidsetExpiry(int value) sets the Message lifetimevoidsetFeedback(int value) sets the Feedback or reason codevoidsets the Format name of message datavoidsetMsgId(byte[] value) sets the Message identifiervoidsetMsgType(int value) sets the Message typevoidsetPersistence(int value) sets the Message persistencevoidsetPriority(int value) sets the Message priorityvoidsetPutApplName(String value) sets the Name of application that put the messagevoidsetPutApplType(int value) sets the Type of application that put the messagevoidsetPutDate(String value) sets the Date when message was putvoidsetPutDateTime(long millis) sets the Date and Time when message was putvoidsetPutTime(String value) sets the Time when message was putvoidsetReplyToQ(String value) sets the Name of reply queuevoidsetReplyToQMgr(String value) sets the Name of reply queue managervoidsetReport(int value) sets the Options for report messagesvoidsetUserIdentifier(String value) sets the User identifierMethods 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, writeMethods inherited from class com.ibm.mq.jmqi.JmqiObject
getJmqiEnvironment
-
Field Details
-
SIZE
public static final int SIZEsize of an MQMD1 Header in bytes- See Also:
-
-
Constructor Details
-
MQMD1
public MQMD1()Constructs an MQMD1 instance with default field values. -
MQMD1
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 stuctureIOException- if there is a problem reading the message content
-
MQMD1
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 stuctureIOException- if there is a problem reading the message content
-
-
Method Details
-
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
gets the Format name of message data- Returns:
- the Format name of message data
-
setFormat
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
gets the Name of reply queue- Returns:
- the Name of reply queue
-
setReplyToQ
sets the Name of reply queue- Parameters:
value- the Name of reply queue
-
getReplyToQMgr
gets the Name of reply queue manager- Returns:
- the Name of reply queue manager
-
setReplyToQMgr
sets the Name of reply queue manager- Parameters:
value- the Name of reply queue manager
-
getUserIdentifier
gets the User identifier- Returns:
- the User identifier
-
setUserIdentifier
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
gets the Application data relating to identity- Returns:
- the Application data relating to identity
-
setApplIdentityData
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
gets the Name of application that put the message- Returns:
- the Name of application that put the message
-
setPutApplName
sets the Name of application that put the message- Parameters:
value- the Name of application that put the message
-
getPutDate
gets the Date when message was put- Returns:
- the Date when message was put
-
setPutDate
sets the Date when message was put- Parameters:
value- the Date when message was put
-
getPutTime
gets the Time when message was put- Returns:
- the Time when message was put
-
setPutTime
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
gets the Application data relating to origin- Returns:
- the Application data relating to origin
-
setApplOriginData
sets the Application data relating to origin- Parameters:
value- the Application data relating to origin
-
nextEncoding
public int nextEncoding()- Specified by:
nextEncodingin interfaceMQChainable- Returns:
- the numeric encoding of the next header or message content.
- See Also:
-
nextEncoding
public void nextEncoding(int value) Description copied from interface:MQChainableSets the numeric encoding of the next header or message content.- Specified by:
nextEncodingin interfaceMQChainable- Parameters:
value- numeric encoding- See Also:
-
nextCharacterSet
public int nextCharacterSet()- Specified by:
nextCharacterSetin interfaceMQChainable- Returns:
- the CCSID of the next header or message content.
- See Also:
-
nextCharacterSet
public void nextCharacterSet(int value) Description copied from interface:MQChainableSets the CCSID of the next header or message content.- Specified by:
nextCharacterSetin interfaceMQChainable- Parameters:
value- character set- See Also:
-
nextFormat
- Specified by:
nextFormatin interfaceMQChainable- Returns:
- the format of the next header or message content.
- See Also:
-
nextFormat
Description copied from interface:MQChainableSets the format of the next header or message content.- Specified by:
nextFormatin interfaceMQChainable- Parameters:
value- format of the header or message content- See Also:
-
format
- Specified by:
formatin interfaceMQChainable- Returns:
- the format associated with this header object or message content.
- See Also:
-
hasExtensionContent
public boolean hasExtensionContent()indicates whether the header has extension content- Returns:
- true or false as appropriate
-
copyFrom
duplicate the content of an MQMD header into this header- Parameters:
md- - the header to copy
-
copyTo
duplicate the content of this header into an MQMD header- Parameters:
md- - the header to copy into- Throws:
MQDataException
-