Search in sources :

Example 1 with AuthenticationFactoryException

use of org.pentaho.di.core.auth.core.AuthenticationFactoryException in project pentaho-kettle by pentaho.

the class AuthenticationPersistenceManager method getAuthenticationManager.

public static AuthenticationManager getAuthenticationManager() {
    AuthenticationManager manager = new AuthenticationManager();
    manager.registerAuthenticationProvider(new NoAuthenticationAuthenticationProvider());
    for (PluginInterface plugin : PluginRegistry.getInstance().getPlugins(AuthenticationConsumerPluginType.class)) {
        try {
            Object pluginMain = PluginRegistry.getInstance().loadClass(plugin);
            if (pluginMain instanceof AuthenticationConsumerType) {
                Class<? extends AuthenticationConsumer<?, ?>> consumerClass = ((AuthenticationConsumerType) pluginMain).getConsumerClass();
                manager.registerConsumerClass(consumerClass);
            } else {
                throw new KettlePluginException(BaseMessages.getString(PKG, "AuthenticationPersistenceManager.NotConsumerType", pluginMain, AuthenticationConsumerType.class));
            }
        } catch (KettlePluginException e) {
            log.logError(e.getMessage(), e);
        } catch (AuthenticationFactoryException e) {
            log.logError(e.getMessage(), e);
        }
    }
    return manager;
}
Also used : AuthenticationManager(org.pentaho.di.core.auth.core.AuthenticationManager) AuthenticationFactoryException(org.pentaho.di.core.auth.core.AuthenticationFactoryException) KettlePluginException(org.pentaho.di.core.exception.KettlePluginException) PluginInterface(org.pentaho.di.core.plugins.PluginInterface)

Aggregations

AuthenticationFactoryException (org.pentaho.di.core.auth.core.AuthenticationFactoryException)1 AuthenticationManager (org.pentaho.di.core.auth.core.AuthenticationManager)1 KettlePluginException (org.pentaho.di.core.exception.KettlePluginException)1 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)1