com.ibm.mq

Class MQDistributionList

  1. java.lang.Object
  2. extended bycom.ibm.mq.jmqi.JmqiObject
  3. extended bycom.ibm.mq.MQManagedObject
  4. extended bycom.ibm.mq.MQDistributionList

  1. public class MQDistributionList
  2. extends MQManagedObject
Create a distribution list using the MQDistributionList constructor or the MQQueueManager.accessDistributionList() method. A distribution list represents a set of open queues to which messages can be sent using a single call to the put method.

Field Summary

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
MQDistributionList(MQQueueManager qMgr,MQDistributionListItem[] litems,int openOptions,java.lang.String alternateUserId)
Creates a new distribution list and opens the queues.

Method Summary

Modifier and Type Method and Description
  1. void
close()
Closes the distribution list.
  1. MQDistributionListItem
getFirstDistributionListItem()
Gets the first item in the distribution list, or null if the list is empty.
  1. int
getInvalidDestinationCount()
Gets the number of items in the distribution list that failed to open successfully.
  1. int
getValidDestinationCount()
Gets the number of items in the distribution list that were opened successfully.
  1. void
put(MQMessage message,MQPutMessageOptions putMessageOptions)
Puts a message to the queues on the distribution list.
Methods inherited from class com.ibm.mq.MQManagedObject
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

Constructor Detail

MQDistributionList

  1. public MQDistributionList(MQQueueManager qMgr,
  2. MQDistributionListItem[] litems,
  3. int openOptions,
  4. java.lang.String alternateUserId)
  5. throws MQException
Creates a new distribution list and opens the queues.
Parameters:
qMgr - the queue manager where the list is to be opened.
litems - the items to be included in the distribution list.
openOptions - options which control the opening of the distribution list.
alternateUserId - the alternative user identifier used to check the authorization for opening queues if MQOO_ALTERNATE_USER_AUTHORITY is specified in openOptions. Otherwise this parameter can be left blank (or null).
Throws:
MQException - is only thrown if the call fails completely. The constructor completes if at least one queue opens succesfully.

Method Detail

put

  1. public void put(MQMessage message,
  2. MQPutMessageOptions putMessageOptions)
  3. throws MQException
Puts a message to the queues on the distribution list.
Parameters:
message - the message descriptor information and the returned message data.
putMessageOptions - controls the action of MQPUT.
Throws:
MQException - if the put fails.

close

  1. public void close()
  2. throws MQException
Closes the distribution list.
Overrides:
Throws:
MQException - if the close fails.

getValidDestinationCount

  1. public int getValidDestinationCount( )
Gets the number of items in the distribution list that were opened successfully.
Returns:
the number of items.

getInvalidDestinationCount

  1. public int getInvalidDestinationCount( )
Gets the number of items in the distribution list that failed to open successfully.
Returns:
the number of items.

getFirstDistributionListItem

  1. public MQDistributionListItem getFirstDistributionListItem( )
Gets the first item in the distribution list, or null if the list is empty.
Returns:
the first item.