congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.apache.james.mailbox.model
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.james.mailbox.model

Best Java code snippets using org.apache.james.mailbox.model (Showing top 20 results out of 315)

origin: apache/james-project

  private boolean hasPositiveUserKey(MailboxACL.Entry entry) {
    return !entry.getKey().isNegative()
      && entry.getKey().getNameType().equals(MailboxACL.NameType.user);
  }
}
origin: apache/james-project

public Blob toBlob() {
  return Blob.builder()
    .id(BlobId.fromBytes(bytes))
    .payload(bytes)
    .contentType(type)
    .build();
}
origin: apache/james-project

/**
 * Creates a filter matching messages whose Address header contains the
 * given address. The address header of the message MUST get canonicalized
 * before try to match it.
 * 
 * @param type
 * @param address
 * @return <code>Criterion</code>
 */
public static Criterion address(AddressType type, String address) {
  return new HeaderCriterion(type.name(), new AddressOperator(address));
}
origin: org.apache.james/apache-james-mailbox-cassandra

  private MessageAttachment createAttachment() {
    return MessageAttachment.builder()
      .attachment(Attachment.builder()
        .bytes("content".getBytes(StandardCharsets.UTF_8))
        .type("type")
        .build())
      .build();
  }
}
origin: apache/james-project

/**
 * Return a read-only {@link Iterator} which contains all uid which fall in the specified range.
 */
@Override
public Iterator<MessageUid> iterator() {
  return new RangeIterator(getUidFrom(), getUidTo());
}

origin: org.apache.james/apache-james-mailbox-store

public MessageParser() {
  cidParser = Cid.parser()
    .relaxed()
    .unwrap();
}
origin: org.apache.james/apache-james-mailbox-store

@Override
public long size() throws MailboxException {
  return result.getHeaders().size();
}
origin: apache/james-project

public static <U extends QuotaValue<U>> SerializableQuota<U> newInstance(U used, U max) {
  return new SerializableQuota<>(
    new SerializableQuotaValue<>(used),
    new SerializableQuotaValue<>(max)
  );
}
origin: apache/james-project

@Override
public  Optional<Cid> apply(CidValidator cidValidator, String value) {
  cidValidator.validate(value);
  if (isWrappedWithAngleBrackets(value)) {
    return unwrap(value, cidValidator);
  }
  return toCid(cidValidator, value);
}
origin: apache/james-project

/**
 * Creates a filter for message size less than the given value
 * 
 * @param value
 *            messages with size less than this value will be selected by
 *            the returned criterion
 * @return <code>Criterion</code>, not null
 */
public static Criterion sizeLessThan(long value) {
  return new SizeCriterion(new NumericOperator(value, NumericComparator.LESS_THAN));
}
origin: apache/james-project

/**
 * Creates a filter for message mod-sequence greater than the given value
 * 
 * @param value
 *            messages with mod-sequence greater than this value will be
 *            selected by the returned criterion
 * @return <code>Criterion</code>, not null
 */
public static Criterion modSeqGreaterThan(long value) {
  return new ModSeqCriterion(new NumericOperator(value, NumericComparator.GREATER_THAN));
}
origin: apache/james-project

/**
 * Creates a filter on the given flag selecting messages where the given
 * flag is not selected.
 * 
 * @param flag
 *            <code>Flag</code>, not null
 * @return <code>Criterion</code>, not null
 */
public static Criterion flagIsUnSet(String flag) {
  return new CustomFlagCriterion(flag, BooleanOperator.unset());
}
origin: apache/james-project

/**
 * Creates a filter on the given flag selecting messages where the given
 * flag is selected.
 * 
 * @param flag
 *            <code>Flag</code>, not null
 * @return <code>Criterion</code>, not null
 */
public static Criterion flagIsSet(Flag flag) {
  return new FlagCriterion(flag, BooleanOperator.set());
}
origin: apache/james-project

/**
 * Creates a filter on the given flag selecting messages where the given
 * flag is selected.
 * 
 * @param flag
 *            <code>Flag</code>, not null
 * @return <code>Criterion</code>, not null
 */
public static Criterion flagIsSet(String flag) {
  return new CustomFlagCriterion(flag, BooleanOperator.set());
}
origin: apache/james-project

/**
 * Creates a filter on the given flag selecting messages where the given
 * flag is not selected.
 * 
 * @param flag
 *            <code>Flag</code>, not null
 * @return <code>Criterion</code>, not null
 */
public static Criterion flagIsUnSet(Flag flag) {
  return new FlagCriterion(flag, BooleanOperator.unset());
}
origin: apache/james-project

/**
 * Creates a filter matching messages with a header matching the given name.
 * 
 * All to-compared Strings MUST BE converted to uppercase before doing so
 * (this also include the search value)
 * 
 * @param headerName
 *            name of the header whose value will be compared, not null
 * @return <code>Criterion</code>, not null
 */
public static Criterion headerExists(String headerName) {
  return new HeaderCriterion(headerName, ExistsOperator.exists());
}
origin: apache/james-project

/**
 * Creates a filter for message size greater than the given value
 * 
 * @param value
 *            messages with size greater than this value will be selected by
 *            the returned criterion
 * @return <code>Criterion</code>, not null
 */
public static Criterion sizeGreaterThan(long value) {
  return new SizeCriterion(new NumericOperator(value, NumericComparator.GREATER_THAN));
}
origin: apache/james-project

/**
 * Creates a filter for message mod-sequence less than the given value
 * 
 * @param value
 *            messages with mod-sequence less than this value will be
 *            selected by the returned criterion
 * @return <code>Criterion</code>, not null
 */
public static Criterion modSeqLessThan(long value) {
  return new ModSeqCriterion(new NumericOperator(value, NumericComparator.LESS_THAN));
}
origin: apache/james-project

/**
 * Creates a filter for message size equal to the given value
 * 
 * @param value
 *            messages with size equal to this value will be selected by the
 *            returned criterion
 * @return <code>Criterion</code>, not null
 */
public static Criterion sizeEquals(long value) {
  return new SizeCriterion(new NumericOperator(value, NumericComparator.EQUALS));
}
origin: apache/james-project

/**
 * Creates a filter for message mod-sequence equal to the given value
 * 
 * @param value
 *            messages with mod-sequence equal to this value will be
 *            selected by the returned criterion
 * @return <code>Criterion</code>, not null
 */
public static Criterion modSeqEquals(long value) {
  return new ModSeqCriterion(new NumericOperator(value, NumericComparator.EQUALS));
}
org.apache.james.mailbox.model

Most used classes

  • MailboxPath
  • MessageRange
  • MailboxACL
  • ComposedMessageId
  • MailboxACL$Rfc4314Rights
  • MailboxACL$EntryKey,
  • UpdatedFlags,
  • MessageId,
  • SearchQuery,
  • Attachment,
  • AttachmentId,
  • MailboxACL$ACLCommand$Builder,
  • Quota,
  • UpdatedFlags$Builder,
  • MailboxQuery$Builder,
  • MailboxQuery,
  • Attachment$Builder,
  • Cid,
  • MailboxAnnotation
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now