ImqTrigger C++ class
This class encapsulates the MQTM (trigger message) data structure.
Objects of this class are typically used by a trigger monitor program. The task of a trigger monitor program is to wait for these particular messages and act on them to ensure that other IBM MQ applications are started when messages are waiting for them.
See the IMQSTRG sample program for a usage example.
- Object attributes
- Constructors
- Overloaded ImqItem methods
- Object methods (public)
- Object data (protected)
- Reason codes
Object attributes
- application id
- Identity of the application that sent the message. The initial value is a null string.
- application type
- Type of application that sent the message. The initial value is zero. The following additional values are possible:
- MQAT_AIX
- MQAT_CICS
- MQAT_DOS
- MQAT_IMS
- MQAT_MVS
- MQAT_NOTES_AGENT
- MQAT_OS2
- MQAT_OS390
- MQAT_OS400
- MQAT_UNIX
- MQAT_WINDOWS
- MQAT_WINDOWS_NT
- MQAT_USER_FIRST
- MQAT_USER_LAST
- environment data
- Environment data for the process. The initial value is a null string.
- process name
- Process name. The initial value is a null string.
- queue name
- Name of the queue to be started. The initial value is a null string.
- trigger data
- Trigger data for the process. The initial value is a null string.
- user data
- User data for the process. The initial value is a null string.
Constructors
- ImqTrigger( );
- The default constructor.
- ImqTrigger( const ImqTrigger & trigger );
- The copy constructor.
Overloaded ImqItem methods
- virtual ImqBoolean copyOut ( ImqMessage & msg );
- Writes an MQTM data structure to the message buffer, replacing any existing content. Sets the msg format to MQFMT_TRIGGER.
See the ImqItem class method description at ImqItem C++ class for further details.
- virtual ImqBoolean pasteIn ( ImqMessage & msg );
- Reads an MQTM data structure from the message buffer.
To be successful, the ImqMessage format must be MQFMT_TRIGGER.
See the ImqItem class method description at ImqItem C++ class for further details.
Object methods (public)
- void operator = ( const ImqTrigger & trigger );
- Copies instance data from trigger, replacing the existing instance data.
- ImqString applicationId ( ) const ;
- Returns a copy of the application id.
- void setApplicationId ( const char * id );
- Sets the application id.
- MQLONG applicationType ( ) const ;
- Returns the application type.
- void setApplicationType ( const MQLONG type );
- Sets the application type.
- ImqBoolean copyOut ( MQTMC2 * ptmc2 );
- Encapsulates the MQTM data structure, which is the one received on initiation queues. Fills in an equivalent MQTMC2 data structure provided by the caller, and sets the QMgrName field (which is not present in the MQTM data structure) to all blanks. The MQTMC2 data structure is traditionally used as a parameter to applications started by a trigger monitor. This method returns TRUE if successful.
- ImqString environmentData ( ) const ;
- Returns a copy of the environment data.
- void setEnvironmentData ( const char * data );
- Sets the environment data.
- ImqString processName ( ) const ;
- Returns a copy of the process name.
- void setProcessName ( const char * name );
- Sets the process name, padded with blanks to 48 characters.
- ImqString queueName ( ) const ;
- Returns a copy of the queue name.
- void setQueueName ( const char * name );
- Sets the queue name, padding with blanks to 48 characters.
- ImqString triggerData ( ) const ;
- Returns a copy of the trigger data.
- void setTriggerData ( const char * data );
- Sets the trigger data.
- ImqString userData ( ) const ;
- Returns a copy of the user data.
- void setUserData ( const char * data );
- Sets the user data.
Object data (protected)
- MQTM omqtm
- The MQTM data structure.
Reason codes
- MQRC_NULL_POINTER
- MQRC_INCONSISTENT_FORMAT
- MQRC_ENCODING_ERROR
- MQRC_STRUC_ID_ERROR
Parent topic: IBM MQ C++ classes