ec.gob.senescyt.sniese.commons.configurations.ConfiguracionSnieseBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sniese-commons Show documentation
Show all versions of sniese-commons Show documentation
Librería que contiene clases de uso comun para sniese hechos en dropwizard
package ec.gob.senescyt.sniese.commons.configurations;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import com.google.common.annotations.VisibleForTesting;
import io.dropwizard.Configuration;
import io.dropwizard.jetty.HttpConnectorFactory;
import io.dropwizard.server.DefaultServerFactory;
import javax.validation.Valid;
public class ConfiguracionSnieseBase extends Configuration {
@Valid
@JsonUnwrapped
private ConfiguracionSegura configuracionSegura;
@Valid
@JsonUnwrapped
private ConfiguracionPersistente configuracionPersistente;
public ConfiguracionSnieseBase() {
// do nothing
}
@VisibleForTesting
public ConfiguracionSnieseBase(ConfiguracionPersistente configuracionPersistente, ConfiguracionSegura configuracionSegura) {
this.configuracionPersistente = configuracionPersistente;
this.configuracionSegura = configuracionSegura;
}
@JsonIgnore
public String getPuertoHttps() {
final DefaultServerFactory serverFactory = (DefaultServerFactory) getServerFactory();
final HttpConnectorFactory httpConnectorFactory = (HttpConnectorFactory) serverFactory.getApplicationConnectors().get(1);
return String.valueOf(httpConnectorFactory.getPort());
}
public ConfiguracionSegura getConfiguracionSegura() {
return configuracionSegura;
}
public ConfiguracionPersistente getConfiguracionPersistente() {
return configuracionPersistente;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy