Search in sources :

Example 1 with Command

use of org.simbasecurity.core.chain.Command in project simba-os by cegeka.

the class AuthenticationFilterServiceImpl method processRequest.

@Transactional
public ActionDescriptor processRequest(RequestData requestData, String chainCommand) throws TException {
    if (requestData == null) {
        throw new IllegalArgumentException("Parameter 'requestData' can not be null");
    }
    if (chainCommand == null) {
        throw new IllegalArgumentException("Parameter 'chainCommand' can not be null");
    }
    Command chain = locateCommandChain(chainCommand);
    Session currentSession = getCurrentSession(requestData);
    ChainContext chainContext = createChainContext(requestData, currentSession);
    try {
        chain.execute(chainContext);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    return chainContext.getActionDescriptor();
}
Also used : ChainContext(org.simbasecurity.core.chain.ChainContext) Command(org.simbasecurity.core.chain.Command) TException(org.apache.thrift.TException) Session(org.simbasecurity.core.domain.Session) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

TException (org.apache.thrift.TException)1 ChainContext (org.simbasecurity.core.chain.ChainContext)1 Command (org.simbasecurity.core.chain.Command)1 Session (org.simbasecurity.core.domain.Session)1 Transactional (org.springframework.transaction.annotation.Transactional)1