public LdapEntry getEntityByIdentifier(String dn, String extId, String uniqueName, List<String> inEntityTypes,
                                           List<String> propNames, boolean getMbrshipAttr, boolean getMbrAttr) throws WIMException {
        String[] attrIds = iLdapConfigMgr.getAttributeNames(inEntityTypes, propNames, getMbrshipAttr, getMbrAttr);
        Attributes attrs = null;
        if (dn == null && !iLdapConfigMgr.needTranslateRDN()) {
            dn = iLdapConfigMgr.switchToLdapNode(uniqueName);
        }
        // Changed the order of the if-else ladder. Please check against tWAS code for the original order
        if (dn != null) {
            attrs = checkAttributesCache(dn, attrIds);
        } else if (extId != null) {
            if (iLdapConfigMgr.isAnyExtIdDN()) {
                dn = LdapHelper.getValidDN(extId);
                if (dn != null) {
                    attrs = checkAttributesCache(dn, attrIds);
                } else if (uniqueName != null) {
                    attrs = getAttributesByUniqueName(uniqueName, attrIds, inEntityTypes);
                    dn = LdapHelper.getDNFromAttributes(attrs);
                } else {
                    String msg = Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND, WIMMessageHelper.generateMsgParms(null));
                    throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, msg);
                }
            } else {
                attrs = getAttributesByUniqueName(extId, attrIds, inEntityTypes);
                dn = LdapHelper.getDNFromAttributes(attrs);
            }
        } else if (uniqueName != null) {
            attrs = getAttributesByUniqueName(uniqueName, attrIds, inEntityTypes);
            dn = LdapHelper.getDNFromAttributes(attrs);
        } else {
            String msg = Tr.formatMessage(tc, WIMMessageKey.ENTITY_NOT_FOUND, WIMMessageHelper.generateMsgParms(null));
            throw new EntityNotFoundException(WIMMessageKey.ENTITY_NOT_FOUND, msg);
        }

        String entityType = iLdapConfigMgr.getEntityType(attrs, uniqueName, dn, extId, inEntityTypes);
        uniqueName = getUniqueName(dn, entityType, attrs);
        if (extId == null) {
            extId = iLdapConfigMgr.getExtIdFromAttributes(dn, entityType, attrs);
        }
        LdapEntry ldapEntry = new LdapEntry(dn, extId, uniqueName, entityType, attrs);

        return ldapEntry;
    }
public LdapEntry getEntityByIdentifier ( String dn , String extId , String uniqueName , List < String > inEntityTypes , List < String > propNames , boolean getMbrshipAttr , boolean getMbrAttr ) throws WIMException { String [ ] attrIds = iLdapConfigMgr . getAttributeNames ( inEntityTypes , propNames , getMbrshipAttr , getMbrAttr ) ; Attributes attrs = null ; if ( dn == null && ! iLdapConfigMgr . needTranslateRDN ( ) ) { dn = iLdapConfigMgr . switchToLdapNode ( uniqueName ) ; } if ( dn != null ) { attrs = checkAttributesCache ( dn , attrIds ) ; } else if ( extId != null ) { if ( iLdapConfigMgr . isAnyExtIdDN ( ) ) { dn = LdapHelper . getValidDN ( extId ) ; if ( dn != null ) { attrs = checkAttributesCache ( dn , attrIds ) ; } else if ( uniqueName != null ) { attrs = getAttributesByUniqueName ( uniqueName , attrIds , inEntityTypes ) ; dn = LdapHelper . getDNFromAttributes ( attrs ) ; } else { String msg = Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( null ) ) ; throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , msg ) ; } } else { attrs = getAttributesByUniqueName ( extId , attrIds , inEntityTypes ) ; dn = LdapHelper . getDNFromAttributes ( attrs ) ; } } else if ( uniqueName != null ) { attrs = getAttributesByUniqueName ( uniqueName , attrIds , inEntityTypes ) ; dn = LdapHelper . getDNFromAttributes ( attrs ) ; } else { String msg = Tr . formatMessage ( tc , WIMMessageKey . ENTITY_NOT_FOUND , WIMMessageHelper . generateMsgParms ( null ) ) ; throw new EntityNotFoundException ( WIMMessageKey . ENTITY_NOT_FOUND , msg ) ; } String entityType = iLdapConfigMgr . getEntityType ( attrs , uniqueName , dn , extId , inEntityTypes ) ; uniqueName = getUniqueName ( dn , entityType , attrs ) ; if ( extId == null ) { extId = iLdapConfigMgr . getExtIdFromAttributes ( dn , entityType , attrs ) ; } LdapEntry ldapEntry = new LdapEntry ( dn , extId , uniqueName , entityType , attrs ) ; return ldapEntry ; }
Get an LDAP entity by an identifier. One of 'dn', 'extId' or 'uniqueName' must be non-null.

@param dn The distinguished name for the entity.
@param extId The external name for the entity.
@param uniqueName The unique name for the entity.
@param inEntityTypes The acceptable entity types to look up.
@param propNames The property names to return in the LdapEntry.
@param getMbrshipAttr Whether to return the membership attribute.
@param getMbrAttr Whether to return the member attribute.
@return The {@link LdapEntry} corresponding to the identifier.
@throws WIMException If there was an error retrieving the LDAP entity.