ec.gob.senescyt.sniese.commons.bundles.audit.AuditoriaBundle 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.bundles.audit;
import ec.gob.senescyt.sniese.commons.configurations.ConfiguracionSnieseBase;
import ec.gob.senescyt.sniese.commons.security.PrincipalProvider;
import io.dropwizard.ConfiguredBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
public class AuditoriaBundle implements ConfiguredBundle {
private PrincipalProvider principalProvider;
public AuditoriaBundle(PrincipalProvider principalProvider) {
this.principalProvider = principalProvider;
}
@Override
public void run(T configuration, Environment environment) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
Class clazz = Class.forName(configuration.getConfiguracionSegura().getConfiguracionAuditoria().getWriterClass());
AuditoriaWriter auditoriaWriter = (AuditoriaWriter) clazz.newInstance();
environment.jersey().register(new AuditoriaMethodDispatcherAdapter(principalProvider, auditoriaWriter));
environment.jersey().getResourceConfig().getContainerRequestFilters().add(new DireccionRemotaFilter());
}
@Override
public void initialize(Bootstrap> bootstrap) {
// Do nothing
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy