class TokenService {

    public void activateToken(String id, char[] password) throws
            TokenNotFoundException, PinIncorrectException, ActionNotPossibleException {

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

        auditDataHelper.put(tokenInfo);

        possibleActionsRuleEngine.requirePossibleTokenAction(PossibleActionEnum.TOKEN_ACTIVATE,
                tokenInfo);
        try {
            signerProxyFacade.activateToken(id, password);
        } catch (CodedException e) {
            if (isCausedByTokenNotFound(e)) {
                throw new TokenNotFoundException(e);
            } else if (isCausedByIncorrectPin(e)) {
                throw new PinIncorrectException(e);
            } else {
                throw e;
            }
        } catch (Exception other) {
            throw new SignerNotReachableException("token activation failed", other);
        }
    }

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

}