Package org.springframework.ldap.core

Examples of org.springframework.ldap.core.DistinguishedName


        return baseDN;
    }

    public void setLdapBase(String ldapBase)
    {
        this.baseDN = new DistinguishedName(ldapBase).immutableDistinguishedName();
    }
View Full Code Here


        return searchDN;
    }

    public void setSearchBase(String searchBase)
    {
        this.searchDN = new DistinguishedName(searchBase).immutableDistinguishedName();
    }
View Full Code Here

    }

    public void getEntities(Entity parent, Filter filter, EntitySearchResultHandler handler) throws SecurityException
    {
        ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader();
        DistinguishedName parentDN = getRelativeDN(parent.getInternalId());
        if (configuration.getSearchDN().size() == 0 || parentDN.startsWith(configuration.getSearchDN()))
        {
            String sf = createSearchFilter(filter);
            SearchControls sc = getSearchControls(SearchControls.ONELEVEL_SCOPE, true, configuration.getEntityAttributeNames());
            handler.setEntityFactory(getEntityFactory());
            PagedSearchExecutor pse = new PagedSearchExecutor(parentDN, sf, sc, handler, searchPageSize);
View Full Code Here

        return handler.getSingleResult();
    }

    protected void getEntityByInternalId(String internalId, EntitySearchResultHandler handler) throws SecurityException
    {
        DistinguishedName principalDN = getRelativeDN(internalId);
        if (configuration.getSearchDN().size() == 0 || principalDN.startsWith(configuration.getSearchDN()))
        {
            SearchControls sc = getSearchControls(SearchControls.OBJECT_SCOPE, true, configuration.getEntityAttributeNames());
            PagedSearchExecutor pse = new PagedSearchExecutor(principalDN, defaultSearchFilterStr, sc, handler);
            handler.setEntityFactory(getEntityFactory());
           
View Full Code Here

        }
    }

    public Entity getParentEntity(Entity childEntity) throws SecurityException
    {
        DistinguishedName parentDN = new DistinguishedName(childEntity.getInternalId());
        parentDN.removeLast();
        return getEntityByInternalId(parentDN.toCompactString());
    }
View Full Code Here

        }
    }

    protected DirContextOperations getEntityContextByInternalId(String internalId, boolean withAttributes) throws SecurityException
    {
        DistinguishedName principalDN = getRelativeDN(internalId);
        if (configuration.getSearchDN().size() == 0 || principalDN.startsWith(configuration.getSearchDN()))
        {
            String sf = createSearchFilter(null);
            SearchControls sc = getSearchControls(SearchControls.OBJECT_SCOPE, true,
                                                  withAttributes ? configuration.getEntityAttributeNames() : new String[0]);
            CollectingSearchResultHandler<DirContextOperations,SearchResult> cbh =
View Full Code Here

        if (parentEntity == null || parentEntity.getInternalId() == null)
        {
            throw new SecurityException(SecurityException.UNEXPECTED.create(getClass().getName(), "add(Entity entity, Entity parentEntity)",
                                                                            "Provided parent entity is null or has no internal ID."));
        }
        DistinguishedName parentDn = new DistinguishedName(parentEntity.getInternalId());
        parentDn.removeFirst(new DistinguishedName(configuration.getBaseDN()));
        internalAdd(entity, parentDn);
    }
View Full Code Here

    }

    public void add(Entity entity) throws SecurityException
    {
        // add entity to "root" searchDN
        internalAdd(entity, new DistinguishedName(configuration.getSearchDN()));
    }
View Full Code Here

        return controls;
    }

    protected DistinguishedName getRelativeDN(String fullDN)
    {
        DistinguishedName principalDN = new DistinguishedName(fullDN);
        if (configuration.getBaseDN().size() > 0)
        {
            principalDN.removeFirst(configuration.getBaseDN());
        }
        return principalDN;
    }
View Full Code Here

        return principalDN;
    }

    protected DistinguishedName getFullDN(DistinguishedName relativeDN)
    {       
        DistinguishedName fullDN = new DistinguishedName(relativeDN);
        if (configuration.getBaseDN().size() > 0 && !fullDN.startsWith(configuration.getBaseDN()))
        {
            fullDN.prepend(configuration.getBaseDN());
        }
        return fullDN;
    }
View Full Code Here

TOP

Related Classes of org.springframework.ldap.core.DistinguishedName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.