MQQueueManager class

This class represents a connection to a queue manager. The queue manager may be running locally (a WebSphere MQ server) or remotely with access provided by the WebSphere MQ client. An application must create an object of this class and connect it to a queue manager. When an object of this class is destroyed it is automatically disconnected from its queue manager.

Containment

MQQueue class objects are associated with this class.

Creation

New creates a new MQQueueManager object and sets all the properties to initial values. Alternatively use the AccessQueueManager method of the MQSession class.

Syntax

Dim mgr As New MQQueueManager
set mgr = New MQQueueManager

Properties

Methods

Property Access

The following properties can be accessed at any time

The remaining properties can be accessed only if the object is connected to a queue manager, and the user ID is authorized to inquire against that queue manager. If an alternate user ID is set and the current user ID is authorized to use it, the alternate user ID is checked for authorization for inquire instead.

If these conditions do not apply, WebSphere MQ Automation Classes for ActiveX attempts to connect to the queue manager and open it for inquire automatically. If this is unsuccessful, the call sets a CompletionCode of MQCC_FAILED and one of the following ReasonCodes:

The Backout, Begin, Commit, Connect, and Disconnect methods set errors matching those set by the MQI calls MQBACK, MQBEGIN, MQCMIT, MQCONN, and MQDISC respectively.

AlternateUserId property

Read-write. The alternate user ID to be used to validate access to the queue manager attributes.

This property should not be set if IsConnected is TRUE.

This property cannot be set whilst the object is open.

Defined in: MQQueueManager class

Data Type: String of 12 characters

Syntax:
To get: altuser$ = MQQueueManager.AlternateUserId
To set: MQQueueManager.AlternateUserId = altuser$

AuthorityEvent property

Read-only. The MQI AuthorityEvent attribute.

Defined in:
MQQueueManager class

Data Type:
Long

Values:

Syntax:
To get: authevent = MQQueueManager.AuthorityEvent

BeginOptions property

Read-write. These are the options that apply to the Begin method.
Initially MQBO_NONE.

Defined in:
MQQueueManager class

Data Type:
Long

Values:

Syntax:
To get: beginoptions&=MQQueueManager.BeginOptions

To set: MQQueueManager.BeginOptions=beginoptions&

ChannelAutoDefinition property

Read-only. This controls whether automatic channel definition is permitted.

Defined in:
MQQueueManager class

Data Type:
Long

Values:

Syntax:
To get: channelautodef&= MQQueueManager.ChannelAutoDefinition

ChannelAutoDefinitionEvent property

Read-only. This controls whether automatic channel definition events are generated.

Defined in:
MQQueueManager class

Data Type:
Long

Values:

Syntax:
To get: channelautodefevent&=MQQueueManager.ChannelAutoDefinitionEvent

ChannelAutoDefinitionExit property

Read-only. The name of the user exit used for automatic channel definition.

Defined in:
MQQueueManager class

Data Type:
String

Syntax:
To get: channelautodefexit$= MQQueueManager.ChannelAutoDefinitionExit

CharacterSet property

Read-only. The MQI CodedCharSetId attribute.

Defined in: MQQueueManager class

Data Type: Long

Syntax:
To get: characterset&= MQQueueManager.CharacterSet

CloseOptions property

Read-write. Options used to control what happens when the queue manger is closed. The initial value is MQCO_NONE.

Defined in:
MQQueueManager class

Data Type:
Long

Values:

Syntax:
To get: closeopt& = MQQueueManager.CloseOptions

To set: MQQueueManager.CloseOptions =closeopt&

CommandInputQueueName property

Read-only. The MQI CommandInputQName attribute.

Defined in: MQQueueManager class

Data Type: String of 48 characters

Syntax:
To get: commandinputqname$ = MQQueueManager.CommandInputQueueName

CommandLevel property

Read-only. Returns the version and level of the WebSphere MQ queue manager implementation (MQI CommandLevel attribute)

Defined in: MQQueueManager class

Data Type: Long

Syntax:
To get: level& = MQQueueManager.CommandLevel

CompletionCode property

Read-only. Returns the completion code set by the last method or property access issued against the object.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: completioncode& = MQQueueManager.CompletionCode

ConnectionHandle property

Read-only. The connection handle for the WebSphere MQ queue manager object.

Defined in:
MQQueueManager class

Data Type:
Long

Syntax:
To get: hconn& = MQQueueManager.ConnectionHandle

ConnectionStatus property

Read-only. Indicates if the object is connected to its queue manager or not.

Defined in: MQQueueManager class

Data Type: Boolean

Values:

Syntax:
To get: status = MQQueueManager.ConnectionStatus

ConnectOptions property

Read-Write. These options apply to the Connect method. Initially MQCNO_NONE.

Defined in:
MQQueueManager class

Data Type:
Long

Values:

Syntax:
To get: connectoptions&=MQQueueManager.ConnectOptions

To set: MQQueueManager.ConnectOptions=connectoptions&

DeadLetterQueueName property

Read-only. The MQI DeadLetterQName attribute.

Defined in: MQQueueManager class

Data Type: String of 48 characters

Syntax:
to get: dlqname$ = MQQueueManager.DeadLetterQueueName

DefaultTransmissionQueueName property

Read-only. The MQI DefXmitQName attribute.

Defined in: MQQueueManager class

Data Type: String of 48 characters

Syntax:
To get: defxmitqname$ = MQQueueManager.DefaultTransmissionQueueName

Description property

Read-only. The MQI QMgrDesc attribute.

Defined in: MQQueueManager class

Data Type: String of 64 characters

Syntax:
To get: description$ = MQQueueManager.Description

DistributionLists property

Read-Only. This is the capability of the queue manager to support distribution lists.

Defined in:
MQQueueManager class

Data Type:
Boolean

Values:

Syntax:
To get: distributionlists= MQQueueManager.DistributionLists

InhibitEvent property

Read-only. The MQI InhibitEvent attribute.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: inhibevent& = MQQueueManager.InhibitEvent

IsConnected property

Read-only. A value that indicates whether or not the queue manager is currently connected.

Defined in: MQQueueManager class

Data Type: Boolean

Values:

Syntax:
To get: isconnected = MQQueueManager.IsConnected

IsOpen property

Read-only. A value that indicates whether or not the queue manager is currently open for inquire.

Defined in:
MQQueueManager class

Data Type:
Boolean

Values:

Syntax:
To get: IsOpen = MQQueueManager.IsOpen

LocalEvent property

Read-only. The MQI LocalEvent attribute.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: localevent& = MQQueueManager.LocalEvent

MaximumHandles property

Read-only. The MQI MaxHandles attribute.

Defined in: MQQueueManager class

Data Type: Long

Syntax:
To get: maxhandles& = MQQueueManager.MaximumHandles

MaximumMessageLength property

Read-only. The MQI MaxMsgLength Queue Manager attribute.

Defined in: MQQueueManager class

Data Type: Long

Syntax:
To get: maxmessagelength& = MQQueueManager.MaximumMessageLength

MaximumPriority property

Read-only. The MQI MaxPriority attribute.

Defined in: MQQueueManager class

Data Type: Long

Syntax:
To get: maxpriority& = MQQueueManager.MaximumPriority

MaximumUncommittedMessages property

Read-only. The MQI MaxUncommittedMsgs attribute.

Defined in: MQQueueManager class

Data Type: Long

Syntax:
To get: maxuncommitted& = MQQueueManager.MaximumUncommittedMessages

Name property

Read-write. The MQI QMgrName attribute. This property cannot be written once the MQQueueManager is connected.

Defined in: MQQueueManager class

Data Type: String of 48 characters

Syntax:
To get: name$ = MQQueueManager.name

To set: MQQueueManager.name = name$

Note:
Visual Basic reserves the "Name" property for use in the visual interface. Therefore, when using within Visual Basic use lower-case, that is, "name".

ObjectHandle property

Read-only. The object handle for the WebSphere MQ queue manager object.

Defined in:
MQQueueManager class

Data type
Long

Syntax:
To get: hobj& = MQQueueManager.ObjectHandle

PerformanceEvent property

Read-only. The MQI PerformanceEvent attribute.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: perfevent& = MQQueueManager.PerformanceEvent

Platform property

Read-only. The MQI Platform attribute.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: platform& = MQQueueManager.Platform

ReasonCode property

Read-only. Returns the reason code set by the last method or property access issued against the object.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: reasoncode& = MQQueueManager.ReasonCode

ReasonName property

Read-only. Returns the symbolic name of the latest reason code. For example, "MQRC_QMGR_NOT_AVAILABLE".

Defined in: MQQueueManager class

Data Type: String

Values:

Syntax:
To get: reasonname$ = MQQueueManager.ReasonName

RemoteEvent property

Read-only. The MQI RemoteEvent attribute.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: remoteevent& = MQQueueManager.RemoteEvent

StartStopEvent property

Read-only. The MQI StartStopEvent attribute.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: strstpevent& = MQQueueManager.StartStopEvent

SyncPointAvailability property

Read-only. The MQI SyncPoint attribute.

Defined in: MQQueueManager class

Data Type: Long

Values:

Syntax:
To get: syncpointavailability& = MQQueueManager.SyncPointAvailability

TriggerInterval property

Read-only. The MQI TriggerInterval attribute.

Defined in: MQQueueManager class

Data Type: Long

Syntax:
To get: trigint& = MQQueueManager.TriggerInterval

AccessQueue method

Creates a new MQQueue object and associates it with this MQQueueManager object by setting the queue's connection reference property. It sets the Name, OpenOptions, DynamicQueueName, and AlternateUserId properties of the MQQueue object to the values provided, and attempts to open it.

If the open is unsuccessful the call fails. An error event is raised against the object, the object's ReasonCode and CompletionCode are set, and the MQSession ReasonCode and CompletionCode are set.

The DynamicQueueName, QueueManagerName, and AlternateUserId parameters are optional and default to "".

The OpenOption MQOO_INQUIRE should be specified in addition to other options if queue properties are to be read.

Do not set the QueueManagerName, or set it to "" if the queue to be opened is local. Otherwise, it should be set to the name of the remote queue manager that owns the queue, and an attempt is made to open a local definition of the remote queue. See the WebSphere MQ Application Programming Guide for more information on remote queue name resolution and queue manager aliasing.

If the Name property is set to a model queue name, specify the name of the dynamic queue to be created in the DynamicQueueName$ parameter. If the value provided in the DynamicQueueName$ parameter is "", the value set into the queue object and used on the open call is "AMQ.*". See the WebSphere MQ Application Programming Guide for more information on naming dynamic queues.

Defined in:

MQQueueManager class.

Syntax:

set queue = MQQueueManager.AccessQueue(Name$, OpenOptions&,QueueManagerName$, DynamicQueueName$, AlternateUserId$)

Parameters

Name$
String. Name of WebSphere MQ queue.

OpenOptions:
Long. Options to be used when queue is opened. See the WebSphere MQ Application Programming Reference.

QueueManagerName$
String. Name of the queue manager that owns the queue to be opened. A value of "" implies the queue manager is local.

DynamicQueueName$
String. The name assigned to the dynamic queue at the time the queue is opened when the Name$ parameter specifies a model queue.

AlternateUserId$
String. The alternate user ID used to validate access when opening the queue.

AddDistributionList method

Creates a new MQDistributionList object and sets its connection reference to the owning queue manager.

Defined in:
MQQueueManager class

Syntax:
set distributionlist = MQQueueManager.AddDistributionList

Backout method

Backs out any uncommitted message puts and gets that have occurred as part of a unit of work since the last syncpoint.

Defined in: MQQueueManager class

Syntax:
Call MQQueueManager.Backout()

Begin method

Begins a unit of work that is coordinated by the queue manager. The begin options affect the behavior of this method.

Defined in:
MQQueueManager class

Syntax:
Call MQQueueManager.Begin()

ClearErrorCodes method

Resets the CompletionCode to MQCC_OK and the ReasonCode to MQRC_NONE for both the MQQueueManager class and the MQSession class.

Defined in: MQQueueManager class

Syntax:
Call MQQueueManager.ClearErrorCodes()

Commit method

Commits any message puts and gets that have occurred as part of a unit of work since the last syncpoint.

Defined in: MQQueueManager class

Syntax:
Call MQQueueManager.Commit()

Connect method

Connects the MQQueueManager object to a real queue manager via the WebSphere MQ client or server. As well as performing a connect, this method also performs an open for queries to be made against the queue manager object.

Sets IsConnected to TRUE.

A maximum of one MQQueueManager object per ActiveX instance is allowed to connect to a queue manager.

Defined in: MQQueueManager class

Syntax:
Call MQQueueManager.Connect()

Disconnect method

Disconnects the MQQueueManager object from the queue manager.

Sets IsConnected to FALSE.

All Queue objects associated with the MQQueueManager object are made unusable and cannot be re-opened.

Any uncommitted changes (message puts and gets) are committed.

Defined in: MQQueueManager class

Syntax:
Call MQQueueManager.Disconnect()



© IBM Corporation 2002. All Rights Reserved