com.ibm.mq
Class MQQueueManager
- java.lang.Object
- com.ibm.mq.jmqi.JmqiObject
- com.ibm.mq.MQManagedObject
- com.ibm.mq.MQQueueManager
- public class MQQueueManager
- extends MQManagedObject
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 MQC.MQGMO_WAIT
(for
example) will therefore block any other threads attempting to make WebSphere MQ calls using the
same MQQueueManager until the get completes.
Field Summary
Modifier and Type | Field and Description |
---|---|
|
isConnected
Deprecated. Use the
isConnected() method instead.
|
Fields inherited from class com.ibm.mq.MQManagedObject |
---|
alternateUserId, closeOptions, connectionReference, isOpen, name, openOptions |
Fields inherited from class com.ibm.mq.jmqi.JmqiObject |
---|
COMP_JM, COMP_JN, COMP_JO |
Constructor Summary
Constructor and Description |
---|
MQQueueManager(java.lang.String queueManagerName)
Creates a connection to the named queue manager.
|
MQQueueManager(java.lang.String queueManagerName,javax.resource.spi.ConnectionManager connectionManager)
Deprecated. Please MQConnectionManager instead of ConnectionManager
|
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,javax.resource.spi.ConnectionManager connectionManager)
Deprecated. Please MQConnectionManager instead of ConnectionManager
|
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
MQEnvironment class 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,javax.resource.spi.ConnectionManager connectionManager)
Deprecated. Please MQConnectionManager instead of ConnectionManager
|
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,javax.resource.spi.ConnectionManager connectionManager)
Deprecated. Please MQConnectionManager instead of ConnectionManager
|
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
Modifier and Type | Method and Description |
---|---|
accessDistributionList(MQDistributionListItem[] items,int options)
Creates a distribution list using the default alternative user ID.
|
|
accessDistributionList(MQDistributionListItem[] items,int options,java.lang.String id)
Creates a distribution list.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
accessTopic(MQDestination destination,java.lang.String topicName,java.lang.String topicObject,int options)
Establishes access to a WebSphere MQ topic.
|
|
accessTopic(MQDestination destination,java.lang.String topicName,java.lang.String topicObject,int options,java.lang.String altUserId)
Establishes access to a WebSphere MQ topic.
|
|
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.
|
|
accessTopic(MQDestination destination,java.lang.String topicName,java.lang.String topicObject,int options,java.lang.String altUserId,java.lang.String subscriptionName,java.util.Hashtable parameters)
Establishes access to a WebSphere MQ topic.
|
|
accessTopic(java.lang.String topicName,java.lang.String topicObject,int openAs,int options)
Establishes access to a WebSphere MQ topic.
|
|
accessTopic(java.lang.String topicName,java.lang.String topicObject,int openAs,int options,java.lang.String altUserId)
Establishes access to a WebSphere MQ topic.
|
|
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.
|
|
accessTopic(java.lang.String topicName,java.lang.String topicObject,int options,java.lang.String altUserId,java.lang.String subscriptionName,java.util.Hashtable parameters)
Establishes access to a WebSphere MQ topic.
|
|
|
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.
|
|
begin()
Begins a new unit of work.
|
|
commit()
Indicates to the queue manager that the application has reached a syncpoint.
|
|
disconnect()
Ends the connection to the queue manager.
|
getAsyncStatus()
Requests asynchronous error status from the queue manager.
|
|
|
getCCDTURL()
Returns the URL of the channel definition file, or null if it does not exist.
|
|
getCharacterSet()
Gets the CCSID (Coded Character Set Identifier) of the queue manager's codeset.
|
|
getCommandInputQueueName()
Gets the name of the command input queue defined on the queue manager.
|
|
getCommandLevel()
Indicates the level of system control commands supported by the queue manager.
|
|
getDistributionListCapable()
Indicates whether the queue manager supports distribution lists.
|
|
getJDBCConnection(javax.sql.XADataSource xads)
Returns a Connection object for use with the JTA-JDBC support.
|
|
getJDBCConnection(javax.sql.XADataSource xads,java.lang.String userid,java.lang.String password)
Registers a database for coordination.
|
|
getMaximumMessageLength()
Gets the maximum length of a message that the queue manager can handle.
|
|
getMaximumPriority()
Gets the maximum message priority supported by the queue manager.
|
|
getSyncpointAvailability()
Indicates whether the queue manager supports units of work and syncpointing with the
MQQueue.get() and MQQueue.put()
methods.
|
|
isConnected()
Indicates whether this object is currently connected to a WebSphere MQ queue manager.
|
|
put(int type,java.lang.String destinationName,MQMessage message)
|
|
put(int type,java.lang.String destinationName,MQMessage message,MQPutMessageOptions putMessageOptions)
|
|
put(int type,java.lang.String destinationName,java.lang.String queueManagerName,java.lang.String topicString,MQMessage message)
|
|
put(int type,java.lang.String destinationName,java.lang.String queueManagerName,java.lang.String topicString,MQMessage message,MQPutMessageOptions putMessageOptions)
|
|
put(int type,java.lang.String destinationName,java.lang.String queueManagerName,java.lang.String topicString,MQMessage message,MQPutMessageOptions putMessageOptions,java.lang.String altUserId)
|
|
put(java.lang.String qName,MQMessage msg)
Puts a single message on to a (possibly unopened) queue.
|
|
put(java.lang.String qName,MQMessage msg,MQPutMessageOptions pmo)
Puts a single message on to a (possibly unopened) queue.
|
|
put(java.lang.String qName,java.lang.String qmName,MQMessage msg)
Puts a single message on to a (possibly unopened) queue.
|
|
put(java.lang.String qName,java.lang.String qmName,MQMessage msg,MQPutMessageOptions pmo)
Puts a single message on to a (possibly unopened) queue.
|
|
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 com.ibm.mq.MQManagedObject |
---|
close, getAlternateUserId, getAttributeString, getCloseOptions, getConnectionReference, getDescription, getName, getOpenOptions, getResolvedObjectString, getResolvedQName, getResolvedType, inquire, inquire, isOpen, set, setAttributeString, setCloseOptions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
isConnected
- public boolean isConnected
isConnected()
method instead.Constructor Detail
MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName)
- throws MQException
The host name, channel name and port to use during the connection request are specified in the
MQEnvironment
class. 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.
queueManagerName
- the name of the queue manager to which to connect. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- int options)
- throws MQException
queueManagerName
- the name of the queue manager. options
- binding options. Possible values are:
MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- java.util.Hashtable properties)
- throws MQException
MQEnvironment
.
queueManagerName
- the name of the queue manager. properties
- connection properties. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- com.ibm.mq.MQConnectionManager connectionManager)
- throws MQException
queueManagerName
- the name of the queue manager. connectionManager
- the connection manager that will handle this connection. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- int options,
- com.ibm.mq.MQConnectionManager connectionManager)
- throws MQException
queueManagerName
- the name of the queue manager. options
- binding options. Possible values are:
connectionManager
- the connection manager that will handle this connection. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- java.util.Hashtable properties,
- com.ibm.mq.MQConnectionManager connectionManager)
- throws MQException
MQEnvironment
class with those in the given Hashtable.
queueManagerName
- the name of the queue manager. properties
- connection properties. connectionManager
- the connection manager that will handle this connection. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- javax.resource.spi.ConnectionManager connectionManager)
- throws MQException
queueManagerName
- the name of the queue manager. connectionManager
- the connection manager which will handle this connection. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- int options,
- javax.resource.spi.ConnectionManager connectionManager)
- throws MQException
queueManagerName
- the name of the queue manager. options
- binding options. Possible values are:
connectionManager
- the Connection manager that handles this connection MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- java.util.Hashtable properties,
- javax.resource.spi.ConnectionManager connectionManager)
- throws MQException
MQEnvironment
.
queueManagerName
- the name of the queue manager. properties
- connection properties. connectionManager
- the ConnectionManager which handles this connection. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- java.net.URL url)
- throws MQException
MQEnvironment
class when opening a channel.
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. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- java.util.Hashtable properties,
- java.net.URL url)
- throws MQException
MQEnvironment
class when opening a channel. Properties
other than those defined by the client channel definition table may be supplied with this
constructor.
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. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- java.net.URL url,
- javax.resource.spi.ConnectionManager connectionManager)
- throws MQException
MQEnvironment
class when opening a channel. The queue
manager name parameter can be in one of the following forms:
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 table to be used in connecting to the
queue manager. connectionManager
- the connection manager. MQException
- if there are connection problems. MQQueueManager
- public MQQueueManager(java.lang.String queueManagerName,
- java.net.URL url,
- com.ibm.mq.MQConnectionManager connectionManager)
- throws MQException
MQEnvironment
class when opening a channel.
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. 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
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. 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
begin()
.
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. 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()
disconnect()
to disconnect from a queue manager.
getCharacterSet
- public int getCharacterSet()
- throws MQException
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
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
CMQC.MQCMDL_LEVEL_1
and
CMQC.MQCMDL_LEVEL_600
. 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
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
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 MQException
MQQueue.get()
and MQQueue.put()
methods.
CMQC.MQSP_AVAILABLE
if syncpointing is available, or
CMQC.MQSP_NOT_AVAILABLE
if not. 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( )
disconnect
- public void disconnect()
- throws MQException
MQException
- if the MQ disconnect call fails. commit
- public void commit()
- throws MQException
MQC.MQPMO_SYNCPOINT
flag
set in MQPutMessageOptions.options
) are made available to
other applications. Messages retrieved as part of a unit of work (with the
MQC.MQGMO_SYNCPOINT
flag set in MQGetMessageOptions.options
) are deleted.
backout
- public void backout()
- throws MQException
MQC.MQPMO_SYNCPOINT
flag set in the options field of
MQPutMessageOptions) are deleted. Messages retrieved as part of a unit of work (with the
MQC.MQGMO_SYNCPOINT
flag set in MQGetMessageOptions.options
) are reinstated on the queue.
begin
- public void begin()
- throws MQException
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
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. 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
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. MQException
- if the WebSphere MQ put call fails. put
- public void put(java.lang.String qName,
- java.lang.String qmName,
- MQMessage msg)
- throws MQException
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. MQException
- if the WebSphere MQ put call fails. put
- public void put(java.lang.String qName,
- MQMessage msg,
- MQPutMessageOptions pmo)
- throws MQException
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. MQException
- if the WebSphere MQ put call fails. put
- public void put(java.lang.String qName,
- MQMessage msg)
- throws MQException
qName
- the name of the queue to which the message is put. msg
- the message to be sent. MQException
- if the WebSphere MQ put call fails. put
- public void put(int type,
- java.lang.String destinationName,
- MQMessage message)
- throws MQException
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 MQC.MQPMO_NO_SYNCPOINT
for all platforms.
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 thedestinationName
parameter directly maps to the queue name - i.e.MQOD.ObjectName
. - If
CMQC.MQOT_TOPIC
is specified thedestinationName
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. MQException
- If the call fails. put
- public void put(int type,
- java.lang.String destinationName,
- MQMessage message,
- MQPutMessageOptions putMessageOptions)
- throws MQException
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 MQC.MQPMO_NO_SYNCPOINT
for all platforms.
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 thedestinationName
parameter directly maps to the queue name - i.e.MQOD.ObjectName
. - If
CMQC.MQOT_TOPIC
is specified thedestinationName
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. 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
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 MQC.MQPMO_NO_SYNCPOINT
for all platforms.
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 thedestinationName
parameter directly maps to the queue name - i.e.MQOD.ObjectName
. - If
CMQC.MQOT_TOPIC
is specified thedestinationName
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. 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
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 MQC.MQPMO_NO_SYNCPOINT
for all platforms.
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 thedestinationName
parameter directly maps to the queue name - i.e.MQOD.ObjectName
. - If
CMQC.MQOT_TOPIC
is specified thedestinationName
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. 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
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 MQC.MQPMO_NO_SYNCPOINT
for all platforms.
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 thedestinationName
parameter directly maps to the queue name - i.e.MQOD.ObjectName
. - If
CMQC.MQOT_TOPIC
is specified thedestinationName
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. 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
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.
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_BROWSE
-
CMQC.MQOO_INPUT_AS_Q_DEF
-
CMQC.MQOO_INPUT_SHARED
-
CMQC.MQOO_INPUT_EXCLUSIVE
-
CMQC.MQOO_OUTPUT
-
CMQC.MQOO_SAVE_ALL_CONTEXT
-
CMQC.MQOO_PASS_IDENTITY_CONTEXT
-
CMQC.MQOO_PASS_ALL_CONTEXT
-
CMQC.MQOO_SET_IDENTITY_CONTEXT
-
CMQC.MQOO_SET_ALL_CONTEXT
-
CMQC.MQOO_ALTERNATE_USER_AUTHORITY
-
CMQC.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
- if MQC.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 MQC.MQOO_ALTERNATE_USER_AUTHORITY
is not specified, this parameter can be left blank
(or null). MQException
- if the open fails. accessQueue
- public MQQueue accessQueue(java.lang.String queueName,
- int openOptionsArg)
- throws MQException
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. MQException
- if the open fails. accessTopic
- public MQTopic accessTopic(java.lang.String topicName,
- java.lang.String topicObject,
- int openAs,
- int options)
- throws MQException
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 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 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.
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:
-
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_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:
MQTopic
object that has been successfully opened. MQException
- If the call fails. accessTopic
- public MQTopic accessTopic(java.lang.String topicName,
- java.lang.String topicObject,
- int openAs,
- int options,
- java.lang.String altUserId)
- throws MQException
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 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 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.
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:
-
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_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).
MQTopic
object that has been successfully opened. MQException
- If the call fails. accessTopic
- public MQTopic accessTopic(java.lang.String topicName,
- java.lang.String topicObject,
- int options,
- java.lang.String altUserId,
- java.lang.String subscriptionName)
- throws MQException
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 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 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.
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
MQTopic
object that has been successfully opened. MQException
- If the call fails. 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 parameters)
- throws MQException
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 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 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.
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:
-
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
String
type properties. The corresponding language
conversion routines can be used to convert the values to the relevant types. MQTopic
object that has been successfully opened. MQException
- If the call fails. accessTopic
- public MQTopic accessTopic(MQDestination destination,
- java.lang.String topicName,
- java.lang.String topicObject,
- int options)
- throws MQException
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 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 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.
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:
MQTopic
object that has been successfully opened. MQException
- If the call fails. accessTopic
- public MQTopic accessTopic(MQDestination destination,
- java.lang.String topicName,
- java.lang.String topicObject,
- int options,
- java.lang.String altUserId)
- throws MQException
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 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 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.
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).
MQTopic
object that has been successfully opened. MQException
- If the call fails. 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
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 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 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.
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:
-
CMQC.MQSO_DURABLE
-
CMQC.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
- 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
MQTopic
object that has been successfully opened. MQException
- If the call fails. 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 parameters)
- throws MQException
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 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 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.
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:
-
CMQC.MQSO_DURABLE
-
CMQC.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
- 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:
-
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
String
type properties. The corresponding language
conversion routines can be used to convert the values to the relevant types. MQTopic
object that has been successfully opened. MQException
- If the call fails. accessProcess
- public MQProcess accessProcess( java.lang.String processName,
- int openOptionsArg,
- java.lang.String queueManagerName,
- java.lang.String alternateUserIdArg)
- throws MQException
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. MQException
- if the open fails. accessProcess
- public MQProcess accessProcess( java.lang.String processName,
- int openOptionsArg)
- throws MQException
processName
- name of process to open. openOptionsArg
- see openOptions
for
details. MQException
- if the open fails. accessDistributionList
- public MQDistributionList accessDistributionList( MQDistributionListItem[] items,
- int options,
- java.lang.String id)
- throws MQException
items
- the elements of the distribution list. options
- the open options for the distribution list. id
- the alternative user ID. MQException
- if there is a problem opening the distribution list. accessDistributionList
- public MQDistributionList accessDistributionList( MQDistributionListItem[] items,
- int options)
- throws MQException
items
- the elements of the distribution list. options
- the open options for the distribution list. MQException
- if there is a problem opening the distribution list. getAsyncStatus
- public MQAsyncStatus getAsyncStatus( )
- throws MQException
MQException
- if there is a problem requesting asynchronous error status from the
queue manager. getCCDTURL
- public java.net.URL getCCDTURL( )
disconnect()
method to disconnect from a queue manager.