use of org.dcache.gplazma.plugins.GPlazmaSessionPlugin in project dcache by dCache.
the class DefaultSessionStrategy method session.
/**
* Devegates execution of the {@link GPlazmaSessionPlugin#session(SessionID,
* Set<Principal>,Set<Object>) GPlazmaSessionPlugin.session} methods of the plugins supplied by
* {@link GPlazmaStrategy#setPlugins(List< GPlazmaPluginService <T>>)
* GPlazmaStrategy.setPlugins} to {@link PAMStyleStrategy#callPlugins(PluginCaller<T>)
* PAMStyleStrategy.callPlugins(PluginCaller<T>)} by providing anonymous implementation of the
* {@link PluginCaller#call(GPlazmaPlugin) PluginCaller} interface.
*
* @param sessionID
* @param authorizedPrincipals
* @param attrib
* @throws AuthenticationException
* @see PAMStyleStrategy
* @see PluginCaller
*/
@Override
public void session(final LoginMonitor monitor, final Set<Principal> authorizedPrincipals, final Set<Object> attrib) throws AuthenticationException {
pamStyleSessionStrategy.callPlugins(service -> {
monitor.sessionPluginBegins(service.getName(), service.getControl(), authorizedPrincipals, attrib);
GPlazmaSessionPlugin plugin = service.getPlugin();
String error = null;
Result result = Result.FAIL;
try {
plugin.session(authorizedPrincipals, attrib);
result = Result.SUCCESS;
} catch (AuthenticationException e) {
error = e.getMessage();
throw e;
} finally {
monitor.sessionPluginEnds(service.getName(), service.getControl(), result, error, authorizedPrincipals, attrib);
}
});
}
Aggregations