3.1.5.9 GetDirectoryData

The GetDirectoryData method returns a vector of DirectoryObject. It accepts two parameters. The DataElementType parameter is a string that specifies the type of the DirectoryObject. The FilterArray parameter is an array of attribute-filter expressions, as specified in [MS-MQDMPR] section 3.1.7.1.20. Each element in the FilterArray parameter specifies a query constraint that MUST be satisfied by all DirectoryObject(s) corresponding to the object type specified in the DataElementType parameter. This method generates Read Directory Begin, Read Directory Next, and Read Directory End events as specified in [MS-MQDMPR] section 3.1.7.1.21, 3.1.7.1.22, and 3.1.7.1.23 respectively, by using the data type HANDLE as specified in [MS-DTYP] section 2.2.16. This method uses the DirectoryOperationResult enumeration as specified in [MS-MQDMPR] section 3.1.1.17, to determine the outcome of these events.

 GetDirectoryData( DataElementType of type string, 
                   FilterArray of type array of string )
  
 ;DataElementType - identifies the type of the Directory's data element to be requested
 ;FilterArray - identifies constraints for reading data from the Directory
  
 INIT Result of type DirectoryOperationResult
 INIT DataTemp of type DirectoryObject
 INIT RequestedData of type vector of DirectoryObject
 INIT Handle of type HANDLE
  
  
 SET RequestedData to Nothing
 SET Handle to Nothing
  
 SET (Result, Handle) to result of RAISE Read Directory Begin event with
 (iDirectoryObjectType = DataElementType, iFilter = FilterArray)
  
 IF Result <> DirectoryOperationResult.Success THEN
     RETURN with RequestedData
 ENDIF
  
 ReadLoop:
  
 SET (Result, DataTemp) to result of RAISE Read Directory Next event with 
 (Handle)
 IF Result = DirectoryOperationResult.Success THEN
    Add DataTemp to RequestedData
    GOTO ReadLoop
  
 ENDIF
 IF Result <> DirectoryOperationResult.EndOfData THEN
     SET RequestedData to Nothing
 ENDIF
  
  
 SET Result to result of RAISE Read Directory End event with (Handle)
  
  
 RETURN with RequestedData