• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java KettleClientEnvironment类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.pentaho.di.core.KettleClientEnvironment的典型用法代码示例。如果您正苦于以下问题:Java KettleClientEnvironment类的具体用法?Java KettleClientEnvironment怎么用?Java KettleClientEnvironment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KettleClientEnvironment类属于org.pentaho.di.core包,在下文中一共展示了KettleClientEnvironment类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initEnv

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
/**
* 初始化环境变量 <br/>
* @author jingma
* @throws KettleException 
*/
public static void initEnv() throws KettleException {
    if(System.getenv("KETTLE_HOME")!=null){
        System.setProperty("DI_HOME", System.getenv("KETTLE_HOME"));
        System.setProperty("KETTLE_HOME", System.getenv("KETTLE_HOME"));
        System.setProperty("org.osjava.sj.root", System.getenv("KETTLE_HOME")+"/simple-jndi");
        log.debug("KETTLE_HOME配置[能自动加载该目录下plugins中的插件]:"+System.getenv("KETTLE_HOME"));
    }
    if(System.getenv("KETTLE_JNDI_ROOT")!=null){
        System.setProperty("org.osjava.sj.root", System.getenv("KETTLE_JNDI_ROOT"));
        log.debug("Simple-jndi配置根路径:"+System.getenv("KETTLE_JNDI_ROOT"));
    }
    //初始化kettle环境
    if(!KettleEnvironment.isInitialized()){
        KettleEnvironment.init();
        KettleClientEnvironment.getInstance().setClient( KettleClientEnvironment.ClientType.SPOON );
    }
}
 
开发者ID:majinju,项目名称:KettleUtil,代码行数:23,代码来源:KettleUtils.java


示例2: main

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
public static void main( String[] args ) {

    Display display = new Display(  );
    try {
      KettleEnvironment.init();

      PropsUI.init( display, Props.TYPE_PROPERTIES_SPOON );

      KettleLogStore
          .init( PropsUI.getInstance().getMaxNrLinesInLog(), PropsUI.getInstance().getMaxLogLineTimeoutMinutes() );

    } catch ( KettleException e ) {
      e.printStackTrace();
    }

    KettleClientEnvironment.getInstance().setClient( KettleClientEnvironment.ClientType.SPOON );
    Shell shell = new Shell( display, SWT.DIALOG_TRIM );
    shell.open();
    CapabilityManagerDialog capabilityManagerDialog = new CapabilityManagerDialog( shell );
    capabilityManagerDialog.open();
    while ( !shell.isDisposed() ) {
      if ( !display.readAndDispatch() ) {
        display.sleep();
      }
    }
  }
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:CapabilityManagerDialog.java


示例3: initRepository

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
/**
 * 初始化资源库
 * 
 * @param repo
 *            资源库
 * @param isConnected
 *            (是否重新连接)
 */
private void initRepository(T entity, boolean isConnected)
		throws KettleException {
	if (null != entity) {
		RepositoriesMeta repositoriesMeta = new RepositoriesMeta();
		DatabaseMeta db = new DatabaseMeta();
		db.setDatabaseType(entity.getDialect());
		db.setAccessType(Integer.parseInt(entity.getAccess()));
		db.setDBName(entity.getDb());
		db.setHostname(entity.getServer());
		db.setDBPort(entity.getPort());
		db.setUsername(entity.getUsername());
		db.setPassword(entity.getPassword());
		KettleDatabaseRepositoryMeta rmeta = new KettleDatabaseRepositoryMeta();
		rmeta.setConnection(db);
		rmeta.setId(entity.getType());
		rmeta.setName(entity.getName());
		repositoriesMeta.addDatabase(db);
		repositoriesMeta.addRepository(rmeta);
		// 选择加载过的资源库
		RepositoryMeta meta = repositoriesMeta.findRepository(entity
				.getName());
		 KettleClientEnvironment.init();
		// 获得资源库实例
		repo = PluginRegistry.getInstance().loadClass(
				RepositoryPluginType.class, meta.getId(), Repository.class);
		repo.init(meta);
		// 连接资源库
		repo.connect(entity.getUser(), entity.getPass());
		if (!isConnected) {
			list.add(repo);
		}
	}
}
 
开发者ID:jiangzongyao,项目名称:kettle_support_kettle8.0,代码行数:42,代码来源:KettleReposServiceImpl.java


示例4: main

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
public static void main(String[] args) {
	try {
		KettleClientEnvironment.init();
	} catch (KettleException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	String obfuscated = Encr.encryptPasswordIfNotUsingVariables( "root" );
    System.out.println( obfuscated );
}
 
开发者ID:jiangzongyao,项目名称:kettle_support_kettle8.0,代码行数:11,代码来源:KettleReposServiceImpl.java


示例5: initEnv

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
/**
* 初始化环境变量 <br/>
* @author jingma
* @throws KettleException 
*/
public static void initEnv() throws KettleException {
    log.debug("KETTLE_HOME配置[能自动加载该目录下plugins中的插件]:"+System.getProperty("KETTLE_HOME"));
    log.debug("Simple-jndi配置根路径:"+System.getProperty("org.osjava.sj.root"));
    log.debug("日志最大行数:"+System.getProperty("KETTLE_MAX_LOG_SIZE_IN_LINES"));
    log.debug("最大日志管道数:"+System.getProperty("KETTLE_MAX_LOGGING_REGISTRY_SIZE"));
    //初始化kettle环境
    if(!KettleEnvironment.isInitialized()){
        KettleEnvironment.init();
        KettleClientEnvironment.getInstance().setClient( KettleClientEnvironment.ClientType.SPOON );
    }
}
 
开发者ID:majinju,项目名称:KettleEasyExpand,代码行数:17,代码来源:KettleUtils.java


示例6: setUp

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Before
public void setUp() throws KettleException {
  KettleClientEnvironment.init();
  metaStore = new MemoryMetaStore();

  repo = new GitRepository();
  repo.setName( NAME );
  repo.setDescription( DESCRIPTION );
  repo.setDirectory( DIRECTORY );
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:11,代码来源:GitRepositoryTest.java


示例7: setUp

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  KettleClientEnvironment.init();
  metaStore = new MemoryMetaStore();

  inputs = new ArrayList<TransUnitTestSetLocation>();
  inputs.add( new TransUnitTestSetLocation( "input-step1", "data-set-name1", 
      Arrays.asList( 
          new TransUnitTestFieldMapping( "fieldA", "setFieldA"),
          new TransUnitTestFieldMapping( "fieldB", "setFieldB"),
          new TransUnitTestFieldMapping( "fieldC", "setFieldC")            
        ), Arrays.asList("order1", "order2", "order3")));
  inputs.add( new TransUnitTestSetLocation( "input-step2", "data-set-name2", 
      Arrays.asList( 
          new TransUnitTestFieldMapping( "fieldX", "setFieldX"),
          new TransUnitTestFieldMapping( "fieldY", "setFieldY"),
          new TransUnitTestFieldMapping( "fieldW", "setFieldW"),
          new TransUnitTestFieldMapping( "fieldZ", "setFieldZ")           
         ), Arrays.asList("order1", "order2", "order3", "order4")));
  
  goldens = new ArrayList<TransUnitTestSetLocation>();
  
  List<TransUnitTestTweak> tweaks = new ArrayList<TransUnitTestTweak>();
  tweaks.add( new TransUnitTestTweak(TransTweak.NONE, "step1") );
  tweaks.add( new TransUnitTestTweak(TransTweak.BYPASS_STEP, "step2") );
  tweaks.add( new TransUnitTestTweak(TransTweak.REMOVE_STEP, "step3") );
  
  test = new TransUnitTest(NAME, DESCRIPTION, 
      null, null, "sometrans.ktr",
      inputs,
      goldens,
      tweaks,
      TestType.UNIT_TEST,
      null, new ArrayList<TransUnitTestDatabaseReplacement>()
      );
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:37,代码来源:TransUnitTestTest.java


示例8: setUp

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
  KettleClientEnvironment.init();
  metaStore = new MemoryMetaStore();
  databaseMeta = new DatabaseMeta( "dataset", "H2", "JDBC", null, "/tmp/datasets", null, null, null );
  dataSetGroup = new DataSetGroup( GROUP_NAME, GROUP_DESC, databaseMeta, GROUP_SCHEMA );

  List<DataSetField> fields = new ArrayList<>();
  for ( int i = 0; i < NR_FIELDS; i++ ) {
    fields.add( new DataSetField( "field" + i, "column" + i, ValueMetaInterface.TYPE_STRING, 50, 0, "comment" + i ) );
  }
  dataSet = new DataSet( NAME, DESC, dataSetGroup, TABLE, fields );
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:14,代码来源:DataSetTest.java


示例9: testResolvingPathVariables

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Test
public void testResolvingPathVariables() throws KettleException {
  String hostConcrete = "host_concrete";
  String portConcrete = "12345";
  String trustStorePath = "${KETTLE_SSL_PATH}";
  String trustStorePathResolved = "/home/test_path";
  String trustStorePassword = "TEST_PASSWORD";

  when( mockLdapMeta.getHost() ).thenReturn( hostConcrete );
  when( mockLdapMeta.getPort() ).thenReturn( portConcrete );
  when( mockLdapMeta.getDerefAliases() ).thenReturn( "always" );
  when( mockLdapMeta.getReferrals() ).thenReturn( "follow" );
  when( mockLdapMeta.isUseCertificate() ).thenReturn( true );
  when( mockLdapMeta.isTrustAllCertificates() ).thenReturn( true );
  when( mockLdapMeta.getTrustStorePath() ).thenReturn( trustStorePath );
  when( mockLdapMeta.getTrustStorePassword() ).thenReturn( trustStorePassword );

  when( mockVariableSpace.environmentSubstitute( eq( hostConcrete ) ) ).thenReturn( hostConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( portConcrete ) ) ).thenReturn( portConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePath ) ) ).thenReturn( trustStorePathResolved );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePassword ) ) ).thenReturn( trustStorePassword );

  KettleClientEnvironment.init();
  TestableLdapProtocol testableLdapProtocol =
          new TestableLdapProtocol( mockLogChannelInterface, mockVariableSpace, mockLdapMeta, null );
  testableLdapProtocol.connect( null, null );
  assertEquals( trustStorePathResolved, testableLdapProtocol.trustStorePath );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:29,代码来源:LdapSslProtocolIT.java


示例10: testResolvingPasswordVariables

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Test
public void testResolvingPasswordVariables() throws KettleException {
  String hostConcrete = "host_concrete";
  String portConcrete = "12345";
  String trustStorePath = "/home/test_path";
  String trustStorePassword = "${PASSWORD_VARIABLE}";
  String trustStorePasswordResolved = "TEST_PASSWORD_VALUE";

  when( mockLdapMeta.getHost() ).thenReturn( hostConcrete );
  when( mockLdapMeta.getPort() ).thenReturn( portConcrete );
  when( mockLdapMeta.getDerefAliases() ).thenReturn( "always" );
  when( mockLdapMeta.getReferrals() ).thenReturn( "follow" );
  when( mockLdapMeta.isUseCertificate() ).thenReturn( true );
  when( mockLdapMeta.isTrustAllCertificates() ).thenReturn( true );
  when( mockLdapMeta.getTrustStorePath() ).thenReturn( trustStorePath );
  when( mockLdapMeta.getTrustStorePassword() ).thenReturn( trustStorePassword );

  when( mockVariableSpace.environmentSubstitute( eq( hostConcrete ) ) ).thenReturn( hostConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( portConcrete ) ) ).thenReturn( portConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePath ) ) ).thenReturn( trustStorePath );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePassword ) ) ).thenReturn( trustStorePasswordResolved );

  KettleClientEnvironment.init();
  TestableLdapProtocol testableLdapProtocol =
          new TestableLdapProtocol( mockLogChannelInterface, mockVariableSpace, mockLdapMeta, null );
  testableLdapProtocol.connect( null, null );
  assertEquals( trustStorePasswordResolved, testableLdapProtocol.trustStorePassword );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:29,代码来源:LdapSslProtocolIT.java


示例11: testResolvingPasswordAndDecryptVariables

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Test
public void testResolvingPasswordAndDecryptVariables() throws KettleException {
  String hostConcrete = "host_concrete";
  String portConcrete = "12345";
  String trustStorePath = "/home/test_path";
  String trustStorePassword = "${PASSWORD_VARIABLE}";
  String trustStorePasswordResolved = "Encrypted 2be98afc86aa7f2e4cb79ff228dc6fa8c"; //original value 123456


  when( mockLdapMeta.getHost() ).thenReturn( hostConcrete );
  when( mockLdapMeta.getPort() ).thenReturn( portConcrete );
  when( mockLdapMeta.getDerefAliases() ).thenReturn( "always" );
  when( mockLdapMeta.getReferrals() ).thenReturn( "follow" );
  when( mockLdapMeta.isUseCertificate() ).thenReturn( true );
  when( mockLdapMeta.isTrustAllCertificates() ).thenReturn( true );
  when( mockLdapMeta.getTrustStorePath() ).thenReturn( trustStorePath );
  when( mockLdapMeta.getTrustStorePassword() ).thenReturn( trustStorePassword );

  when( mockVariableSpace.environmentSubstitute( eq( hostConcrete ) ) ).thenReturn( hostConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( portConcrete ) ) ).thenReturn( portConcrete );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePath ) ) ).thenReturn( trustStorePath );
  when( mockVariableSpace.environmentSubstitute( eq( trustStorePassword ) ) ).thenReturn( trustStorePasswordResolved );

  KettleClientEnvironment.init();
  TestableLdapProtocol testableLdapProtocol =
          new TestableLdapProtocol( mockLogChannelInterface, mockVariableSpace, mockLdapMeta, null );
  testableLdapProtocol.connect( null, null );
  assertEquals( "123456", testableLdapProtocol.trustStorePassword );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:30,代码来源:LdapSslProtocolIT.java


示例12: init

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@BeforeClass
public static void init() throws Exception {
  KettleClientEnvironment.init();
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:10,代码来源:SafeStopTest.java


示例13: init

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@BeforeClass
public static void init() throws Exception {
  if ( !KettleClientEnvironment.isInitialized() ) {
    KettleClientEnvironment.init();
  }
  PluginRegistry.addPluginType( StepPluginType.getInstance() );
  PluginRegistry.init();
  if ( !Props.isInitialized() ) {
    Props.init( 0 );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:12,代码来源:TransMetaConverterTest.java


示例14: setupBeforeClass

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws KettleException {
  if ( Const.isWindows() ) {
    wasEncoding = System.getProperty( "file.encoding" );
    fiddleWithDefaultCharset( "utf8" );
  }
  KettleClientEnvironment.init();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:9,代码来源:LoadFileInputTest.java


示例15: main

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
public static void main( String[] args ) throws Exception {

    if ( args.length != 2 ) {
      System.err.println( "Usage: Translator <translator.xml> <path-to-source>" );
      System.err.println( "Example:" );
      System.err.println( "sh translator.sh translator.xml ." );
      System.exit( 1 );
    }

    KettleClientEnvironment.init();

    String configFile = args[0];
    String sourceFolder = args[1];

    Display display = new Display();
    LogChannelInterface log = new LogChannel( APP_NAME );
    PropsUI.init( display, Props.TYPE_PROPERTIES_SPOON );

    Translator2 translator = new Translator2( display );
    translator.loadConfiguration( configFile, sourceFolder );
    translator.open();

    try {
      while ( !display.isDisposed() ) {
        if ( !display.readAndDispatch() ) {
          display.sleep();
        }
      }
    } catch ( Throwable e ) {
      log.logError( BaseMessages.getString( PKG, "i18n.UnexpectedError", e.getMessage() ) );
      log.logError( Const.getStackTracker( e ) );
    }
  }
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:34,代码来源:Translator2.java


示例16: setupBeforeClass

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws Exception {
  pool = ClassPool.getDefault();
  pool.insertClassPath( new ClassClassPath( ExtensionPointIntegrationTest.class ) );
  for ( KettleExtensionPoint ep : KettleExtensionPoint.values() ) {
    ExtensionPointPluginType.getInstance().registerCustom( createClassRuntime( ep ),
        "custom", "id" + ep.id, ep.id, "no description", null );
  }

  KettleClientEnvironment.init();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:12,代码来源:ExtensionPointIntegrationTest.java


示例17: setupOnce

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Before
public void setupOnce() throws Exception {
  nativeMeta = new ConcreteBaseDatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
  odbcMeta = new ConcreteBaseDatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
  jndiMeta = new ConcreteBaseDatabaseMeta();
  KettleClientEnvironment.init();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:10,代码来源:BaseDatabaseMetaTest.java


示例18: setUpOnce

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@BeforeClass
public static void setUpOnce() throws KettlePluginException, KettleException {
  // Register Natives to create a default DatabaseMeta
  DatabasePluginType.getInstance().searchPlugins();
  ValueMetaPluginType.getInstance().searchPlugins();
  KettleClientEnvironment.init();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:8,代码来源:DatabaseMetaTest.java


示例19: setupOnce

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Before
public void setupOnce() throws Exception {
  nativeMeta = new AS400DatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
  odbcMeta = new AS400DatabaseMeta();
  odbcMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
  KettleClientEnvironment.init();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:9,代码来源:AS400DatabaseMetaTest.java


示例20: setupOnce

import org.pentaho.di.core.KettleClientEnvironment; //导入依赖的package包/类
@Before
public void setupOnce() throws Exception {
  nativeMeta = new OracleDatabaseMeta();
  odbcMeta = new OracleDatabaseMeta();
  ociMeta = new OracleDatabaseMeta();
  nativeMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_NATIVE );
  odbcMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_ODBC );
  ociMeta.setAccessType( DatabaseMeta.TYPE_ACCESS_OCI );
  //nativeMeta.setSupportsTimestampDataType( true );
  KettleClientEnvironment.init();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:12,代码来源:OracleDatabaseMetaTest.java



注:本文中的org.pentaho.di.core.KettleClientEnvironment类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TypeDeclarationStmt类代码示例发布时间:2022-05-22
下一篇:
Java TransformFilter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap