Search in sources :

Example 1 with PasswordEncoderException

use of org.pentaho.support.encryption.PasswordEncoderException in project pentaho-kettle by pentaho.

the class Encr method init.

public static void init(String encoderPluginId) throws KettleException {
    if (Utils.isEmpty(encoderPluginId)) {
        throw new KettleException("Unable to initialize the two way password encoder: No encoder plugin type specified.");
    }
    PluginRegistry registry = PluginRegistry.getInstance();
    PluginInterface plugin = registry.findPluginWithId(TwoWayPasswordEncoderPluginType.class, encoderPluginId);
    if (plugin == null) {
        throw new KettleException("Unable to find plugin with ID '" + encoderPluginId + "'.  If this is a test, make sure" + " kettle-core tests jar is a dependency.  If this is live make sure a kettle-password-encoder-plugins.xml" + " exits in the classpath");
    }
    encoder = (TwoWayPasswordEncoderInterface) registry.loadClass(plugin);
    // 
    try {
        encoder.init();
    } catch (PasswordEncoderException e) {
        throw new KettleException(e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) PasswordEncoderException(org.pentaho.support.encryption.PasswordEncoderException) PluginRegistry(org.pentaho.di.core.plugins.PluginRegistry) PluginInterface(org.pentaho.di.core.plugins.PluginInterface)

Aggregations

KettleException (org.pentaho.di.core.exception.KettleException)1 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)1 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)1 PasswordEncoderException (org.pentaho.support.encryption.PasswordEncoderException)1