100 lines
2.6 KiB
Plaintext
Executable File
100 lines
2.6 KiB
Plaintext
Executable File
/*
|
|
*
|
|
*/
|
|
package com.fp.bpmlib.mail;
|
|
|
|
import java.util.NoSuchElementException;
|
|
|
|
import com.fp.persistence.commondb.PersistenceHelper;
|
|
import com.fp.persistence.commondb.data.ThreadFacade;
|
|
import com.fp.persistence.pgeneral.gene.TgeneParameters;
|
|
import com.fp.persistence.pgeneral.gene.TgeneParametersKey;
|
|
|
|
// TODO: Auto-generated Javadoc
|
|
/**
|
|
* Parámetros del Sistema empleados para el manejo del Envío de Correos.
|
|
*
|
|
* @author gfiallos
|
|
*
|
|
*/
|
|
public enum MailParameters {
|
|
|
|
/** REMITENTE. */
|
|
MAIL_FROM("MAIL.FROM"),
|
|
|
|
/** INDICADOR SI SE REQUIERE AUTENTICACIÓN CON EL SERVIDOR. */
|
|
MAIL_SMTP_AUTH("MAIL.SMTP.AUTH"),
|
|
|
|
/** PASSWORD DE INGRESO AL SERVIDOR SMTP. */
|
|
MAIL_SMTP_PASSWORD("MAIL.SMTP.PASSWORD"),
|
|
|
|
/** PUERTO SMTP. */
|
|
MAIL_SMTP_PORT("MAIL.SMTP.PORT"),
|
|
|
|
/** SERVIDOR SMTP. */
|
|
MAIL_SMTP_SERVER("MAIL.SMTP.SERVER"),
|
|
|
|
/** USUARIO DE INGRESO AL SERVIDOR SMTP. */
|
|
MAIL_SMTP_USER("MAIL.SMTP.USER"),
|
|
|
|
/** INDICADOR SI EL SERVIDOR MANEJA PROTOCOLO SEGURO. */
|
|
MAIL_SMTPS("MAIL.SMTPS");
|
|
|
|
/** El valor de name. */
|
|
private String name;
|
|
|
|
/**
|
|
* Crea una nueva instancia de mail parameters.
|
|
*
|
|
* @param pName the name
|
|
*/
|
|
private MailParameters(String pName) {
|
|
this.name = pName;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de parameter.
|
|
*
|
|
* @return Valor de parameter
|
|
* @throws Exception la exception
|
|
*/
|
|
private TgeneParameters getParameter() throws Exception {
|
|
TgeneParametersKey k = new TgeneParametersKey(this.name, ThreadFacade.getSessionData().getCompany());
|
|
TgeneParameters p = TgeneParameters.find(PersistenceHelper.getEntityManager(), k);
|
|
if (p != null) {
|
|
return p;
|
|
}
|
|
throw new NoSuchElementException();
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de string value.
|
|
*
|
|
* @return Valor de string value
|
|
* @throws Exception la exception
|
|
*/
|
|
public String getStringValue() throws Exception {
|
|
return this.getParameter().getTextvalue();
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de int value.
|
|
*
|
|
* @return Valor de int value
|
|
* @throws Exception la exception
|
|
*/
|
|
public Integer getIntValue() throws Exception {
|
|
return this.getParameter().getNumbervalue().intValue();
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de boolean value.
|
|
*
|
|
* @return Valor de boolean value
|
|
* @throws Exception la exception
|
|
*/
|
|
public boolean isBooleanValue() throws Exception {
|
|
return Boolean.valueOf(this.getStringValue());
|
|
}
|
|
}
|