ImqChannel C++ class
This class encapsulates a channel definition (MQCD) for use during execution of the Manager::connect method, for custom client connections.
See the description of the Manager::connect method, and Sample program HELLO WORLD (imqwrld.cpp), for more details.
Not all the listed methods are applicable to all platforms. See the descriptions of the DEFINE CHANNEL and ALTER CHANNEL commands for more information.
The ImqChannel class is not supported on z/OSĀ®.
Object attributes
- batch heart-beat
- The number of milliseconds between checks that a remote channel is active. The initial value is 0.
- channel name
- The name of the channel. The initial value is null.
- connection name
- The name of the connection. For example, the IP address of a host computer. The initial value is null.
- header compression
- The list of header data compression techniques supported by the channel. The initial values are all set to MQCOMPRESS_NOT_AVAILABLE.
- heart-beat interval
- The number of seconds between checks that a connection is still working. The initial value is 300.
- keep alive interval
- The number of seconds passed to the communications stack specifying the keep alive timing for the channel. The initial value is MQKAI_AUTO.
- local address
- The local communications address for the channel.
- maximum message length
- The maximum length of message supported by the channel in a single communication. The initial value is 4 194 304.
- message compression
- The list of message data compression techniques supported by the channel. The initial values are all set to MQCOMPRESS_NOT_AVAILABLE.
- mode name
- The name of the mode. The initial value is null.
- password
- A password supplied for connection authentication. The initial value is null.
- receive exit count
- The number of receive exits. The initial value is zero. This attribute is read-only.
- receive exit names
- The names of receive exits.
- receive user data
- Data associated with receive exits.
- security exit name
- The name of a security exit to be invoked on the server side of the connection. The initial value is null.
- security user data
- Data to be passed to the security exit. The initial value is null.
- send exit count
- The number of send exits. The initial value is zero. This attribute is read-only.
- send exit names
- The names of send exits.
- send user data
- Data associated with send exits.
- SSL CipherSpec
- CipherSpec for use with TLS.
- SSL client authentication type
- Client authentication type for use with TLS.
- SSL peer name
- Peer name for use with TLS.
- transaction program name
- The name of the transaction program. The initial value is null.
- transport type
- The transport type of the connection. The initial value is MQXPT_LU62.
- user id
- A user identifier supplied for authorization. The initial value is null.
Constructors
- ImqChannel( ) ;
- The default constructor.
- ImqChannel( const ImqChannel & channel );
- The copy constructor.
Object methods (public)
- void operator = ( const ImqChannel & channel );
- Copies instance data from channel, replacing any existing instance data.
- MQLONG batchHeartBeat( ) const ;
- Returns the batch heart-beat.
- ImqBoolean setBatchHeartBeat( const MQLONG heartbeat = 0L );
- Sets the batch heart-beat. This method returns TRUE if successful.
- ImqString channelName( ) const ;
- Returns the channel name.
- ImqBoolean setChannelName( const char * name = 0 );
- Sets the channel name. This method returns TRUE if successful.
- ImqString connectionName( ) const ;
- Returns the connection name.
- ImqBoolean setConnectionName( const char * name = 0 );
- Sets the connection name. This method returns TRUE if successful.
- size_t headerCompressionCount( ) const ;
- Returns the supported header data compression techniques count.
- ImqBoolean headerCompression( const size_t count, MQLONG compress [ ] ) const ;
- Returns copies of the supported header data compression techniques in compress. This method returns TRUE if successful.
- ImqBoolean setHeaderCompression( const size_t count, const MQLONG compress [ ] );
-
Sets the supported header data compression techniques to compress.
Sets the supported header data compression techniques count to count.
This method returns TRUE if successful.
- MQLONG heartBeatInterval( ) const ;
- Returns the heart-beat interval.
- ImqBoolean setHeartBeatInterval( const MQLONG interval = 300L );
- Sets the heart-beat interval. This method returns TRUE if successful.
- MQLONG keepAliveInterval( ) const ;
- Returns the keep alive interval.
- ImqBoolean setKeepAliveInterval( const MQLONG interval = MQKAI_AUTO );
- Sets the keep alive interval. This method returns TRUE if successful.
- ImqString localAddress() const ;
- Returns the local address.
- ImqBoolean setLocalAddress ( const char * address = 0 );
- Sets the local address. This method returns TRUE if successful.
- MQLONG maximumMessageLength( ) const ;
- Returns the maximum message length.
- ImqBoolean setMaximumMessageLength( const MQLONG length = 4194304L );
- Sets the maximum message length. This method returns TRUE if successful.
- size_t messageCompressionCount( ) const ;
- Returns the supported message data compression techniques count.
- ImqBoolean messageCompression( const size_t count, MQLONG compress [ ]) const ;
- Returns copies of the supported message data compression techniques in compress. This method returns TRUE if successful.
- ImqBoolean setMessageCompression( const size_t count, const MQLONG compress [ ] );
-
Sets the supported message data compression techniques to compress.
Sets the supported message data compression techniques count to count.
This method returns TRUE if successful.
- ImqString modeName( ) const ;
- Returns the mode name.
- ImqBoolean setModeName( const char * name = 0 );
- Sets the mode name. This method returns TRUE if successful.
- ImqString password( ) const ;
- Returns the password.
- ImqBoolean setPassword( const char * password = 0 );
- Sets the password. This method returns TRUE if successful.
- size_t receiveExitCount( ) const ;
- Returns the receive exit count.
- ImqString receiveExitName( );
- Returns the first of the receive exit names, if any. If the receive exit count is zero, it returns an empty string.
- ImqBoolean receiveExitNames( const size_t count, ImqString * names [ ] );
- Returns copies of the receive exit names in names. Sets any names in excess of receive exit count to null strings. This method returns TRUE if successful.
- ImqBoolean setReceiveExitName( const char * name = 0 );
- Sets the receive exit names to the single name. name can be blank or null. Sets the receive exit count to either 1 or zero. Clears the receive user data. This method returns TRUE if successful.
- ImqBoolean setReceiveExitNames( const size_t count, const char * names [ ] );
- Sets the receive exit names to names. Individual names values must not be blank or null. Sets the receive exit count to count. Clears the receive user data. This method returns TRUE if successful.
- ImqBoolean setReceiveExitNames( const size_t count, const ImqString * names [ ] );
- Sets the receive exit names to names. Individual names values must not be blank or null. Sets the receive exit count to count. Clears the receive user data. This method returns TRUE if successful.
- ImqString receiveUserData( );
- Returns the first of the receive user data items, if any. If the receive exit count is zero, returns an empty string.
- ImqBoolean receiveUserData( const size_t count, ImqString * data [ ] );
- Returns copies of the receive user data items in data. Sets any data in excess of receive exit count to null strings. This method returns TRUE if successful.
- ImqBoolean setReceiveUserData( const char * data = 0 );
- Sets the receive user data to the single item data. If data is not null, receive exit count must be at least 1. This method returns TRUE if successful.
- ImqBoolean setReceiveUserData( const size_t count, const char * data [ ] );
- Sets the receive user data to data. count must be no greater than the receive exit count. This method returns TRUE if successful.
- ImqBoolean setReceiveUserData( const size_t count, const ImqString * data [ ] );
- Sets the receive user data to data. count must be no greater than the receive exit count. This method returns TRUE if successful.
- ImqString securityExitName( ) const ;
- Returns the security exit name.
- ImqBoolean setSecurityExitName( const char * name = 0 );
- Sets the security exit name. This method returns TRUE if successful.
- ImqString securityUserData( ) const ;
- Returns the security user data.
- ImqBoolean setSecurityUserData( const char * data = 0 );
- Sets the security user data. This method returns TRUE if successful.
- size_t sendExitCount( ) const ;
- Returns the send exit count.
- ImqString sendExitName( );
- Returns the first of the send exit names, if any. Returns an empty string if the send exit count is zero.
- ImqBoolean sendExitNames( const size_t count, ImqString * names [ ] );
- Returns copies of the send exit names in names. Sets any names in excess of send exit count to null strings. This method returns TRUE if successful.
- ImqBoolean setSendExitName( const char * name = 0 );
- Sets the send exit names to the single name. name can be blank or null. Sets the send exit count to either 1 or zero. Clears the send user data. This method returns TRUE if successful
- ImqBoolean setSendExitNames( const size_t count, const char * names [ ] );
- Sets the send exit names to names. Individual names values must not be blank or null. Sets the send exit count to count. Clears the send user data. This method returns TRUE if successful.
- ImqBoolean setSendExitNames( const size_t count, const ImqString * names [ ] );
- Sets the send exit names to names. Individual names values must not be blank or null. Sets the send exit count to count. Clears the send user data. This method returns TRUE if successful.
- ImqString sendUserData( );
- Returns the first of the send user data items, if any. , Returns an empty string if the send exit count is zero.
- ImqBoolean sendUserData( const size_t count, ImqString * data [ ] );
- Returns copies of the send user data items in data. Sets any data in excess of send exit count to null strings. This method returns TRUE if successful.
- ImqBoolean setSendUserData( const char * data = 0 );
- Sets the send user data to the single item data. If data is not null, send exit count must be at least 1. This method returns TRUE if successful.
- ImqBoolean setSendUserData( const size_t count, const char * data [ ] );
- Sets the send user data to data. count must be no greater than the send exit count. This method returns TRUE if successful.
- ImqBoolean setSendUserData( const size_t count, const ImqString * data [ ] );
- Sets the send user data to data. count must be no greater than the send exit count. This method returns TRUE if successful.
- ImqString sslCipherSpecification( ) const ;
- Returns the TLS cipher specification.
- ImqBoolean setSslCipherSpecification( const char * name = 0 );
- Sets the TLS cipher specification. This method returns TRUE if successful.
- MQLONG sslClientAuthentication( ) const ;
- Returns the TLS client authentication type.
- ImqBoolean setSslClientAuthentication( const MQLONG auth = MQSCA_REQUIRED);
- Sets the TLS client authentication type. This method returns TRUE if successful.
- ImqString sslPeerName( ) const ;
- Returns the TLS peer name.
- ImqBoolean setSslPeerName( const char * name = 0 );
- Sets the TLS peer name. This method returns TRUE if successful.
- ImqString transactionProgramName( ) const ;
- Returns the transaction program name.
- ImqBoolean setTransactionProgramName( const char * name = 0 );
- Sets the transaction program name. This method returns TRUE if successful.
- MQLONG transportType( ) const ;
- Returns the transport type.
- ImqBoolean setTransportType( const MQLONG type = MQXPT_LU62 );
- Sets the transport type. This method returns TRUE if successful.
- ImqString userId( ) const ;
- Returns the user id.
- ImqBoolean setUserId( const char * id = 0 );
- Sets the user id. This method returns TRUE if successful.
Reason codes
- MQRC_DATA_LENGTH_ERROR
- MQRC_ITEM_COUNT_ERROR
- MQRC_NULL_POINTER
- MQRC_SOURCE_BUFFER_ERROR