Examples of SearchTerm


Examples of javax.mail.search.SearchTerm

    }

    @Override
    public GmailMessageList getMessagesBy(EmailSearchStrategy strategy, String value)
    {
        SearchTerm seekStrategy = null;
        switch(strategy)
        {
            case SUBJECT:
                seekStrategy =  new SubjectTerm(value);
                LOG.debug("Fetching emails with a subject of \"" + value + "\"");
View Full Code Here

Examples of javax.mail.search.SearchTerm

        Map<String, Object> sstParams = IntrospectionSupport.extractProperties(parameters, "searchTerm.");
        if (!sstParams.isEmpty()) {
            // use SimpleSearchTerm as POJO to store the configuration and then convert that to the actual SearchTerm
            SimpleSearchTerm sst = new SimpleSearchTerm();
            setProperties(sst, sstParams);
            SearchTerm st = MailConverters.toSearchTerm(sst, getCamelContext().getTypeConverter());
            endpoint.setSearchTerm(st);
        }

        // sanity check that we know the mail server
        ObjectHelper.notEmpty(config.getHost(), "host");
View Full Code Here

Examples of javax.mail.search.SearchTerm

        log.debug( "Millis for fetching " + msgs.length + " Messages: "
            + (System.currentTimeMillis() - time) );

        if ( searchFields != null && searchFields.length > 0 && searchValues != null && searchValues.length > 0 ) {
          log.debug( "Start filtering messages..." );
          SearchTerm term = MessageUtils.createSearchTerm( searchFields, searchValues );
          msgs = folder.search( term );
          log.debug( "Millis for filtering " + msgs.length + " Messages: "
              + (System.currentTimeMillis() - time) );
        }
View Full Code Here

Examples of javax.mail.search.SearchTerm

        Folder source = getFolder(folder, Folder.READ_WRITE);
       
        for (Rule rule : rules) {
            if ("move".equals(rule.getType())) {
                if (rule.getMatchingText() != null) {
                    SearchTerm st = new FromStringTerm(rule.getMatchingText());
                    Message[] msgs = source.search(st);
                    if (msgs != null && msgs.length > 0) {
                        moveMessages(msgs, source, getFolder(rule.getDestFolder(), Folder.READ_WRITE));
                    }
                } else if (rule.getOlderThan() > 0) {
                   
                }
            } else  if ("delete".equals(rule.getType())) {
                if (rule.getMatchingText() != null) {
                    SearchTerm st = new FromStringTerm(rule.getMatchingText());
                    Message[] msgs = source.search(st);
                    if (msgs != null && msgs.length > 0) {
                        moveMessages(msgs, source, getFolder(rule.getDestFolder(), Folder.READ_WRITE));
                    }
                } else if (rule.getOlderThan() > 0) {
View Full Code Here

Examples of javax.mail.search.SearchTerm

  public void testAnd1() {
    EmailFilter emailFilter =
      filter()
        .from("from");

    SearchTerm expected = new FromStringTerm("from");
    assertEquals(expected, emailFilter.searchTerm);
  }
View Full Code Here

Examples of javax.mail.search.SearchTerm

    EmailFilter emailFilter =
      filter()
        .from("from")
        .to("to");

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

Examples of javax.mail.search.SearchTerm

          filter().from("from"),
          filter().to("to")

      );

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

Examples of javax.mail.search.SearchTerm

    EmailFilter emailFilter =
      filter().or()
          .from("from")
          .to("to");

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

Examples of javax.mail.search.SearchTerm

            .or()
            .not()
            .subject("subject")
            .from("from2");

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

Examples of javax.mail.search.SearchTerm

  /**
   * Defines filter for SUBJECT field.
   */
  public EmailFilter subject(String subject) {
    SearchTerm subjectTerm = new SubjectTerm(subject);
    concat(subjectTerm);
    return this;
  }
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.