Package org.springframework.ldap.filter

Examples of org.springframework.ldap.filter.EqualsFilter


            {
                String name = nameAndValues[0];
                OrFilter fieldFilter = new OrFilter();
                for (int i = 1; i < nameAndValues.length; i++)
                {
                    fieldFilter.or(new EqualsFilter(name, nameAndValues[i]));
                }
                filter.and(fieldFilter);
            }
        }
        return baseFilter != null ? andFilters(baseFilter, filter) : filter;
View Full Code Here


            }
        }
       
        AndFilter filter = new AndFilter();
        filter.and(
                new EqualsFilter("objectclass", this.getObjectClass())).and(
                        new EqualsFilter(this.getUserNameAttribute(), user));

        List<String> searchAttributeList = new ArrayList<String>();
        for (RequestClaim claim : claims) {
            if (getClaimsLdapAttributeMapping().keySet().contains(claim.getClaimType().toString())) {
                searchAttributeList.add(
View Full Code Here

            Assert.notNull(user, "Property 'claimUser' not configured");

            String dn = null;

            AndFilter filter = new AndFilter();
            filter.and(new EqualsFilter("objectclass", "person")).and(new EqualsFilter("cn", user));

            //find DN of user
            AttributesMapper mapper =
                new AttributesMapper() {
                    public Object mapFromAttributes(Attributes attrs) throws NamingException {
View Full Code Here

            }
        }
       
        AndFilter filter = new AndFilter();
        filter.and(
                new EqualsFilter("objectclass", this.getObjectClass())).and(
                        new EqualsFilter(this.getUserNameAttribute(), user));

        List<String> searchAttributeList = new ArrayList<String>();
        for (RequestClaim claim : claims) {
            if (getClaimsLdapAttributeMapping().keySet().contains(claim.getClaimType().toString())) {
                searchAttributeList.add(
View Full Code Here

    protected String getUserDn(String userName) throws SecurityException
    {
        DirContext ctx = null;
        try
        {
            Filter filter = new EqualsFilter(userEntryPrefix, userName);
            if (userFilter != null)
            {
                filter = new AndFilter().and(userFilter).and(filter);
            }
            ctx = poolingContextsource.getReadOnlyContext();
            NamingEnumeration<SearchResult> results = ctx.search(userSearchPath, filter.encode(), searchControls);
           
            String dn = null;        
            if (null != results && results.hasMore())
            {
                SearchResult result = results.next();
View Full Code Here

            // the entity
            if (!StringUtils.isEmpty(fromEntityUsedIdValue))
            {
                // fetch entities using target Entity DAO with a specific filter
                // on the member attribute
                Filter memberAttrFilter = new EqualsFilter(relationAttribute, fromEntityUsedIdValue);
                toDAO.getEntities(memberAttrFilter, handler);
            }
        }
    }
View Full Code Here

    }

    public Entity getEntity(String entityId) throws SecurityException
    {
        CollectingEntitySearchResultHandler handler = new CollectingEntitySearchResultHandler(1);
        getEntities(new EqualsFilter(configuration.getLdapIdAttribute(), entityId), handler);
        return handler.getCount() == 1 ? handler.getSingleResult() : null;
    }
View Full Code Here

    {
        OrFilter filter = new OrFilter();
        String idAttr = configuration.getLdapIdAttribute();
        for (String id : entityIds)
        {
            filter.or(new EqualsFilter(idAttr, id));
        }
        getEntities(filter, handler);
    }
View Full Code Here

        return getInternalId(entity.getId(), required);
    }

    public String getInternalId(String entityId, boolean required) throws SecurityException
    {
        String sf = createSearchFilter(new EqualsFilter(configuration.getLdapIdAttribute(), entityId));
        SearchControls sc = getSearchControls(SearchControls.SUBTREE_SCOPE, false, new String[0]);
        CollectingSearchResultHandler<String,SearchResult> cbh =
            new CollectingSearchResultHandler<String,SearchResult>(1)
        {
            protected String mapResult(SearchResult result, int pageSize, int pageIndex, int index)
View Full Code Here

        }
    }

    protected DirContextOperations getEntityContextById(String entityId, boolean withAttributes) throws SecurityException
    {
        String sf = createSearchFilter(new EqualsFilter(configuration.getLdapIdAttribute(), entityId));
        SearchControls sc = getSearchControls(SearchControls.SUBTREE_SCOPE, true,
                                              withAttributes ? configuration.getEntityAttributeNames() : new String[0]);
        CollectingSearchResultHandler<DirContextOperations,SearchResult> cbh =
            new CollectingSearchResultHandler<DirContextOperations,SearchResult>(1)
        {
View Full Code Here

TOP

Related Classes of org.springframework.ldap.filter.EqualsFilter

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.