本文整理匯總了Java中org.pentaho.di.trans.TransMeta.getMetaStore方法的典型用法代碼示例。如果您正苦於以下問題:Java TransMeta.getMetaStore方法的具體用法?Java TransMeta.getMetaStore怎麽用?Java TransMeta.getMetaStore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.trans.TransMeta
的用法示例。
在下文中一共展示了TransMeta.getMetaStore方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getData
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
@Override
public void getData( TransMeta transMeta ) throws KettleException {
try {
String serviceName = transMeta.getAttribute( StreamingConst.STREAMING_GROUP, StreamingConst.STREAMING_SERVICE_NAME );
if ( Const.isEmpty( serviceName ) ) {
return;
}
MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, transMeta.getMetaStore(), PentahoDefaults.NAMESPACE );
StreamingService streamingService = rtFactory.loadElement( serviceName );
if ( streamingService == null ) {
return;
}
wServiceName.setText( Const.NVL( streamingService.getName(), "" ) );
wServiceStep.setText( Const.NVL( streamingService.getStepname(), "" ) );
wServiceCacheDuration.setText( Const.NVL( streamingService.getCacheDuration(), "" ) );
wServiceCacheSize.setText( Const.NVL( streamingService.getCacheSize(), "" ) );
wPreloadService.setSelection( streamingService.isPreloaded() );
wClearOnStart.setSelection( streamingService.isClearingOnStart() );
wReplaceAtTransEnd.setSelection(streamingService.isCacheFlipping());
LogLevel logLevel = streamingService.getLogLevel()==null ? LogLevel.BASIC : streamingService.getLogLevel();
wLogLevel.select( logLevel.getLevel() );
} catch ( Exception e ) {
throw new KettleException( "Unable to load streaming service", e );
}
}
示例2: ok
import org.pentaho.di.trans.TransMeta; //導入方法依賴的package包/類
@Override
public void ok( TransMeta transMeta ) throws KettleException {
try {
// Get streaming service details...
//
StreamingService streamingService = new StreamingService();
streamingService.setName( wServiceName.getText() );
streamingService.setStepname( wServiceStep.getText() );
streamingService.setCacheDuration( wServiceCacheDuration.getText() );
streamingService.setCacheSize( wServiceCacheSize.getText() );
streamingService.setPreloaded( wPreloadService.getSelection() );
streamingService.setClearingOnStart( wClearOnStart.getSelection() );
streamingService.setCacheFlipping(wReplaceAtTransEnd.getSelection());
streamingService.setLogLevel( LogLevel.values()[wLogLevel.getSelectionIndex()] );
streamingService.setTransFilename( transMeta.getFilename() );
Repository repository = transMeta.getRepository();
if ( repository != null ) {
if ( repository.getRepositoryMeta().getRepositoryCapabilities().supportsReferences() ) {
ObjectId objectId = transMeta.getObjectId();
streamingService.setTransObjectId( objectId == null ? null : objectId.getId() );
}
streamingService.setTransRepositoryPath( transMeta.getRepositoryDirectory().getPath() + "/" + transMeta.getName() );
}
MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, transMeta.getMetaStore(), PentahoDefaults.NAMESPACE );
rtFactory.saveElement( streamingService );
transMeta.setAttribute( StreamingConst.STREAMING_GROUP, StreamingConst.STREAMING_SERVICE_NAME, streamingService.getName() );
transMeta.setChanged();
} catch ( Exception e ) {
throw new KettleException( "Error saveing streaming service metadata", e );
}
}