class TokenService {

    public void deactivateToken(String id) throws TokenNotFoundException, ActionNotPossibleException {

        // check that action is possible
        TokenInfo tokenInfo = getToken(id);

        auditDataHelper.put(tokenInfo);

        possibleActionsRuleEngine.requirePossibleTokenAction(PossibleActionEnum.TOKEN_DEACTIVATE,
                tokenInfo);

        try {
            signerProxyFacade.deactivateToken(id);
        } catch (CodedException e) {
            if (isCausedByTokenNotFound(e)) {
                throw new TokenNotFoundException(e);
            } else {
                throw e;
            }
        } catch (Exception other) {
            throw new SignerNotReachableException("token deactivation failed", other);
        }
    }

    @Autowired public  TokenService(SignerProxyFacade signerProxyFacade,
            PossibleActionsRuleEngine possibleActionsRuleEngine,
            AuditDataHelper auditDataHelper);

}