Package javax.mail.search

Examples of javax.mail.search.RecipientStringTerm


    public SearchTermBuilder recipient(Message.RecipientType type, String pattern) {
        return recipient(Op.and, type, pattern);
    }

    public SearchTermBuilder recipient(Op op, Message.RecipientType type, String pattern) {
        SearchTerm st = new RecipientStringTerm(type, pattern);
        addTerm(op, st);
        return this;
    }
View Full Code Here


            case SUBJECT:
                seekStrategy =  new SubjectTerm(value);
                LOG.debug("Fetching emails with a subject of \"" + value + "\"");
                break;
            case TO:
                seekStrategy = new RecipientStringTerm(Message.RecipientType.TO,value);
                LOG.debug("Fetching emails sent to \"" + value + "\"");
                break;
            case FROM:
                seekStrategy = new FromStringTerm(value);
                LOG.debug("Fetching emails sent from \"" + value + "\"");
                break;
            case CC:
                seekStrategy = new RecipientStringTerm(Message.RecipientType.CC,value);
                LOG.debug("Fetching emails CC'd to \"" + value + "\"");
                break;
            case DATE_GT:
                seekStrategy = new SentDateTerm(SentDateTerm.GT, parseDate(value));
                LOG.debug("Fetching emails with a send date newer than \"" + value + "\"");
View Full Code Here

            case SUBJECT:
                seekStrategy =  new SubjectTerm(value);
                LOG.debug("Fetching emails with a subject of \"" + value + "\"");
                break;
            case TO:
                seekStrategy = new RecipientStringTerm(Message.RecipientType.TO,value);
                LOG.debug("Fetching emails sent to \"" + value + "\"");
                break;
            case FROM:
                seekStrategy = new FromStringTerm(value);
                LOG.debug("Fetching emails sent from \"" + value + "\"");
                break;
            case CC:
                seekStrategy = new RecipientStringTerm(Message.RecipientType.CC,value);
                LOG.debug("Fetching emails CC'd to \"" + value + "\"");
                break;
            case DATE_GT:
                seekStrategy = new SentDateTerm(SentDateTerm.GT, parseDate(value));
                LOG.debug("Fetching emails with a send date newer than \"" + value + "\"");
View Full Code Here

      }
      else if ( searchField == MessageListFields.FROM ) {
        terms[i] = new FromStringTerm( searchValues[i] );
      }
      else if ( searchField == MessageListFields.TO ) {
        terms[i] = new RecipientStringTerm( RecipientType.TO, searchValues[i] );
      }
      else if ( searchField == MessageListFields.CC ) {
        terms[i] = new RecipientStringTerm( RecipientType.CC, searchValues[i] );
      }
      else if ( searchField == MessageListFields.CONTENT ) {
        terms[i] = new BodyTerm( searchValues[i] );
      }
      else {
View Full Code Here

        .to("to");

    SearchTerm expected =
        new AndTerm(
          new FromStringTerm("from"),
          new RecipientStringTerm(Message.RecipientType.TO, "to")
        );
    assertEquals(expected, emailFilter.searchTerm);
  }
View Full Code Here

      );

    SearchTerm expected =
        new OrTerm(
          new FromStringTerm("from"),
          new RecipientStringTerm(Message.RecipientType.TO, "to")
        );

    assertEquals(expected, emailFilter.searchTerm);
  }
View Full Code Here

          .to("to");

    SearchTerm expected =
        new OrTerm(
          new FromStringTerm("from"),
          new RecipientStringTerm(Message.RecipientType.TO, "to")
        );

    assertEquals(expected, emailFilter.searchTerm);
  }
View Full Code Here

    SearchTerm expected =
        new OrTerm(
          new OrTerm(
            new AndTerm(
                new FromStringTerm("from"),
                new RecipientStringTerm(Message.RecipientType.TO, "to")
            ),
            new NotTerm(
                new SubjectTerm("subject")
            )
          ),
View Full Code Here

    SearchTerm expected =
        new OrTerm(
          new SearchTerm[] {
            new AndTerm(
                new FromStringTerm("from"),
                new RecipientStringTerm(Message.RecipientType.TO, "to")
            ),
            new NotTerm(
                new SubjectTerm("subject")
            ),
            new FromStringTerm("from2")
View Full Code Here

  /**
   * Defines filter for TO field.
   */
  public EmailFilter to(String toAddress) {
    SearchTerm toTerm = new RecipientStringTerm(Message.RecipientType.TO, toAddress);
    concat(toTerm);
    return this;
  }
View Full Code Here

TOP

Related Classes of javax.mail.search.RecipientStringTerm

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.