private void setFilters(Map<String, Object> configProps) throws WIMSystemException {
        // If no ldap type configured, return
        if (iLdapType == null)
            return;

        // Determine the Ldap type configured.
        //name under which filters are put
        String key = null;
        if (iLdapType.equalsIgnoreCase(LdapConstants.AD_LDAP_SERVER)) {
            key = ConfigConstants.CONFIG_ACTIVE_DIRECTORY_FILTERS;
        } else if (iLdapType.equalsIgnoreCase(LdapConstants.CUSTOM_LDAP_SERVER)) {
            key = ConfigConstants.CONFIG_CUSTOM_FILTERS;
        } else if (iLdapType.equalsIgnoreCase(LdapConstants.DOMINO_LDAP_SERVER)) {
            key = ConfigConstants.CONFIG_DOMINO_FILTERS;
        } else if (iLdapType.equalsIgnoreCase(LdapConstants.NOVELL_LDAP_SERVER)) {
            key = ConfigConstants.CONFIG_NOVELL_DIRECTORY_FILTERS;
        } else if (iLdapType.equalsIgnoreCase(LdapConstants.IDS_LDAP_SERVER)) {
            key = ConfigConstants.CONFIG_TDS_FILTERS;
        } else if (iLdapType.equalsIgnoreCase(LdapConstants.SUN_LDAP_SERVER)) {
            key = ConfigConstants.CONFIG_SUN_DIRECTORY_FILTERS;
        } else if (iLdapType.equalsIgnoreCase(LdapConstants.NETSCAPE_LDAP_SERVER)) {
            key = ConfigConstants.CONFIG_NETSCAPE_DIRECTORY_FILTERS;
        } else if (iLdapType.equalsIgnoreCase(LdapConstants.SECUREWAY_LDAP_SERVER)) {
            key = ConfigConstants.CONFIG_SECUREWAY_DIRECTORY_FILTERS;
        } else {
            return;
        }

        List<Map<String, Object>> filterList = Nester.nest(key, configProps);

        // If config is found,
        if (!filterList.isEmpty()) {
            Map<String, Object> props = filterList.get(0);

            if (props.get(ConfigConstants.CONFIG_USER_FILTER) != null)
                iUserFilter = (String) props.get(ConfigConstants.CONFIG_USER_FILTER);
            if (props.get(ConfigConstants.CONFIG_GROUP_FILTER) != null)
                iGroupFilter = (String) props.get(ConfigConstants.CONFIG_GROUP_FILTER);
            if (props.get(ConfigConstants.CONFIG_USER_ID_FILTER) != null)
                iUserIdMap = (String) props.get(ConfigConstants.CONFIG_USER_ID_FILTER);
            if (props.get(ConfigConstants.CONFIG_GROUP_ID_FILTER) != null)
                iGroupIdMap = (String) props.get(ConfigConstants.CONFIG_GROUP_ID_FILTER);
            if (props.get(ConfigConstants.CONFIG_GROUP_MEMBER_ID_FILTER) != null)
                iGroupMemberIdMap = (String) props.get(ConfigConstants.CONFIG_GROUP_MEMBER_ID_FILTER);
            // Update the Ldap entities with search filters.
            String objectClassStr = "objectclass=";
            if (iLdapType.equalsIgnoreCase(LdapConstants.AD_LDAP_SERVER))
                objectClassStr = "objectcategory=";

            int length = objectClassStr.length();

            // Parse the User filter and extract the applicable objectclass names
            if (iUserFilter != null) {
                LdapEntity ldapEntity = getLdapEntity(SchemaConstants.DO_PERSON_ACCOUNT);
                if (ldapEntity != null) {
                    Set<String> objClsSet = new HashSet<String>();
                    int index = iUserFilter.indexOf(objectClassStr);
                    while (index > -1) {
                        int endIndex = iUserFilter.indexOf(")", index);
                        String objectClass = iUserFilter.substring(index + length, endIndex);
                        objClsSet.add(objectClass);

                        index = endIndex + 1;
                        index = iUserFilter.indexOf(objectClassStr, endIndex);
                    }
                    if (objClsSet.size() > 0) {
                        ldapEntity.getObjectClasses().clear();
                        ldapEntity.getObjectClasses().addAll(objClsSet);
                    }
                }

                // Set the login property.
                // Remove the default uid login Property if userFilter is configured.
                if (iLoginAttrs != null)
                    iLoginAttrs.remove(0);
                if (iLoginProps != null)
                    iLoginProps.remove(0);

                String pattern = "=%v";
                int startIndex = 0;
                boolean hasLoginProperties = true;
                LdapEntity acct = getLdapEntity(iPersonAccountTypes.get(iPersonAccountTypes.size() - 1));
                while (hasLoginProperties) {
                    int index = iUserFilter.indexOf(pattern, startIndex);
                    int beginIndex = index;
                    if (index > -1) {
                        for (; beginIndex > 0; beginIndex--) {
                            if (iUserFilter.charAt(beginIndex) == ' ' || iUserFilter.charAt(beginIndex) == '(')
                                break;
                        }

                        String propName = iUserFilter.substring(beginIndex + 1, index);
                        if (iLoginAttrs != null && !iLoginAttrs.contains(propName)) {
                            if (tc.isDebugEnabled())
                                Tr.debug(tc, "Setting login property from UserFilter as [" + propName + "]");
                            //iLoginAttrs.add(propName);
                            iLoginAttrs.add(getAttributeName(acct, propName));
                            iLoginProps.add(propName);
                        }
                        startIndex = index + 1;
                    } else
                        hasLoginProperties = false;
                }
                if (ldapEntity != null) {
                    try {
                        ldapEntity.addPropertyAttributeMap(SchemaConstants.PROP_PRINCIPAL_NAME, iLoginAttrs.get(0));
                    } catch (IndexOutOfBoundsException e) {
                        throw new WIMSystemException(WIMMessageKey.MALFORMED_SEARCH_EXPRESSION, Tr.formatMessage(
                                                                                                                 tc,
                                                                                                                 WIMMessageKey.MALFORMED_SEARCH_EXPRESSION,
                                                                                                                 WIMMessageHelper.generateMsgParms(e.toString())));
                    }
                }
            }

            // Parse the Group filter and extract the applicable objectclass names
            if (iGroupFilter != null) {
                LdapEntity ldapEntity = getLdapEntity(SchemaConstants.DO_GROUP);
                if (ldapEntity != null) {
                    Set<String> objClsSet = new HashSet<String>();
                    int index = iGroupFilter.indexOf(objectClassStr);
                    while (index > -1) {
                        int endIndex = iGroupFilter.indexOf(")", index);
                        String objectClass = iGroupFilter.substring(index + length, endIndex);
                        objClsSet.add(objectClass);

                        index = endIndex + 1;
                        index = iGroupFilter.indexOf(objectClassStr, endIndex);
                    }
                    if (objClsSet.size() > 0) {
                        ldapEntity.getObjectClasses().clear();
                        ldapEntity.getObjectClasses().addAll(objClsSet);
                    }
                }
            }

            // Parse the user id map
            if (iUserIdMap != null) {
                StringTokenizer strtok = new StringTokenizer(iUserIdMap, ":;");
                LdapEntity ldapEntity = getLdapEntity(SchemaConstants.DO_PERSON_ACCOUNT);
                if (ldapEntity != null) {
                    List<String> rdnPropList = new ArrayList<String>();
                    List<String> objClsList = new ArrayList<String>();
                    while (strtok.hasMoreTokens()) {
                        String objectClass = strtok.nextToken();
                        String attribute = strtok.nextToken();
                        // Handle samAccountName.
                        Set<String> propNames = null;

                        if (LdapConstants.LDAP_ATTR_SAM_ACCOUNT_NAME.equalsIgnoreCase(attribute)) {
                            propNames = getPropertyName(ldapEntity, "cn");
                            // propNames.addAll(getPropertyName(ldapEntity, attribute));
                        } else
                            propNames = getPropertyName(ldapEntity, attribute);

                        rdnPropList.add(propNames.iterator().next());

                        if (!SchemaConstants.VALUE_ALL_PROPERTIES.equalsIgnoreCase(objectClass))
                            objClsList.add(objectClass);
                    }
                    if (rdnPropList.size() > 0) {
                        String[][] rdnProps = new String[rdnPropList.size()][];
                        String[][] rdnAttrs = new String[rdnPropList.size()][];
                        String rdnObjCls[][] = new String[objClsList.size()][];
                        String objCls[] = new String[objClsList.size()];

                        objCls = objClsList.toArray(objCls);
                        for (int j = 0; j < rdnPropList.size(); j++) {
                            rdnProps[j] = LdapHelper.getRDNs(rdnPropList.get(j));
                            rdnAttrs[j] = new String[rdnProps[j].length];
                            for (int k = 0; k < rdnProps[j].length; k++) {
                                String rdnProp = rdnProps[j][k];
                                rdnAttrs[j][k] = getAttributeName(ldapEntity, rdnProp);
                            }
                            if (objCls.length > 0) {
                                rdnObjCls[j] = new String[objCls.length];
                                rdnObjCls[j][0] = objCls[j];
                            }
                        }
                        ldapEntity.setRDNProperties(rdnProps, rdnAttrs);
                        if (isVMMRdnPropertiesDefined) {
                            String updatedRdnAttrs[][] = null;
                            String updatedRdnObjCls[][] = null;
                            if (ldapEntity.getRDNAttributes().length > 0) {
                                String orgRdnAttr[][] = ldapEntity.getRDNAttributes();
                                updatedRdnAttrs = new String[orgRdnAttr.length + rdnAttrs.length][];
                                for (int i = 0; i < orgRdnAttr.length; i++) {
                                    updatedRdnAttrs[i] = new String[orgRdnAttr[i].length];
                                    for (int j = 0; j < orgRdnAttr[i].length; j++)
                                        updatedRdnAttrs[i][j] = orgRdnAttr[i][j];
                                }
                                int len = orgRdnAttr.length;
                                for (int i = 0; i < rdnAttrs.length; i++) {
                                    updatedRdnAttrs[len] = new String[rdnAttrs[i].length];
                                    for (int j = 0; j < rdnAttrs[i].length; j++)
                                        updatedRdnAttrs[len][j] = rdnAttrs[i][j];
                                    len++;
                                }
                            }
                            if (ldapEntity.getRDNObjectclasses().length > 0) {
                                String orgRdnObjCls[][] = ldapEntity.getRDNObjectclasses();
                                updatedRdnObjCls = new String[orgRdnObjCls.length + rdnObjCls.length][];
                                for (int i = 0; i < orgRdnObjCls.length; i++) {
                                    updatedRdnObjCls[i] = new String[orgRdnObjCls[i].length];
                                    for (int j = 0; j < orgRdnObjCls[i].length; j++)
                                        updatedRdnObjCls[i][j] = orgRdnObjCls[i][j];
                                }
                                int len = orgRdnObjCls.length;
                                for (int i = 0; i < rdnObjCls.length; i++) {
                                    updatedRdnObjCls[len] = new String[rdnObjCls[i].length];
                                    for (int j = 0; j < rdnObjCls[i].length; j++)
                                        updatedRdnObjCls[len][j] = rdnObjCls[i][j];
                                    len++;
                                }

                            }
                            ldapEntity.setRDNAttributes(updatedRdnAttrs, updatedRdnObjCls);
                        } else {
                            ldapEntity.setRDNAttributes(rdnAttrs, rdnObjCls);
                        }
                        if (ldapEntity.needTranslateRDN()) {
                            iNeedTranslateRDN = true;
                        }
                    }
                } else {
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "Could not find entity for person account!!");
                }
            }

            // Parse the group id map
            if (iGroupIdMap != null) {
                StringTokenizer strtok = new StringTokenizer(iGroupIdMap, ":;");
                LdapEntity ldapEntity = getLdapEntity(SchemaConstants.DO_GROUP);
                if (ldapEntity != null) {
                    List<String> rdnPropList = new ArrayList<String>();
                    Set<String> objClsSet = new HashSet<String>();
                    while (strtok.hasMoreTokens()) {
                        String objectClass = strtok.nextToken();
                        String attribute = strtok.nextToken();

                        Set<String> propNames = getPropertyName(ldapEntity, attribute);
                        rdnPropList.add(propNames.iterator().next());

                        if (!SchemaConstants.VALUE_ALL_PROPERTIES.equalsIgnoreCase(objectClass))
                            objClsSet.add(objectClass);
                    }
                    if (rdnPropList.size() > 0) {
                        String[][] rdnProps = new String[rdnPropList.size()][];
                        String[][] rdnAttrs = new String[rdnPropList.size()][];
                        for (int j = 0; j < rdnPropList.size(); j++) {
                            rdnProps[j] = LdapHelper.getRDNs(rdnPropList.get(j));
                            rdnAttrs[j] = new String[rdnProps[j].length];
                            for (int k = 0; k < rdnProps[j].length; k++) {
                                String rdnProp = rdnProps[j][k];
                                rdnAttrs[j][k] = getAttributeName(ldapEntity, rdnProp);
                            }
                        }
                        ldapEntity.setRDNProperties(rdnProps, rdnAttrs);
                        if (ldapEntity.needTranslateRDN()) {
                            iNeedTranslateRDN = true;
                        }
                    }
                } else if (tc.isDebugEnabled())
                    Tr.debug(tc, "Could not find entity for Group!!");
            }

            // Parse the group member id map
            if (iGroupMemberIdMap != null) {
                // Check if iGroupMemberIdMap have ibm-allGroups , if true then do the nested search for group members
                iLdapOperationalAttr = iGroupMemberIdMap.toLowerCase().contains(IBM_ALL_GROUPS.toLowerCase());

                // Clear the membership attribute if we were using the default. Otherwise keep it, as it was explicitly set
                if (iDefaultMembershipAttr) {
                    iMembershipAttrName = null;
                }
                LdapEntity ldapEntity = null;
                List<String> grpTypes = getGroupTypes();
                List<String> objectClasses = new ArrayList<String>();
                for (int i = 0; i < grpTypes.size(); i++) {
                    ldapEntity = getLdapEntity(grpTypes.get(i));
                    List<String> objClses = ldapEntity.getObjectClasses();
                    for (int j = 0; j < objClses.size(); j++) {
                        String objCls = objClses.get(j);
                        objectClasses.add(objCls);
                    }
                }

                List<String> attrScopes = new ArrayList<String>();
                List<String> attrNames = new ArrayList<String>();

                StringTokenizer strtok = new StringTokenizer(iGroupMemberIdMap, ":;");
                if (ldapEntity != null) {
                    while (strtok.hasMoreTokens()) {
                        String objectClass = strtok.nextToken();
                        String attribute = strtok.nextToken();
                        String scope = LdapConstants.LDAP_DIRECT_GROUP_MEMBERSHIP_STRING;
                        if (SchemaConstants.VALUE_ALL_PROPERTIES.equalsIgnoreCase(objectClass)) {
                            for (int j = 0; j < objectClasses.size(); j++) {
                                iMbrAttrMap.put(objectClasses.get(j), attribute);
                            }
                        } else {
                            iMbrAttrMap.put(objectClass.toLowerCase(), attribute);
                        }
                        if (!attrNames.contains(attribute)) {
                            attrNames.add(attribute);
                            attrScopes.add(scope);
                        }
                        if (objectClass != null && !objectClasses.contains(objectClass.toLowerCase())
                            && (getGroupTypes() != null && getGroupTypes().size() > 0)
                            && !SchemaConstants.VALUE_ALL_PROPERTIES.equals(objectClass)) {
                            getLdapEntity(getGroupTypes().get(0)).addObjectClass(objectClass);
                        }
                    }
                    iMbrAttrs = attrNames.toArray(new String[0]);
                    iMbrAttrScope = new short[iMbrAttrs.length];

                    iMbrAttrsAllScope = true;
                    iMbrAttrsNestedScope = true;
                    for (int i = 0; i < attrScopes.size(); i++) {
                        iMbrAttrScope[i] = LdapHelper.getMembershipScope(attrScopes.get(i));
                        if (iMbrAttrScope[i] == LdapConstants.LDAP_DIRECT_GROUP_MEMBERSHIP) {
                            iMbrAttrsAllScope = false;
                            iMbrAttrsNestedScope = false;
                        } else if (iMbrAttrScope[i] == LdapConstants.LDAP_NESTED_GROUP_MEMBERSHIP) {
                            iMbrAttrsAllScope = false;
                        }
                    }
                } else if (tc.isDebugEnabled()) {
                    Tr.debug(tc, "Could not find entity for Group!!");
                }

            }

            // check if this is a RACF configuration
            if (checkIfRacf()) {
                initializeRacfFilters();
            }

            resetEntitySearchFilters();
        }
    }
private void setFilters ( Map < String , Object > configProps ) throws WIMSystemException { if ( iLdapType == null ) return ; String key = null ; if ( iLdapType . equalsIgnoreCase ( LdapConstants . AD_LDAP_SERVER ) ) { key = ConfigConstants . CONFIG_ACTIVE_DIRECTORY_FILTERS ; } else if ( iLdapType . equalsIgnoreCase ( LdapConstants . CUSTOM_LDAP_SERVER ) ) { key = ConfigConstants . CONFIG_CUSTOM_FILTERS ; } else if ( iLdapType . equalsIgnoreCase ( LdapConstants . DOMINO_LDAP_SERVER ) ) { key = ConfigConstants . CONFIG_DOMINO_FILTERS ; } else if ( iLdapType . equalsIgnoreCase ( LdapConstants . NOVELL_LDAP_SERVER ) ) { key = ConfigConstants . CONFIG_NOVELL_DIRECTORY_FILTERS ; } else if ( iLdapType . equalsIgnoreCase ( LdapConstants . IDS_LDAP_SERVER ) ) { key = ConfigConstants . CONFIG_TDS_FILTERS ; } else if ( iLdapType . equalsIgnoreCase ( LdapConstants . SUN_LDAP_SERVER ) ) { key = ConfigConstants . CONFIG_SUN_DIRECTORY_FILTERS ; } else if ( iLdapType . equalsIgnoreCase ( LdapConstants . NETSCAPE_LDAP_SERVER ) ) { key = ConfigConstants . CONFIG_NETSCAPE_DIRECTORY_FILTERS ; } else if ( iLdapType . equalsIgnoreCase ( LdapConstants . SECUREWAY_LDAP_SERVER ) ) { key = ConfigConstants . CONFIG_SECUREWAY_DIRECTORY_FILTERS ; } else { return ; } List < Map < String , Object > > filterList = Nester . nest ( key , configProps ) ; if ( ! filterList . isEmpty ( ) ) { Map < String , Object > props = filterList . get ( 0 ) ; if ( props . get ( ConfigConstants . CONFIG_USER_FILTER ) != null ) iUserFilter = ( String ) props . get ( ConfigConstants . CONFIG_USER_FILTER ) ; if ( props . get ( ConfigConstants . CONFIG_GROUP_FILTER ) != null ) iGroupFilter = ( String ) props . get ( ConfigConstants . CONFIG_GROUP_FILTER ) ; if ( props . get ( ConfigConstants . CONFIG_USER_ID_FILTER ) != null ) iUserIdMap = ( String ) props . get ( ConfigConstants . CONFIG_USER_ID_FILTER ) ; if ( props . get ( ConfigConstants . CONFIG_GROUP_ID_FILTER ) != null ) iGroupIdMap = ( String ) props . get ( ConfigConstants . CONFIG_GROUP_ID_FILTER ) ; if ( props . get ( ConfigConstants . CONFIG_GROUP_MEMBER_ID_FILTER ) != null ) iGroupMemberIdMap = ( String ) props . get ( ConfigConstants . CONFIG_GROUP_MEMBER_ID_FILTER ) ; String objectClassStr = "objectclass=" ; if ( iLdapType . equalsIgnoreCase ( LdapConstants . AD_LDAP_SERVER ) ) objectClassStr = "objectcategory=" ; int length = objectClassStr . length ( ) ; if ( iUserFilter != null ) { LdapEntity ldapEntity = getLdapEntity ( SchemaConstants . DO_PERSON_ACCOUNT ) ; if ( ldapEntity != null ) { Set < String > objClsSet = new HashSet < String > ( ) ; int index = iUserFilter . indexOf ( objectClassStr ) ; while ( index > - 1 ) { int endIndex = iUserFilter . indexOf ( ")" , index ) ; String objectClass = iUserFilter . substring ( index + length , endIndex ) ; objClsSet . add ( objectClass ) ; index = endIndex + 1 ; index = iUserFilter . indexOf ( objectClassStr , endIndex ) ; } if ( objClsSet . size ( ) > 0 ) { ldapEntity . getObjectClasses ( ) . clear ( ) ; ldapEntity . getObjectClasses ( ) . addAll ( objClsSet ) ; } } if ( iLoginAttrs != null ) iLoginAttrs . remove ( 0 ) ; if ( iLoginProps != null ) iLoginProps . remove ( 0 ) ; String pattern = "=%v" ; int startIndex = 0 ; boolean hasLoginProperties = true ; LdapEntity acct = getLdapEntity ( iPersonAccountTypes . get ( iPersonAccountTypes . size ( ) - 1 ) ) ; while ( hasLoginProperties ) { int index = iUserFilter . indexOf ( pattern , startIndex ) ; int beginIndex = index ; if ( index > - 1 ) { for ( ; beginIndex > 0 ; beginIndex -- ) { if ( iUserFilter . charAt ( beginIndex ) == ' ' || iUserFilter . charAt ( beginIndex ) == '(' ) break ; } String propName = iUserFilter . substring ( beginIndex + 1 , index ) ; if ( iLoginAttrs != null && ! iLoginAttrs . contains ( propName ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Setting login property from UserFilter as [" + propName + "]" ) ; iLoginAttrs . add ( getAttributeName ( acct , propName ) ) ; iLoginProps . add ( propName ) ; } startIndex = index + 1 ; } else hasLoginProperties = false ; } if ( ldapEntity != null ) { try { ldapEntity . addPropertyAttributeMap ( SchemaConstants . PROP_PRINCIPAL_NAME , iLoginAttrs . get ( 0 ) ) ; } catch ( IndexOutOfBoundsException e ) { throw new WIMSystemException ( WIMMessageKey . MALFORMED_SEARCH_EXPRESSION , Tr . formatMessage ( tc , WIMMessageKey . MALFORMED_SEARCH_EXPRESSION , WIMMessageHelper . generateMsgParms ( e . toString ( ) ) ) ) ; } } } if ( iGroupFilter != null ) { LdapEntity ldapEntity = getLdapEntity ( SchemaConstants . DO_GROUP ) ; if ( ldapEntity != null ) { Set < String > objClsSet = new HashSet < String > ( ) ; int index = iGroupFilter . indexOf ( objectClassStr ) ; while ( index > - 1 ) { int endIndex = iGroupFilter . indexOf ( ")" , index ) ; String objectClass = iGroupFilter . substring ( index + length , endIndex ) ; objClsSet . add ( objectClass ) ; index = endIndex + 1 ; index = iGroupFilter . indexOf ( objectClassStr , endIndex ) ; } if ( objClsSet . size ( ) > 0 ) { ldapEntity . getObjectClasses ( ) . clear ( ) ; ldapEntity . getObjectClasses ( ) . addAll ( objClsSet ) ; } } } if ( iUserIdMap != null ) { StringTokenizer strtok = new StringTokenizer ( iUserIdMap , ":;" ) ; LdapEntity ldapEntity = getLdapEntity ( SchemaConstants . DO_PERSON_ACCOUNT ) ; if ( ldapEntity != null ) { List < String > rdnPropList = new ArrayList < String > ( ) ; List < String > objClsList = new ArrayList < String > ( ) ; while ( strtok . hasMoreTokens ( ) ) { String objectClass = strtok . nextToken ( ) ; String attribute = strtok . nextToken ( ) ; Set < String > propNames = null ; if ( LdapConstants . LDAP_ATTR_SAM_ACCOUNT_NAME . equalsIgnoreCase ( attribute ) ) { propNames = getPropertyName ( ldapEntity , "cn" ) ; } else propNames = getPropertyName ( ldapEntity , attribute ) ; rdnPropList . add ( propNames . iterator ( ) . next ( ) ) ; if ( ! SchemaConstants . VALUE_ALL_PROPERTIES . equalsIgnoreCase ( objectClass ) ) objClsList . add ( objectClass ) ; } if ( rdnPropList . size ( ) > 0 ) { String [ ] [ ] rdnProps = new String [ rdnPropList . size ( ) ] [ ] ; String [ ] [ ] rdnAttrs = new String [ rdnPropList . size ( ) ] [ ] ; String rdnObjCls [ ] [ ] = new String [ objClsList . size ( ) ] [ ] ; String objCls [ ] = new String [ objClsList . size ( ) ] ; objCls = objClsList . toArray ( objCls ) ; for ( int j = 0 ; j < rdnPropList . size ( ) ; j ++ ) { rdnProps [ j ] = LdapHelper . getRDNs ( rdnPropList . get ( j ) ) ; rdnAttrs [ j ] = new String [ rdnProps [ j ] . length ] ; for ( int k = 0 ; k < rdnProps [ j ] . length ; k ++ ) { String rdnProp = rdnProps [ j ] [ k ] ; rdnAttrs [ j ] [ k ] = getAttributeName ( ldapEntity , rdnProp ) ; } if ( objCls . length > 0 ) { rdnObjCls [ j ] = new String [ objCls . length ] ; rdnObjCls [ j ] [ 0 ] = objCls [ j ] ; } } ldapEntity . setRDNProperties ( rdnProps , rdnAttrs ) ; if ( isVMMRdnPropertiesDefined ) { String updatedRdnAttrs [ ] [ ] = null ; String updatedRdnObjCls [ ] [ ] = null ; if ( ldapEntity . getRDNAttributes ( ) . length > 0 ) { String orgRdnAttr [ ] [ ] = ldapEntity . getRDNAttributes ( ) ; updatedRdnAttrs = new String [ orgRdnAttr . length + rdnAttrs . length ] [ ] ; for ( int i = 0 ; i < orgRdnAttr . length ; i ++ ) { updatedRdnAttrs [ i ] = new String [ orgRdnAttr [ i ] . length ] ; for ( int j = 0 ; j < orgRdnAttr [ i ] . length ; j ++ ) updatedRdnAttrs [ i ] [ j ] = orgRdnAttr [ i ] [ j ] ; } int len = orgRdnAttr . length ; for ( int i = 0 ; i < rdnAttrs . length ; i ++ ) { updatedRdnAttrs [ len ] = new String [ rdnAttrs [ i ] . length ] ; for ( int j = 0 ; j < rdnAttrs [ i ] . length ; j ++ ) updatedRdnAttrs [ len ] [ j ] = rdnAttrs [ i ] [ j ] ; len ++ ; } } if ( ldapEntity . getRDNObjectclasses ( ) . length > 0 ) { String orgRdnObjCls [ ] [ ] = ldapEntity . getRDNObjectclasses ( ) ; updatedRdnObjCls = new String [ orgRdnObjCls . length + rdnObjCls . length ] [ ] ; for ( int i = 0 ; i < orgRdnObjCls . length ; i ++ ) { updatedRdnObjCls [ i ] = new String [ orgRdnObjCls [ i ] . length ] ; for ( int j = 0 ; j < orgRdnObjCls [ i ] . length ; j ++ ) updatedRdnObjCls [ i ] [ j ] = orgRdnObjCls [ i ] [ j ] ; } int len = orgRdnObjCls . length ; for ( int i = 0 ; i < rdnObjCls . length ; i ++ ) { updatedRdnObjCls [ len ] = new String [ rdnObjCls [ i ] . length ] ; for ( int j = 0 ; j < rdnObjCls [ i ] . length ; j ++ ) updatedRdnObjCls [ len ] [ j ] = rdnObjCls [ i ] [ j ] ; len ++ ; } } ldapEntity . setRDNAttributes ( updatedRdnAttrs , updatedRdnObjCls ) ; } else { ldapEntity . setRDNAttributes ( rdnAttrs , rdnObjCls ) ; } if ( ldapEntity . needTranslateRDN ( ) ) { iNeedTranslateRDN = true ; } } } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Could not find entity for person account!!" ) ; } } if ( iGroupIdMap != null ) { StringTokenizer strtok = new StringTokenizer ( iGroupIdMap , ":;" ) ; LdapEntity ldapEntity = getLdapEntity ( SchemaConstants . DO_GROUP ) ; if ( ldapEntity != null ) { List < String > rdnPropList = new ArrayList < String > ( ) ; Set < String > objClsSet = new HashSet < String > ( ) ; while ( strtok . hasMoreTokens ( ) ) { String objectClass = strtok . nextToken ( ) ; String attribute = strtok . nextToken ( ) ; Set < String > propNames = getPropertyName ( ldapEntity , attribute ) ; rdnPropList . add ( propNames . iterator ( ) . next ( ) ) ; if ( ! SchemaConstants . VALUE_ALL_PROPERTIES . equalsIgnoreCase ( objectClass ) ) objClsSet . add ( objectClass ) ; } if ( rdnPropList . size ( ) > 0 ) { String [ ] [ ] rdnProps = new String [ rdnPropList . size ( ) ] [ ] ; String [ ] [ ] rdnAttrs = new String [ rdnPropList . size ( ) ] [ ] ; for ( int j = 0 ; j < rdnPropList . size ( ) ; j ++ ) { rdnProps [ j ] = LdapHelper . getRDNs ( rdnPropList . get ( j ) ) ; rdnAttrs [ j ] = new String [ rdnProps [ j ] . length ] ; for ( int k = 0 ; k < rdnProps [ j ] . length ; k ++ ) { String rdnProp = rdnProps [ j ] [ k ] ; rdnAttrs [ j ] [ k ] = getAttributeName ( ldapEntity , rdnProp ) ; } } ldapEntity . setRDNProperties ( rdnProps , rdnAttrs ) ; if ( ldapEntity . needTranslateRDN ( ) ) { iNeedTranslateRDN = true ; } } } else if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Could not find entity for Group!!" ) ; } if ( iGroupMemberIdMap != null ) { iLdapOperationalAttr = iGroupMemberIdMap . toLowerCase ( ) . contains ( IBM_ALL_GROUPS . toLowerCase ( ) ) ; if ( iDefaultMembershipAttr ) { iMembershipAttrName = null ; } LdapEntity ldapEntity = null ; List < String > grpTypes = getGroupTypes ( ) ; List < String > objectClasses = new ArrayList < String > ( ) ; for ( int i = 0 ; i < grpTypes . size ( ) ; i ++ ) { ldapEntity = getLdapEntity ( grpTypes . get ( i ) ) ; List < String > objClses = ldapEntity . getObjectClasses ( ) ; for ( int j = 0 ; j < objClses . size ( ) ; j ++ ) { String objCls = objClses . get ( j ) ; objectClasses . add ( objCls ) ; } } List < String > attrScopes = new ArrayList < String > ( ) ; List < String > attrNames = new ArrayList < String > ( ) ; StringTokenizer strtok = new StringTokenizer ( iGroupMemberIdMap , ":;" ) ; if ( ldapEntity != null ) { while ( strtok . hasMoreTokens ( ) ) { String objectClass = strtok . nextToken ( ) ; String attribute = strtok . nextToken ( ) ; String scope = LdapConstants . LDAP_DIRECT_GROUP_MEMBERSHIP_STRING ; if ( SchemaConstants . VALUE_ALL_PROPERTIES . equalsIgnoreCase ( objectClass ) ) { for ( int j = 0 ; j < objectClasses . size ( ) ; j ++ ) { iMbrAttrMap . put ( objectClasses . get ( j ) , attribute ) ; } } else { iMbrAttrMap . put ( objectClass . toLowerCase ( ) , attribute ) ; } if ( ! attrNames . contains ( attribute ) ) { attrNames . add ( attribute ) ; attrScopes . add ( scope ) ; } if ( objectClass != null && ! objectClasses . contains ( objectClass . toLowerCase ( ) ) && ( getGroupTypes ( ) != null && getGroupTypes ( ) . size ( ) > 0 ) && ! SchemaConstants . VALUE_ALL_PROPERTIES . equals ( objectClass ) ) { getLdapEntity ( getGroupTypes ( ) . get ( 0 ) ) . addObjectClass ( objectClass ) ; } } iMbrAttrs = attrNames . toArray ( new String [ 0 ] ) ; iMbrAttrScope = new short [ iMbrAttrs . length ] ; iMbrAttrsAllScope = true ; iMbrAttrsNestedScope = true ; for ( int i = 0 ; i < attrScopes . size ( ) ; i ++ ) { iMbrAttrScope [ i ] = LdapHelper . getMembershipScope ( attrScopes . get ( i ) ) ; if ( iMbrAttrScope [ i ] == LdapConstants . LDAP_DIRECT_GROUP_MEMBERSHIP ) { iMbrAttrsAllScope = false ; iMbrAttrsNestedScope = false ; } else if ( iMbrAttrScope [ i ] == LdapConstants . LDAP_NESTED_GROUP_MEMBERSHIP ) { iMbrAttrsAllScope = false ; } } } else if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Could not find entity for Group!!" ) ; } } if ( checkIfRacf ( ) ) { initializeRacfFilters ( ) ; } resetEntitySearchFilters ( ) ; } }
Set the filters depending on the ldap type selected.

@param configProps