本文整理汇总了Java中org.pentaho.di.core.plugins.RepositoryPluginType类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryPluginType类的具体用法?Java RepositoryPluginType怎么用?Java RepositoryPluginType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryPluginType类属于org.pentaho.di.core.plugins包,在下文中一共展示了RepositoryPluginType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: openRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
private Repository openRepository(String repositoryName, String user, String pass) throws KettleException {
if (Const.isEmpty(repositoryName)) return null;
RepositoriesMeta repositoriesMeta = new RepositoriesMeta();
repositoriesMeta.readData();
RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName );
PluginRegistry registry = PluginRegistry.getInstance();
Repository repository = registry.loadClass(
RepositoryPluginType.class,
repositoryMeta,
Repository.class
);
repository.init(repositoryMeta);
repository.connect(user, pass);
return repository;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:ExecuteTransServlet.java
示例2: editRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
public void editRepository() {
try {
PluginInterface plugin = null;
RepositoryMeta ri = input.searchRepository(model.getSelectedRepository().getName());
if (ri != null) {
plugin = PluginRegistry.getInstance().getPlugin(RepositoryPluginType.class, ri.getId());
if (plugin == null) {
throw new KettleException(BaseMessages.getString(PKG, "RepositoryLogin.ErrorFindingPlugin", ri.getId())); //$NON-NLS-1$
}
}
RepositoryDialogInterface dd = getRepositoryDialog(plugin, ri, input, this.shell);
if (dd.open(MODE.EDIT) != null) {
fillRepositories();
int idx = input.indexOfRepository(ri);
model.setSelectedRepository(input.getRepository(idx));
writeData();
}
} catch (Exception e) {
log.logDetailed(BaseMessages.getString(PKG, "RepositoryLogin.ErrorEditingRepository", e.getLocalizedMessage()));//$NON-NLS-1$
new ErrorDialog(shell, BaseMessages.getString(PKG, "Dialog.Error"), BaseMessages.getString(PKG, "RepositoryLogin.ErrorEditingRepository", e.getLocalizedMessage()), e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:RepositoriesHelper.java
示例3: openRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
private void openRepository(String repositoryId) throws KettleXMLException {
try {
RepositoriesMeta repositoriesMeta = new RepositoriesMeta();
repositoriesMeta.readData();
repositoryMeta = repositoriesMeta.findRepository( repositoryId );
PluginRegistry registry = PluginRegistry.getInstance();
repository = registry.loadClass(
RepositoryPluginType.class,
repositoryMeta,
Repository.class
);
repository.init(repositoryMeta);
repository.connect(repositoryUsername, repositoryPassword);
} catch(Exception e) {
throw new KettleXMLException(e);
}
}
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:20,代码来源:SlaveServerConfig.java
示例4: openRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
private Repository openRepository( String repositoryName, String user, String pass ) throws KettleException {
if ( Utils.isEmpty( repositoryName ) ) {
return null;
}
RepositoriesMeta repositoriesMeta = new RepositoriesMeta();
repositoriesMeta.readData();
RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName );
if ( repositoryMeta == null ) {
throw new KettleException( "Unable to find repository: " + repositoryName );
}
PluginRegistry registry = PluginRegistry.getInstance();
Repository repository = registry.loadClass( RepositoryPluginType.class, repositoryMeta, Repository.class );
repository.init( repositoryMeta );
repository.connect( user, pass );
return repository;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:ExecuteJobServlet.java
示例5: connectRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
public Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ) throws KettleException {
RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName );
if ( repositoryMeta == null ) {
log.logBasic( "I couldn't find the repository with name '" + repositoryName + "'" );
return null;
}
Repository rep = PluginRegistry.getInstance().loadClass( RepositoryPluginType.class, repositoryMeta,
Repository.class );
rep.init( repositoryMeta );
try {
rep.connect( username, password );
log.logBasic( "Connected to " + repositoryName + " as " + username );
setRepository( rep );
return rep;
} catch ( Exception e ) {
log.logBasic( "Unable to connect to the repository with name '" + repositoryName + "'" );
return null;
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:22,代码来源:JobExecutionConfiguration.java
示例6: connectRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
public Repository connectRepository( RepositoriesMeta repositoriesMeta, String repositoryName, String username, String password ) throws KettleException {
RepositoryMeta repositoryMeta = repositoriesMeta.findRepository( repositoryName );
if ( repositoryMeta == null ) {
log.logBasic( "I couldn't find the repository with name '" + repositoryName + "'" );
return null;
}
Repository rep = PluginRegistry.getInstance().loadClass( RepositoryPluginType.class, repositoryMeta, Repository.class );
if ( rep == null ) {
log.logBasic( "Unable to load repository plugin for '" + repositoryName + "'" );
return null;
}
rep.init( repositoryMeta );
try {
rep.connect( username, password );
setRepository( rep );
return rep;
} catch ( Exception e ) {
log.logBasic( "Unable to connect to the repository with name '" + repositoryName + "'" );
return null;
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:TransExecutionConfiguration.java
示例7: init
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
/**
* Initializes the Kettle environment. This method performs the following operations:
* <p/>
* - Creates a Kettle "home" directory if it does not already exist - Reads in the kettle.properties file -
* Initializes the logging back-end - Sets the console log level to debug - If specified by parameter, configures
* Simple JNDI - Registers the native types and the plugins for the various plugin types - Reads the list of variables
* - Initializes the Lifecycle listeners
*
* @param simpleJndi true to configure Simple JNDI, false otherwise
* @throws KettleException Any errors that occur during initialization will throw a KettleException.
*/
public static void init( boolean simpleJndi ) throws KettleException {
init( Arrays.asList(
RowDistributionPluginType.getInstance(),
StepPluginType.getInstance(),
StepDialogFragmentType.getInstance(),
PartitionerPluginType.getInstance(),
JobEntryPluginType.getInstance(),
LogTablePluginType.getInstance(),
RepositoryPluginType.getInstance(),
LifecyclePluginType.getInstance(),
KettleLifecyclePluginType.getInstance(),
ImportRulePluginType.getInstance(),
CartePluginType.getInstance(),
CompressionPluginType.getInstance(),
AuthenticationProviderPluginType.getInstance(),
AuthenticationConsumerPluginType.getInstance(),
EnginePluginType.getInstance()
), simpleJndi );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:31,代码来源:KettleEnvironment.java
示例8: editRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
public void editRepository() {
try {
PluginInterface plugin = null;
RepositoryMeta ri = input.searchRepository( model.getSelectedRepository().getName() );
if ( ri != null ) {
plugin = PluginRegistry.getInstance().getPlugin( RepositoryPluginType.class, ri.getId() );
if ( plugin == null ) {
throw new KettleException( BaseMessages
.getString( PKG, "RepositoryLogin.ErrorFindingPlugin", ri.getId() ) );
}
}
RepositoryDialogInterface dd = getRepositoryDialog( plugin, ri, input, this.shell );
if ( dd.open( MODE.EDIT ) != null ) {
fillRepositories();
int idx = input.indexOfRepository( ri );
model.setSelectedRepository( input.getRepository( idx ) );
writeData();
}
} catch ( Exception e ) {
log.logDetailed( BaseMessages.getString( PKG, "RepositoryLogin.ErrorEditingRepository", e
.getLocalizedMessage() ) );
new ErrorDialog( shell, BaseMessages.getString( PKG, "Dialog.Error" ), BaseMessages.getString(
PKG, "RepositoryLogin.ErrorEditingRepository", e.getLocalizedMessage() ), e );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:RepositoriesHelper.java
示例9: loginToRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
public void loginToRepository() throws KettleException, KettleSecurityException {
if ( model != null && model.getSelectedRepository() != null ) {
RepositoryMeta repositoryMeta =
input.getRepository( model.getRepositoryIndex( model.getSelectedRepository() ) );
repository =
PluginRegistry.getInstance().loadClass(
RepositoryPluginType.class, repositoryMeta.getId(), Repository.class );
repository.init( repositoryMeta );
repository.connect( model.getUsername(), model.getPassword() );
props.setLastRepository( repositoryMeta.getName() );
props.setLastRepositoryLogin( model.getUsername() );
} else {
log.logDetailed( BaseMessages.getString( PKG, "RepositoryLogin.ErrorLoginToRepository" ) );
throw new KettleException( BaseMessages.getString( PKG, "RepositoryLogin.ErrorLoginToRepository" ) );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:RepositoriesHelper.java
示例10: registerUIPluginObjectTypes
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
/**
* The core plugin types don't know about UI classes. This method adds those in before initialization.
*
* TODO: create a SpoonLifecycle listener that can notify interested parties of a pre-initialization state so this can
* happen in those listeners.
*/
private static void registerUIPluginObjectTypes() {
RepositoryPluginType repositoryPluginType = RepositoryPluginType.getInstance();
repositoryPluginType.addObjectType( RepositoryRevisionBrowserDialogInterface.class, "version-browser-classname" );
repositoryPluginType.addObjectType( RepositoryDialogInterface.class, "dialog-classname" );
PluginRegistry.addPluginType( SpoonPluginType.getInstance() );
SpoonPluginType.getInstance().getPluginFolders().add( new PluginFolder( "plugins/repositories", false, true ) );
LifecyclePluginType.getInstance().getPluginFolders().add( new PluginFolder( "plugins/spoon", false, true ) );
LifecyclePluginType.getInstance().getPluginFolders().add( new PluginFolder( "plugins/repositories", false, true ) );
PluginRegistry.addPluginType( JobDialogPluginType.getInstance() );
PluginRegistry.addPluginType( TransDialogPluginType.getInstance() );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:22,代码来源:Spoon.java
示例11: createRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
public boolean createRepository( String id, Map<String, Object> items ) {
try {
RepositoryMeta repositoryMeta = pluginRegistry.loadClass( RepositoryPluginType.class, id, RepositoryMeta.class );
repositoryMeta.populate( items, repositoriesMeta );
if ( repositoryMeta.getName() != null ) {
Repository repository =
pluginRegistry.loadClass( RepositoryPluginType.class, repositoryMeta.getId(), Repository.class );
repository.init( repositoryMeta );
if ( currentRepository != null && isCompatibleRepositoryEdit( repositoryMeta ) ) {
setConnectedRepository( repositoryMeta );
}
repositoriesMeta.addRepository( repositoryMeta );
repositoriesMeta.writeData();
currentRepository = repositoryMeta;
if ( !testRepository( repository ) ) {
return false;
}
( (AbstractRepository) repository ).create();
}
} catch ( KettleException ke ) {
log.logError( "Unable to load repository type", ke );
return false;
}
return true;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:RepositoryConnectController.java
示例12: setUp
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
@Before
public void setUp() {
controller = new RepositoryConnectController( pluginRegistry, () -> spoon, repositoriesMeta );
when( pluginInterface.getName() ).thenReturn( PLUGIN_NAME );
when( pluginInterface.getIds() ).thenReturn( new String[] { ID } );
when( pluginInterface.getDescription() ).thenReturn( PLUGIN_DESCRIPTION );
List<PluginInterface> plugins = new ArrayList<>();
plugins.add( pluginInterface );
when( pluginRegistry.getPlugins( RepositoryPluginType.class ) ).thenReturn( plugins );
when( repositoryMeta.getId() ).thenReturn( ID );
when( repositoryMeta.getName() ).thenReturn( PLUGIN_NAME );
when( repositoryMeta.getDescription() ).thenReturn( PLUGIN_DESCRIPTION );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:RepositoryConnectControllerTest.java
示例13: testRepoSwitch
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
@Test
public void testRepoSwitch() throws Exception {
when( pluginRegistry.loadClass( RepositoryPluginType.class, REPOSITORY_ID, Repository.class ) ).thenReturn(
repository );
KettleFileRepositoryMeta kettleFileRepositoryMeta = new KettleFileRepositoryMeta();
kettleFileRepositoryMeta.setId( REPOSITORY_ID );
kettleFileRepositoryMeta.setDescription( REPOSITORY_DESCRIPTION );
kettleFileRepositoryMeta.setName( REPOSITORY_NAME );
controller.connectToRepository( kettleFileRepositoryMeta );
verify( spoon ).closeAllJobsAndTransformations( true );
when( spoon.getRepository() ).thenReturn( repository );
controller.connectToRepository( kettleFileRepositoryMeta );
verify( spoon ).closeRepository();
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:RepositoryConnectControllerTest.java
示例14: testOnlySetConnectedOnConnect
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
@Test
public void testOnlySetConnectedOnConnect() throws Exception {
when( pluginRegistry.loadClass( RepositoryPluginType.class, ID, Repository.class ) )
.thenReturn( repository );
when( pluginRegistry.loadClass( RepositoryPluginType.class, ID, RepositoryMeta.class ) )
.thenReturn( repositoryMeta );
when( repository.test() ).thenReturn( true );
Map<String, Object> items = new HashMap<>();
boolean result = controller.createRepository( ID, items );
assertEquals( true, result );
assertNull( controller.getConnectedRepository() );
controller.connectToRepository();
assertNotNull( controller.getConnectedRepository() );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:RepositoryConnectControllerTest.java
示例15: testEditConnectedRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
@Test
public void testEditConnectedRepository() throws Exception {
RepositoryMeta before = new TestRepositoryMeta( ID, "name1", PLUGIN_DESCRIPTION, "same" );
RepositoryMeta edited = new TestRepositoryMeta( ID, "name2", PLUGIN_DESCRIPTION, "same" );
when( pluginRegistry.loadClass( RepositoryPluginType.class, ID, Repository.class ) )
.thenReturn( repository );
when( pluginRegistry.loadClass( RepositoryPluginType.class, ID, RepositoryMeta.class ) )
.thenReturn( edited );
when( repositoriesMeta.nrRepositories() ).thenReturn( 1 );
when( repositoriesMeta.getRepository( 0 ) ).thenReturn( before );
controller.setConnectedRepository( before.clone() );
controller.setCurrentRepository( before );
controller.createRepository( ID, new HashMap<>() );
assertEquals( edited, controller.getConnectedRepository() );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:RepositoryConnectControllerTest.java
示例16: testEditConnectedRepositoryIncomaptible
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
@Test
public void testEditConnectedRepositoryIncomaptible() throws Exception {
RepositoryMeta before = new TestRepositoryMeta( ID, "name1", PLUGIN_DESCRIPTION, "inner1" );
RepositoryMeta edited = new TestRepositoryMeta( ID, "name2", PLUGIN_DESCRIPTION, "something completely different" );
when( pluginRegistry.loadClass( RepositoryPluginType.class, ID, Repository.class ) )
.thenReturn( repository );
when( pluginRegistry.loadClass( RepositoryPluginType.class, ID, RepositoryMeta.class ) )
.thenReturn( edited );
when( repositoriesMeta.nrRepositories() ).thenReturn( 1 );
when( repositoriesMeta.getRepository( 0 ) ).thenReturn( before );
controller.setConnectedRepository( before.clone() );
controller.setCurrentRepository( before );
controller.createRepository( ID, new HashMap<>() );
assertNotEquals( edited, controller.getConnectedRepository() );
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:RepositoryConnectControllerTest.java
示例17: init
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
/**
* 初始化Ketle环境。此方法执行以下 操作:
*
* 创建一个Kettle "home" 的目录,如果它已经不存在 - 读取 在kettle.properties文件 - 初始化记录后端 - 设置
* 控制台日志级别调试 - 如果指定的参数,配置 简单的JNDI - 寄存器的各种原生类型和插件 插件类型 - 读取变量列表 - 初始化生命周期
* 启动监听程序等
*
* @param simpleJndi
* , 真正简单的JNDI配置,否则返回false
* @throws KettleException
* 在初始化过程中发生的任何错误都将抛出 KettleException。
*/
public static void init(boolean simpleJndi) throws KettleException {
if (initialized == null) {
// 创建一个Kettle "home" 的目录
// createKettleHome();
// 初始化 kettle.properties 初始化其他属性等
environmentInit();
// 初始化日志
// CentralLogStore.init();
// // 设置控制台日志级用来调试
// LogWriter.setConsoleAppenderDebug();
// 配置简单的JNDI 仅供我们在单机模式运行
if (simpleJndi) {
JndiUtil.initJNDI();
}
// 注册原生类型和各个所需的插件
PluginRegistry.addPluginType(StepPluginType.getInstance());
PluginRegistry.addPluginType(PartitionerPluginType.getInstance());
PluginRegistry.addPluginType(JobEntryPluginType.getInstance());
PluginRegistry.addPluginType(RepositoryPluginType.getInstance());
PluginRegistry.addPluginType(DatabasePluginType.getInstance());
PluginRegistry.addPluginType(LifecyclePluginType.getInstance());
PluginRegistry.addPluginType(KettleLifecyclePluginType
.getInstance());
PluginRegistry.addPluginType(ImportRulePluginType.getInstance());
PluginRegistry.init();
// 初始化读取的变量列表。
KettleVariablesList.init();
// 初始化生命周期监听器
initLifecycleListeners();
initialized = true;
}
}
开发者ID:jiangzongyao,项目名称:kettle_support_kettle8.0,代码行数:45,代码来源:KettleEnvironment.java
示例18: initRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的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
示例19: init
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的package包/类
/**
* 初始化Ketle环境。此方法执行以下 操作:
*
* 创建一个Kettle "home" 的目录,如果它已经不存在 - 读取 在kettle.properties文件 - 初始化记录后端 - 设置
* 控制台日志级别调试 - 如果指定的参数,配置 简单的JNDI - 寄存器的各种原生类型和插件 插件类型 - 读取变量列表 - 初始化生命周期
* 启动监听程序等
*
* @param simpleJndi
* , 真正简单的JNDI配置,否则返回false
* @throws KettleException
* 在初始化过程中发生的任何错误都将抛出 KettleException。
*/
public static void init(boolean simpleJndi) throws KettleException {
if (initialized == null) {
// 创建一个Kettle "home" 的目录
// createKettleHome();
// 初始化 kettle.properties 初始化其他属性等
environmentInit();
// 初始化日志
CentralLogStore.init();
// 设置控制台日志级用来调试
LogWriter.setConsoleAppenderDebug();
// 配置简单的JNDI 仅供我们在单机模式运行
if (simpleJndi) {
JndiUtil.initJNDI();
}
// 注册原生类型和各个所需的插件
PluginRegistry.addPluginType(StepPluginType.getInstance());
PluginRegistry.addPluginType(PartitionerPluginType.getInstance());
PluginRegistry.addPluginType(JobEntryPluginType.getInstance());
PluginRegistry.addPluginType(RepositoryPluginType.getInstance());
PluginRegistry.addPluginType(DatabasePluginType.getInstance());
PluginRegistry.addPluginType(LifecyclePluginType.getInstance());
PluginRegistry.addPluginType(KettleLifecyclePluginType
.getInstance());
PluginRegistry.addPluginType(ImportRulePluginType.getInstance());
PluginRegistry.init();
// 初始化读取的变量列表。
KettleVariablesList.init();
// 初始化生命周期监听器
initLifecycleListeners();
initialized = true;
}
}
开发者ID:839536,项目名称:kettle,代码行数:45,代码来源:KettleEnvironment.java
示例20: initRepository
import org.pentaho.di.core.plugins.RepositoryPluginType; //导入依赖的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());
// 获得资源库实例
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:839536,项目名称:kettle,代码行数:41,代码来源:KettleReposServiceImpl.java
注:本文中的org.pentaho.di.core.plugins.RepositoryPluginType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论