Examples of AndFilter


Examples of org.springframework.ldap.filter.AndFilter

            String user = props.getProperty("claimUser");
            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 {
                        return attrs.get("distinguishedName").get();
                    }
                };
            @SuppressWarnings("rawtypes")
            List users =
                ldap.search(
                            "OU=users,DC=emea,DC=mycompany,DC=com",
                            filter.toString(),
                            SearchControls.SUBTREE_SCOPE,
                            mapper
                );

            Assert.isTrue(users.size() == 1, "Only one user expected");
View Full Code Here

Examples of org.springframework.ldap.filter.AndFilter

    }


    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 {
                    return attrs.get("distinguishedName").get();
                }
            };
        @SuppressWarnings("rawtypes")
        List users =
            ldap.search(this.userBaseDn, filter.toString(), SearchControls.SUBTREE_SCOPE, mapper);
        if (users.size() == 1) {
            dn = (String)users.get(0);
        }
        return dn;
    }
View Full Code Here

Examples of org.springframework.ldap.filter.AndFilter

        dn.add(this.namingAttribute, service.getName());
        return new DirContextAdapter(dn);
    }

    protected Filter getSearchFilter(final Long id) {
        return new AndFilter().and(getLoadFilter()).and(new EqualsFilter(this.idAttribute, String.valueOf(id)));
    }
View Full Code Here

Examples of ru.petrsu.akolosov.flowbrook.processing.filters.AndFilter

            final FlowFilter udpFlows = new ProtoFilter(17);
            final FlowFilter tcpFlows = new ProtoFilter(6);
           
            /* TCP destination ports */
            final AndFilter tcpDstFlows = new AndFilter();
            tcpDstFlows.addFilter(tcpFlows);
            tcpDstFlows.addFilter(dstWellKnownPorts);
            statsRules.add(new PortDistributionRule(tcpDstFlows, new FileOutputStream("flowsTcpDstPorts.csv", true), true));

            /* TCP source ports */
            final AndFilter tcpSrcFlows = new AndFilter();
            tcpSrcFlows.addFilter(tcpFlows);
            tcpSrcFlows.addFilter(srcWellKnownPorts);
            statsRules.add(new PortDistributionRule(tcpSrcFlows, new FileOutputStream("flowsTcpSrcPorts.csv", true), false));

            /* UDP destination ports */
            final AndFilter udpDstFlows = new AndFilter();
            udpDstFlows.addFilter(udpFlows);
            udpDstFlows.addFilter(dstWellKnownPorts);
            statsRules.add(new PortDistributionRule(udpDstFlows, new FileOutputStream("flowsUdpDstPorts.csv", true), true));

            /* UDP source ports */
            final AndFilter udpSrcFlows = new AndFilter();
            udpSrcFlows.addFilter(udpFlows);
            udpSrcFlows.addFilter(srcWellKnownPorts);
            statsRules.add(new PortDistributionRule(udpSrcFlows, new FileOutputStream("flowsUdpSrcPorts.csv", true), false));

            /* UDP and TCP flows */
            final OrFilter udpTcpFlows = new OrFilter();
            udpTcpFlows.addFilter(udpFlows);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.