當前位置: 首頁>>代碼示例>>Java>>正文


Java AuthenticationPerformer類代碼示例

本文整理匯總了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;
}
 
開發者ID:pentaho,項目名稱:pentaho-kettle,代碼行數:15,代碼來源:DefaultAuthenticationPerformerFactory.java

示例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 );
}
 
開發者ID:pentaho,項目名稱:pentaho-hadoop-shims,代碼行數:47,代碼來源:AuthenticatingHadoopShim.java


注:本文中的org.pentaho.di.core.auth.core.AuthenticationPerformer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。