code: public static List<ConfigObjectRecord> readRecordFromLDAP(
              final ChaiEntry ldapEntry,
              final String attr,
              final String recordType,
              final Set guid1,
              final Set guid2
      )
              throws ChaiOperationException, ChaiUnavailableException
      {
          if ( ldapEntry == null )
          {
              throw new NullPointerException( "ldapEntry can not be null" );
          }
  
          if ( attr == null )
          {
              throw new NullPointerException( "attr can not be null" );
          }
  
          if ( recordType == null )
          {
              throw new NullPointerException( "recordType can not be null" );
          }
  
          //Read the attribute
          final Set<String> values = ldapEntry.readMultiStringAttribute( attr );
  
          final List<ConfigObjectRecord> cors = new ArrayList<ConfigObjectRecord>();
  
          for ( final String value : values )
          {
              final ConfigObjectRecord loopRec = parseString( value );
              loopRec.objectEntry = ldapEntry;
              loopRec.attr = attr;
              cors.add( loopRec );
  
              //If it doesnt match any of the tests, then remove the record.
              if ( !loopRec.getRecordType().equalsIgnoreCase( recordType ) )
              {
                  cors.remove( loopRec );
              }
              else if ( guid1 != null && !guid1.contains( loopRec.getGuid1() ) )
              {
                  cors.remove( loopRec );
              }
              else if ( guid2 != null && !guid2.contains( loopRec.getGuid2() ) )
              {
                  cors.remove( loopRec );
              }
          }
  
          return cors;
      }
docs: Retreive matching config object records from the directory.
  
  @param ldapEntry  The ldapEntry object to examine.  Must be a valid entry.
  @param attr       The attribute used to store COR's
  @param recordType the record recordType to use, can not be null.
  @param guid1      GUID1 value to match on, may be null if no guid1 match is desired.
  @param guid2      GUID2 value to match on, may be null if no guid2 match is desired.
  @return A List containing matching ConfigObjectRecords
  @throws ChaiOperationException   If there is an error during the operation
  @throws ChaiUnavailableException If the directory server(s) are unavailable