com.ibm.mq

Class MQQueueManager



  • public class MQQueueManager
    extends MQManagedObject
    The MQQueueManager class provides a connection to a WebSphere MQ queue manager.

    An MQQueueManager object (and any queues or processes accessed through it) can be shared between multiple threads, but be aware that access to the WebSphere MQ queue manager itself is synchronized, so that only one thread can communicate with it at any one time. A call to MQQueue.get()specifying CMQC.MQGMO_WAIT(for example) will therefore block any other threads attempting to make WebSphere MQ calls using the same MQQueueManager until the get completes.

    • Constructor Summary

      Constructors 
      Constructor and Description
      MQQueueManager(java.lang.String queueManagerName)
      Creates a connection to the named queue manager.
      MQQueueManager(java.lang.String queueManagerName, java.util.Hashtable properties)
      Creates a connection to the named queue manager using a Hashtable.
      MQQueueManager(java.lang.String queueManagerName, java.util.Hashtable properties, com.ibm.mq.MQConnectionManager connectionManager)
      Creates a connection to a queue manager which overrides the settings in MQEnvironmentclass with those in the given Hashtable.
      MQQueueManager(java.lang.String queueManagerName, java.util.Hashtable properties, java.net.URL url)
      Creates a connection to the named queue manager using a channel definition table.
      MQQueueManager(java.lang.String queueManagerName, int options)
      Creates a connection to the named queue manager specifying binding options.
      MQQueueManager(java.lang.String queueManagerName, int options, com.ibm.mq.MQConnectionManager connectionManager)
      Creates a connection to a queue manager allowing binding options to be specified.
      MQQueueManager(java.lang.String queueManagerName, com.ibm.mq.MQConnectionManager connectionManager)
      Creates a connection to a named queue manager using a connection manager.
      MQQueueManager(java.lang.String queueManagerName, java.net.URL url)
      Creates a connection to the named queue manager using a channel definition table.
      MQQueueManager(java.lang.String queueManagerName, java.net.URL url, com.ibm.mq.MQConnectionManager connectionManager)
      Creates a connection to the named queue manager using a client channel definition table.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      MQDistributionList accessDistributionList(MQDistributionListItem[] items, int options)
      Creates a distribution list using the default alternative user ID.
      MQDistributionList accessDistributionList(MQDistributionListItem[] items, int options, java.lang.String id)
      Creates a distribution list.
      MQProcess accessProcess(java.lang.String processName, int openOptionsArg)
      Accesses a WebSphere MQ process on this queue manager using default queue manager name and alternative user ID values.
      MQProcess accessProcess(java.lang.String processName, int openOptionsArg, java.lang.String queueManagerName, java.lang.String alternateUserIdArg)
      Establishes access to a WebSphere MQ process on this queue manager in order to inquire about the process attributes.
      MQQueue accessQueue(java.lang.String queueName, int openOptionsArg)
      Establishes access to an WebSphere MQ queue on this queue manager using default queue manager name and alternative user ID values.
      MQQueue accessQueue(java.lang.String queueName, int openOptionsArg, java.lang.String queueManagerName, java.lang.String dynamicQueueName, java.lang.String alternateUserIdArg)
      Establishes access to a WebSphere MQ queue on this queue manager in order to get or browse messages, put messages, inquire about the attributes of the queue, or set the attributes of the queue.
      MQTopic accessTopic(MQDestination destination, java.lang.String topicName, java.lang.String topicObject, int options)
      Establishes access to a WebSphere MQ topic.
      MQTopic accessTopic(MQDestination destination, java.lang.String topicName, java.lang.String topicObject, int options, java.lang.String altUserId)
      Establishes access to a WebSphere MQ topic.
      MQTopic accessTopic(MQDestination destination, java.lang.String topicName, java.lang.String topicObject, int options, java.lang.String altUserId, java.lang.String subscriptionName)
      Establishes access to a WebSphere MQ topic.
      MQTopic accessTopic(MQDestination destination, java.lang.String topicName, java.lang.String topicObject, int options, java.lang.String altUserId, java.lang.String subscriptionName, java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
      Establishes access to a WebSphere MQ topic.
      MQTopic accessTopic(java.lang.String topicName, java.lang.String topicObject, int openAs, int options)
      Establishes access to a WebSphere MQ topic.
      MQTopic accessTopic(java.lang.String topicName, java.lang.String topicObject, int openAs, int options, java.lang.String altUserId)
      Establishes access to a WebSphere MQ topic.
      MQTopic accessTopic(java.lang.String topicName, java.lang.String topicObject, int options, java.lang.String altUserId, java.lang.String subscriptionName)
      Establishes access to a WebSphere MQ topic.
      MQTopic accessTopic(java.lang.String topicName, java.lang.String topicObject, int options, java.lang.String altUserId, java.lang.String subscriptionName, java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
      Establishes access to a WebSphere MQ topic.
      void backout()
      Indicates to the queue manager that all the message gets and puts that have occurred since the last syncpoint are to be backed out.
      void begin()
      Begins a new unit of work.
      void commit()
      Indicates to the queue manager that the application has reached a syncpoint.
      void disconnect()
      Ends the connection to the queue manager.
      MQAsyncStatus getAsyncStatus()
      Requests asynchronous error status from the queue manager.
      java.net.URL getCCDTURL()
      Returns the URL of the channel definition file, or null if it does not exist.
      int getCharacterSet()
      Gets the CCSID (Coded Character Set Identifier) of the queue manager's codeset.
      java.lang.String getCommandInputQueueName()
      Gets the name of the command input queue defined on the queue manager.
      int getCommandLevel()
      Indicates the level of system control commands supported by the queue manager.
      boolean getDistributionListCapable()
      Indicates whether the queue manager supports distribution lists.
      java.sql.Connection getJDBCConnection(javax.sql.XADataSource xads)
      Returns a Connection object for use with the JTA-JDBC support.
      java.sql.Connection getJDBCConnection(javax.sql.XADataSource xads, java.lang.String userid, java.lang.String password)
      Registers a database for coordination.
      int getMaximumMessageLength()
      Gets the maximum length of a message that the queue manager can handle.
      int getMaximumPriority()
      Gets the maximum message priority supported by the queue manager.
      int getSyncpointAvailability()
      Indicates whether the queue manager supports units of work and syncpointing with the MQQueue.get() and MQQueue.put() methods.
      boolean isConnected()
      Indicates whether this object is currently connected to a WebSphere MQ queue manager.
      void put(int type, java.lang.String destinationName, MQMessage message)
      Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.
      void put(int type, java.lang.String destinationName, MQMessage message, MQPutMessageOptions putMessageOptions)
      Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.
      void put(int type, java.lang.String destinationName, java.lang.String queueManagerName, java.lang.String topicString, MQMessage message)
      Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.
      void put(int type, java.lang.String destinationName, java.lang.String queueManagerName, java.lang.String topicString, MQMessage message, MQPutMessageOptions putMessageOptions)
      Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.
      void put(int type, java.lang.String destinationName, java.lang.String queueManagerName, java.lang.String topicString, MQMessage message, MQPutMessageOptions putMessageOptions, java.lang.String altUserId)
      Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.
      void put(java.lang.String qName, MQMessage msg)
      Puts a single message on to a (possibly unopened) queue.
      void put(java.lang.String qName, MQMessage msg, MQPutMessageOptions pmo)
      Puts a single message on to a (possibly unopened) queue.
      void put(java.lang.String qName, java.lang.String qmName, MQMessage msg)
      Puts a single message on to a (possibly unopened) queue.
      void put(java.lang.String qName, java.lang.String qmName, MQMessage msg, MQPutMessageOptions pmo)
      Puts a single message on to a (possibly unopened) queue.
      void put(java.lang.String qName, java.lang.String qmName, MQMessage msg, MQPutMessageOptions pmo, java.lang.String altUserId)
      Puts a single message onto a (possibly unopened) queue.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • isConnected

        public boolean isConnected
        Deprecated. Use the isConnected() method instead.
        Indicates whether this MQQueueManager object is currently connected to a WebSphere MQ queue manager. Use the disconnect() method to disconnect from a queue manager.
    • Constructor Detail

      • MQQueueManager

        public MQQueueManager(java.lang.String queueManagerName)
                       throws MQException
        Creates a connection to the named queue manager.

        The host name, channel name and port to use during the connection request are specified in the MQEnvironmentclass. This must be done before calling this constructor.

        The following example shows a connection to a queue manager "MYQM", running on a system with host name "fred.mq.com".

         <CODE>
         MQEnvironment.hostname = "fred.mq.com"; // host to connect to
         MQEnvironment.port = -1; // port to connect to.  If not set, this
         // defaults to 1414 for WebSphereMQ Client connections.
         MQEnvironment.channel = "channel.name"; // the CASE-SENSITIVE name of the SVRCONN channel
         // on the queue manager
         MQQueueManager qMgr = new MQQueueManager("MYQM");
         </CODE>
         

        If the queue manager name is null or blank, then a connection is made to the default queue manager.

        Parameters:
        queueManagerName - the name of the queue manager to which to connect.
        Throws:
        MQException - if there are connection problems.
      • MQQueueManager

        public MQQueueManager(java.lang.String queueManagerName,
                      java.util.Hashtable properties)
                       throws MQException
        Creates a connection to the named queue manager using a Hashtable. The Hashtable overrides the specification held in MQEnvironment.
        Parameters:
        queueManagerName - the name of the queue manager.
        properties - connection properties.
        Throws:
        MQException - if there are connection problems.
      • MQQueueManager

        public MQQueueManager(java.lang.String queueManagerName,
                      com.ibm.mq.MQConnectionManager connectionManager)
                       throws MQException
        Creates a connection to a named queue manager using a connection manager.
        Parameters:
        queueManagerName - the name of the queue manager.
        connectionManager - the connection manager that will handle this connection.
        Throws:
        MQException - if there are connection problems.
        See Also:
        MQSimpleConnectionManager
      • MQQueueManager

        public MQQueueManager(java.lang.String queueManagerName,
                      int options,
                      com.ibm.mq.MQConnectionManager connectionManager)
                       throws MQException
        Creates a connection to a queue manager allowing binding options to be specified. It also allows a connection manager to be specified.
        Parameters:
        queueManagerName - the name of the queue manager.
        options - binding options. Possible values are:
        connectionManager - the connection manager that will handle this connection.
        Throws:
        MQException - if there are connection problems.
      • MQQueueManager

        public MQQueueManager(java.lang.String queueManagerName,
                      java.util.Hashtable properties,
                      com.ibm.mq.MQConnectionManager connectionManager)
                       throws MQException
        Creates a connection to a queue manager which overrides the settings in MQEnvironmentclass with those in the given Hashtable.
        Parameters:
        queueManagerName - the name of the queue manager.
        properties - connection properties.
        connectionManager - the connection manager that will handle this connection.
        Throws:
        MQException - if there are connection problems.
      • MQQueueManager

        public MQQueueManager(java.lang.String queueManagerName,
                      java.net.URL url)
                       throws MQException
        Creates a connection to the named queue manager using a channel definition table. Using a client channel definition table enables alternative channel definitions to be defined. The constructor selects a set of definitions from the table and these are used instead of any settings held in MQEnvironmentclass when opening a channel.
        Parameters:
        queueManagerName - the queue manager that is used when selecting a channel definition. This can be in of the following forms:
        • "qMgrName", where the actual name of the required queue manager is passed in. The channel must connect to a queue manager of this name.
        • "*qMgrName", where "*" followed by the actual name of the required queue manager is passed in. The channel definition that is used must specify this queue manager name. This full name is passed onto the queueManager during a connect, but the queue manager that is ultimately connected to may not have the same name as specified here after the '*'.
        • "*" or "" or a name which consists entirely of blanks is passed in. The actual queue manager name is disregarded when a channel definition is being selected.
        url - the URL which specifies the channel definition file to be used in connecting to the queue manager.
        Throws:
        MQException - if there are connection problems.
      • MQQueueManager

        public MQQueueManager(java.lang.String queueManagerName,
                      java.util.Hashtable properties,
                      java.net.URL url)
                       throws MQException
        Creates a connection to the named queue manager using a channel definition table. Using a client channel definition table enables alternative channel definitions to be defined. The constructor selects a set of definitions from the table and these are used instead of any settings held in MQEnvironmentclass when opening a channel. Properties other than those defined by the client channel definition table may be supplied with this constructor.
        Parameters:
        queueManagerName - the queue manager that is used when selecting a channel definition. This can be in of the following forms:
        • "qMgrName", where the actual name of the required queue manager is passed in. The channel must connect to a queue manager of this name.
        • "*qMgrName", where "*" followed by the actual name of the required queue manager is passed in. The channel definition that is used must specify this queue manager name. This full name is passed onto the queueManager during a connect, but the queue manager that is ultimately connected to may not have the same name as specified here after the '*'.
        • "*" or "" or a name which consists entirely of blanks is passed in. The actual queue manager name is disregarded when a channel definition is being selected.
        properties - A hashtable of properties to be used to establish the connection with those defined in the client channel definition that is actually used. Any properties that are not valid for this type of connection will be be ignored.
        url - the URL which specifies the channel definition file to be used in connecting to the queue manager.
        Throws:
        MQException - if there are connection problems.
      • MQQueueManager

        public MQQueueManager(java.lang.String queueManagerName,
                      java.net.URL url,
                      com.ibm.mq.MQConnectionManager connectionManager)
                       throws MQException
        Creates a connection to the named queue manager using a client channel definition table. Using a client channel definition table enables alternative channel definitions to be defined. The constructor selects a set of definitions from the table and these are used instead of any settings held in MQEnvironmentclass when opening a channel.
        Parameters:
        queueManagerName - the queue manager that is used when selecting a channel definition. This can be in of the following forms:
        • "qMgrName", where the actual name of the required queue manager is passed in. The channel must connect to a queue manager of this name.
        • "*qMgrName", where "*" followed by the actual name of the required queue manager is passed in. The channel definition that is used must specify this queue manager name. This full name is passed onto the queueManager during a connect, but the queue manager that is ultimately connected to may not have the same name as specified here after the '*'.
        • "*" or "" or a name which consists entirely of blanks is passed in. The actual queue manager name is disregarded when a channel definition is being selected.
        url - the URL which specifies the channel definition file to be used in connecting to the queue manager.
        connectionManager - the connection manager.
        Throws:
        MQException - if there are connection problems.
    • Method Detail

      • getJDBCConnection

        public java.sql.Connection getJDBCConnection(javax.sql.XADataSource xads)
                                              throws MQException,
                                                     java.sql.SQLException,
                                                     javax.transaction.xa.XAException
        Returns a Connection object for use with the JTA-JDBC support.
        Parameters:
        xads - A database-specific implementation of the XADataSource interface that defines the details of the database to connect to. See the documentation for your database to determine how to create an appropriate XADataSource object to pass into this method.
        Returns:
        a connection for use with the JTA-JDBC support.
        Throws:
        MQException - if there is a WebSphere MQ failure.
        java.sql.SQLException - if there are problems getting the Connection object.
        javax.transaction.xa.XAException - if there are problems associating the connection with a unit of work
      • getJDBCConnection

        public java.sql.Connection getJDBCConnection(javax.sql.XADataSource xads,
                                            java.lang.String userid,
                                            java.lang.String password)
                                              throws MQException,
                                                     java.sql.SQLException,
                                                     javax.transaction.xa.XAException
        Registers a database for coordination. Used to create a JDBC Connection which is coordinated by the queue manager after a call to begin().
        Parameters:
        xads - database-specific implementation of the XADataSource interface that defines the details of the database. See the documentation for your database to determine how to create an appropriate XADataSource object to pass into this method.
        userid - the user ID for connecting to the database.
        password - the password for connecting to the database.
        Returns:
        connection for use with the JTA-JDBC support.
        Throws:
        MQException - if there is a WebSphere MQ failure.
        java.sql.SQLException - if there are problems getting the Connection object.
        javax.transaction.xa.XAException - if there are problems associating the connection with a unit of work
      • isConnected

        public boolean isConnected()
        Indicates whether this object is currently connected to a WebSphere MQ queue manager. Use disconnect()to disconnect from a queue manager.
        Returns:
        true if connected.
      • getCharacterSet

        public int getCharacterSet()
                            throws MQException
        Gets the CCSID (Coded Character Set Identifier) of the queue manager's codeset. This defines the character set used by the queue manager for all character string fields in the application programming interface.
        Returns:
        the CCSID.
        Throws:
        MQException - if you call this method after disconnecting from the queue manager, indicating that the connection is no longer valid.
      • getMaximumMessageLength

        public int getMaximumMessageLength()
                                    throws MQException
        Gets the maximum length of a message that the queue manager can handle. No queue can be defined with a maximum message length greater than this.
        Returns:
        The maximum message length in bytes.
        Throws:
        MQException - if you call this method after disconnecting from the queue manager, indicating that the connection is no longer valid.
      • getCommandLevel

        public int getCommandLevel()
                            throws MQException
        Indicates the level of system control commands supported by the queue manager. The set of system control commands corresponding to a particular command level varies according to the platform on which the queue manager is running. See the WebSphere MQ Application Programming Reference .
        Returns:
        values between CMQC.MQCMDL_LEVEL_1and CMQC.MQCMDL_LEVEL_600.
        Throws:
        MQException - if you call this method after disconnecting from the queue manager to indicate that the connection is no longer valid.
      • getCommandInputQueueName

        public java.lang.String getCommandInputQueueName()
                                                  throws MQException
        Gets the name of the command input queue defined on the queue manager. This is a queue to which applications can send commands, if authorised to do so.
        Returns:
        the name of the command input queue.
        Throws:
        MQException - if you call this method after disconnecting from the queue manager, indicating that the connection is no longer valid.
      • getMaximumPriority

        public int getMaximumPriority()
                               throws MQException
        Gets the maximum message priority supported by the queue manager. Priorities range from 0 (lowest) to this value.
        Returns:
        the maximum message priority.
        Throws:
        MQException - if you call this method after disconnecting from the queue manager, indicating that the connection is no longer valid.
      • getDistributionListCapable

        public boolean getDistributionListCapable()
        Indicates whether the queue manager supports distribution lists.
        Returns:
        true if distribution lists are supported.
      • disconnect

        public void disconnect()
                        throws MQException
        Ends the connection to the queue manager. All open queues and processes accessed through this queue manager are closed and become unusable. The only way to reconnect is to create a new MQQueueManager object.
        Throws:
        MQException - if the MQ disconnect call fails.
      • backout

        public void backout()
                     throws MQException
        Indicates to the queue manager that all the message gets and puts that have occurred since the last syncpoint are to be backed out. Messages sent as part of a unit of work (with the CMQC.MQPMO_SYNCPOINTflag set in the options field of MQPutMessageOptions) are deleted. Messages retrieved as part of a unit of work (with the CMQC.MQGMO_SYNCPOINTflag set in MQGetMessageOptions.options) are reinstated on the queue.
        Throws:
        MQException - if the call fails.
        See Also:
        commit()
      • begin

        public void begin()
                   throws MQException
        Begins a new unit of work. This method is only supported by WebSphere MQ in a bindings connection. It signals to the queue manager that a new unit of work is to begin.
        Throws:
        MQException - if the call fails

        The error behavour of this method changed between MQ version 6 and version 7. If called on a shared connection (the default on most platforms) on version 6 the MQException was thrown with a reason code 2121 ie MQRC_NO_EXTERNAL_PARTICIPANTS) The same error on version 7 causes a MQException to be thrown with reason 2018 (ie MQRC_HCONN_ERROR)

      • put

        public void put(java.lang.String qName,
               java.lang.String qmName,
               MQMessage msg,
               MQPutMessageOptions pmo,
               java.lang.String altUserId)
                 throws MQException
        Puts a single message onto a (possibly unopened) queue. If a send exit has been specified, it processes the message before it is sent. See the description of MQPUT1 in WebSphere MQ Application Programming Reference for more information.
        Parameters:
        qName - the name of the queue to which the message is put.
        qmName - the name of the queue manager which holds the queue.
        msg - the message to be sent.
        pmo - the put message options to use.
        altUserId - alternative user ID to use when putting the message.
        Throws:
        MQException - if the WebSphere MQ put call fails.
      • put

        public void put(java.lang.String qName,
               java.lang.String qmName,
               MQMessage msg,
               MQPutMessageOptions pmo)
                 throws MQException
        Puts a single message on to a (possibly unopened) queue. If a send exit has been specified it processes the message before it is sent.
        Parameters:
        qName - the name of the queue to which the message is put.
        qmName - the name of the queue manager that holds the queue.
        msg - the message to be sent.
        pmo - the put message options to use.
        Throws:
        MQException - if the WebSphere MQ put call fails.
      • put

        public void put(java.lang.String qName,
               java.lang.String qmName,
               MQMessage msg)
                 throws MQException
        Puts a single message on to a (possibly unopened) queue. If a send exit has been specified it processes the message before it is sent.
        Parameters:
        qName - the name of the queue to which the message is put.
        qmName - the name of the queue manager which holds the queue.
        msg - the message to be sent.
        Throws:
        MQException - if the WebSphere MQ put call fails.
      • put

        public void put(java.lang.String qName,
               MQMessage msg,
               MQPutMessageOptions pmo)
                 throws MQException
        Puts a single message on to a (possibly unopened) queue. If a send exit has been specified it processes the message before it is sent.
        Parameters:
        qName - the name of the queue to which the message is put.
        msg - the message to be sent.
        pmo - the put message options to use.
        Throws:
        MQException - if the WebSphere MQ put call fails.
      • put

        public void put(java.lang.String qName,
               MQMessage msg)
                 throws MQException
        Puts a single message on to a (possibly unopened) queue. If a send exit has been specified it processes the message before it is sent.
        Parameters:
        qName - the name of the queue to which the message is put.
        msg - the message to be sent.
        Throws:
        MQException - if the WebSphere MQ put call fails.
      • put

        public void put(int type,
               java.lang.String destinationName,
               MQMessage message)
                 throws MQException
        Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.

        When used to place messages to a queue allows you to omit the queue manager name, put message options, and alternative user ID. When used to publish messages to a topic allows you to omit the topic string, put message options and alternative user ID.

        The destinationName parameter will adopt different meanings depending upon the destination type being specified in the type parameter.

        The default options used for unspecified parameters may alter depending upon the destination type specified.

        Note that the default syncpoint is CMQC.MQPMO_NO_SYNCPOINT for all platforms.

        Parameters:
        type - The options used to control the specified destination type. Valid values are: Only one option should be specified - the values must not be combined by addition or using the bitwise OR operator.

        These options may be expanded later to include new destination types such as multicast addresses, etc.

        destinationName - The name of the queue or topic onto which to place or publish the message. Depending upon the value of the type parameter this parameter will adopt different meanings:
        • If CMQC.MQOT_Q is specified the destinationName parameter directly maps to the queue name - i.e. MQOD.ObjectName.
        • If CMQC.MQOT_TOPIC is specified the destinationName parameter directly maps to the topic object - i.e. MQSD.getObjectName() (the topic object ObjectName property is left blank).
        message - The message to send. Properties within the message may be altered as a result of placing or publishing the message to a queue or topic. It is therefore marked as both an input and output parameter.
        Throws:
        MQException - If the call fails.
      • put

        public void put(int type,
               java.lang.String destinationName,
               MQMessage message,
               MQPutMessageOptions putMessageOptions)
                 throws MQException
        Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.

        When used to place messages to a queue allows you to omit the queue manager name and alternative user ID. When used to publish messages to a topic allows you to omit the topic string and alternative user ID.

        The options specified in the putMessageOptions parameter are used when putting the message to either the queue or topic. These options will differ depending upon the destination type being specified.

        The destinationName parameter will adopt different meanings depending upon the destination type being specified in the type parameter.

        Note that the default syncpoint is CMQC.MQPMO_NO_SYNCPOINT for all platforms.

        Parameters:
        type - The options used to control the specified destination type. Valid values are: Only one option should be specified - the values must not be combined by addition or using the bitwise OR operator.

        These options may be expanded later to include new destination types such as multicast addresses, etc.

        destinationName - The name of the queue or topic onto which to place or publish the message. Depending upon the value of the type parameter this parameter will adopt different meanings:
        • If CMQC.MQOT_Q is specified the destinationName parameter directly maps to the queue name - i.e. MQOD.ObjectName.
        • If CMQC.MQOT_TOPIC is specified the destinationName parameter directly maps to the topic object - i.e. MQSD.getObjectName() (the topic object ObjectName property is left blank).
        message - The message to send. Properties within the message may be altered as a result of placing or publishing the message to a queue or topic. It is therefore marked as both an input and output parameter.
        putMessageOptions - Options controlling the action of the put or publish. Additional options are available when publishing to a topic. These relate to the use of the MQPutMessageOptions.options, MQPutMessageOptions.resolvedQueueName, and MQPutMessageOptions.resolvedQueueManagerName properties.
        Throws:
        MQException - If the call fails.
      • put

        public void put(int type,
               java.lang.String destinationName,
               java.lang.String queueManagerName,
               java.lang.String topicString,
               MQMessage message)
                 throws MQException
        Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.

        The method, when used to place or publish messages to either a queue or topic allows you to omit the put message options and alternative user ID.

        The destinationName parameter will adopt different meanings depending upon the destination type being specified in the type parameter. Other parameters will be optional.

        Note that the default syncpoint is CMQC.MQPMO_NO_SYNCPOINT for all platforms.

        Parameters:
        type - The options used to control the specified destination type. Valid values are: Only one option should be specified - the values must not be combined by addition or using the bitwise OR operator.

        These options may be expanded later to include new destination types such as multicast addresses, etc.

        destinationName - The name of the queue or topic onto which to place or publish the message. Depending upon the value of the type parameter this parameter will adopt different meanings:
        • If CMQC.MQOT_Q is specified the destinationName parameter directly maps to the queue name - i.e. MQOD.ObjectName.
        • If CMQC.MQOT_TOPIC is specified the destinationName parameter directly maps to the topic object - i.e. MQSD.getObjectName() (the topic object ObjectName property is left blank).
        queueManagerName - The name of the queue manager onto which to place the message. If CMQC.MQOT_TOPIC is specified (as the type) this parameter is ignored.
        topicString - The name of the topic string onto which to publish the message. If CMQC.MQOT_Q is specified (as the type) this parameter is ignored.
        message - The message to send. Properties within the message may be altered as a result of placing or publishing the message to a queue or topic. It is therefore marked as both an input and output parameter.
        Throws:
        MQException - If the call fails.
      • put

        public void put(int type,
               java.lang.String destinationName,
               java.lang.String queueManagerName,
               java.lang.String topicString,
               MQMessage message,
               MQPutMessageOptions putMessageOptions)
                 throws MQException
        Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.

        When used to place or publish messages to either a queue or topic allows you to omit the alternative user ID.

        The options specified in the putMessageOptions parameter are used when putting the message to either the queue or topic. These options will differ depending upon the destination type being specified.

        The destinationName parameter will adopt different meanings depending upon the destination type being specified in the type parameter. Other parameters will be optional.

        Note that the default syncpoint is CMQC.MQPMO_NO_SYNCPOINT for all platforms.

        Parameters:
        type - The options used to control the specified destination type. Valid values are: Only one option should be specified - the values must not be combined by addition or using the bitwise OR operator.

        These options may be expanded later to include new destination types such as multicast addresses, etc.

        destinationName - The name of the queue or topic onto which to place or publish the message. Depending upon the value of the type parameter this parameter will adopt different meanings:
        • If CMQC.MQOT_Q is specified the destinationName parameter directly maps to the queue name - i.e. MQOD.ObjectName.
        • If CMQC.MQOT_TOPIC is specified the destinationName parameter directly maps to the topic object - i.e. MQSD.getObjectName() (the topic object ObjectName property is left blank).
        queueManagerName - The name of the queue manager onto which to place the message. If CMQC.MQOT_TOPIC is specified (as the type) this parameter is ignored.
        topicString - The name of the topic string onto which to publish the message. If CMQC.MQOT_Q is specified (as the type) this parameter is ignored.
        message - The message to send. Properties within the message may be altered as a result of placing or publishing the message to a queue or topic. It is therefore marked as both an input and output parameter.
        putMessageOptions - Options controlling the action of the put or publish. Additional options are available when publishing to a topic. These relate to the use of the MQPutMessageOptions.options, MQPutMessageOptions.resolvedQueueName, and MQPutMessageOptions.resolvedQueueManagerName properties.
        Throws:
        MQException - If the call fails.
      • put

        public void put(int type,
               java.lang.String destinationName,
               java.lang.String queueManagerName,
               java.lang.String topicString,
               MQMessage message,
               MQPutMessageOptions putMessageOptions,
               java.lang.String altUserId)
                 throws MQException
        Places or publishes a single message onto a queue or topic without having to create an MQQueue or MQTopic object first.

        The options specified in the putMessageOptions parameter are used when putting the message to either the queue or topic. These options will differ depending upon the destination type being specified.

        The destinationName parameter will adopt different meanings depending upon the destination type being specified in the type parameter. Other parameters will be optional.

        The alternateUserId parameter is an alternative user identifier used to check authorization when placing or publishing the message onto a queue or topic.

        Note that the default syncpoint is CMQC.MQPMO_NO_SYNCPOINT for all platforms.

        Parameters:
        type - The options used to control the specified destination type. Valid values are: Only one option should be specified - the values must not be combined by addition or using the bitwise OR operator.

        These options may be expanded later to include new destination types such as multicast addresses, etc.

        destinationName - The name of the queue or topic onto which to place or publish the message. Depending upon the value of the type parameter this parameter will adopt different meanings:
        • If CMQC.MQOT_Q is specified the destinationName parameter directly maps to the queue name - i.e. MQOD.ObjectName.
        • If CMQC.MQOT_TOPIC is specified the destinationName parameter directly maps to the topic object - i.e. MQSD.getObjectName() (the topic object ObjectName property is left blank).
        queueManagerName - The name of the queue manager onto which to place the message. If CMQC.MQOT_TOPIC is specified (as the type) this parameter is ignored.
        topicString - The name of the topic string onto which to publish the message. If CMQC.MQOT_Q is specified (as the type) this parameter is ignored.
        message - The message to send. Properties within the message may be altered as a result of placing or publishing the message to a queue or topic. It is therefore marked as both an input and output parameter.
        putMessageOptions - Options controlling the action of the put or publish. Additional options are available when publishing to a topic. These relate to the use of the MQPutMessageOptions.options, MQPutMessageOptions.resolvedQueueName, and MQPutMessageOptions.resolvedQueueManagerName properties.
        altUserId - Specifies an alternative user identifier used to check authorization when placing or publishing the message onto a queue or topic. If you do not specify CMQC.MQPMO_ALTERNATE_USER_AUTHORITY, this parameter is ignored.
        Throws:
        MQException - If the call fails.
      • accessQueue

        public MQQueue accessQueue(java.lang.String queueName,
                          int openOptionsArg,
                          java.lang.String queueManagerName,
                          java.lang.String dynamicQueueName,
                          java.lang.String alternateUserIdArg)
                            throws MQException
        Establishes access to a WebSphere MQ queue on this queue manager in order to get or browse messages, put messages, inquire about the attributes of the queue, or set the attributes of the queue.

        If the queue named is a model queue, then a dynamic local queue is created. The name of the created queue is held in the name field of the returned MQQueue object.

        Parameters:
        queueName - name of queue to open.
        openOptionsArg - options which control the opening of the queue. As inquire and set options are automatically added to the options provided, there is no need to specify these explicitly. The valid options are: If more than one option is required the values can be combined using either the '+' or '|' operator. See WebSphere MQ Application Programming Reference for a complete description of these options.
        queueManagerName - name of the queue manager on which the queue is defined. A name which is blank, or which is null, denotes the queue manager to which this object is connected.
        dynamicQueueName - name of the dynamic queue to be created. This parameter is ignored unless queueName specifies the name of a model queue. If it does, this parameter specifies the name of the dynamic queue to be created. A blank or null name is not valid if queueName specifies the name of a model queue. If the last non-blank character in the name is an asterisk (*), the queue manager replaces it with a string of characters which guarantees that the name generated for the queue is unique at the local queue mananager. Asterisk is only valid in positions 1 to 33 of the dynamicQueueName parameter.
        alternateUserIdArg - if CMQC.MQOO_ALTERNATE_USER_AUTHORITY is specified in the openOptions parameter this parameter specifies the alternate user ID to be used to check the authorization for the open. If CMQC.MQOO_ALTERNATE_USER_AUTHORITYis not specified, this parameter can be left blank (or null).
        Returns:
        the MQQueue that has been successfully opened.
        Throws:
        MQException - if the open fails.
        See Also:
        accessProcess(String,int)
      • accessQueue

        public MQQueue accessQueue(java.lang.String queueName,
                          int openOptionsArg)
                            throws MQException
        Establishes access to an WebSphere MQ queue on this queue manager using default queue manager name and alternative user ID values.
        Parameters:
        queueName - the name of the queue to open.
        openOptionsArg - options which control the opening of the queue. See accessQueue(String, int, String, String, String) for more information.
        Returns:
        an MQQueue that has been successfully opened.
        Throws:
        MQException - if the open fails.
      • accessTopic

        public MQTopic accessTopic(java.lang.String topicName,
                          java.lang.String topicObject,
                          int openAs,
                          int options)
                            throws MQException
        Establishes access to a WebSphere MQ topic. The MQTopic object may be opened for either publication or subscription depending upon the value of the openAs parameter. The value dictates the use of the options parameter - this may map to the equivalent CMQC#MQOO options for publication or the equivalent CMQC #MQSO options for subscription.

        The options specified allows the MQTopic object to be used to get or browse messages, put messages, inquire about the attributes of the topic, or set the attributes of the topic.

        An MQTopic object cannot be used for both publication and subscription simultaneously. Therefore, the constructor creates an MQTopic object for publication OR subscription using the supplied topic name (topicName) and topic object ( topicObject).

        The full topic name is given by the concatenation of the preceding two parts. A part exists if the first character of the field is neither a blank nor a null character. If both parts exist a ?/? character is inserted between them in the resultant combined topic. If only one of these parts exist it is used unchanged as the topic. These parts are concatenated in the order they are listed below.

        • The value of the TOPICSTR parameter of the topic object named in topicObject.
        • topicName, if the length provided for that string is non-zero.
        If there are wildcards in the topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in the options parameter.

        When creating an MQTopic for subscriptions, the store (MQQueue) will be managed and owned by the queue manager. This constructor can therefore only be used to create a managed subscription.

        Parameters:
        topicName - The topic string to publish or subscribe against. The topicName parameter directly maps to the ObjectString field of the MQSD (see MQSD.getObjectString(). The full topic name used is the combination of the topicObject and topicName parameters.
        topicObject - The name of the topic object as defined on the local queue manager. If this property is specified in combination with a non-zero length topicName, then the specified topicName is appended to the topic string contained in the topic object with a separator character. It is the full topic string which is published or subscribed against.

        The parameter is both an input and output parameter. Upon successful completion of the method the closest matching administrative node is located within the topic hierarchy and returned. The contained topic object may therefore differ to that originally specified.

        openAs - Indicates whether the topic is being opened for either publication or subscription. The parameter may contain one of the following valid options: The topic object may only be opened for either publication or subscription. Specifying more than a single option will result in an error condition.
        options - Options that control the opening of the topic for either publication or subscription. The following options are valid: If more than one option is required, the values can be added together or combined using the bitwise OR operator. See the WebSphere MQ Application Programming Reference for a fuller description of these options.

        However, upon opening the topic for subscription the following valid options are shown below. If more than one option is required, the values can be added together or combined using the bitwise OR operator.

        If none of these options are specified, then CMQC.MQSO_CREATE + CMQC.MQSO_ALTER is assumed. Other valid options are also available.

        Upon opening a topic for subscription, the constructor can only cater for a managed, non-durable subscription. The following options are therefore enforced:

        Returns:
        An MQTopic object that has been successfully opened.
        Throws:
        MQException - If the call fails.
        See Also:
        MQTopic.MQTopic(MQQueueManager, String, String, int, int)
      • accessTopic

        public MQTopic accessTopic(java.lang.String topicName,
                          java.lang.String topicObject,
                          int openAs,
                          int options,
                          java.lang.String altUserId)
                            throws MQException
        Establishes access to a WebSphere MQ topic. The MQTopic object may be opened for either publication or subscription depending upon the value of the openAs parameter. The value dictates the use of the options parameter - this may map to the equivalent CMQC#MQOO options for publication or the equivalent CMQC MQSO options for subscription.

        If either CMQC.MQOO_ALTERNATE_USER_AUTHORITY or CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, the alternateUserId parameter is used to check for the necessary authorization.

        The options specified allows the MQTopic object to be used to get or browse messages, put messages, inquire about the attributes of the topic, or set the attributes of the topic.

        An MQTopic object cannot be used for both publication and subscription simultaneously. Therefore, the constructor creates an MQTopic object for publication OR subscription using the supplied topic name (topicName) and topic object ( topicObject).

        The full topic name is given by the concatenation of the preceding two parts. A part exists if the first character of the field is neither a blank nor a null character. If both parts exist a ?/? character is inserted between them in the resultant combined topic. If only one of these parts exist it is used unchanged as the topic. These parts are concatenated in the order they are listed below.

        • The value of the TOPICSTR parameter of the topic object named in topicObject.
        • topicName, if the length provided for that string is non-zero.
        If there are wildcards in the topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in the options parameter.

        When creating an MQTopic for subscriptions, the store (MQQueue) will be managed and owned by the queue manager. This constructor can therefore only be used to create a managed subscription.

        Parameters:
        topicName - The topic string to publish or subscribe against. The topicName parameter directly maps to the ObjectString field of the MQSD (see MQSD.getObjectString(). The full topic name used is the combination of the topicObject and topicName parameters.
        topicObject - The name of the topic object as defined on the local queue manager. If this property is specified in combination with a non-zero length topicName, then the specified topicName is appended to the topic string contained in the topic object with a separator character. It is the full topic string which is published or subscribed against.

        The parameter is both an input and output parameter. Upon successful completion of the method the closest matching administrative node is located within the topic hierarchy and returned. The contained topic object may therefore differ to that originally specified.

        openAs - Indicates whether the topic is being opened for either publication or subscription. The parameter may contain one of the following valid options: The topic object may only be opened for either publication or subscription. Specifying more than a single option will result in an error condition.
        options - Options that control the opening of the topic for either publication or subscription. The following options are valid: If more than one option is required, the values can be added together or combined using the bitwise OR operator. See the WebSphere MQ Application Programming Reference for a fuller description of these options.

        However, upon opening the topic for subscription the following valid options are shown below. If more than one option is required, the values can be added together or combined using the bitwise OR operator.

        If none of these options are specified, then CMQC.MQSO_CREATE + CMQC.MQSO_ALTER is assumed. Other valid options are also available.

        Upon opening a topic for subscription, the constructor can only cater for a managed, non-durable subscription. The following options are therefore enforced:

        altUserId - If either CMQC.MQOO_ALTERNATE_USER_AUTHORITY or CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, this parameter specifies the alternate user identifier that is used to check for the required authorization to complete the operation.

        If either CMQC.MQOO_ALTERNATE_USER_AUTHORITY or CMQC.MQSO_ALTERNATE_USER_AUTHORITY is not specified, this parameter can be left blank (or null).

        Returns:
        An MQTopic object that has been successfully opened.
        Throws:
        MQException - If the call fails.
        See Also:
        MQTopic.MQTopic(MQQueueManager, String, String, int, int, String)
      • accessTopic

        public MQTopic accessTopic(java.lang.String topicName,
                          java.lang.String topicObject,
                          int options,
                          java.lang.String altUserId,
                          java.lang.String subscriptionName)
                            throws MQException
        Establishes access to a WebSphere MQ topic. The presence of the subscriptionName parameter indicates that this constructor may be used for opening the topic for subscriptions only. The options parameter therefore always maps to the equivalent CMQC #MQSO values.

        If the CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, the alternateUserId parameter is used to check for the necessary authorization.

        The options specified allows the MQTopic object to be used to get or browse messages, inquire about the attributes of the topic, or set the attributes of the topic.

        The constructor creates an MQTopic object for subscription using the supplied topic name (topicName) and topic object (topicObject).

        The full topic name is given by the concatenation of the preceding two parts. A part exists if the first character of the field is neither a blank nor a null character. If both parts exist a ?/? character is inserted between them in the resultant combined topic. If only one of these parts exist it is used unchanged as the topic. These parts are concatenated in the order they are listed below.

        • The value of the TOPICSTR parameter of the topic object named in topicObject.
        • topicName, if the length provided for that string is non-zero.
        If there are wildcards in the topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in the options parameter.

        When creating an MQTopic for subscriptions, the store (MQQueue) will be managed and owned by the queue manager. This constructor can therefore only be used to create a managed subscription.

        Parameters:
        topicName - The topic string to publish or subscribe against. The topicName parameter directly maps to the ObjectString field of the MQSD (see MQSD.getObjectString(). The full topic name used is the combination of the topicObject and topicName parameters.
        topicObject - The name of the topic object as defined on the local queue manager. If this property is specified in combination with a non-zero length topicName, then the specified topicName is appended to the topic string contained in the topic object with a separator character. It is the full topic string which is published or subscribed against.

        The parameter is both an input and output parameter. Upon successful completion of the method the closest matching administrative node is located within the topic hierarchy and returned. The contained topic object may therefore differ to that originally specified.

        options - Upon opening the topic for subscription the following valid options are shown below. If more than one option is required, the values can be added together or combined using the bitwise OR operator. If none of these options are specified, then CMQC.MQSO_CREATE + CMQC.MQSO_ALTER is assumed. Other valid options are also available.

        The constructor can only cater for managed subscriptions. The following options are therefore enforced:

        altUserId - If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, this parameter specifies the alternate user identifier that is used to check for the required authorization to complete the operation.

        If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is not specified, this parameter can be left blank (or null).

        subscriptionName - This field is only required if the options parameter specified CMQC.MQSO_DURABLE, but if provided will be used by the queue manager for CMQC.MQSO_NON_DURABLE as well.

        For a CMQC.MQSO_DURABLE subscription it is the means by which you identify a subscription to resume it after it has been created, if you have either closed the handle to the subscription or have been disconnected from the queue manager.

        If altering an existing subscription using the CMQC.MQSO_ALTER option, the subscription name cannot be changed

        Returns:
        An MQTopic object that has been successfully opened.
        Throws:
        MQException - If the call fails.
        See Also:
        MQTopic.MQTopic(MQQueueManager, String, String, int, String, String)
      • accessTopic

        public MQTopic accessTopic(java.lang.String topicName,
                          java.lang.String topicObject,
                          int options,
                          java.lang.String altUserId,
                          java.lang.String subscriptionName,
                          java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
                            throws MQException
        Establishes access to a WebSphere MQ topic. The presence of the subscriptionName parameter indicates that this constructor may be used for opening the topic for subscriptions only. The options parameter therefore always maps to the equivalent CMQC #MQSO values.

        If the CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, the alternateUserId parameter is used to check for the necessary authorization.

        The options specified allows the MQTopic object to be used to get or browse messages, inquire about the attributes of the topic, or set the attributes of the topic.

        The constructor creates an MQTopic object for subscription using the supplied topic name (topicName) and topic object (topicObject).

        The full topic name is given by the concatenation of the preceding two parts. A part exists if the first character of the field is neither a blank nor a null character. If both parts exist a ?/? character is inserted between them in the resultant combined topic. If only one of these parts exist it is used unchanged as the topic. These parts are concatenated in the order they are listed below.

        • The value of the TOPICSTR parameter of the topic object named in topicObject.
        • topicName, if the length provided for that string is non-zero.
        If there are wildcards in the topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in the options parameter.

        When creating an MQTopic for subscriptions, the store (MQQueue) will be managed and owned by the queue manager. This constructor can therefore only be used to create a managed subscription.

        Extra non-standard input and output parameters can also be specified using the parameters hash table. If a property is an output field it will only be populated within the hash table if it was originally specified on input. Essentially, no new key/value pairs will be added to the hash table - only existing ones updated.

        Parameters:
        topicName - The topic string to publish or subscribe against. The topicName parameter directly maps to the ObjectString field of the MQSD (see MQSD.getObjectString(). The full topic name used is the combination of the topicObject and topicName parameters.
        topicObject - The name of the topic object as defined on the local queue manager. If this property is specified in combination with a non-zero length topicName, then the specified topicName is appended to the topic string contained in the topic object with a separator character. It is the full topic string which is published or subscribed against.

        The parameter is both an input and output parameter. Upon successful completion of the method the closest matching administrative node is located within the topic hierarchy and returned. The contained topic object may therefore differ to that originally specified.

        options - Upon opening the topic for subscription the following valid options are shown below. If more than one option is required, the values can be added together or combined using the bitwise OR operator. If none of these options are specified, then CMQC.MQSO_CREATE + CMQC.MQSO_ALTER is assumed. Other valid options are also available.

        The constructor can only cater for managed subscriptions. The following options are therefore enforced:

        altUserId - If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, this parameter specifies the alternate user identifier that is used to check for the required authorization to complete the operation.

        If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is not specified, this parameter can be left blank (or null).

        subscriptionName - This field is only required if the options parameter specified CMQC.MQSO_DURABLE, but if provided will be used by the queue manager for CMQC.MQSO_NON_DURABLE as well.

        For a CMQC.MQSO_DURABLE subscription it is the means by which you identify a subscription to resume it after it has been created, if you have either closed the handle to the subscription or have been disconnected from the queue manager.

        If altering an existing subscription using the CMQC.MQSO_ALTER option, the subscription name cannot be changed

        parameters - The hash table can be used to specify non-standard input and output parameters to the subscription request. If a property is an output field it will only be populated within the hash table if it was originally specified on input. Consequently, no new key / value pairs will be added to the hash table - only existing ones updated. The following key names are valid and may be specified: All are specified as String type properties. The corresponding language conversion routines can be used to convert the values to the relevant types.
        Returns:
        An MQTopic object that has been successfully opened.
        Throws:
        MQException - If the call fails.
        See Also:
        MQTopic.MQTopic(MQQueueManager, String, String, int, String, String, Hashtable)
      • accessTopic

        public MQTopic accessTopic(MQDestination destination,
                          java.lang.String topicName,
                          java.lang.String topicObject,
                          int options)
                            throws MQException
        Establishes access to a WebSphere MQ topic. The presence of the destination parameter indicates that this constructor may be used for opening the topic for subscriptions only. The options parameter therefore always maps to the equivalent CMQC #MQSO values.

        The options specified allows the MQTopic object to be used to get or browse messages, inquire about the attributes of the topic, or set the attributes of the topic.

        The constructor creates an MQTopic object for subscription using the supplied topic name (topicName) and topic object (topicObject).

        The full topic name is given by the concatenation of the preceding two parts. A part exists if the first character of the field is neither a blank nor a null character. If both parts exist a ?/? character is inserted between them in the resultant combined topic. If only one of these parts exist it is used unchanged as the topic. These parts are concatenated in the order they are listed below.

        • The value of the TOPICSTR parameter of the topic object named in topicObject.
        • topicName, if the length provided for that string is non-zero.
        If there are wildcards in the topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in the options parameter.

        When creating an MQTopic for subscription, the subscription store ( destination) is provided, managed and owned by the user. The queue manager takes no responsibility for this object and it is left to the user to correctly dispose of it. Any messages available for this subscription will be delivered to the specified destination.

        The destination parameter must be valid and cannot be left blank or null. Consequently, this constructor can therefore only be used to create an unmanaged, non-durable subscription.

        Parameters:
        destination - An existing MQDestination object which should receive the publications. For WebSphere MQ v7.0 this will always map to an MQQueue object. However, other destination types may exist in future.

        The MQDestination (MQQueue) object can be created by calling an MQQueueManager#accessQueue method or an MQQueue constructor.

        The corresponding destination is held as a reference within the MQTopic object as the UnmanagedDestinationReference property (see MQTopic.getUnmanagedDestinationReference().

        topicName - The topic string to publish or subscribe against. The topicName parameter directly maps to the ObjectString field of the MQSD (see MQSD.getObjectString(). The full topic name used is the combination of the topicObject and topicName parameters.
        topicObject - The name of the topic object as defined on the local queue manager. If this property is specified in combination with a non-zero length topicName, then the specified topicName is appended to the topic string contained in the topic object with a separator character. It is the full topic string which is published or subscribed against.

        The parameter is both an input and output parameter. Upon successful completion of the method the closest matching administrative node is located within the topic hierarchy and returned. The contained topic object may therefore differ to that originally specified.

        options - Upon opening the topic for subscription the following valid options are shown below. If more than one option is required, the values can be added together or combined using the bitwise OR operator. If none of these options are specified, then CMQC.MQSO_CREATE + CMQC.MQSO_ALTER is assumed. Other valid options are also available.

        The constructor can only cater for unmanaged, non-durable subscriptions. The following options are therefore enforced:

        Returns:
        An MQTopic object that has been successfully opened.
        Throws:
        MQException - If the call fails.
        See Also:
        MQTopic.MQTopic(MQQueueManager, MQDestination, String, String, int)
      • accessTopic

        public MQTopic accessTopic(MQDestination destination,
                          java.lang.String topicName,
                          java.lang.String topicObject,
                          int options,
                          java.lang.String altUserId)
                            throws MQException
        Establishes access to a WebSphere MQ topic. The presence of the destination parameter indicates that this constructor may be used for opening the topic for subscriptions only. The options parameter therefore always maps to the equivalent CMQC #MQSO values.

        If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, the alternateUserId parameter is used to check for the necessary authorization.

        The options specified allows the MQTopic object to be used to get or browse messages, inquire about the attributes of the topic, or set the attributes of the topic.

        The constructor creates an MQTopic object for subscription using the supplied topic name (topicName) and topic object (topicObject).

        The full topic name is given by the concatenation of the preceding two parts. A part exists if the first character of the field is neither a blank nor a null character. If both parts exist a ?/? character is inserted between them in the resultant combined topic. If only one of these parts exist it is used unchanged as the topic. These parts are concatenated in the order they are listed below.

        • The value of the TOPICSTR parameter of the topic object named in topicObject.
        • topicName, if the length provided for that string is non-zero.
        If there are wildcards in the topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in the options parameter.

        When creating an MQTopic for subscription, the subscription store ( destination) is provided, managed and owned by the user. The queue manager takes no responsibility for this object and it is left to the user to correctly dispose of it. Any messages available for this subscription will be delivered to the specified destination.

        The destination parameter must be valid and cannot be left blank or null. Consequently, this constructor can therefore only be used to create an unmanaged, non-durable subscription.

        Parameters:
        destination - An existing MQDestination object which should receive the publications. For WebSphere MQ v7.0 this will always map to an MQQueue object. However, other destination types may exist in future.

        The MQDestination (MQQueue) object can be created by calling an MQQueueManager#accessQueue method or an MQQueue constructor.

        The corresponding destination is held as a reference within the MQTopic object as the UnmanagedDestinationReference property (see MQTopic.getUnmanagedDestinationReference().

        topicName - The topic string to publish or subscribe against. The topicName parameter directly maps to the ObjectString field of the MQSD (see MQSD.getObjectString(). The full topic name used is the combination of the topicObject and topicName parameters.
        topicObject - The name of the topic object as defined on the local queue manager. If this property is specified in combination with a non-zero length topicName, then the specified topicName is appended to the topic string contained in the topic object with a separator character. It is the full topic string which is published or subscribed against.

        The parameter is both an input and output parameter. Upon successful completion of the method the closest matching administrative node is located within the topic hierarchy and returned. The contained topic object may therefore differ to that originally specified.

        options - Upon opening the topic for subscription the following valid options are shown below. If more than one option is required, the values can be added together or combined using the bitwise OR operator. If none of these options are specified, then CMQC.MQSO_CREATE + CMQC.MQSO_ALTER is assumed. Other valid options are also available.

        The constructor can only cater for unmanaged, non-durable subscriptions. The following options are therefore enforced:

        altUserId - If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, this parameter specifies the alternate user identifier that is used to check for the required authorization to complete the operation.

        If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is not specified, this parameter can be left blank (or null).

        Returns:
        An MQTopic object that has been successfully opened.
        Throws:
        MQException - If the call fails.
        See Also:
        MQTopic.MQTopic(MQQueueManager, MQDestination, String, String, int, String)
      • accessTopic

        public MQTopic accessTopic(MQDestination destination,
                          java.lang.String topicName,
                          java.lang.String topicObject,
                          int options,
                          java.lang.String altUserId,
                          java.lang.String subscriptionName)
                            throws MQException
        Establishes access to a WebSphere MQ topic. The presence of the destination and subscriptionName parameters indicates that this constructor may be used for opening the topic for subscriptions only. The options parameter therefore always maps to the equivalent MQSO values.

        If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, the alternateUserId parameter is used to check for the necessary authorization.

        The options specified allows the MQTopic object to be used to get or browse messages, inquire about the attributes of the topic, or set the attributes of the topic.

        The constructor creates an MQTopic object for subscription using the supplied topic name (topicName) and topic object (topicObject).

        The full topic name is given by the concatenation of the preceding two parts. A part exists if the first character of the field is neither a blank nor a null character. If both parts exist a ?/? character is inserted between them in the resultant combined topic. If only one of these parts exist it is used unchanged as the topic. These parts are concatenated in the order they are listed below.

        • The value of the TOPICSTR parameter of the topic object named in topicObject.
        • topicName, if the length provided for that string is non-zero.
        If there are wildcards in the topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in the options parameter.

        When creating an MQTopic for subscription, the subscription store ( destination) is provided, managed and owned by the user. The queue manager takes no responsibility for this object and it is left to the user to correctly dispose of it. Any messages available for this subscription will be delivered to the specified destination.

        The destination parameter must be valid and cannot be left blank or null. Consequently, this constructor can therefore only be used to create an unmanaged subscription.

        Parameters:
        destination - An existing MQDestination object which should receive the publications. For WebSphere MQ v7.0 this will always map to an MQQueue object. However, other destination types may exist in future.

        The MQDestination (MQQueue) object can be created by calling an MQQueueManager#accessQueue method or an MQQueue constructor.

        The corresponding destination is held as a reference within the MQTopic object as the UnmanagedDestinationReference property (see MQTopic.getUnmanagedDestinationReference().

        topicName - The topic string to publish or subscribe against. The topicName parameter directly maps to the ObjectString field of the MQSD (see MQSD.getObjectString(). The full topic name used is the combination of the topicObject and topicName parameters.
        topicObject - The name of the topic object as defined on the local queue manager. If this property is specified in combination with a non-zero length topicName, then the specified topicName is appended to the topic string contained in the topic object with a separator character. It is the full topic string which is published or subscribed against.

        The parameter is both an input and output parameter. Upon successful completion of the method the closest matching administrative node is located within the topic hierarchy and returned. The contained topic object may therefore differ to that originally specified.

        options - Upon opening the topic for subscription the following valid options are shown below. If more than one option is required, the values can be added together or combined using the bitwise OR operator. If none of these options are specified, then CMQC.MQSO_CREATE + CMQC.MQSO_ALTER is assumed. Other valid options are:

        The constructor can only cater for unmanaged subscriptions. The following options are therefore enforced:

        altUserId - If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, this parameter specifies the alternate user identifier that is used to check for the required authorization to complete the operation.

        If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is not specified, this parameter can be left blank (or null).

        subscriptionName - This field is only required if the options parameter specified CMQC.MQSO_DURABLE, but if provided will be used by the queue manager for CMQC.MQSO_NON_DURABLE as well.

        For a CMQC.MQSO_DURABLE subscription it is the means by which you identify a subscription to resume it after it has been created, if you have either closed the handle to the subscription or have been disconnected from the queue manager.

        If altering an existing subscription using the CMQC.MQSO_ALTER option, the subscription name cannot be changed

        Returns:
        An MQTopic object that has been successfully opened.
        Throws:
        MQException - If the call fails.
        See Also:
        MQTopic.MQTopic(MQQueueManager, MQDestination, String, String, int, String, String)
      • accessTopic

        public MQTopic accessTopic(MQDestination destination,
                          java.lang.String topicName,
                          java.lang.String topicObject,
                          int options,
                          java.lang.String altUserId,
                          java.lang.String subscriptionName,
                          java.util.Hashtable<java.lang.String,java.lang.Object> parameters)
                            throws MQException
        Establishes access to a WebSphere MQ topic. The presence of the destination and subscriptionName parameters indicates that this constructor may be used for opening the topic for subscriptions only. The options parameter therefore always maps to the equivalent CMQC#MQSO values.

        If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, the alternateUserId parameter is used to check for the necessary authorization.

        The options specified allows the MQTopic object to be used to get or browse messages, inquire about the attributes of the topic, or set the attributes of the topic.

        The constructor creates an MQTopic object for subscription using the supplied topic name (topicName) and topic object (topicObject).

        The full topic name is given by the concatenation of the preceding two parts. A part exists if the first character of the field is neither a blank nor a null character. If both parts exist a ?/? character is inserted between them in the resultant combined topic. If only one of these parts exist it is used unchanged as the topic. These parts are concatenated in the order they are listed below.

        • The value of the TOPICSTR parameter of the topic object named in topicObject.
        • topicName, if the length provided for that string is non-zero.
        If there are wildcards in the topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in the options parameter.

        When creating an MQTopic for subscription, the subscription store ( destination) is provided, managed and owned by the user. The queue manager takes no responsibility for this object and it is left to the user to correctly dispose of it. Any messages available for this subscription will be delivered to the specified destination.

        The destination parameter must be valid and cannot be left blank or null. Consequently, this constructor can therefore only be used to create an unmanaged subscription.

        Extra non-standard input and output parameters can also be specified using the parameters hash table. If a property is an output field it will only be populated within the hash table if it was originally specified on input. Essentially, no new key/value pairs will be added to the hash table - only existing ones updated.

        Parameters:
        destination - An existing MQDestination object which should receive the publications. For WebSphere MQ v7.0 this will always map to an MQQueue object. However, other destination types may exist in future.

        The MQDestination (MQQueue) object can be created by calling an MQQueueManager#accessQueue method or an MQQueue constructor.

        The corresponding destination is held as a reference within the MQTopic object as the UnmanagedDestinationReference property (see MQTopic.getUnmanagedDestinationReference().

        topicName - The topic string to publish or subscribe against. The topicName parameter directly maps to the ObjectString field of the MQSD (see MQSD.getObjectString(). The full topic name used is the combination of the topicObject and topicName parameters.
        topicObject - The name of the topic object as defined on the local queue manager. If this property is specified in combination with a non-zero length topicName, then the specified topicName is appended to the topic string contained in the topic object with a separator character. It is the full topic string which is published or subscribed against.

        The parameter is both an input and output parameter. Upon successful completion of the method the closest matching administrative node is located within the topic hierarchy and returned. The contained topic object may therefore differ to that originally specified.

        options - Upon opening the topic for subscription the following valid options are shown below. If more than one option is required, the values can be added together or combined using the bitwise OR operator. If none of these options are specified, then CMQC.MQSO_CREATE + CMQC.MQSO_ALTER is assumed. Other valid options are:

        The constructor can only cater for unmanaged subscriptions. The following options are therefore enforced:

        altUserId - If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is specified in the options parameter, this parameter specifies the alternate user identifier that is used to check for the required authorization to complete the operation.

        If CMQC.MQSO_ALTERNATE_USER_AUTHORITY is not specified, this parameter can be left blank (or null).

        subscriptionName - This field is only required if the options parameter specified CMQC.MQSO_DURABLE, but if provided will be used by the queue manager for CMQC.MQSO_NON_DURABLE as well.

        For a CMQC.MQSO_DURABLE subscription it is the means by which you identify a subscription to resume it after it has been created, if you have either closed the handle to the subscription or have been disconnected from the queue manager.

        If altering an existing subscription using the CMQC.MQSO_ALTER option, the subscription name cannot be changed

        parameters - The hash table can be used to specify non-standard input and output parameters to the subscription request. If a property is an output field it will only be populated within the hash table if it was originally specified on input. Consequently, no new key / value pairs will be added to the hash table - only existing ones updated. The following key names are valid and may be specified: All are specified as String type properties. The corresponding language conversion routines can be used to convert the values to the relevant types.
        Returns:
        An MQTopic object that has been successfully opened.
        Throws:
        MQException - If the call fails.
        See Also:
        MQTopic.MQTopic(MQQueueManager, MQDestination, String, String, int, String, String, Hashtable)
      • accessProcess

        public MQProcess accessProcess(java.lang.String processName,
                              int openOptionsArg,
                              java.lang.String queueManagerName,
                              java.lang.String alternateUserIdArg)
                                throws MQException
        Establishes access to a WebSphere MQ process on this queue manager in order to inquire about the process attributes.
        Parameters:
        processName - name of the process to open
        openOptionsArg - options which control the opening of the process. As inquire is automatically added to the options specified there is no need to specify it explicitly. Valid options are: If more than one option is required the values can be combined using either the '+' or '|' operator.
        queueManagerName - name of the queue manager on which the process is defined. A name which is entirely blank or null denotes the queue manager to which this object is connected.
        alternateUserIdArg - if CMQC.MQOO_ALTERNATE_USER_AUTHORITY is specified in the openOptions parameter, this parameter specifies the alternative user ID to be used to check the authorization for the open. Otherwise this parameter can be blank or null.
        Returns:
        an MQProcess that has been successfully opened.
        Throws:
        MQException - if the open fails.
        See Also:
        accessQueue(String, int, String, String, String)
      • accessProcess

        public MQProcess accessProcess(java.lang.String processName,
                              int openOptionsArg)
                                throws MQException
        Accesses a WebSphere MQ process on this queue manager using default queue manager name and alternative user ID values.
        Parameters:
        processName - name of process to open.
        openOptionsArg - see openOptionsfor details.
        Returns:
        an MQProcess that has been successfully opened.
        Throws:
        MQException - if the open fails.
        See Also:
        accessProcess(String,int,String,String)
      • accessDistributionList

        public MQDistributionList accessDistributionList(MQDistributionListItem[] items,
                                                int options,
                                                java.lang.String id)
                                                  throws MQException
        Creates a distribution list.
        Parameters:
        items - the elements of the distribution list.
        options - the open options for the distribution list.
        id - the alternative user ID.
        Returns:
        the distribution list.
        Throws:
        MQException - if there is a problem opening the distribution list.
      • accessDistributionList

        public MQDistributionList accessDistributionList(MQDistributionListItem[] items,
                                                int options)
                                                  throws MQException
        Creates a distribution list using the default alternative user ID.
        Parameters:
        items - the elements of the distribution list.
        options - the open options for the distribution list.
        Returns:
        the distribution list.
        Throws:
        MQException - if there is a problem opening the distribution list.
      • getAsyncStatus

        public MQAsyncStatus getAsyncStatus()
                                     throws MQException
        Requests asynchronous error status from the queue manager. This relates to asynchronous put operations performed since the last time asynchronous error status was requested on this connection. This status can be updated by calling updateAsyncStatus() against the returned object.
        Returns:
        The asynchronous error status.
        Throws:
        MQException - if there is a problem requesting asynchronous error status from the queue manager.
        See Also:
        MQAsyncStatus.updateAsyncStatus()
      • getCCDTURL

        public java.net.URL getCCDTURL()
        Returns the URL of the channel definition file, or null if it does not exist. Java URLs support various protocols, which normally include file, HTTP, FTP and LDAP. The URL class has several constructors, one of which is: URL(String spec).
        Returns:
        The URL of the channel definition file.
(c) Copyright IBM Corp. 2008, 2015. All Rights Reserved.