javax.mail.search.ReceivedDateTerm Java Examples

The following examples show how to use javax.mail.search.ReceivedDateTerm. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MailConnection.java    From hop with Apache License 2.0 5 votes vote down vote up
/**
 * Set filter on message received date.
 *
 * @param receiveddate messages will be filtered on receiveddate
 */
public void setReceivedDateTermEQ( Date receiveddate ) {
  if ( this.protocol == MailConnectionMeta.PROTOCOL_POP3 ) {
    log.logError( BaseMessages.getString( PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported" ) );
  } else {
    addSearchTerm( new ReceivedDateTerm( ComparisonTerm.EQ, receiveddate ) );
  }
}
 
Example #2
Source File: MailConnection.java    From hop with Apache License 2.0 5 votes vote down vote up
/**
 * Set filter on message received date.
 *
 * @param futureDate messages will be filtered on futureDate
 */
public void setReceivedDateTermLT( Date futureDate ) {
  if ( this.protocol == MailConnectionMeta.PROTOCOL_POP3 ) {
    log.logError( BaseMessages.getString( PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported" ) );
  } else {
    addSearchTerm( new ReceivedDateTerm( ComparisonTerm.LT, futureDate ) );
  }
}
 
Example #3
Source File: MailConnection.java    From hop with Apache License 2.0 5 votes vote down vote up
/**
 * Set filter on message received date.
 *
 * @param pastDate messages will be filtered on pastDate
 */
public void setReceivedDateTermGT( Date pastDate ) {
  if ( this.protocol == MailConnectionMeta.PROTOCOL_POP3 ) {
    log.logError( BaseMessages.getString( PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported" ) );
  } else {
    addSearchTerm( new ReceivedDateTerm( ComparisonTerm.GT, pastDate ) );
  }
}
 
Example #4
Source File: MailConnection.java    From hop with Apache License 2.0 5 votes vote down vote up
public void setReceivedDateTermBetween( Date beginDate, Date endDate ) {
  if ( this.protocol == MailConnectionMeta.PROTOCOL_POP3 ) {
    log.logError( BaseMessages.getString( PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported" ) );
  } else {
    addSearchTerm( new AndTerm( new ReceivedDateTerm( ComparisonTerm.LT, endDate ), new ReceivedDateTerm(
      ComparisonTerm.GT, beginDate ) ) );
  }
}
 
Example #5
Source File: SearchTermBuilder.java    From greenmail with Apache License 2.0 5 votes vote down vote up
private static SearchTermBuilder createReceivedDateTermBuilder(final int searchTerm) {
    return new SearchTermBuilder() {
        @Override
        public SearchTerm build() {
            return new ReceivedDateTerm(searchTerm, parseDate(getParameters()));
        }
    };
}
 
Example #6
Source File: MailConnection.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Set filter on message received date.
 *
 * @param receiveddate
 *          messages will be filtered on receiveddate
 */
public void setReceivedDateTermEQ( Date receiveddate ) {
  if ( this.protocol == MailConnectionMeta.PROTOCOL_POP3 ) {
    log.logError( BaseMessages.getString( PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported" ) );
  } else {
    addSearchTerm( new ReceivedDateTerm( ComparisonTerm.EQ, receiveddate ) );
  }
}
 
Example #7
Source File: MailConnection.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Set filter on message received date.
 *
 * @param futureDate
 *          messages will be filtered on futureDate
 */
public void setReceivedDateTermLT( Date futureDate ) {
  if ( this.protocol == MailConnectionMeta.PROTOCOL_POP3 ) {
    log.logError( BaseMessages.getString( PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported" ) );
  } else {
    addSearchTerm( new ReceivedDateTerm( ComparisonTerm.LT, futureDate ) );
  }
}
 
Example #8
Source File: MailConnection.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
/**
 * Set filter on message received date.
 *
 * @param pastDate
 *          messages will be filtered on pastDate
 */
public void setReceivedDateTermGT( Date pastDate ) {
  if ( this.protocol == MailConnectionMeta.PROTOCOL_POP3 ) {
    log.logError( BaseMessages.getString( PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported" ) );
  } else {
    addSearchTerm( new ReceivedDateTerm( ComparisonTerm.GT, pastDate ) );
  }
}
 
Example #9
Source File: MailConnection.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void setReceivedDateTermBetween( Date beginDate, Date endDate ) {
  if ( this.protocol == MailConnectionMeta.PROTOCOL_POP3 ) {
    log.logError( BaseMessages.getString( PKG, "MailConnection.Error.ReceivedDatePOP3Unsupported" ) );
  } else {
    addSearchTerm( new AndTerm( new ReceivedDateTerm( ComparisonTerm.LT, endDate ), new ReceivedDateTerm(
      ComparisonTerm.GT, beginDate ) ) );
  }
}