本文整理汇总了Java中org.pentaho.di.core.auth.core.AuthenticationPerformer类的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationPerformer类的具体用法?Java AuthenticationPerformer怎么用?Java AuthenticationPerformer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AuthenticationPerformer类属于org.pentaho.di.core.auth.core包,在下文中一共展示了AuthenticationPerformer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.pentaho.di.core.auth.core.AuthenticationPerformer; //导入依赖的package包/类
@SuppressWarnings( { "rawtypes", "unchecked" } )
@Override
public <ReturnType, CreateArgType, ConsumedType> AuthenticationPerformer<ReturnType, CreateArgType> create(
AuthenticationProvider authenticationProvider,
AuthenticationConsumerFactory<ReturnType, CreateArgType, ConsumedType> authenticationConsumerFactory ) {
if ( authenticationConsumerFactory.getConsumedType().isInstance( authenticationProvider ) ) {
return new DefaultAuthenticationPerformer( authenticationProvider, authenticationConsumerFactory );
} else if ( AuthenticationConsumerInvocationHandler.isCompatible( authenticationConsumerFactory.getConsumedType(),
authenticationProvider ) ) {
return new ClassloaderBridgingAuthenticationPerformer<ReturnType, CreateArgType, ConsumedType>(
authenticationProvider, authenticationConsumerFactory );
}
return null;
}
示例2: onLoad
import org.pentaho.di.core.auth.core.AuthenticationPerformer; //导入依赖的package包/类
@Override
public void onLoad( HadoopConfiguration config, HadoopConfigurationFileSystemManager fsm ) throws Exception {
AuthenticationConsumerPluginType.getInstance().registerPlugin( (URLClassLoader) getClass().getClassLoader(),
HadoopNoAuthConsumer.HadoopNoAuthConsumerType.class );
String activators = config.getConfigProperties().getProperty( "activator.classes" );
if ( activators != null ) {
activators = activators.trim();
for ( String className : activators.split( "," ) ) {
className = className.trim();
if ( className.length() > 0 ) {
createActivatorInstance( className );
}
}
}
String provider = NoAuthenticationAuthenticationProvider.NO_AUTH_ID;
if ( config.getConfigProperties().containsKey( SUPER_USER ) && !config.getConfigProperties()
.getProperty( MAPPING_IMPERSONATION_TYPE, "" ).trim().equalsIgnoreCase( "disabled" ) ) {
provider = config.getConfigProperties().getProperty( SUPER_USER );
if ( provider.trim().length() == 0 ) {
provider = NoAuthenticationAuthenticationProvider.NO_AUTH_ID;
}
}
AuthenticationManager manager = AuthenticationPersistenceManager.getAuthenticationManager();
new PropertyAuthenticationProviderParser( config.getConfigProperties(), manager ).process( PROVIDER_LIST );
AuthenticationPerformer<HadoopAuthorizationService, Properties> performer =
manager.getAuthenticationPerformer( HadoopAuthorizationService.class, Properties.class, provider );
if ( performer == null ) {
throw new RuntimeException( "Unable to find relevant provider for chosen authentication method (id of "
+ config.getConfigProperties().getProperty( SUPER_USER ) );
} else {
HadoopAuthorizationService hadoopAuthorizationService = performer.perform( config.getConfigProperties() );
if ( hadoopAuthorizationService == null ) {
throw new RuntimeException( "Unable to get HadoopAuthorizationService for provider "
+ config.getConfigProperties().getProperty( SUPER_USER ) );
}
for ( PentahoHadoopShim shim : config.getAvailableShims() ) {
if ( HasHadoopAuthorizationService.class.isInstance( shim ) ) {
( (HasHadoopAuthorizationService) shim ).setHadoopAuthorizationService( hadoopAuthorizationService );
} else {
throw new Exception( "Found shim: " + shim + " that didn't implement "
+ HasHadoopAuthorizationService.class.getCanonicalName() );
}
}
}
super.onLoad( config, fsm );
}