3.1.6.2 Get Queue Format Name from Pathname

This event MUST be generated with the following arguments:

Return Values

  • rStatus: A status code that can be one of the following:

    • MQ_OK (0x00000000)

    • MQ_ERROR_QUEUE_NOT_FOUND (0xC00E0003)

    • MQ_ERROR_ILLEGAL_QUEUE_PATHNAME (0xC00E0014L)

  • rFormatName: A format name that can be used to identify the queue referenced by iPathname. This format name can be one of the following:

    • A Direct Format Name as specified in [MS-MQMQ] section 2.1.2.

    • A Public Format Name as specified in [MS-MQMQ] section 2.1.3.

    • A Private Format Name as specified in [MS-MQMQ] section 2.1.4.

  • If rStatus is not Success, the value of this parameter is undefined.

The Queue Manager MUST perform the following actions to process this event:

  • Set rStatus to MQ_OK (0x00000000).

  • Declare subqueueName as a variable.

  • If the input pathname represents a subqueue (as specified in [MS-MQMQ] section 2.1.1):

    • Perform string manipulation on iPathname to extract the subqueue name and set subqueueName to this value.

    • Perform string manipulation on iPathname to remove the subqueue part from the path name.

  • Else

    • Set subqueueName equal to NULL.

  • If the input path name represents a public queue:

    • If QueueManager.DirectoryOffline is True:

      • Set rStatus to MQ_ERROR_QUEUE_NOT_FOUND (0xC00E0003L) and take no further action.

    • Generate a 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:

        • "Pathname" EQUALS iPathname

      • iAttributeList: = An array of the following queue attributes:

        • Queue.Identifier

    • If the rStatus returned by the Read Directory event is not set to Success:

      • Set rStatus to MQ_ERROR_QUEUE_NOT_FOUND (0xC00E0003L) and take no further action.

    • Set queueIdentifier to the Queue.Identifier of the returned queue object.

    • Set rFormatName to the following string where queueIdentifier is replaced by its value:

      • "PUBLIC=queueIdentifier"

  • Else if the input path name represents a private queue:

    • If QueueManager.DirectoryIntegrated is False:

      • Set rFormatName to the following string where iPathName is replaced by its value:

        • "DIRECT=OS:iPathname"

    • Else:

      • Declare privateQueueLocalIdentifier as a variable, and set it equal to the private queue local identifier which is computed as follows:

        • Declare hashValue as a 32 bit integer and set it to 0.

        • Declare oldHashValue as a 32 bit integer and set it to 0.

        • Extract the queue name from iPathname.

        • For each character in the queue name from left to right:

          • Set oldHashValue to hashValue.

          • Perform an arithmetic shift left of hashValue by 5 bits.

          • Add the ASCII value of the character to hashValue.

          • Add the oldHashValue to hashValue.

        • Set privateQueueLocalIdentifier to hashValue.

      • Declare queueManagerIdentifier as a variable, and set it equal to the local QueueManager.Identifier.

      • Set rFormatName to the following string where queueManagerIdentifier and privateQueueLocalIdentifier are replaced by their values:

        • "PRIVATE=queueManagerIdentifier/privateQueueLocalIdentifier"

  • Else

    • Set rStatus to MQ_ERROR_ILLEGAL_QUEUE_PATHNAME (0xC00E0014) and take no further action.

  • If subqueueName is not equal to NULL:

    • Perform string manipulation on rFormatName to append the subqueueName at the end.