Class MQSubscription
- java.lang.Object
-
- com.ibm.mq.jmqi.JmqiObject
-
- com.ibm.mq.MQManagedObject
-
- com.ibm.mq.MQSubscription
-
public class MQSubscription extends MQManagedObject
MQSubscription is a helper object designed to encapsulate theHSUBreference. Under normal operating circumstances the user will not use or modify the object. It is a sub class ofMQManagedObjectand in this fashion can take advantage of the close features offered by the base class.
-
-
Field Summary
-
Fields inherited from class com.ibm.mq.MQManagedObject
alternateUserId, closeOptions, connectionReference, isOpen, name, openOptions
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetAlternateUserId()This property is not valid for an MQSubscription.java.lang.StringgetAttributeString(int aSelector, int length)Although available on theMQManagedObjectbase class, this method has no relevance upon MQSubscription.java.lang.StringgetDescription()This property is not valid for an MQSubscription.intgetOpenOptions()This property is not valid for an MQSubscription.voidinquire(int[] selectors, int[] intAttrs, byte[] charAttrs)Although available on theMQManagedObjectbase class, this method has no relevance upon MQSubscription.intrequestPublicationUpdate(int options)Requests an update publication to be sent for the current topic.voidset(int[] selectors, int[] intAttrs, byte[] charAttrs)Although available on theMQManagedObjectbase class, this method has no relevance upon MQSubscription.voidsetAttributeString(int aSelector, java.lang.String aValue, int length)Although available on theMQManagedObjectbase class, this method has no relevance upon MQSubscription.-
Methods inherited from class com.ibm.mq.MQManagedObject
close, getCloseOptions, getConnectionReference, getName, getResolvedObjectString, getResolvedQName, getResolvedType, inquire, isOpen, setCloseOptions
-
-
-
-
Method Detail
-
requestPublicationUpdate
public int requestPublicationUpdate(int options) throws MQExceptionRequests an update publication to be sent for the current topic. This is normally used if the user specified theCMQC.MQSO_PUBLICATIONS_ON_REQUESToption. If the queue manager has a retained publication for the topic, this is sent to the subscriber.The method returns the number of retained publications to be sent to the subscription queue or multicast address. There is no guarantee that this many messages will be available for the application to get, especially if they are non-persistent messages, or if the transport being used is multicast.
There may be more than one publication if the subscribed topic contained a wildcard. If no wildcards were present in the topic string when the subscription was made, then only one publication will be sent as a result of this call.
- Parameters:
options- This parameter maps directly to theoptionsfield of theMQSROstructure. Any or none of the following options can be specified.CMQC.MQSRO_FAIL_IF_QUIESCINGThe method fails if the queue manager is in a quiescent state. On z/OS, for a CICS or IMS application, this option also forces the method to fail if the connection is in a quiescent state.
CMQC.MQSRO_NONEIf none of the options described above are required, this option can be used. Use this value to indicate that no other options have been specified.
- Returns:
- The number of retained publications to be sent to the subscription queue or multicast address.
- Throws:
MQException- If the call fails.
-
inquire
public void inquire(int[] selectors, int[] intAttrs, byte[] charAttrs) throws MQExceptionAlthough available on theMQManagedObjectbase class, this method has no relevance upon MQSubscription.- Overrides:
inquirein classMQManagedObject- Parameters:
selectors- Ignored as this method is not relevant to this class.intAttrs- Ignored as this method is not relevant to this class.charAttrs- Ignored as this method is not relevant to this class.- Throws:
MQException- if the inquire fails.- See Also:
MQManagedObject.inquire(int[], int[], byte[])
-
set
public void set(int[] selectors, int[] intAttrs, byte[] charAttrs) throws MQExceptionAlthough available on theMQManagedObjectbase class, this method has no relevance upon MQSubscription.- Overrides:
setin classMQManagedObject- Parameters:
selectors- Ignored as this method is not relevant to this class.intAttrs- Ignored as this method is not relevant to this class.charAttrs- Ignored as this method is not relevant to this class.- Throws:
MQException- if the set call fails.- See Also:
MQManagedObject.set(int[], int[], byte[])
-
getAttributeString
public java.lang.String getAttributeString(int aSelector, int length) throws MQExceptionAlthough available on theMQManagedObjectbase class, this method has no relevance upon MQSubscription.- Overrides:
getAttributeStringin classMQManagedObject- Parameters:
aSelector- Ignored as this method is not relevant to this class.length- Ignored as this method is not relevant to this class.- Returns:
- String attribute string
- Throws:
MQException- if the call fails.- See Also:
MQManagedObject.getAttributeString(int, int)
-
setAttributeString
public void setAttributeString(int aSelector, java.lang.String aValue, int length) throws MQExceptionAlthough available on theMQManagedObjectbase class, this method has no relevance upon MQSubscription.- Overrides:
setAttributeStringin classMQManagedObject- Parameters:
aSelector- Ignored as this method is not relevant to this class.aValue- Ignored as this method is not relevant to this class.length- Ignored as this method is not relevant to this class.- Throws:
MQException- if the call fails.- See Also:
MQManagedObject.setAttributeString(int, String, int)
-
getAlternateUserId
public java.lang.String getAlternateUserId() throws MQExceptionThis property is not valid for an MQSubscription.- Overrides:
getAlternateUserIdin classMQManagedObject- Returns:
- This method will always return null.
- Throws:
MQException- If the call fails.- See Also:
MQManagedObject.getAlternateUserId()
-
getDescription
public java.lang.String getDescription() throws MQExceptionThis property is not valid for an MQSubscription.- Overrides:
getDescriptionin classMQManagedObject- Returns:
- This method will always return null.
- Throws:
MQException- If this method is called after the resource has been closed, to indicate that the resource is no longer available.- See Also:
MQManagedObject.getDescription()
-
getOpenOptions
public int getOpenOptions() throws MQExceptionThis property is not valid for an MQSubscription.- Overrides:
getOpenOptionsin classMQManagedObject- Returns:
- This method will always return -1.
- Throws:
MQException- If the call fails.- See Also:
MQManagedObject.getOpenOptions()
-
-