All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hubspot.imap.ImapClientConfigurationIF Maven / Gradle / Ivy

There is a newer version: 0.6.1
Show newest version
package com.hubspot.imap;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.net.HostAndPort;
import com.hubspot.imap.protocol.capabilities.AuthMechanism;
import com.hubspot.imap.utils.ConfigDefaults;
import java.util.List;
import java.util.Optional;
import javax.net.ssl.TrustManagerFactory;
import org.immutables.value.Value.Default;
import org.immutables.value.Value.Derived;
import org.immutables.value.Value.Immutable;
import org.immutables.value.Value.Style;

@Immutable
@Style(typeAbstract = { "*IF" }, typeImmutable = "*")
@JsonDeserialize(as = ImapClientConfiguration.class)
@JsonSerialize(as = ImapClientConfiguration.class)
public interface ImapClientConfigurationIF {
  HostAndPort hostAndPort();

  /**
   * @deprecated please use {@link #allowedAuthMechanisms()} instead.
   */
  @Derived
  @Deprecated
  default AuthMechanism authType() {
    return allowedAuthMechanisms().size() > 0
      ? allowedAuthMechanisms().get(0)
      : AuthMechanism.UNKNOWN;
  }

  @Default
  default boolean useSsl() {
    return true;
  }

  @Default
  default int noopKeepAliveIntervalSec() {
    return -1;
  }

  @Default
  default int socketTimeoutMs() {
    return 90000;
  }

  @Default
  default int writeBackOffMs() {
    return 100;
  }

  @Default
  default int maxLineLength() {
    return 100000;
  }

  @Default
  default int defaultResponseBufferSize() {
    return 1000;
  }

  @Default
  default int connectTimeoutMillis() {
    return 5000;
  }

  @Default
  default int closeTimeoutSec() {
    return 5;
  }

  @Default
  default int soLinger() {
    return 5;
  }

  @Default
  default boolean tracingEnabled() {
    return false;
  }

  @Default
  default int maxHeaderCount() {
    return 10000;
  }

  @Default
  default Optional trustManagerFactory() {
    return Optional.empty();
  }

  @Default
  default Optional proxyConfig() {
    return Optional.empty();
  }

  @Default
  default Optional socksProxyConfig() {
    return Optional.empty();
  }

  @Default
  default List allowedAuthMechanisms() {
    return ConfigDefaults.DEFAULT_ALLOWED_AUTH_MECHANISMS;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy