com.anaptecs.jeaf.serviceproviders.mail.MailServiceProviderImplBase Maven / Gradle / Ivy
The newest version!
/*
* anaptecs GmbH, Ricarda-Huch-Str. 71, 72760 Reutlingen, Germany
*
* Copyright 2004 - 2019. All rights reserved.
*/
package com.anaptecs.jeaf.serviceproviders.mail;
import com.anaptecs.jeaf.core.spi.ServiceProviderImplementation;
import com.anaptecs.jeaf.spi.mail.MailServiceProvider;
import com.anaptecs.jeaf.xfun.api.XFun;
import com.anaptecs.jeaf.xfun.api.common.ComponentID;
import com.anaptecs.jeaf.xfun.api.config.Configuration;
/**
* Implementation of the JEAF Mail Service Provider.
*/
abstract class MailServiceProviderImplBase implements ServiceProviderImplementation, MailServiceProvider {
/**
* Reference to the object that identifies this component. The reference is never null.
*/
private static final ComponentID COMPONENT_ID;
/**
* Resource access provider enables access to the properties of the service provider.
*/
private final Configuration configuration;
/**
* Static initializer is used to create the components ComponentID object and its trace object.
*/
static {
// Create Component ID and trace object.
Package lBasePackage = MailServiceProviderImpl.class.getPackage();
COMPONENT_ID = new ComponentID("MailServiceProviderImpl", lBasePackage.getName());
}
/**
* Constructor has reduced visibility in order to ensure that all service provider implementations are created through
* the factory.
*/
MailServiceProviderImplBase( ) {
// Create resource access provider for properties of the component.
configuration = XFun.getConfigurationProvider().getComponentConfiguration(COMPONENT_ID);
}
/**
* Method returns the value of the property "mailDebug".
*
* @return {@link Boolean} Value of the property "mailDebug". The method returns null if no value for the property is
* defined.
*/
public Boolean getMailDebug( ) {
return configuration.getConfigurationValue("mailDebug", Boolean.class);
}
/**
* Method returns the value of the property "mailFrom".
*
* @return {@link String} Value of the property "mailFrom". The method returns null if no value for the property is
* defined.
*/
public String getMailFrom( ) {
return configuration.getConfigurationValue("mailFrom", String.class);
}
/**
* Method returns the value of the property "mailFromPersonal".
*
* @return {@link String} Value of the property "mailFromPersonal". The method returns null if no value for the
* property is defined.
*/
public String getMailFromPersonal( ) {
return configuration.getConfigurationValue("mailFromPersonal", String.class);
}
/**
* Method returns the value of the property "mailSessionJNDI".
*
* @return {@link String} Value of the property "mailSessionJNDI". The method returns null if no value for the
* property is defined.
*/
public String getMailSessionJNDI( ) {
return configuration.getConfigurationValue("mailSessionJNDI", String.class);
}
/**
* Method returns the value of the property "mailSmtpHost".
*
* @return {@link String} Value of the property "mailSmtpHost". The method returns null if no value for the property
* is defined.
*/
public String getMailSmtpHost( ) {
return configuration.getConfigurationValue("mailSmtpHost", String.class);
}
/**
* Method returns the value of the property "mailSmtpPort".
*
* @return {@link Integer} Value of the property "mailSmtpPort". The method returns null if no value for the property
* is defined.
*/
public Integer getMailSmtpPort( ) {
return configuration.getConfigurationValue("mailSmtpPort", Integer.class);
}
/**
* Method returns the value of the property "mailSmtpSendpartial".
*
* @return {@link Boolean} Value of the property "mailSmtpSendpartial". The method returns null if no value for the
* property is defined.
*/
public Boolean getMailSmtpSendpartial( ) {
return configuration.getConfigurationValue("mailSmtpSendpartial", Boolean.class);
}
/**
* Method returns the value of the property "mailSmtpUser".
*
* @return {@link String} Value of the property "mailSmtpUser". The method returns null if no value for the property
* is defined.
*/
public String getMailSmtpUser( ) {
return configuration.getConfigurationValue("mailSmtpUser", String.class);
}
/**
* Method returns the value of the property "mailStoreProtocol".
*
* @return {@link String} Value of the property "mailStoreProtocol". The method returns null if no value for the
* property is defined.
*/
public String getMailStoreProtocol( ) {
return configuration.getConfigurationValue("mailStoreProtocol", String.class);
}
/**
* Method returns the value of the property "mailTransportProtocol".
*
* @return {@link String} Value of the property "mailTransportProtocol". The method returns null if no value for the
* property is defined.
*/
public String getMailTransportProtocol( ) {
return configuration.getConfigurationValue("mailTransportProtocol", String.class);
}
/**
* Method returns the value of the property "mailDisableSending".
*
* @return {@link Boolean} Value of the property "mailDisableSending". The method returns null if no value for the
* property is defined.
*/
public Boolean getMailDisableSending( ) {
return configuration.getConfigurationValue("mailDisableSending", Boolean.class);
}
/**
* Method returns the value of the property "mailSmtpPassword".
*
* @return {@link String} Value of the property "mailSmtpPassword". The method returns null if no value for the
* property is defined.
*/
public String getMailSmtpPassword( ) {
return configuration.getConfigurationValue("mailSmtpPassword", String.class);
}
/**
* Method returns the value of the property "mailSmtpStarttlsEnable".
*
* @return {@link Boolean} Value of the property "mailSmtpStarttlsEnable". The method returns null if no value for the
* property is defined.
*/
public Boolean getMailSmtpStarttlsEnable( ) {
return configuration.getConfigurationValue("mailSmtpStarttlsEnable", Boolean.class);
}
/**
* Method returns the value of the property "mailSmtpSslEnable".
*
* @return {@link Boolean} Value of the property "mailSmtpSslEnable". The method returns null if no value for the
* property is defined.
*/
public Boolean getMailSmtpSslEnable( ) {
return configuration.getConfigurationValue("mailSmtpSslEnable", Boolean.class);
}
/**
* Method returns the value of the property "mailSmtpAuth".
*
* @return {@link Boolean} Value of the property "mailSmtpAuth". The method returns null if no value for the property
* is defined.
*/
public Boolean getMailSmtpAuth( ) {
return configuration.getConfigurationValue("mailSmtpAuth", Boolean.class);
}
}