class TokenOperationFactoryImpl implements TokenOperationFactory {

    @Override
    public TokenValidator getSimpleTokenValidator(TokenType validatedTokenType) throws STSInitializationException {
        if (TokenType.SAML2.equals(validatedTokenType)) {
            return new SimpleSAML2TokenValidator(tokenServiceConsumer, soapSTSAccessTokenProvider, ctsTokenIdGenerator, xmlUtilities);
        }  else if (TokenType.OPENIDCONNECT.equals(validatedTokenType)) {
            return new SimpleOpenIdConnectTokenValidator(tokenServiceConsumer, soapSTSAccessTokenProvider, ctsTokenIdGenerator);
        }
        throw new STSInitializationException(ResourceException.INTERNAL_ERROR,
                "Unexpected TokenType passed to TokenOperationFactoryImpl#getSimpleTokenValidator: " + validatedTokenType);
    }

    @Inject public  TokenOperationFactoryImpl(
            ThreadLocalAMTokenCache threadLocalAMTokenCache,
            PrincipalFromSession principalFromSession,
            TokenServiceConsumer tokenServiceConsumer,
            @Named(AMSTSConstants.STS_INSTANCE_ID) String stsInstanceId,
            @Named (AMSTSConstants.REALM) String realm,
            XMLUtilities xmlUtilities,
            Saml2XmlTokenAuthnContextMapper saml2XmlTokenAuthnContextMapper,
            Provider<AMSessionInvalidator> amSessionInvalidatorProvider,
            SoapSTSAccessTokenProvider soapSTSAccessTokenProvider,
            AuthenticationHandler<UsernameToken> usernameTokenAuthenticationHandler,
            SoapOpenIdConnectTokenAuthnContextMapper soapOpenIdConnectTokenAuthnContextMapper,
            SoapOpenIdConnectTokenAuthnMethodsReferencesMapper soapOpenIdConnectTokenAuthnMethodsReferencesMapper,
            CTSTokenIdGenerator ctsTokenIdGenerator,
            Logger logger);

}