ImqWorkHeader

Figure 26. ImqWorkHeader class

A Booch class diagram showing the ImqWorkHeader class and its parent class, ImqHeader.

This class encapsulates specific features of the MQWIH data structure (see Table 26). Objects of this class are used by applications putting messages to the queue managed by the z/OS Workload Manager.

Other relevant classes

ImqBinary (see ImqBinary)

ImqHeader (see ImqHeader)

ImqItem (see ImqItem)

ImqMessage (see ImqMessage)

ImqString (see ImqString)

Object attributes

message token
Message token for the z/OS Workload Manager, of length MQ_MSG_TOKEN_LENGTH. The initial value is MQMTOK_NONE.

service name
The 32-character name of a process. The name is initially blanks.

service step
The 8-character name of a step within the process. The name is initially blanks.

Constructors

ImqWorkHeader( );
The default constructor.

ImqWorkHeader( const ImqWorkHeader & header );
The copy constructor.

Overloaded "ImqItem" methods

virtual ImqBoolean copyOut( ImqMessage & msg );
Inserts an MQWIH data structure into the beginning of the message buffer, moving the existing message data further along, and sets the msg format to MQFMT_WORK_INFO_HEADER.

See the parent class method description for more details.

virtual ImqBoolean pasteIn( ImqMessage & msg );
Reads an MQWIH data structure from the message buffer.

To be successful, the encoding of the msg object should be MQENC_NATIVE. It is recommended that messages be retrieved with MQGMO_CONVERT to MQENC_NATIVE.

The ImqMessage format must be MQFMT_WORK_INFO_HEADER.

See the parent class method description for more details.

Object methods (public)

void operator = ( const ImqWorkHeader & header );
Instance data is copied from header, replacing the existing instance data.

ImqBinary messageToken ( ) const;
Returns the message token.

ImqBoolean setMessageToken( const ImqBinary & token );
Sets the message token. The data length of token must be either zero or MQ_MSG_TOKEN_LENGTH. It returns TRUE if successful.

void setMessageToken( const MQBYTE16 token = 0 );
Sets the message token. token may be zero, which is the same as specifying MQMTOK_NONE. If token is nonzero, then it must address MQ_MSG_TOKEN_LENGTH bytes of binary data.

When using predefined values such as MQMTOK_NONE, it may be necessary to make a cast to ensure a signature match; for example, (MQBYTE *)MQMTOK_NONE.

ImqString serviceName ( ) const;
Returns the service name, including trailing blanks.

void setServiceName( const char * name );
Sets the service name.

ImqString serviceStep ( ) const;
Returns the service step, including trailing blanks.

void setServiceStep( const char * step );
Sets the service step.

Object data (protected)

MQWIH omqwih
The MQWIH data structure.

Reason codes

MQRC_BINARY_DATA_LENGTH_ERROR



© IBM Corporation 2001. All Rights Reserved