当前位置: 首页>>代码示例>>Java>>正文


Java KettleClientEnvironment.init方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: ConnectionControllerITest

import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
public ConnectionControllerITest() throws InitializationError {
  super(ConnectionControllerITest.class);
  try {
  	KettleClientEnvironment.init();
  } catch (Exception e) {
  	e.printStackTrace();
  }
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:9,代码来源:ConnectionControllerITest.java

示例7: 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

示例8: 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

示例9: 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

示例10: setupOnce

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

示例11: 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

示例12: main

import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
/**
 * The main startup of the Aggregation Designer
 * @param args
 */
public static void main(String[] args) {
  try {
  	KettleClientEnvironment.init();
  	ApplicationContext context = new ClassPathXmlApplicationContext(
      new String[] {"applicationContext.xml", "plugins.xml"}); //$NON-NLS-1$ //$NON-NLS-2$

    UIMain uiMain = (UIMain) context.getBean("uiMain"); //$NON-NLS-1$
    uiMain.start(context);
  } catch (Throwable t) {
    logger.error("uncaught exception in main", t);
    System.exit(1);
  }
}
 
开发者ID:pentaho,项目名称:pentaho-aggdesigner,代码行数:18,代码来源:UIMain.java

示例13: setUp

import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
  KettleClientEnvironment.init();
  metaStore = new MemoryMetaStore();
  // metaStore = MetaStoreConst.openLocalPentahoMetaStore();
  
  // Temporary databases and so on.
  //
  File tmpSharedObjectsFile = File.createTempFile("shared-objects-unit-test", ".xml");
  sharedObjects = new SharedObjects();
  
  // This Database needs to be found in a shared objects store...
  //
  databaseMeta = new DatabaseMeta( "dataset", "H2", "JDBC", null, "/tmp/datasets", null, null, null );
  sharedObjects.storeObject(databaseMeta);
  sharedObjects.setFilename(tmpSharedObjectsFile.getAbsolutePath());
  sharedObjects.saveToFile();
  
  dataSetGroup = new DataSetGroup( GROUP_NAME, GROUP_DESC, databaseMeta, GROUP_SCHEMA );

  // Write an input data set...
  //
  createInputDataSet();
  
  // Write the golden data set...
  //
  createGoldenDataSet();
  
  // Create a unit test...
  //
  createUnitTest();
  
  // Create the data set group in the metastore...
  //
  MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE);
  groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, Arrays.asList( databaseMeta ) );
  groupFactory.saveElement( dataSetGroup );
  
  // Create the input data set in the metastore...
  //
  MetaStoreFactory<DataSet> setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE);
  setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groupFactory.getElements() );
  setFactory.saveElement( inputDataSet );
  
  // Create the golden data set in the metastore...
  //
  setFactory.saveElement( goldenDataSet );
  
  // Create a unit test...
  MetaStoreFactory<TransUnitTest> testFactory = new MetaStoreFactory<TransUnitTest>( TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE);
  testFactory.saveElement( unitTest );
  
  // Reload the whole thing...
  factories = new FactoriesHierarchy( metaStore, Arrays.asList( databaseMeta ) );
  
  DataSetGroup verifyGroup = factories.getGroupFactory().loadElement(dataSetGroup.getName());
  assertNotNull(verifyGroup.getDatabaseMeta());
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:59,代码来源:TransUnitTestExecutionTest.java

示例14: setUp

import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
  KettleClientEnvironment.init();
  databaseMeta = new DatabaseMeta( "foo", "H2", "JDBC", null, null, null, null, null );
  metaStore = new MemoryMetaStore();
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:7,代码来源:DataSetGroupTest.java

示例15: setupBeforeClass

import org.pentaho.di.core.KettleClientEnvironment; //导入方法依赖的package包/类
@BeforeClass
public static void setupBeforeClass() throws KettleException {
  if ( !KettleClientEnvironment.isInitialized() ) {
    KettleClientEnvironment.init();
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:7,代码来源:NameResourceIT.java


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