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

com.phloc.web.smtp.ISMTPSettings Maven / Gradle / Ivy

/**
 * Copyright (C) 2006-2015 phloc systems
 * http://www.phloc.com
 * office[at]phloc[dot]com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.phloc.web.smtp;

import java.io.Serializable;
import java.nio.charset.Charset;

import javax.annotation.CheckForSigned;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * Interface representing the basic SMTP settings required to login to a user.
 * 
 * @author Philip Helger
 */
public interface ISMTPSettings extends Serializable
{
  /**
   * @return The SMTP server host name
   */
  @Nonnull
  String getHostName ();

  /**
   * @return The SMTP server port to use. May be -1 to use the default port.
   */
  int getPort ();

  /**
   * @return The server user name. May be null.
   */
  @Nullable
  String getUserName ();

  /**
   * @return The server user's password. May be null.
   */
  @Nullable
  String getPassword ();

  /**
   * @return The mail encoding to be used. May be null.
   */
  @Nonnull
  String getCharset ();

  /**
   * @return The mail encoding to be used. May be null.
   */
  @Nonnull
  Charset getCharsetObj ();

  /**
   * @return true if SSL is enabled, false if SSL is
   *         disabled
   */
  boolean isSSLEnabled ();

  /**
   * @return true if STARTTLS is enabled, false if
   *         STARTTLS is disabled
   */
  boolean isSTARTTLSEnabled ();

  /**
   * Get the connection timeout in milliseconds.
   * 
   * @return If the value is ≤ 0 than there should be no connection timeout.
   */
  @CheckForSigned
  long getConnectionTimeoutMilliSecs ();

  /**
   * Get the socket timeout in milliseconds.
   * 
   * @return If the value is ≤ 0 than there should be no connection timeout.
   */
  @CheckForSigned
  long getTimeoutMilliSecs ();

  /**
   * @return true if the minimum number of fields are defined, that
   *         are required for sending.
   */
  boolean areRequiredFieldsSet ();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy