
com.daedafusion.security.obligation.providers.impl.LoggingHandlerProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of security-framework Show documentation
Show all versions of security-framework Show documentation
A pluggable security framework "inspired" by the OWASP ESAPI framework
package com.daedafusion.security.obligation.providers.impl;
import com.daedafusion.sf.AbstractProvider;
import com.daedafusion.security.common.Context;
import com.daedafusion.security.obligation.Obligation;
import com.daedafusion.security.obligation.providers.ObligationHandlerProvider;
import org.apache.log4j.Logger;
/**
* Created by mphilpot on 7/14/14.
*/
public class LoggingHandlerProvider extends AbstractProvider implements ObligationHandlerProvider
{
private static final Logger log = Logger.getLogger(LoggingHandlerProvider.class);
@Override
public boolean canHandle(Obligation obligation)
{
return obligation.getUri().toString().equals("obligation:logging");
}
@Override
public void handle(Obligation obligation, Context context)
{
if(obligation.getAttributes().containsKey("level"))
{
// log at some specified level
}
else
{
log.info(String.format("Logging Obligation :: %s %s %s",
obligation.getFulfillment(), obligation.getAttributes(), context));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy