Examples of FilterParser


Examples of org.apache.harmony.jndi.provider.ldap.parser.FilterParser

    private Filter commonFilter;

    public LdapSchemaFilter(String filterValue, Object[] filterArgs)
            throws InvalidSearchFilterException {
        try {
            FilterParser commonFilterParser = new FilterParser(filterValue);
            commonFilterParser.setArgs(filterArgs);
            commonFilter = commonFilterParser.parse();
        } catch (ParseException e) {
            // ldap.29=Invalid search filter
            throw new InvalidSearchFilterException(Messages
                    .getString("ldap.29")); //$NON-NLS-1$
        }
View Full Code Here

Examples of org.apache.harmony.jndi.provider.ldap.parser.FilterParser

        if (filter == null) {
            // ldap.28=Parameter of filter should not be null
            throw new NullPointerException(Messages.getString("ldap.28")); //$NON-NLS-1$
        }

        FilterParser parser = new FilterParser(filter);
       
        if (args == null) {
            args = new Object[0];
        }
       
        parser.setArgs(args);
       
        try {
            return parser.parse();
        } catch (ParseException e) {
            // ldap.29=Invalid search filter
            InvalidSearchFilterException ex = new InvalidSearchFilterException(
                    Messages.getString("ldap.29")); //$NON-NLS-1$
            ex.setRootCause(e);
View Full Code Here

Examples of org.apache.harmony.jndi.provider.ldap.parser.FilterParser

        }

        SearchControls searchControls = new SearchControls();
        SearchOp search = null;
        Filter filter = null;
        FilterParser filterParser = null;
        LdapSearchResult sre = null;
        Map<String, Attributes> names = null;
        Set<String> keyset = null;

        if (null == subschemasubentry) {
            filterParser = new FilterParser("(objectClass=*)");
            try {
                filter = filterParser.parse();
            } catch (ParseException e) {
                InvalidSearchFilterException ex = new InvalidSearchFilterException(
                        Messages.getString("ldap.29")); //$NON-NLS-1$
                ex.setRootCause(e);
                throw ex;
            }

            searchControls.setSearchScope(SearchControls.OBJECT_SCOPE);
            searchControls.setReturningAttributes(new String[] {
                    "namingContexts", "subschemaSubentry", "altServer", });
            search = new SearchOp(name.toString(), searchControls, filter);

            try {
                client.doOperation(search, requestControls);
            } catch (IOException e) {
                CommunicationException ex = new CommunicationException(e
                        .getMessage());
                ex.setRootCause(e);
                if (search.getSearchResult().isEmpty()) {
                    throw ex;
                }
                search.getSearchResult().setException(ex);
            }

            sre = search.getSearchResult();
            names = sre.getEntries();

            keyset = names.keySet();

            schemaRoot: for (Iterator<String> iterator = keyset.iterator(); iterator
                    .hasNext();) {
                String key = iterator.next();
                Attributes as = names.get(key);
                NamingEnumeration<String> ids = as.getIDs();
                while (ids.hasMore()) {
                    String id = ids.next();
                    if (id.equalsIgnoreCase("subschemasubentry")) {
                        subschemasubentry = (String) as.get(id).get();
                        break schemaRoot;
                    }
                }
            }
        }

        if (null == subschemasubentry) {
            return getSchema(name.getPrefix(name.size() - 1));
        }

        searchControls.setSearchScope(SearchControls.OBJECT_SCOPE);
        searchControls.setReturningAttributes(new String[] { "objectclasses",
                "attributetypes", "matchingrules", "ldapsyntaxes" });
        searchControls.setReturningObjFlag(true);
        filterParser = new FilterParser("(objectClass=subschema)");
        try {
            filter = filterParser.parse();
        } catch (ParseException e) {
            InvalidSearchFilterException ex = new InvalidSearchFilterException(
                    Messages.getString("ldap.29")); //$NON-NLS-1$
            ex.setRootCause(e);
            throw ex;
View Full Code Here

Examples of org.apache.harmony.jndi.provider.ldap.parser.FilterParser

        SearchControls searchControls = new SearchControls();
        searchControls.setSearchScope(SearchControls.OBJECT_SCOPE);
        searchControls.setReturningAttributes(new String[] { "objectClass", });
        searchControls.setReturningObjFlag(false);
        FilterParser parser = new FilterParser("(objectClass=*)");
        Filter filter = null;
        try {
            filter = parser.parse();
        } catch (ParseException e1) {
            // Should not throw this excption
        }
        String targetDN = getTargetDN(name, contextDn);
        SearchOp search = new SearchOp(targetDN, searchControls, filter);
View Full Code Here

Examples of org.apache.ldap.common.filter.FilterParser

    }


    public void testWithMinMaxAndSimpleRefinement() throws Exception
    {
        FilterParser parser = new FilterParserImpl();
        ExprNode refinement = parser.parse( "( objectClass = person )" );

        SubtreeSpecificationModifier modifier = new SubtreeSpecificationModifier();
        modifier.setRefinement( refinement );
        modifier.setMinBaseDistance( 1 );
        modifier.setMaxBaseDistance( 3 );
View Full Code Here

Examples of org.apache.ldap.common.filter.FilterParser

        throws Exception
    {
        System.out.println( "Search attempt using filter '" + filter + "' "
            + "with scope '" + scope + "' and a return limit of '" + limit
            + "'" );
        FilterParser parser = new FilterParserImpl();
        ExprNode root = null;

        try
        {
            root = parser.parse( filter );
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            JTextArea text = new JTextArea();
View Full Code Here

Examples of org.apache.ldap.common.filter.FilterParser


    public boolean doAnnotate( String filter )
        throws Exception
    {
    FilterParser parser = new FilterParserImpl();
        ExprNode root = null;

        try
        {
            root = parser.parse( filter );
        }
        catch( Exception e )
        {
            JTextArea text = new JTextArea();
            String msg = e.getMessage();
View Full Code Here

Examples of org.apache.ldap.common.filter.FilterParser

            log.debug( "Search attempt using filter '" + filter + "' "
            + "with scope '" + scope + "' and a return limit of '" + limit
            + "'" );
        }

        FilterParser parser = new FilterParserImpl();
        ExprNode root = null;

        try
        {
            root = parser.parse( filter );
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            JTextArea text = new JTextArea();
View Full Code Here

Examples of org.apache.ldap.common.filter.FilterParser


    public boolean doAnnotate( String filter )
        throws Exception
    {
    FilterParser parser = new FilterParserImpl();
        ExprNode root = null;

        try
        {
            root = parser.parse( filter );
        }
        catch( Exception e )
        {
            JTextArea text = new JTextArea();
            String msg = e.getMessage();
View Full Code Here

Examples of org.apache.ldap.common.filter.FilterParser

            log.debug( "Search attempt using filter '" + filter + "' "
            + "with scope '" + scope + "' and a return limit of '" + limit
            + "'" );
        }

        FilterParser parser = new FilterParserImpl();
        ExprNode root = null;

        try
        {
            root = parser.parse( filter );
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            JTextArea text = new JTextArea();
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.