use of com.walmartlabs.concord.server.process.queue.ProcessInitiatorEntry in project concord by walmartlabs.
the class SessionKeyRealm method doGetAuthenticationInfo.
@Override
@WithTimer
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
SessionKey t = (SessionKey) token;
PartialProcessKey processKey = PartialProcessKey.from(t.getInstanceId());
try {
ProcessInitiatorEntry p = processQueueManager.getInitiator(processKey);
if (p == null) {
log.warn("doGetAuthenticationInfo -> process not found: {}", t.getInstanceId());
return null;
}
if (p.initiatorId() == null) {
log.warn("doGetAuthenticationInfo -> initiator not found: {}", t.getInstanceId());
return null;
}
if (isFinished(p)) {
log.warn("doGetAuthenticationInfo -> process is finished: {}", t.getInstanceId());
return null;
}
PrincipalCollection principals = getPrincipals(processKey);
return new SimpleAccount(principals, t.getInstanceId(), getName());
} catch (Exception e) {
log.error("doGetAuthenticationInfo ['{}'] -> error", t.getInstanceId(), e);
throw e;
}
}
Aggregations