Example usage for org.apache.commons.mail SimpleEmail getSocketConnectionTimeout

List of usage examples for org.apache.commons.mail SimpleEmail getSocketConnectionTimeout

Introduction

In this page you can find the example usage for org.apache.commons.mail SimpleEmail getSocketConnectionTimeout.

Prototype

public int getSocketConnectionTimeout() 

Source Link

Document

Get the socket connection timeout value in milliseconds.

Usage

From source file:com.adobe.acs.commons.email.impl.EmailServiceImplTest.java

@Test
public void testDefaultTimeouts() {
    emailService.activate(Collections.emptyMap());
    SimpleEmail email = sendTestEmail();
    assertEquals(30000, email.getSocketConnectionTimeout());
    assertEquals(30000, email.getSocketTimeout());
}

From source file:com.adobe.acs.commons.email.impl.EmailServiceImplTest.java

@Test
public void testCustomTimeouts() {
    Map<String, Object> params = new HashMap<>();
    params.put("so.timeout", 100);
    params.put("conn.timeout", 500);
    emailService.activate(params);/*from  www  . j  av  a2  s  .com*/
    SimpleEmail email = sendTestEmail();
    assertEquals(500, email.getSocketConnectionTimeout());
    assertEquals(100, email.getSocketTimeout());
}

From source file:com.adobe.acs.commons.hc.impl.SMTPMailServiceHealthCheck.java

private void logMailServiceConfig(FormattingResultLog resultLog, SimpleEmail email) {
    resultLog.info("SMTP Host: {}", email.getHostName());
    resultLog.info("SMTP use SSL: {}", email.isSSL());
    if (email.isSSL()) {
        resultLog.info("SMTP SSL Port: {}", email.getSslSmtpPort());
    } else {/*from  ww w .  j  a  va 2  s . co  m*/
        resultLog.info("SMTP Port: {}", email.getSmtpPort());
    }
    resultLog.info("SMTP From Address: {}", email.getFromAddress());
    resultLog.info("Socket Connection Timeout: {} seconds", email.getSocketConnectionTimeout() / 1000);
    resultLog.info("Socket IO Timeout: {} seconds", email.getSocketTimeout() / 1000);
}