Class MQQueueManager
- java.lang.Object
-
- com.ibm.mq.jmqi.JmqiObject
-
- com.ibm.mq.MQManagedObject
-
- com.ibm.mq.MQQueueManager
-
public class MQQueueManager extends MQManagedObject
The MQQueueManager class provides a connection to an IBM 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 IBM MQ queue manager itself is synchronized, so that only one thread can communicate with it at any one time. A call to
MQQueue.get()specifyingCMQC.MQGMO_WAIT(for example) will therefore block any other threads attempting to make IBM MQ calls using the same MQQueueManager until the get completes.
-
-
Field Summary
Fields Modifier and Type Field and Description booleanisConnectedDeprecated.Use theisConnected()method instead.-
Fields inherited from class com.ibm.mq.MQManagedObject
alternateUserId, closeOptions, connectionReference, isOpen, name, openOptions
-
-
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 inMQEnvironmentclass 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
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description MQDistributionListaccessDistributionList(MQDistributionListItem[] items, int options)Creates a distribution list using the default alternative user ID.MQDistributionListaccessDistributionList(MQDistributionListItem[] items, int options, java.lang.String id)Creates a distribution list.MQProcessaccessProcess(java.lang.String processName, int openOptionsArg)Accesses an IBM MQ process on this queue manager using default queue manager name and alternative user ID values.MQProcessaccessProcess(java.lang.String processName, int openOptionsArg, java.lang.String queueManagerName, java.lang.String alternateUserIdArg)Establishes access to an IBM MQ process on this queue manager in order to inquire about the process attributes.MQQueueaccessQueue(java.lang.String queueName, int openOptionsArg)Establishes access to an IBM MQ queue on this queue manager using default queue manager name and alternative user ID values.MQQueueaccessQueue(java.lang.String queueName, int openOptionsArg, java.lang.String queueManagerName, java.lang.String dynamicQueueName, java.lang.String alternateUserIdArg)Establishes access to an IBM 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.MQTopicaccessTopic(MQDestination destination, java.lang.String topicName, java.lang.String topicObject, int options)Establishes access to an IBM MQ topic.MQTopicaccessTopic(MQDestination destination, java.lang.String topicName, java.lang.String topicObject, int options, java.lang.String altUserId)Establishes access to an IBM MQ topic.MQTopicaccessTopic(MQDestination destination, java.lang.String topicName, java.lang.String topicObject, int options, java.lang.String altUserId, java.lang.String subscriptionName)Establishes access to an IBM MQ topic.MQTopicaccessTopic(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 an IBM MQ topic.MQTopicaccessTopic(java.lang.String topicName, java.lang.String topicObject, int openAs, int options)Establishes access to an IBM MQ topic.MQTopicaccessTopic(java.lang.String topicName, java.lang.String topicObject, int openAs, int options, java.lang.String altUserId)Establishes access to an IBM MQ topic.MQTopicaccessTopic(java.lang.String topicName, java.lang.String topicObject, int options, java.lang.String altUserId, java.lang.String subscriptionName)Establishes access to an IBM MQ topic.MQTopicaccessTopic(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 an IBM MQ topic.voidbackout()Indicates to the queue manager that all the message gets and puts that have occurred since the last syncpoint are to be backed out.voidbegin()Begins a new unit of work.voidcommit()Indicates to the queue manager that the application has reached a syncpoint.voiddisconnect()Ends the connection to the queue manager.MQAsyncStatusgetAsyncStatus()Requests asynchronous error status from the queue manager.java.net.URLgetCCDTURL()Returns the URL of the channel definition file, or null if it does not exist.intgetCharacterSet()Gets the CCSID (Coded Character Set Identifier) of the queue manager's codeset.java.lang.StringgetCommandInputQueueName()Gets the name of the command input queue defined on the queue manager.intgetCommandLevel()Indicates the level of system control commands supported by the queue manager.booleangetDistributionListCapable()Indicates whether the queue manager supports distribution lists.java.sql.ConnectiongetJDBCConnection(javax.sql.XADataSource xads)Returns a Connection object for use with the JTA-JDBC support.java.sql.ConnectiongetJDBCConnection(javax.sql.XADataSource xads, java.lang.String userid, java.lang.String password)Registers a database for coordination.intgetMaximumMessageLength()Gets the maximum length of a message that the queue manager can handle.intgetMaximumPriority()Gets the maximum message priority supported by the queue manager.intgetSyncpointAvailability()Indicates whether the queue manager supports units of work and syncpointing with theMQQueue.get()andMQQueue.put()methods.booleanisConnected()Indicates whether this object is currently connected to an IBM MQ queue manager.voidput(int type, java.lang.String destinationName, MQMessage message)voidput(int type, java.lang.String destinationName, MQMessage message, MQPutMessageOptions putMessageOptions)voidput(int type, java.lang.String destinationName, java.lang.String queueManagerName, java.lang.String topicString, MQMessage message)voidput(int type, java.lang.String destinationName, java.lang.String queueManagerName, java.lang.String topicString, MQMessage message, MQPutMessageOptions putMessageOptions)voidput(int type, java.lang.String destinationName, java.lang.String queueManagerName, java.lang.String topicString, MQMessage message, MQPutMessageOptions putMessageOptions, java.lang.String altUserId)voidput(java.lang.String qName, MQMessage msg)Puts a single message on to a (possibly unopened) queue.voidput(java.lang.String qName, MQMessage msg, MQPutMessageOptions pmo)Puts a single message on to a (possibly unopened) queue.voidput(java.lang.String qName, java.lang.String qmName, MQMessage msg)Puts a single message on to a (possibly unopened) queue.voidput(java.lang.String qName, java.lang.String qmName, MQMessage msg, MQPutMessageOptions pmo)Puts a single message on to a (possibly unopened) queue.voidput(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 com.ibm.mq.MQManagedObject
close, getAlternateUserId, getAttributeString, getCloseOptions, getConnectionReference, getDescription, getName, getOpenOptions, getResolvedObjectString, getResolvedQName, getResolvedType, inquire, inquire, isOpen, set, setAttributeString, setCloseOptions
-
-
-
-
Field Detail
-
isConnected
public boolean isConnected
Deprecated. Use theisConnected()method instead.Indicates whether this MQQueueManager object is currently connected to an IBM MQ queue manager. Use thedisconnect()method to disconnect from a queue manager.
-
-
Constructor Detail
-
MQQueueManager
public MQQueueManager(java.lang.String queueManagerName) throws MQExceptionCreates 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 IBMMQ 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, int options) throws MQExceptionCreates a connection to the named queue manager specifying binding options.- Parameters:
queueManagerName- the name of the queue manager.options- binding options. Possible values are:- Throws:
MQException- if there are connection problems.
-
MQQueueManager
public MQQueueManager(java.lang.String queueManagerName, java.util.Hashtable properties) throws MQExceptionCreates a connection to the named queue manager using a Hashtable. The Hashtable overrides the specification held inMQEnvironment.- 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 MQExceptionCreates 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 MQExceptionCreates 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 MQExceptionCreates a connection to a queue manager which overrides the settings inMQEnvironmentclass 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 MQExceptionCreates 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 inMQEnvironmentclass 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 MQExceptionCreates 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 inMQEnvironmentclass 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 MQExceptionCreates 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 inMQEnvironmentclass 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.XAExceptionReturns 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 an IBM 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.XAExceptionRegisters a database for coordination. Used to create a JDBC Connection which is coordinated by the queue manager after a call tobegin().- 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 an IBM 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 an IBM MQ queue manager. Usedisconnect()to disconnect from a queue manager.- Returns:
- true if connected.
-
getCharacterSet
public int getCharacterSet() throws MQExceptionGets 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 MQExceptionGets 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 MQExceptionIndicates 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 IBM MQ Application Programming Reference .- Returns:
- values between
CMQC.MQCMDL_LEVEL_1andCMQC.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 MQExceptionGets 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 MQExceptionGets 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.
-
getSyncpointAvailability
public int getSyncpointAvailability() throws MQExceptionIndicates whether the queue manager supports units of work and syncpointing with theMQQueue.get()andMQQueue.put()methods.- Returns:
CMQC.MQSP_AVAILABLEif syncpointing is available, orCMQC.MQSP_NOT_AVAILABLEif not.- Throws:
MQException- if you call this method after disconnecting from the queue manager to indicate 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 MQExceptionEnds 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.
-
commit
public void commit() throws MQExceptionIndicates to the queue manager that the application has reached a syncpoint. All the message gets and puts that have occurred since the last syncpoint are to be made permanent. Messages sent as part of a unit of work (with theCMQC.MQPMO_SYNCPOINTflag set inMQPutMessageOptions.options) are made available to other applications. Messages retrieved as part of a unit of work (with theCMQC.MQGMO_SYNCPOINTflag set inMQGetMessageOptions.options) are deleted.- Throws:
MQException- if the call fails.- See Also:
backout()
-
backout
public void backout() throws MQExceptionIndicates 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 theCMQC.MQPMO_SYNCPOINTflag set in the options field of MQPutMessageOptions) are deleted. Messages retrieved as part of a unit of work (with theCMQC.MQGMO_SYNCPOINTflag set inMQGetMessageOptions.options) are reinstated on the queue.- Throws:
MQException- if the call fails.- See Also:
commit()
-
begin
public void begin() throws MQExceptionBegins a new unit of work. This method is only supported by IBM 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 failsThe 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 MQExceptionPuts 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 IBM 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 IBM MQ put call fails.
-
put
public void put(java.lang.String qName, java.lang.String qmName, MQMessage msg, MQPutMessageOptions pmo) throws MQExceptionPuts 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 IBM MQ put call fails.
-
put
public void put(java.lang.String qName, java.lang.String qmName, MQMessage msg) throws MQExceptionPuts 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 IBM MQ put call fails.
-
put
public void put(java.lang.String qName, MQMessage msg, MQPutMessageOptions pmo) throws MQExceptionPuts 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 IBM MQ put call fails.
-
put
public void put(java.lang.String qName, MQMessage msg) throws MQExceptionPuts 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 IBM MQ put call fails.
-
put
public void put(int type, java.lang.String destinationName, MQMessage message) throws MQExceptionPlaces or publishes a single message onto a queue or topic without having to create anMQQueueorMQTopicobject 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
destinationNameparameter will adopt different meanings depending upon the destination type being specified in thetypeparameter.The default options used for unspecified parameters may alter depending upon the destination type specified.
Note that the default syncpoint is
CMQC.MQPMO_NO_SYNCPOINTfor 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 thetypeparameter this parameter will adopt different meanings:- If
CMQC.MQOT_Qis specified thedestinationNameparameter directly maps to the queue name - i.e.MQOD.ObjectName. - If
CMQC.MQOT_TOPICis specified thedestinationNameparameter directly maps to the topic object - i.e.MQSD.getObjectName()(the topic object ObjectName property is left blank).
- If
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 MQExceptionPlaces or publishes a single message onto a queue or topic without having to create anMQQueueorMQTopicobject 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
putMessageOptionsparameter are used when putting the message to either the queue or topic. These options will differ depending upon the destination type being specified.The
destinationNameparameter will adopt different meanings depending upon the destination type being specified in thetypeparameter.Note that the default syncpoint is
CMQC.MQPMO_NO_SYNCPOINTfor 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 thetypeparameter this parameter will adopt different meanings:- If
CMQC.MQOT_Qis specified thedestinationNameparameter directly maps to the queue name - i.e.MQOD.ObjectName. - If
CMQC.MQOT_TOPICis specified thedestinationNameparameter directly maps to the topic object - i.e.MQSD.getObjectName()(the topic object ObjectName property is left blank).
- If
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 theMQPutMessageOptions.options,MQPutMessageOptions.resolvedQueueName, andMQPutMessageOptions.resolvedQueueManagerNameproperties.- 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 MQExceptionPlaces or publishes a single message onto a queue or topic without having to create anMQQueueorMQTopicobject 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
destinationNameparameter will adopt different meanings depending upon the destination type being specified in thetypeparameter. Other parameters will be optional.Note that the default syncpoint is
CMQC.MQPMO_NO_SYNCPOINTfor 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 thetypeparameter this parameter will adopt different meanings:- If
CMQC.MQOT_Qis specified thedestinationNameparameter directly maps to the queue name - i.e.MQOD.ObjectName. - If
CMQC.MQOT_TOPICis specified thedestinationNameparameter directly maps to the topic object - i.e.MQSD.getObjectName()(the topic object ObjectName property is left blank).
- If
queueManagerName- The name of the queue manager onto which to place the message. IfCMQC.MQOT_TOPICis specified (as thetype) this parameter is ignored.topicString- The name of the topic string onto which to publish the message. IfCMQC.MQOT_Qis specified (as thetype) 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 MQExceptionPlaces or publishes a single message onto a queue or topic without having to create anMQQueueorMQTopicobject 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
putMessageOptionsparameter are used when putting the message to either the queue or topic. These options will differ depending upon the destination type being specified.The
destinationNameparameter will adopt different meanings depending upon the destination type being specified in thetypeparameter. Other parameters will be optional.Note that the default syncpoint is
CMQC.MQPMO_NO_SYNCPOINTfor 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 thetypeparameter this parameter will adopt different meanings:- If
CMQC.MQOT_Qis specified thedestinationNameparameter directly maps to the queue name - i.e.MQOD.ObjectName. - If
CMQC.MQOT_TOPICis specified thedestinationNameparameter directly maps to the topic object - i.e.MQSD.getObjectName()(the topic object ObjectName property is left blank).
- If
queueManagerName- The name of the queue manager onto which to place the message. IfCMQC.MQOT_TOPICis specified (as thetype) this parameter is ignored.topicString- The name of the topic string onto which to publish the message. IfCMQC.MQOT_Qis specified (as thetype) 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 theMQPutMessageOptions.options,MQPutMessageOptions.resolvedQueueName, andMQPutMessageOptions.resolvedQueueManagerNameproperties.- 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 MQExceptionPlaces or publishes a single message onto a queue or topic without having to create anMQQueueorMQTopicobject first.The options specified in the
putMessageOptionsparameter are used when putting the message to either the queue or topic. These options will differ depending upon the destination type being specified.The
destinationNameparameter will adopt different meanings depending upon the destination type being specified in thetypeparameter. Other parameters will be optional.The
alternateUserIdparameter 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_SYNCPOINTfor 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 thetypeparameter this parameter will adopt different meanings:- If
CMQC.MQOT_Qis specified thedestinationNameparameter directly maps to the queue name - i.e.MQOD.ObjectName. - If
CMQC.MQOT_TOPICis specified thedestinationNameparameter directly maps to the topic object - i.e.MQSD.getObjectName()(the topic object ObjectName property is left blank).
- If
queueManagerName- The name of the queue manager onto which to place the message. IfCMQC.MQOT_TOPICis specified (as thetype) this parameter is ignored.topicString- The name of the topic string onto which to publish the message. IfCMQC.MQOT_Qis specified (as thetype) 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 theMQPutMessageOptions.options,MQPutMessageOptions.resolvedQueueName, andMQPutMessageOptions.resolvedQueueManagerNameproperties.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 specifyCMQC.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 an IBM 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:CMQC.MQOO_BROWSECMQC.MQOO_INPUT_AS_Q_DEFCMQC.MQOO_INPUT_SHAREDCMQC.MQOO_INPUT_EXCLUSIVECMQC.MQOO_OUTPUTCMQC.MQOO_SAVE_ALL_CONTEXTCMQC.MQOO_PASS_IDENTITY_CONTEXTCMQC.MQOO_PASS_ALL_CONTEXTCMQC.MQOO_SET_IDENTITY_CONTEXTCMQC.MQOO_SET_ALL_CONTEXTCMQC.MQOO_ALTERNATE_USER_AUTHORITYCMQC.MQOO_FAIL_IF_QUIESCING
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- ifCMQC.MQOO_ALTERNATE_USER_AUTHORITYis specified in the openOptions parameter this parameter specifies the alternate user ID to be used to check the authorization for the open. IfCMQC.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 IBM 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. SeeaccessQueue(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 an IBM MQ topic. TheMQTopicobject may be opened for either publication or subscription depending upon the value of theopenAsparameter. The value dictates the use of theoptionsparameter - this may map to the equivalentCMQC#MQOOoptions for publication or the equivalentCMQC#MQSOoptions for subscription.The options specified allows the
MQTopicobject 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
MQTopicobject cannot be used for both publication and subscription simultaneously. Therefore, the constructor creates anMQTopicobject 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
TOPICSTRparameter of the topic object named intopicObject. topicName, if the length provided for that string is non-zero.
topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in theoptionsparameter.When creating an
MQTopicfor 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. ThetopicNameparameter directly maps to the ObjectString field of theMQSD(seeMQSD.getObjectString(). The full topic name used is the combination of thetopicObjectandtopicNameparameters.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 lengthtopicName, then the specifiedtopicNameis 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:CMQC.MQOO_ALTERNATE_USER_AUTHORITY-
CMQC.MQOO_BIND_AS_Q_DEF -
CMQC.MQOO_FAIL_IF_QUIESCING -
CMQC.MQOO_OUTPUT -
CMQC.MQOO_PASS_ALL_CONTEXT -
CMQC.MQOO_PASS_IDENTITY_CONTEXT -
CMQC.MQOO_SET_ALL_CONTEXT -
CMQC.MQOO_SET_IDENTITY_CONTEXT
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, thenCMQC.MQSO_CREATE+CMQC.MQSO_ALTERis 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
MQTopicobject that has been successfully opened. - Throws:
MQException- If the call fails.- See Also:
MQTopic.MQTopic(MQQueueManager, String, String, int, int)
- The value of the
-
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 an IBM MQ topic. TheMQTopicobject may be opened for either publication or subscription depending upon the value of theopenAsparameter. The value dictates the use of theoptionsparameter - this may map to the equivalentCMQC#MQOOoptions for publication or the equivalentCMQCMQSOoptions for subscription.If either
CMQC.MQOO_ALTERNATE_USER_AUTHORITYorCMQC.MQSO_ALTERNATE_USER_AUTHORITYis specified in theoptionsparameter, thealternateUserIdparameter is used to check for the necessary authorization.The options specified allows the
MQTopicobject 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
MQTopicobject cannot be used for both publication and subscription simultaneously. Therefore, the constructor creates anMQTopicobject 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
TOPICSTRparameter of the topic object named intopicObject. topicName, if the length provided for that string is non-zero.
topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in theoptionsparameter.When creating an
MQTopicfor 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. ThetopicNameparameter directly maps to the ObjectString field of theMQSD(seeMQSD.getObjectString(). The full topic name used is the combination of thetopicObjectandtopicNameparameters.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 lengthtopicName, then the specifiedtopicNameis 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:CMQC.MQOO_ALTERNATE_USER_AUTHORITY-
CMQC.MQOO_BIND_AS_Q_DEF -
CMQC.MQOO_FAIL_IF_QUIESCING -
CMQC.MQOO_OUTPUT -
CMQC.MQOO_PASS_ALL_CONTEXT -
CMQC.MQOO_PASS_IDENTITY_CONTEXT -
CMQC.MQOO_SET_ALL_CONTEXT -
CMQC.MQOO_SET_IDENTITY_CONTEXT
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, thenCMQC.MQSO_CREATE+CMQC.MQSO_ALTERis 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 eitherCMQC.MQOO_ALTERNATE_USER_AUTHORITYorCMQC.MQSO_ALTERNATE_USER_AUTHORITYis 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_AUTHORITYorCMQC.MQSO_ALTERNATE_USER_AUTHORITYis not specified, this parameter can be left blank (or null).- Returns:
- An
MQTopicobject that has been successfully opened. - Throws:
MQException- If the call fails.- See Also:
MQTopic.MQTopic(MQQueueManager, String, String, int, int, String)
- The value of the
-
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 an IBM MQ topic. The presence of thesubscriptionNameparameter indicates that this constructor may be used for opening the topic for subscriptions only. Theoptionsparameter therefore always maps to the equivalentCMQC#MQSOvalues.If the
CMQC.MQSO_ALTERNATE_USER_AUTHORITYis specified in theoptionsparameter, thealternateUserIdparameter is used to check for the necessary authorization.The options specified allows the
MQTopicobject 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
MQTopicobject 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
TOPICSTRparameter of the topic object named intopicObject. topicName, if the length provided for that string is non-zero.
topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in theoptionsparameter.When creating an
MQTopicfor 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. ThetopicNameparameter directly maps to the ObjectString field of theMQSD(seeMQSD.getObjectString(). The full topic name used is the combination of thetopicObjectandtopicNameparameters.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 lengthtopicName, then the specifiedtopicNameis 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, thenCMQC.MQSO_CREATE+CMQC.MQSO_ALTERis assumed. Other valid options are also available.The constructor can only cater for managed subscriptions. The following options are therefore enforced:
altUserId- IfCMQC.MQSO_ALTERNATE_USER_AUTHORITYis 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_AUTHORITYis not specified, this parameter can be left blank (or null).subscriptionName- This field is only required if theoptionsparameter specifiedCMQC.MQSO_DURABLE, but if provided will be used by the queue manager forCMQC.MQSO_NON_DURABLEas well.For a
CMQC.MQSO_DURABLEsubscription 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_ALTERoption, the subscription name cannot be changed- Returns:
- An
MQTopicobject that has been successfully opened. - Throws:
MQException- If the call fails.- See Also:
MQTopic.MQTopic(MQQueueManager, String, String, int, String, String)
- The value of the
-
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 an IBM MQ topic. The presence of thesubscriptionNameparameter indicates that this constructor may be used for opening the topic for subscriptions only. Theoptionsparameter therefore always maps to the equivalentCMQC#MQSOvalues.If the
CMQC.MQSO_ALTERNATE_USER_AUTHORITYis specified in theoptionsparameter, thealternateUserIdparameter is used to check for the necessary authorization.The options specified allows the
MQTopicobject 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
MQTopicobject 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
TOPICSTRparameter of the topic object named intopicObject. topicName, if the length provided for that string is non-zero.
topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in theoptionsparameter.When creating an
MQTopicfor 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
parametershash 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. ThetopicNameparameter directly maps to the ObjectString field of theMQSD(seeMQSD.getObjectString(). The full topic name used is the combination of thetopicObjectandtopicNameparameters.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 lengthtopicName, then the specifiedtopicNameis 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, thenCMQC.MQSO_CREATE+CMQC.MQSO_ALTERis assumed. Other valid options are also available.The constructor can only cater for managed subscriptions. The following options are therefore enforced:
altUserId- IfCMQC.MQSO_ALTERNATE_USER_AUTHORITYis 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_AUTHORITYis not specified, this parameter can be left blank (or null).subscriptionName- This field is only required if theoptionsparameter specifiedCMQC.MQSO_DURABLE, but if provided will be used by the queue manager forCMQC.MQSO_NON_DURABLEas well.For a
CMQC.MQSO_DURABLEsubscription 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_ALTERoption, the subscription name cannot be changedparameters- 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:CMQC.MQSUB_PROP_ALTERNATE_SECURITY_ID-
CMQC.MQSUB_PROP_SUBSCRIPTION_EXPIRY -
CMQC.MQSUB_PROP_SUBSCRIPTION_USER_DATA -
CMQC.MQSUB_PROP_SUBSCRIPTION_CORRELATION_ID -
CMQC.MQSUB_PROP_PUBLICATION_PRIORITY -
CMQC.MQSUB_PROP_PUBLICATION_ACCOUNTING_TOKEN -
CMQC.MQSUB_PROP_PUBLICATION_APPLICATIONID_DATA
Stringtype properties. The corresponding language conversion routines can be used to convert the values to the relevant types.- Returns:
- An
MQTopicobject that has been successfully opened. - Throws:
MQException- If the call fails.- See Also:
MQTopic.MQTopic(MQQueueManager, String, String, int, String, String, Hashtable)
- The value of the
-
accessTopic
public MQTopic accessTopic(MQDestination destination, java.lang.String topicName, java.lang.String topicObject, int options) throws MQException
Establishes access to an IBM MQ topic. The presence of thedestinationparameter indicates that this constructor may be used for opening the topic for subscriptions only. Theoptionsparameter therefore always maps to the equivalentCMQC#MQSOvalues.The options specified allows the
MQTopicobject 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
MQTopicobject 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
TOPICSTRparameter of the topic object named intopicObject. topicName, if the length provided for that string is non-zero.
topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in theoptionsparameter.When creating an
MQTopicfor 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
destinationparameter 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 existingMQDestinationobject which should receive the publications. For WebSphere MQ v7.0 this will always map to anMQQueueobject. However, other destination types may exist in future.The
MQDestination(MQQueue) object can be created by calling anMQQueueManager#accessQueuemethod or anMQQueueconstructor.The corresponding destination is held as a reference within the
MQTopicobject as the UnmanagedDestinationReference property (seeMQTopic.getUnmanagedDestinationReference().topicName- The topic string to publish or subscribe against. ThetopicNameparameter directly maps to the ObjectString field of theMQSD(seeMQSD.getObjectString(). The full topic name used is the combination of thetopicObjectandtopicNameparameters.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 lengthtopicName, then the specifiedtopicNameis 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, thenCMQC.MQSO_CREATE+CMQC.MQSO_ALTERis 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
MQTopicobject that has been successfully opened. - Throws:
MQException- If the call fails.- See Also:
MQTopic.MQTopic(MQQueueManager, MQDestination, String, String, int)
- The value of the
-
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 an IBM MQ topic. The presence of thedestinationparameter indicates that this constructor may be used for opening the topic for subscriptions only. Theoptionsparameter therefore always maps to the equivalentCMQC#MQSOvalues.If
CMQC.MQSO_ALTERNATE_USER_AUTHORITYis specified in theoptionsparameter, thealternateUserIdparameter is used to check for the necessary authorization.The options specified allows the
MQTopicobject 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
MQTopicobject 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
TOPICSTRparameter of the topic object named intopicObject. topicName, if the length provided for that string is non-zero.
topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in theoptionsparameter.When creating an
MQTopicfor 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
destinationparameter 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 existingMQDestinationobject which should receive the publications. For WebSphere MQ v7.0 this will always map to anMQQueueobject. However, other destination types may exist in future.The
MQDestination(MQQueue) object can be created by calling anMQQueueManager#accessQueuemethod or anMQQueueconstructor.The corresponding destination is held as a reference within the
MQTopicobject as the UnmanagedDestinationReference property (seeMQTopic.getUnmanagedDestinationReference().topicName- The topic string to publish or subscribe against. ThetopicNameparameter directly maps to the ObjectString field of theMQSD(seeMQSD.getObjectString(). The full topic name used is the combination of thetopicObjectandtopicNameparameters.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 lengthtopicName, then the specifiedtopicNameis 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, thenCMQC.MQSO_CREATE+CMQC.MQSO_ALTERis assumed. Other valid options are also available.The constructor can only cater for unmanaged, non-durable subscriptions. The following options are therefore enforced:
altUserId- IfCMQC.MQSO_ALTERNATE_USER_AUTHORITYis 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_AUTHORITYis not specified, this parameter can be left blank (or null).- Returns:
- An
MQTopicobject that has been successfully opened. - Throws:
MQException- If the call fails.- See Also:
MQTopic.MQTopic(MQQueueManager, MQDestination, String, String, int, String)
- The value of the
-
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 an IBM MQ topic. The presence of thedestinationandsubscriptionNameparameters indicates that this constructor may be used for opening the topic for subscriptions only. Theoptionsparameter therefore always maps to the equivalentMQSOvalues.If
CMQC.MQSO_ALTERNATE_USER_AUTHORITYis specified in theoptionsparameter, thealternateUserIdparameter is used to check for the necessary authorization.The options specified allows the
MQTopicobject 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
MQTopicobject 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
TOPICSTRparameter of the topic object named intopicObject. topicName, if the length provided for that string is non-zero.
topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in theoptionsparameter.When creating an
MQTopicfor 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
destinationparameter 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 existingMQDestinationobject which should receive the publications. For WebSphere MQ v7.0 this will always map to anMQQueueobject. However, other destination types may exist in future.The
MQDestination(MQQueue) object can be created by calling anMQQueueManager#accessQueuemethod or anMQQueueconstructor.The corresponding destination is held as a reference within the
MQTopicobject as the UnmanagedDestinationReference property (seeMQTopic.getUnmanagedDestinationReference().topicName- The topic string to publish or subscribe against. ThetopicNameparameter directly maps to the ObjectString field of theMQSD(seeMQSD.getObjectString(). The full topic name used is the combination of thetopicObjectandtopicNameparameters.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 lengthtopicName, then the specifiedtopicNameis 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, thenCMQC.MQSO_CREATE+CMQC.MQSO_ALTERis assumed. Other valid options are:CMQC.MQSO_DURABLECMQC.MQSO_GROUP_SUB-
CMQC.MQSO_MANAGED -
CMQC.MQSO_SET_IDENTITY_CONTEXT -
CMQC.MQSO_FIXED_USERID -
CMQC.MQSO_ANY_USERID -
CMQC.MQSO_PUBLICATIONS_ON_REQUEST -
CMQC.MQSO_NEW_PUBLICATIONS_ONLY -
CMQC.MQSO_FAIL_IF_QUIESCING -
CMQC.MQSO_ALTERNATE_USER_AUTHORITY -
CMQC.MQSO_WILDCARD_CHAR -
CMQC.MQSO_WILDCARD_TOPIC -
CMQC.MQSO_SET_CORREL_ID -
CMQC.MQSO_SCOPE_QMGR -
CMQC.MQSO_NO_READ_AHEAD -
CMQC.MQSO_READ_AHEAD
The constructor can only cater for unmanaged subscriptions. The following options are therefore enforced:
altUserId- IfCMQC.MQSO_ALTERNATE_USER_AUTHORITYis 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_AUTHORITYis not specified, this parameter can be left blank (or null).subscriptionName- This field is only required if theoptionsparameter specifiedCMQC.MQSO_DURABLE, but if provided will be used by the queue manager forCMQC.MQSO_NON_DURABLEas well.For a
CMQC.MQSO_DURABLEsubscription 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_ALTERoption, the subscription name cannot be changed- Returns:
- An
MQTopicobject that has been successfully opened. - Throws:
MQException- If the call fails.- See Also:
MQTopic.MQTopic(MQQueueManager, MQDestination, String, String, int, String, String)
- The value of the
-
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 an IBM MQ topic. The presence of thedestinationandsubscriptionNameparameters indicates that this constructor may be used for opening the topic for subscriptions only. Theoptionsparameter therefore always maps to the equivalentCMQC#MQSOvalues.If
CMQC.MQSO_ALTERNATE_USER_AUTHORITYis specified in theoptionsparameter, thealternateUserIdparameter is used to check for the necessary authorization.The options specified allows the
MQTopicobject 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
MQTopicobject 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
TOPICSTRparameter of the topic object named intopicObject. topicName, if the length provided for that string is non-zero.
topicName, the interpretation of those wildcards can be controlled using the wildcard options specified in theoptionsparameter.When creating an
MQTopicfor 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
destinationparameter 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
parametershash 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 existingMQDestinationobject which should receive the publications. For WebSphere MQ v7.0 this will always map to anMQQueueobject. However, other destination types may exist in future.The
MQDestination(MQQueue) object can be created by calling anMQQueueManager#accessQueuemethod or anMQQueueconstructor.The corresponding destination is held as a reference within the
MQTopicobject as the UnmanagedDestinationReference property (seeMQTopic.getUnmanagedDestinationReference().topicName- The topic string to publish or subscribe against. ThetopicNameparameter directly maps to the ObjectString field of theMQSD(seeMQSD.getObjectString(). The full topic name used is the combination of thetopicObjectandtopicNameparameters.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 lengthtopicName, then the specifiedtopicNameis 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, thenCMQC.MQSO_CREATE+CMQC.MQSO_ALTERis assumed. Other valid options are:CMQC.MQSO_DURABLECMQC.MQSO_GROUP_SUB-
CMQC.MQSO_MANAGED -
CMQC.MQSO_SET_IDENTITY_CONTEXT -
CMQC.MQSO_FIXED_USERID -
CMQC.MQSO_ANY_USERID -
CMQC.MQSO_PUBLICATIONS_ON_REQUEST -
CMQC.MQSO_NEW_PUBLICATIONS_ONLY -
CMQC.MQSO_FAIL_IF_QUIESCING -
CMQC.MQSO_ALTERNATE_USER_AUTHORITY -
CMQC.MQSO_WILDCARD_CHAR -
CMQC.MQSO_WILDCARD_TOPIC -
CMQC.MQSO_SET_CORREL_ID -
CMQC.MQSO_SCOPE_QMGR -
CMQC.MQSO_NO_READ_AHEAD -
CMQC.MQSO_READ_AHEAD
The constructor can only cater for unmanaged subscriptions. The following options are therefore enforced:
altUserId- IfCMQC.MQSO_ALTERNATE_USER_AUTHORITYis 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_AUTHORITYis not specified, this parameter can be left blank (or null).subscriptionName- This field is only required if theoptionsparameter specifiedCMQC.MQSO_DURABLE, but if provided will be used by the queue manager forCMQC.MQSO_NON_DURABLEas well.For a
CMQC.MQSO_DURABLEsubscription 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_ALTERoption, the subscription name cannot be changedparameters- 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:CMQC.MQSUB_PROP_ALTERNATE_SECURITY_ID-
CMQC.MQSUB_PROP_SUBSCRIPTION_EXPIRY -
CMQC.MQSUB_PROP_SUBSCRIPTION_USER_DATA -
CMQC.MQSUB_PROP_SUBSCRIPTION_CORRELATION_ID -
CMQC.MQSUB_PROP_PUBLICATION_PRIORITY -
CMQC.MQSUB_PROP_PUBLICATION_ACCOUNTING_TOKEN -
CMQC.MQSUB_PROP_PUBLICATION_APPLICATIONID_DATA
Stringtype properties. The corresponding language conversion routines can be used to convert the values to the relevant types.- Returns:
- An
MQTopicobject that has been successfully opened. - Throws:
MQException- If the call fails.- See Also:
MQTopic.MQTopic(MQQueueManager, MQDestination, String, String, int, String, String, Hashtable)
- The value of the
-
accessProcess
public MQProcess accessProcess(java.lang.String processName, int openOptionsArg, java.lang.String queueManagerName, java.lang.String alternateUserIdArg) throws MQException
Establishes access to an IBM MQ process on this queue manager in order to inquire about the process attributes.- Parameters:
processName- name of the process to openopenOptionsArg- 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- ifCMQC.MQOO_ALTERNATE_USER_AUTHORITYis 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 an IBM MQ process on this queue manager using default queue manager name and alternative user ID values.- Parameters:
processName- name of process to open.openOptionsArg- seeopenOptionsfor 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.
-
-