com.ibm.mq
Class MQManagedObject

java.lang.Object
  |
  +--com.ibm.mq.MQManagedObject
Direct Known Subclasses:
MQDistributionList, MQProcess, MQQueue, MQQueueManager

public class MQManagedObject
extends java.lang.Object

MQManagedObject is a superclass for MQDistributionList, MQProcess, MQQueue, MQQueueManager. It provides the ability to inquire and set attributes of these objects.

See Also:
MQQueueManager, MQQueue, MQProcess, MQDistributionList

Field Summary
 java.lang.String alternateUserId
          The alternative user ID specified (if any) when this resource was opened.
 int closeOptions
          Controls the way the resource is closed.
 MQQueueManager connectionReference
          The queue manager to which this resource belongs.
 boolean isOpen
          Deprecated. use the isOpen() method instead.
 java.lang.String name
          The name of this resource.
 int openOptions
          The options specified when this resource was opened.
 
Method Summary
 void close()
          Closes the object.
 java.lang.String getAttributeString(int aSelector, int length)
          Gets an attribute string.
 java.lang.String getDescription()
          Gets the description of this resource as held by the queue manager.
 void inquire(int[] selectors, int[] intAttrs, byte[] charAttrs)
          Queries requested attributes of the object.
 boolean isOpen()
          Indicates whether this object is open.
 void set(int[] selectors, int[] intAttrs, byte[] charAttrs)
          Sets requested attributes of the object.
 void setAttributeString(int aSelector, java.lang.String aValue, int length)
          Sets an attribute string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

alternateUserId

public java.lang.String alternateUserId
The alternative user ID specified (if any) when this resource was opened. Setting this attribute has no effect.


name

public java.lang.String name
The name of this resource. This is either the name supplied by the access method, or the name allocated by the queue manager for a dynamic queue. Setting this attribute has no effect.


openOptions

public int openOptions
The options specified when this resource was opened. Setting this attribute has no effect.


isOpen

public boolean isOpen
Deprecated. use the isOpen() method instead.

Indicates whether this resource is currently open. Do not set this attribute.


connectionReference

public MQQueueManager connectionReference
The queue manager to which this resource belongs. Setting this attribute has no effect.


closeOptions

public int closeOptions
Controls the way the resource is closed. Permitted values are:

Method Detail

isOpen

public boolean isOpen()
Indicates whether this object is open.

Returns:
true if the object is open.

getDescription

public java.lang.String getDescription()
                                throws MQException
Gets the description of this resource as held by the queue manager.

Returns:
the description.
Throws:
MQException - if this method is called after the resource has been closed, to indicate that the resource is no longer available.

inquire

public void inquire(int[] selectors,
                    int[] intAttrs,
                    byte[] charAttrs)
             throws MQException
Queries requested attributes of the object.

Many of the common attribute values can be queried using the getXXX() methods defined in MQManagedObject, MQQueue, MQQueueManager and MQProcess.

Parameters:
selectors - indicates which attributes are being queried. Suitable selectors for character attributes are shown in MQCA_* Suitable selectors for integer attributes are shown in MQIA_*.
intAttrs - the requested attribute values in the same order as in selectors.
charAttrs - the requested character attributes, concatenated together and in the same order as in selectors.
Throws:
MQException - if the inquire fails.

set

public void set(int[] selectors,
                int[] intAttrs,
                byte[] charAttrs)
         throws MQException
Sets requested attributes of the object.

Note that many of the more common attribute values can be set using the setXXX() methods defined in MQQueue.

Parameters:
selectors - indicates which attributes are being set. Suitable selectors for character attributes are shown in MQCA_* Suitable selectors for integer attributes are shown in MQIA_*.
intAttrs - the requested attribute values in the same order as in selectors.
charAttrs - the requested character attributes, concatenated together and in the same order as in selectors.
Throws:
MQException - if the inquire fails.

close

public void close()
           throws MQException
Closes the object. No further operations on this object are permitted after it is closed. The behaviour of the close method can be altered by setting closeOptions.

Throws:
MQException - if the WebSphere MQ call fails.

getAttributeString

public final java.lang.String getAttributeString(int aSelector,
                                                 int length)
                                          throws MQException
Gets an attribute string.

Parameters:
aSelector - indicates which attribute is being queried. Suitable selectors for character attributes are shown in MQCA_*
length - the length of string required.
Returns:
String attribute string
Throws:
MQException - if the call fails.

setAttributeString

public final void setAttributeString(int aSelector,
                                     java.lang.String aValue,
                                     int length)
                              throws MQException
Sets an attribute string.

Parameters:
aSelector - an integer that indicates which attribute is being set. Suitable selectors for character attributes are shown in MQCA_* together with the string lengths. Please refer to WebSphere MQ Application Programming Reference for further details.
aValue - the value of the attribute.
length - the number of characters of aValue to set.
Throws:
MQException - if the call fails.

(c) Copyright IBM Corp. 2005. All Rights Reserved.