mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
03.30.2014 cb23430920141d1a79c7a593a27a5c59f8df40a3
Factorized code into CommonArguments.getSearchScope().
6 files modified
66 ■■■■■ changed files
opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentConstants.java 10 ●●●●● patch | view | raw | blame | history
opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java 27 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java 8 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java 7 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java 7 ●●●● patch | view | raw | blame | history
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java 7 ●●●● patch | view | raw | blame | history
opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentConstants.java
@@ -338,6 +338,16 @@
    public static final String OPTION_LONG_SASLOPTION = "saslOption";
    /**
     * The value for the short option searchScope.
     */
    public static final  char OPTION_SHORT_SEARCHSCOPE = 's';
    /**
     * The value for the long option searchScope.
     */
    public static final String OPTION_LONG_SEARCHSCOPE = "searchScope";
    /**
     * The value for the short option geteffectiverights control authzid.
     */
    public static final char OPTION_SHORT_EFFECTIVERIGHTSUSER = 'g';
opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java
@@ -30,6 +30,7 @@
import static com.forgerock.opendj.cli.CliConstants.DEFAULT_LDAP_CONNECT_TIMEOUT;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.ldap.SearchScope;
/**
 * This class regroup commons arguments used by the different CLI.
@@ -719,6 +720,24 @@
    }
    /**
     * Returns the "searchScope" string argument.<br>
     * <i> N.B : the 's' short option is also used by servicestate, sourceldif, randomSeed, script-friendly.</i>
     *
     * @return The "searchScope" argument.
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static  MultiChoiceArgument<SearchScope> getSearchScope() throws ArgumentException {
        final MultiChoiceArgument<SearchScope> searchScope = new MultiChoiceArgument<SearchScope>(
                OPTION_LONG_SEARCHSCOPE, OPTION_SHORT_SEARCHSCOPE, OPTION_LONG_SEARCHSCOPE, false, true,
                INFO_SEARCH_SCOPE_PLACEHOLDER.get(), SearchScope.values(), false,
                INFO_SEARCH_DESCRIPTION_SEARCH_SCOPE.get());
        searchScope.setPropertyName(OPTION_LONG_SEARCHSCOPE);
        searchScope.setDefaultValue(SearchScope.WHOLE_SUBTREE);
        return searchScope;
    }
    /**
     * Returns the "serverRoot" string argument. <br>
     * <i> N.B : the 'R' short option is also used by rejectfile, restart.</i>
     *
@@ -735,7 +754,7 @@
    /**
     * Returns the "servicestate" boolean argument. <br>
     * <i> N.B : the 's' short option is also used by sourceldif, randomSeed, script-friendly.</i>
     * <i> N.B : the 's' short option is also used by searchScope, sourceldif, randomSeed, script-friendly.</i>
     *
     * @return The "servicestate" argument.
     * @throws ArgumentException
@@ -747,8 +766,8 @@
    }
    /**
     * Returns the "script-friendly" boolean argument. <i> N.B : the 's' short option is also used by servicestate,
     * sourceldif, randomSeed.</i>
     * Returns the "script-friendly" boolean argument.<br>
     * <i> N.B : the 's' short option is also used by searchScope, servicestate, sourceldif, randomSeed.</i>
     *
     * @return The "script-friendly" argument.
     * @throws ArgumentException
@@ -849,7 +868,7 @@
    /**
     * Returns the "sourceldif" string argument. <br>
     * <i> N.B : the 's' short option is also used by servicestate, randomSeed, script-friendly.</i>
     * <i> N.B : the 's' short option is also used by searchScope, servicestate, randomSeed, script-friendly.</i>
     *
     * @param description
     *            The description of this argument.
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/AuthRate.java
@@ -357,6 +357,7 @@
    }
    /** {@inheritDoc} */
    @Override
    public boolean isInteractive() {
        return false;
    }
@@ -417,12 +418,7 @@
            baseDN.setPropertyName(OPTION_LONG_BASEDN);
            argParser.addArgument(baseDN);
            searchScope =
                    new MultiChoiceArgument<SearchScope>("searchScope", 's', "searchScope", false,
                            true, INFO_SEARCH_SCOPE_PLACEHOLDER.get(), SearchScope.values(), false,
                            INFO_SEARCH_DESCRIPTION_SEARCH_SCOPE.get());
            searchScope.setPropertyName("searchScope");
            searchScope.setDefaultValue(SearchScope.WHOLE_SUBTREE);
            searchScope = CommonArguments.getSearchScope();
            argParser.addArgument(searchScope);
            dereferencePolicy =
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
@@ -274,12 +274,7 @@
            baseDN.setPropertyName(OPTION_LONG_BASEDN);
            argParser.addArgument(baseDN);
            searchScope =
                    new MultiChoiceArgument<SearchScope>("searchScope", 's', "searchScope", false,
                            true, INFO_SEARCH_SCOPE_PLACEHOLDER.get(), SearchScope.values(), false,
                            INFO_SEARCH_DESCRIPTION_SEARCH_SCOPE.get());
            searchScope.setPropertyName("searchScope");
            searchScope.setDefaultValue(SearchScope.WHOLE_SUBTREE);
            searchScope = CommonArguments.getSearchScope();
            argParser.addArgument(searchScope);
            filename =
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDIFSearch.java
@@ -118,12 +118,7 @@
            baseDN.setPropertyName(OPTION_LONG_BASEDN);
            argParser.addArgument(baseDN);
            searchScope =
                    new MultiChoiceArgument<SearchScope>("searchScope", 's', "searchScope", false,
                            true, INFO_SEARCH_SCOPE_PLACEHOLDER.get(), SearchScope.values(), false,
                            INFO_SEARCH_DESCRIPTION_SEARCH_SCOPE.get());
            searchScope.setPropertyName("searchScope");
            searchScope.setDefaultValue(SearchScope.WHOLE_SUBTREE);
            searchScope = CommonArguments.getSearchScope();
            argParser.addArgument(searchScope);
            filename =
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/SearchRate.java
@@ -238,12 +238,7 @@
            baseDN.setPropertyName(OPTION_LONG_BASEDN);
            argParser.addArgument(baseDN);
            searchScope =
                    new MultiChoiceArgument<SearchScope>("searchScope", 's', "searchScope", false,
                            true, INFO_SEARCH_SCOPE_PLACEHOLDER.get(), SearchScope.values(), false,
                            INFO_SEARCH_DESCRIPTION_SEARCH_SCOPE.get());
            searchScope.setPropertyName("searchScope");
            searchScope.setDefaultValue(SearchScope.WHOLE_SUBTREE);
            searchScope = CommonArguments.getSearchScope();
            argParser.addArgument(searchScope);
            dereferencePolicy =