ImqDeadLetterHeader

Figure 8. ImqDeadLetterHeader class

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

This class encapsulates specific features of the MQDLH data structure (see Table 10). Objects of this class are typically used by an application that encounters an unprocessable message. A new message comprising a dead-letter header and the unprocessable message content is placed on the dead-letter queue, and the unprocessable message is discarded.

Other relevant classes

ImqHeader (see ImqHeader)

ImqItem (see ImqItem)

ImqMessage (see ImqMessage)

ImqString (see ImqString)

Object attributes

dead-letter reason code
The reason the message arrived on the dead-letter queue. The initial value is MQRC_NONE.

destination queue manager name
The name of the original destination queue manager. The name is a string of length MQ_Q_MGR_NAME_LENGTH. Its initial value is null.

destination queue name
The name of the original destination queue. The name is a string of length MQ_Q_NAME_LENGTH. Its initial value is null.

put application name
The name of the application that put the message on the dead-letter queue. The name is a string of length MQ_PUT_APPL_NAME_LENGTH. Its initial value is null.

put application type
The type of application that put the message on the dead-letter queue. The initial value is zero.

put date
The date when the message was put on the dead-letter queue. The date is a string of length MQ_PUT_DATE_LENGTH. Its initial value is a null string.

put time
The time when the message was put on the dead-letter queue. The time is a string of length MQ_PUT_TIME_LENGTH. Its initial value is a null string.

Constructors

ImqDeadLetterHeader( );
The default constructor.

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

Overloaded "ImqItem" methods

virtual ImqBoolean copyOut( ImqMessage & msg );
Inserts an MQDLH data structure into the message buffer at the beginning, moving existing message data further along. Sets the msg format to MQFMT_DEAD_LETTER_HEADER.

See the ImqHeader class method description on page "ImqHeader" for further details.

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

To be successful, the ImqMessage format must be MQFMT_DEAD_LETTER_HEADER.

See the ImqHeader class method description on page "ImqHeader" for further details.

Object methods (public)

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

MQLONG deadLetterReasonCode( ) const ;
Returns the dead-letter reason code.

void setDeadLetterReasonCode( const MQLONG reason );
Sets the dead-letter reason code.

ImqString destinationQueueManagerName( ) const ;
Returns the destination queue manager name, stripped of any trailing blanks.

void setDestinationQueueManagerName( const char * name );
Sets the destination queue manager name. Data longer than MQ_Q_MGR_NAME_LENGTH (48 characters) is truncated.

ImqString destinationQueueName( ) const ;
Returns a copy of the destination queue name, stripped of any trailing blanks.

void setDestinationQueueName( const char * name );
Sets the destination queue name. Data longer than MQ_Q_NAME_LENGTH (48 characters) is truncated.

ImqString putApplicationName( ) const ;
Returns a copy of the put application name, stripped of any trailing blanks.

void setPutApplicationName( const char * name = 0 );
Sets the put application name. Data longer than MQ_PUT_APPL_NAME_LENGTH (28 characters) is truncated.

MQLONG putApplicationType( ) const ;
Returns the put application type.

void setPutApplicationType( const MQLONG type = MQAT_NO_CONTEXT );
Sets the put application type.

ImqString putDate( ) const ;
Returns a copy of the put date, stripped of any trailing blanks.

void setPutDate( const char * date = 0 );
Sets the put date. Data longer than MQ_PUT_DATE_LENGTH (8 characters) is truncated.

ImqString putTime( ) const ;
Returns a copy of the put time, stripped of any trailing blanks.

void setPutTime( const char * time = 0 );
Sets the put time. Data longer than MQ_PUT_TIME_LENGTH (8 characters) is truncated.

Object data (protected)

MQDLH omqdlh
The MQDLH data structure.

Reason codes

MQRC_INCONSISTENT_FORMAT

MQRC_STRUC_ID_ERROR

MQRC_ENCODING_ERROR



© IBM Corporation 2001. All Rights Reserved