Package org.apache.james.mailbox.model.SearchQuery

Examples of org.apache.james.mailbox.model.SearchQuery.DateResolution


    private boolean matches(final SearchQuery.DateOperator operator, final String headerName, final Message<?> message)
            throws MailboxException {

        final Date date = operator.getDate();
        final DateResolution res = operator.getDateResultion();
        try {
            final String value = headerValue(headerName, message);
            if (value == null) {
                return false;
            } else {
View Full Code Here


    }

    private boolean matchesInternalDate(final SearchQuery.DateOperator operator, final Message<?> message)
            throws UnsupportedSearchException {
        final Date date = operator.getDate();
        final DateResolution res = operator.getDateResultion();
        final Date internalDate = message.getInternalDate();
        final SearchQuery.DateComparator type = operator.getType();
        switch (type) {
        case ON:
            return on(internalDate, date, res);
View Full Code Here

     * @return query
     * @throws UnsupportedSearchException
     */
    private Query createInternalDateQuery(SearchQuery.InternalDateCriterion crit) throws UnsupportedSearchException {
        DateOperator dop = crit.getOperator();
        DateResolution res = dop.getDateResultion();
        String field = toInteralDateField(res);
        return createQuery(field, dop);
    }
View Full Code Here

    }
   
   
    private Query createQuery(String field, DateOperator dop) throws UnsupportedSearchException {
        Date date = dop.getDate();
        DateResolution res = dop.getDateResultion();
        DateTools.Resolution dRes = toResolution(res);
        String value = DateTools.dateToString(date, dRes);
        switch(dop.getType()) {
        case ON:
            return new TermQuery(new Term(field ,value));
View Full Code Here

TOP

Related Classes of org.apache.james.mailbox.model.SearchQuery.DateResolution

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.