javax.naming.directory.SearchControls#OBJECT_SCOPE源码实例Demo

下面列出了javax.naming.directory.SearchControls#OBJECT_SCOPE 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: openjdk-8-source   文件: ContextEnumerator.java
protected ContextEnumerator(Context context, int scope, String contextName,
                         boolean returnSelf)
    throws NamingException {
    if(context == null) {
        throw new IllegalArgumentException("null context passed");
    }

    root = context;

    // No need to list children if we're only searching object
    if (scope != SearchControls.OBJECT_SCOPE) {
        children = getImmediateChildren(context);
    }
    this.scope = scope;
    this.contextName = contextName;
    // pretend root is processed, if we're not supposed to return ourself
    rootProcessed = !returnSelf;
    prepNextChild();
}
 
源代码2 项目: jdk8u60   文件: ContextEnumerator.java
protected ContextEnumerator(Context context, int scope, String contextName,
                         boolean returnSelf)
    throws NamingException {
    if(context == null) {
        throw new IllegalArgumentException("null context passed");
    }

    root = context;

    // No need to list children if we're only searching object
    if (scope != SearchControls.OBJECT_SCOPE) {
        children = getImmediateChildren(context);
    }
    this.scope = scope;
    this.contextName = contextName;
    // pretend root is processed, if we're not supposed to return ourself
    rootProcessed = !returnSelf;
    prepNextChild();
}
 
源代码3 项目: jdk8u-jdk   文件: ContextEnumerator.java
protected ContextEnumerator(Context context, int scope, String contextName,
                         boolean returnSelf)
    throws NamingException {
    if(context == null) {
        throw new IllegalArgumentException("null context passed");
    }

    root = context;

    // No need to list children if we're only searching object
    if (scope != SearchControls.OBJECT_SCOPE) {
        children = getImmediateChildren(context);
    }
    this.scope = scope;
    this.contextName = contextName;
    // pretend root is processed, if we're not supposed to return ourself
    rootProcessed = !returnSelf;
    prepNextChild();
}
 
源代码4 项目: openjdk-jdk9   文件: ContextEnumerator.java
protected ContextEnumerator(Context context, int scope, String contextName,
                         boolean returnSelf)
    throws NamingException {
    if(context == null) {
        throw new IllegalArgumentException("null context passed");
    }

    root = context;

    // No need to list children if we're only searching object
    if (scope != SearchControls.OBJECT_SCOPE) {
        children = getImmediateChildren(context);
    }
    this.scope = scope;
    this.contextName = contextName;
    // pretend root is processed, if we're not supposed to return ourself
    rootProcessed = !returnSelf;
    prepNextChild();
}
 
源代码5 项目: jdk8u-jdk   文件: ContextEnumerator.java
protected ContextEnumerator(Context context, int scope, String contextName,
                         boolean returnSelf)
    throws NamingException {
    if(context == null) {
        throw new IllegalArgumentException("null context passed");
    }

    root = context;

    // No need to list children if we're only searching object
    if (scope != SearchControls.OBJECT_SCOPE) {
        children = getImmediateChildren(context);
    }
    this.scope = scope;
    this.contextName = contextName;
    // pretend root is processed, if we're not supposed to return ourself
    rootProcessed = !returnSelf;
    prepNextChild();
}
 
源代码6 项目: jdk8u-jdk   文件: ContextEnumerator.java
public Binding next() throws NamingException {
    if (!rootProcessed) {
        rootProcessed = true;
        return new Binding("", root.getClass().getName(),
                           root, true);
    }

    if (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants()) {
        return getNextDescendant();
    }

    throw new NoSuchElementException();
}
 
源代码7 项目: hottub   文件: ContextEnumerator.java
public Binding next() throws NamingException {
    if (!rootProcessed) {
        rootProcessed = true;
        return new Binding("", root.getClass().getName(),
                           root, true);
    }

    if (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants()) {
        return getNextDescendant();
    }

    throw new NoSuchElementException();
}
 
源代码8 项目: openjdk-8-source   文件: ContextEnumerator.java
public Binding next() throws NamingException {
    if (!rootProcessed) {
        rootProcessed = true;
        return new Binding("", root.getClass().getName(),
                           root, true);
    }

    if (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants()) {
        return getNextDescendant();
    }

    throw new NoSuchElementException();
}
 
源代码9 项目: openjdk-8   文件: ContextEnumerator.java
public Binding next() throws NamingException {
    if (!rootProcessed) {
        rootProcessed = true;
        return new Binding("", root.getClass().getName(),
                           root, true);
    }

    if (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants()) {
        return getNextDescendant();
    }

    throw new NoSuchElementException();
}
 
源代码10 项目: jdk8u-jdk   文件: ContextEnumerator.java
public Binding next() throws NamingException {
    if (!rootProcessed) {
        rootProcessed = true;
        return new Binding("", root.getClass().getName(),
                           root, true);
    }

    if (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants()) {
        return getNextDescendant();
    }

    throw new NoSuchElementException();
}
 
源代码11 项目: openjdk-jdk9   文件: ContextEnumerator.java
public Binding next() throws NamingException {
    if (!rootProcessed) {
        rootProcessed = true;
        return new Binding("", root.getClass().getName(),
                           root, true);
    }

    if (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants()) {
        return getNextDescendant();
    }

    throw new NoSuchElementException();
}
 
源代码12 项目: jdk8u-jdk   文件: ContextEnumerator.java
public boolean hasMore() throws NamingException {
    return !rootProcessed ||
        (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants());
}
 
@Test
   public void testSearchScopeObjectScopeSetInConstructorIsUsed() throws Exception {
       DefaultDirContextValidator tested = new DefaultDirContextValidator(SearchControls.OBJECT_SCOPE);
       assertThat(tested.getSearchControls().getSearchScope()).as("OBJECT_SCOPE, ").isEqualTo(SearchControls.OBJECT_SCOPE);
}
 
源代码14 项目: jdk8u60   文件: ContextEnumerator.java
public boolean hasMore() throws NamingException {
    return !rootProcessed ||
        (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants());
}
 
源代码15 项目: openjdk-8-source   文件: ContextEnumerator.java
public boolean hasMore() throws NamingException {
    return !rootProcessed ||
        (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants());
}
 
源代码16 项目: CloverETL-Engine   文件: LdapReader.java
public static Node fromXML(TransformationGraph graph, Element nodeXML) throws XMLConfigurationException, AttributeNotFoundException {
	ComponentXMLAttributes xattribs = new ComponentXMLAttributes(nodeXML, graph);
	LdapReader aLdapReader = null;
	int i_scope = SearchControls.OBJECT_SCOPE;
	
	String scope = xattribs.getString(XML_SCOPE_ATTRIBUTE, null);
	String sMsg = null;
	if (scope == null) {
		sMsg = "Missing scope specification";
	} else if(scope.equalsIgnoreCase("OBJECT")) {
		// i_scope = SearchControls.OBJECT_SCOPE;	// default value
	} else if(scope.equalsIgnoreCase("ONELEVEL")) {
		i_scope = SearchControls.ONELEVEL_SCOPE;
	} else if(scope.equalsIgnoreCase("SUBTREE")) {
		i_scope = SearchControls.SUBTREE_SCOPE;
	} else {
		sMsg = "Invalid scope specification \"" + scope + "\"";
	}
	if (sMsg != null) {
		StringBuffer msg = new StringBuffer();
		
		msg.append(sMsg);
		msg.append(" in component ").append(xattribs.getString(Node.XML_ID_ATTRIBUTE, "unknown ID"));
		msg.append("; defaulting to scope \"OBJECT\"");
		logger.warn(msg.toString());
	}

	if(xattribs.exists(XML_USER_ATTRIBUTE) && xattribs.exists(XML_PASSWORD_ATTRIBUTE) ) {
		aLdapReader = new LdapReader(
				xattribs.getString(Node.XML_ID_ATTRIBUTE),
				xattribs.getStringEx(XML_LDAPURL_ATTRIBUTE, null, RefResFlag.URL),
				xattribs.getString(XML_BASE_ATTRIBUTE, null),
				xattribs.getString(XML_FILTER_ATTRIBUTE, null),
				i_scope,
				xattribs.getString(XML_USER_ATTRIBUTE),
				xattribs.getStringEx(XML_PASSWORD_ATTRIBUTE, RefResFlag.PASSWORD));
	} else {
		aLdapReader = new LdapReader(
				xattribs.getString(Node.XML_ID_ATTRIBUTE),
				xattribs.getStringEx(XML_LDAPURL_ATTRIBUTE, null, RefResFlag.URL),
				xattribs.getString(XML_BASE_ATTRIBUTE, null),
				xattribs.getString(XML_FILTER_ATTRIBUTE, null),
				i_scope);
	}
	if (xattribs.exists(XML_MULTI_VALUE_SEPARATOR_ATTRIBUTE)) {
		aLdapReader.setMultiValueSeparator(xattribs.getString(XML_MULTI_VALUE_SEPARATOR_ATTRIBUTE));
	}
	if (xattribs.exists(XML_ALIAS_HANDLING_ATTRIBUTE)) {
		aLdapReader.setAliasHandling(Enum.valueOf(AliasHandling.class, xattribs.getString(XML_ALIAS_HANDLING_ATTRIBUTE)));
	}
	if (xattribs.exists(XML_REFERRAL_HANDLING_ATTRIBUTE)) {
		aLdapReader.setReferralHandling(Enum.valueOf(ReferralHandling.class, xattribs.getString(XML_REFERRAL_HANDLING_ATTRIBUTE)));
	}
	if (xattribs.exists(XML_DEFAULT_MAPPING_FIELD)){
		aLdapReader.setDefaultMappingField(xattribs.getString(XML_DEFAULT_MAPPING_FIELD));
	}
	if (xattribs.exists(XML_PAGE_SIZE)){
		aLdapReader.setPageSize(xattribs.getInteger(XML_PAGE_SIZE));
	}
	if (xattribs.exists(XML_ALL_LDAP_ATTRIBUTES)){
		aLdapReader.setAllAttributes(xattribs.getBoolean(XML_ALL_LDAP_ATTRIBUTES));
	}
	if (xattribs.exists(XML_ADDITIONAL_BINARY_ATTRIBUTES)){
		aLdapReader.setAdditionalBinaryAttributes(xattribs.getString(XML_ADDITIONAL_BINARY_ATTRIBUTES));
	}
	if (xattribs.exists(XML_ADDITIONAL_LDAP_ENV)){
		aLdapReader.setLdapExtraPropertiesDef(xattribs.getString(XML_ADDITIONAL_LDAP_ENV));
	}
	
	return aLdapReader;
}
 
源代码17 项目: openjdk-jdk8u-backup   文件: ContextEnumerator.java
public boolean hasMore() throws NamingException {
    return !rootProcessed ||
        (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants());
}
 
源代码18 项目: openjdk-jdk9   文件: ContextEnumerator.java
public boolean hasMore() throws NamingException {
    return !rootProcessed ||
        (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants());
}
 
源代码19 项目: jdk8u-dev-jdk   文件: ContextEnumerator.java
public boolean hasMore() throws NamingException {
    return !rootProcessed ||
        (scope != SearchControls.OBJECT_SCOPE && hasMoreDescendants());
}
 
源代码20 项目: spring-ldap   文件: DefaultDirContextValidator.java
/**
 * Create the default validator, creates {@link SearchControls} with search scope <code>OBJECT_SCOPE</code>,
 * a countLimit of 1, returningAttributes of objectclass and timeLimit of 500.
 * The default base is an empty string and the default filter is objectclass=*
 */
public DefaultDirContextValidator() {
    this(SearchControls.OBJECT_SCOPE);        
}