ec.gob.senescyt.sniese.commons.bundles.audit.AuditoriaMethodDispatcher 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 com.sun.jersey.api.core.HttpContext;
import com.sun.jersey.spi.dispatch.RequestDispatcher;
import ec.gob.senescyt.sniese.commons.security.PrincipalProvider;
public class AuditoriaMethodDispatcher implements RequestDispatcher {
private RequestDispatcher dispatcher;
private AuditoriaWriter auditoriaWriter;
private PrincipalProvider principalProvider;
public AuditoriaMethodDispatcher(RequestDispatcher dispatcher, AuditoriaWriter auditoriaWriter, PrincipalProvider principalProvider) {
this.dispatcher = dispatcher;
this.auditoriaWriter = auditoriaWriter;
this.principalProvider = principalProvider;
}
@Override
public void dispatch(Object resource, HttpContext context) {
dispatcher.dispatch(resource, context);
ModeloAuditable modeloAuditable = new ModeloAuditable(context, principalProvider.obtenerUsuario());
if (modeloAuditable.esAuditable()){
auditoriaWriter.escribir(modeloAuditable);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy