public AttrSet read(java.security.Principal principal,Guid guid,String attrNames[]) throws UMSException {
  String id=guid.getDn();
  ConnectionEntryReader entryReader;
  SearchRequest request=LDAPRequests.newSearchRequest(id,SearchScope.BASE_OBJECT,"(objectclass=*)",attrNames);
  entryReader=readLDAPEntry(principal,request);
  if (entryReader == null) {
    throw new AccessRightsException(id);
  }
  Collection<Attribute> attrs=new ArrayList<>();
  try (ConnectionEntryReader reader=entryReader){
    while (reader.hasNext()) {
      if (reader.isReference()) {
        reader.readReference();
      }
      SearchResultEntry entry=entryReader.readEntry();
      for (      Attribute attr : entry.getAllAttributes()) {
        attrs.add(attr);
      }
    }
    if (attrs.isEmpty()) {
      throw new EntryNotFoundException(i18n.getString(IUMSConstants.ENTRY_NOT_FOUND,new String[]{id}));
    }
    return new AttrSet(attrs);
  }
 catch (  IOException e) {
    throw new UMSException(i18n.getString(IUMSConstants.UNABLE_TO_READ_ENTRY,new String[]{id}),e);
  }
}

public AttrSet read ( java . security . Principal principal , Guid guid , String attrNames [ ] ) throws UMSException { String id = guid . getDn ( ) ; ConnectionEntryReader entryReader ; SearchRequest request = LDAPRequests . newSearchRequest ( id , SearchScope . BASE_OBJECT , "(objectclass=*)" , attrNames ) ; entryReader = readLDAPEntry ( principal , request ) ; if ( entryReader == null ) { throw new AccessRightsException ( id ) ; } Collection < Attribute > attrs = new ArrayList < > ( ) ; try ( ConnectionEntryReader reader = entryReader ) { while ( reader . hasNext ( ) ) { if ( reader . isReference ( ) ) { reader . readReference ( ) ; } SearchResultEntry entry = entryReader . readEntry ( ) ; for ( Attribute attr : entry . getAllAttributes ( ) ) { attrs . add ( attr ) ; } } if ( attrs . isEmpty ( ) ) { throw new EntryNotFoundException ( i18n . getString ( IUMSConstants . ENTRY_NOT_FOUND , new String [ ] { id } ) ) ; } return new AttrSet ( attrs ) ; } catch ( IOException e ) { throw new UMSException ( i18n . getString ( IUMSConstants . UNABLE_TO_READ_ENTRY , new String [ ] { id } ) , e ) ; } }
reads an ldap entry .
