Package org.springframework.ldap.filter

Examples of org.springframework.ldap.filter.EqualsFilter


        }

        LdapTemplate template = new LdapTemplate(source);
        try {
            template.authenticate(DistinguishedName.EMPTY_PATH,
                    new EqualsFilter(configurationModel.getLdapConfiguration()
                            .getLdapUserId(), "test").toString(), "test");
            messages.showMessage(Level.INFO,
                    _("LDAP connection was successful"));
        } catch (Exception e) {
            LOG.info(e);
View Full Code Here


    }

    private boolean authenticateAgainstLDAP(String username,
            String clearPassword) {
        return ldapTemplate.authenticate(DistinguishedName.EMPTY_PATH,
                new EqualsFilter(configuration.getLdapUserId(), username)
                        .toString(), clearPassword);
    }
View Full Code Here

            }

            // We must make a search for each role-matching in nodes
            List<Attribute> resultsSearch = new ArrayList<Attribute>();
            resultsSearch.addAll(ldapTemplate.search(
                    DistinguishedName.EMPTY_PATH, new EqualsFilter(
                            roleProperty, roleLDAP.getRoleLdap()).toString(),
                    new AttributesMapper() {
                        @Override
                        public Object mapFromAttributes(Attributes attributes)
                                throws NamingException {
View Full Code Here


    private String getDnOfPrincipal(String principal) {
        String dn = null;
        AndFilter filter = new AndFilter();
        filter.and(new EqualsFilter("objectclass", "person")).and(new EqualsFilter("cn", principal));

        //find DN of user
        AttributesMapper mapper =
            new AttributesMapper() {
                public Object mapFromAttributes(Attributes attrs) throws NamingException {
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

     */
    @Test
    public final void testCreateFilter()
    {
        List<Filter> filterList = new ArrayList<Filter>();
        filterList.add(new EqualsFilter("objectclass", "person"));
        filterList.add(new EqualsFilter("objectclass", "user"));
        sut = new FindByAttributeQuery(filterList);
        AbstractFilter filter = sut.getFilter("attrib=something");

        assertEquals("(&(objectclass=person)(objectclass=user)(attrib=something))", filter.encode());
    }
View Full Code Here

     */
    @Test
    public void testCreateFilterWildcard()
    {
        List<Filter> filterList = new ArrayList<Filter>();
        filterList.add(new EqualsFilter("objectclass", "person"));
        filterList.add(new EqualsFilter("objectclass", "user"));
        FindByAttributeQuery findByAttribFilterCreator = new FindByAttributeQuery(filterList);

        sut = new FindByAttribute("cn", findByAttribFilterCreator, false);

        AbstractFilter filter = sut.getFilter("something");
View Full Code Here

     */
    @Test
    public void testCreateFilterNoWildcard()
    {
        List<Filter> filterList = new ArrayList<Filter>();
        filterList.add(new EqualsFilter("objectclass", "person"));
        filterList.add(new EqualsFilter("objectclass", "user"));
        FindByAttributeQuery findByAttribFilterCreator = new FindByAttributeQuery(filterList);

        sut = new FindByAttribute("cn", findByAttribFilterCreator, true);

        AbstractFilter filter = sut.getFilter("something");
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 roleMemberAttrFilter = new EqualsFilter(relationAttribute, fromEntityUsedIdValue);
                return toDAO.getEntities(roleMemberAttrFilter);
            }
        }
        return null;
    }
View Full Code Here

    {
        OrFilter idFilter = new OrFilter();
        String idAttr = configuration.getLdapIdAttribute();
        for (String id : entityIds)
        {
            idFilter.or(new EqualsFilter(idAttr, id));
        }
        Filter combinedFilter = null;
        if (configuration.getSearchFilter() != null)
        {
            combinedFilter = SearchUtil.andFilters(idFilter, configuration.getSearchFilter());
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.