Line data Source code
1 : // Copyright (C) 2009 The Android Open Source Project 2 : // 3 : // Licensed under the Apache License, Version 2.0 (the "License"); 4 : // you may not use this file except in compliance with the License. 5 : // You may obtain a copy of the License at 6 : // 7 : // http://www.apache.org/licenses/LICENSE-2.0 8 : // 9 : // Unless required by applicable law or agreed to in writing, software 10 : // distributed under the License is distributed on an "AS IS" BASIS, 11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 : // See the License for the specific language governing permissions and 13 : // limitations under the License. 14 : 15 : package com.google.gerrit.auth.ldap; 16 : 17 : import javax.naming.directory.SearchControls; 18 : 19 0 : public enum SearchScope { 20 : // Search only the base DN 21 : // 22 0 : OBJECT(SearchControls.OBJECT_SCOPE), // 23 0 : BASE(SearchControls.OBJECT_SCOPE), 24 : 25 : // Search all entries one level under the base DN 26 : // 27 : // Does not include the base DN, and does not include items below items 28 : // under the base DN. 29 : // 30 0 : ONE(SearchControls.ONELEVEL_SCOPE), 31 : 32 : // Search all entries under the base DN, including the base DN. 33 : // 34 0 : SUBTREE(SearchControls.SUBTREE_SCOPE), // 35 0 : SUB(SearchControls.SUBTREE_SCOPE); 36 : 37 : private final int scope; 38 : 39 0 : SearchScope(int scope) { 40 0 : this.scope = scope; 41 0 : } 42 : 43 : int scope() { 44 0 : return scope; 45 : } 46 : }