com.ibm.mq

Class MQManagedObject

  1. java.lang.Object
  2. extended bycom.ibm.mq.jmqi.JmqiObject
  3. extended bycom.ibm.mq.MQManagedObject
Direct known subclasses:
MQDestination, MQDistributionList, MQProcess, MQQueueManager, MQSubscription

  1. public class MQManagedObject
  2. extends com.ibm.mq.jmqi.JmqiObject
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

Modifier and Type Field and Description
  1. java.lang.String
alternateUserId
Deprecated. Accessing this field directly is not recommended. The getAlternateUserId() call should be used instead.
  1. int
closeOptions
Deprecated. Accessing this field directly is not recommended. The setCloseOptions(int) and getCloseOptions() calls should be used instead.
  1. MQQueueManager
connectionReference
Deprecated. Accessing this field directly is not recommended. The getConnectionReference() call should be used instead.
  1. boolean
isOpen
Deprecated. Accessing this field directly is not recommended. The isOpen() call should be used instead.
  1. java.lang.String
name
Deprecated. Accessing this field directly is not recommended. The getName() call should be used instead.
  1. int
openOptions
Deprecated. Accessing this field directly is not recommended. The getOpenOptions() call should be used instead.
Fields inherited from class com.ibm.mq.jmqi.JmqiObject
COMP_JM, COMP_JN, COMP_JO

Method Summary

Modifier and Type Method and Description
  1. void
close()
Closes the object.
  1. java.lang.String
getAlternateUserId()
Gets the alternative user ID specified (if any) when this resource was opened.
  1. java.lang.String
getAttributeString(int aSelector,int length)
Gets an attribute string.
  1. int
getCloseOptions()
Gets the options controlling the way the resource is closed.
  1. MQQueueManager
getConnectionReference()
Gets the connection queue manager associated with this resource.
  1. java.lang.String
getDescription()
Gets the description of this resource as held by the queue manager.
  1. java.lang.String
getName()
Gets the name of this resource.
  1. int
getOpenOptions()
Gets the set of open options used when opening the resource.
  1. java.lang.String
getResolvedObjectString()
  1. java.lang.String
getResolvedQName()
  1. int
getResolvedType()
  1. void
inquire(int[] selectors,int[] intAttrs,byte[] charAttrs)
Queries requested attributes of the object.
  1. void
inquire(int[] selectors,int[] intAttrs,char[] charAttrs)
Queries requested attributes of the object.
  1. boolean
isOpen()
Indicates whether the resource is currently open.
  1. void
set(int[] selectors,int[] intAttrs,byte[] charAttrs)
Sets requested attributes of the object.
  1. void
setAttributeString(int aSelector,java.lang.String aValue,int length)
Sets an attribute string.
  1. void
setCloseOptions(int closeOptions)
Set this attribute to control the way the resource is closed.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

alternateUserId

  1. @Deprecated
  2. public java.lang.String alternateUserId
Deprecated. Accessing this field directly is not recommended. The getAlternateUserId() call should be used instead.
The alternative user ID specified (if any) when this resource was opened. Setting this attribute has no effect.

name

  1. @Deprecated
  2. public java.lang.String name
Deprecated. Accessing this field directly is not recommended. The getName() call should be used instead.
The name of this resource. Setting this attribute has no effect.

openOptions

  1. @Deprecated
  2. public int openOptions
Deprecated. Accessing this field directly is not recommended. The getOpenOptions() call should be used instead.
The set of open options used when opening this resource. Setting this attribute has no effect.

isOpen

  1. @Deprecated
  2. public boolean isOpen
Deprecated. Accessing this field directly is not recommended. The isOpen() call should be used instead.
Indicates whether this resource is currently open. Do not set this attribute.

connectionReference

  1. @Deprecated
  2. public MQQueueManager connectionReference
Deprecated. Accessing this field directly is not recommended. The getConnectionReference() call should be used instead.
The queue manager to which this resource belongs. Setting this attribute has no effect.

closeOptions

  1. @Deprecated
  2. public int closeOptions
Deprecated. Accessing this field directly is not recommended. The setCloseOptions(int) and getCloseOptions() calls should be used instead.
Controls the way the resource is closed.

Method Detail

inquire

  1. public void inquire(int[] selectors,
  2. int[] intAttrs,
  3. char[] charAttrs)
  4. throws MQException
Queries requested attributes of the object. This method return character attributes converted if necessary, in a char array.

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.

inquire

  1. public void inquire(int[] selectors,
  2. int[] intAttrs,
  3. byte[] charAttrs)
  4. 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

  1. public void set(int[] selectors,
  2. int[] intAttrs,
  3. byte[] charAttrs)
  4. 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 set call fails.

close

  1. public void close()
  2. 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

  1. public java.lang.String getAttributeString( int aSelector,
  2. int length)
  3. 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

  1. public void setAttributeString( int aSelector,
  2. java.lang.String aValue,
  3. int length)
  4. 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.

getDescription

  1. public java.lang.String getDescription( )
  2. throws MQException
Gets the description of this resource as held by the queue manager. The description of the resource is queried using the underlying MQINQ function.
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.

getAlternateUserId

  1. public java.lang.String getAlternateUserId( )
  2. throws MQException
Gets the alternative user ID specified (if any) when this resource was opened.
Returns:
the alternative user ID
Throws:
MQException - If the call fails.

getName

  1. public java.lang.String getName( )
  2. throws MQException
Gets 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, or Upon opening an MQTopic resource this property will map to the full, resolved topic name.
Returns:
the name
Throws:
MQException - If the call fails.

getOpenOptions

  1. public int getOpenOptions()
  2. throws MQException
Gets the set of open options used when opening the resource. Currently, these options will map directly to the MQOO options. Upon opening an MQTopic resource these options will map directly to the MQSO options. The property is not valid for the MQSubscription sub class.
Returns:
the open options
Throws:
MQException - If the call fails.

getConnectionReference

  1. public MQQueueManager getConnectionReference( )
  2. throws MQException
Gets the connection queue manager associated with this resource.
Returns:
the queue manager
Throws:
MQException - If the call fails.

isOpen

  1. public boolean isOpen()
Indicates whether the resource is currently open. The property is valid for all sub classes. Since the MQSubscription sub class is created and implicitly opened during an MQSUB function call, this property will always return true unless explicitly closed by the user.
Returns:
true if the object is open.

getCloseOptions

  1. public int getCloseOptions()
  2. throws MQException
Gets the options controlling the way the resource is closed.
Returns:
the close options
Throws:
MQException - If the call fails.
See Also:

setCloseOptions

  1. public void setCloseOptions(int closeOptions)
  2. throws MQException
Set this attribute to control the way the resource is closed. The default value is CMQC.MQCO_NONE. The standard set of options can be used when closing an MQTopic or MQQueue object. The CMQC.MQCO_QUIESCE close option can only be honored when explicitly closing an MQTopic or MQQueue object using the close() method. Upon object destruction, this option is ignored and disabled. Upon closing an MQTopic or MQSubscription object, the following additional values are permissible:
Parameters:
closeOptions - the close options
Throws:
MQException - If the call fails.

getResolvedType

  1. public int getResolvedType()
Returns:
resolved type from MQOPEN

getResolvedQName

  1. public java.lang.String getResolvedQName( )
Returns:
resolved Queue Name from MQOPEN

getResolvedObjectString

  1. public java.lang.String getResolvedObjectString( )
Returns:
resolved Object String from MQOPEN