accessQueue

 

public MQQueue accessQueue(String queueName, int openOptions, 
                           String queueManagerName, 
                           String dynamicQueueName, 
                           String alternateUserId) 
              throws MQException;

Establishes access to a WebSphere MQ queue on this queue manager in order to get or browse messages, put messages, inquire about the attributes of the queue, or set the attributes of the queue.

If the queue named is a model queue, then a dynamic local queue is created. The name of the created queue is held in the name field of the returned MQQueue object.

Parameters

  • queueName - name of queue to open.

  • openOptions - options which control the opening of the queue. As inquire and set options are automatically added to the options provided, there is no need to specify these explicitly. The valid options are:

    • MQC.MQOO_BROWSE

    • MQC.MQOO_INPUT_AS_Q_DEF

    • MQC.MQOO_INPUT_SHARED

    • MQC.MQOO_INPUT_EXCLUSIVE

    • MQC.MQOO_OUTPUT

    • MQC.MQOO_SAVE_ALL_CONTEXT

    • MQC.MQOO_PASS_IDENTITY_CONTEXT

    • MQC.MQOO_PASS_ALL_CONTEXT

    • MQC.MQOO_SET_IDENTITY_CONTEXT

    • MQC.MQOO_SET_ALL_CONTEXT

    • MQC.MQOO_ALTERNATE_USER_AUTHORITY

    • MQC.MQOO_FAIL_IF_QUIESCING

    If more than one option is required the values can be combined using either the '+' or '|' operator. See WebSphere MQ Application Programming Reference for a fuller description of these options.

  • queueManagerName - name of the queue manager on which the queue is defined. A name which is blank, or which is null, denotes the queue manager to which this object is connected.

  • dynamicQueueName - name of the dynamic queue to be created. This parameter is ignored unless queueName specifies the name of a model queue. If it does, this parameter specifies the name of the dynamic queue to be created. A blank or null name is not valid if queueName specifies the name of a model queue. If the last non-blank character in the name is an asterisk (*), the queue manager replaces it with a string of characters which guarantees that the name generated for the queue is unique at the local queue manager. Asterisk is only valid in positions 1 to 33 of the dynamicQueueName parameter.

  • alternateUserId - if MQC.MQOO_ALTERNATE_USER_AUTHORITY is specified in the openOptions parameter this parameter specifies the alternate user ID to be used to check the authorization for the open. If MQC.MQOO_ALTERNATE_USER_AUTHORITY is not specified, this parameter can be left blank (or null).

Returns

  • the MQQueue which has been successfully opened.

Exceptions

  • MQException - if the open fails.


uj15100_