3.10.4.1.29 Refresh (Opnum 35)

The Refresh method is received by the server in an RPC_REQUEST packet. In response, the server refreshes the properties of the MSMQQueueInfo object with the values stored in the directory (for public queues) or in the local QueueManager (for private queues).

 HRESULT Refresh();

This method has no parameters.

Return Values: The method MUST return S_OK (0x00000000) on success or an implementation-specific error HRESULT on failure.

When processing this call, the server MUST abide by the following contract:

  • Generate Update QueueFormatName event (section 3.10.6.1).

  • If rStatus is an error HRESULT return an error HRESULT, and take no further action.

  • If the QueueFormatName instance variable is NULL:

    • Return an error HRESULT, and take no further action.

  • If the QueueFormatName instance variable identifies more than one queue, or contains an HTTP or multicast format name:

    • Return an error HRESULT, and take no further action.

  • Define IsLocal as a BOOLEAN value that equals True if the queue identified by the QueueFormatName instance variable belongs to the QueueCollection of the local QueueManager. Otherwise, IsLocal is False.

  • Define IsPublic as a BOOLEAN value that equals True if the QueueFormatName instance variable identifies a public queue. Otherwise, IsPublic equals False.

  • If IsLocal equals False and IsPublic equals False:

    • Return an error HRESULT, and take no further action.

  • Look up the queue identified by the QueueFormatName instance variable. If the queue exists:

    • If the QueueFormatName does not match the ABNF rule MachineQueuePath defined in [MS-MQMQ] section 2.1.2, the queue is an ApplicationQueue and the protocol MUST set IsApplicationQueue to True. Otherwise, IsApplicationQueue MUST be set to False.

  • Else:

    • Return an error HRESULT, and take no further action.

  • If IsApplicationQueue equals True:

    • If IsPublic equals True:

      • Generate the Read Directory ([MS-MQDMPR] section 3.1.7.1.20) event with the following arguments:

        • iDirectoryObjectType: Queue.

        • iFilter = An array of the following attribute-filter expressions:

          • "Identifier" equals ApplicationQueue.Identifier.

      • If the query results with returned rStatus not Success:

        • Return an error HRESULT, and take no further action.

      • Else:

        • Retrieve the returned properties of the public queue, and set the instance variables of the MSMQQueueInfo object to the values of the retrieved properties, according to the mappings described in the abstract data model section for this object, and transitively, according to the definition of the public queue.

    • Else:

      • Retrieve the identified properties of the ApplicationQueue, copy all properties to refQueue, and set other instance variables of the MSMQQueueInfo object to the values of the retrieved properties, according to the mappings described in the abstract data model section for this object.

  • Set IsRefreshed to True.

  • Return S_OK (0x00000000), and take no further action.