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

Java MetaStoreException类代码示例

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

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



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

示例1: addRepo

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
public void addRepo() throws MetaStoreException, XulException {
  MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();
  GitRepository repo = new GitRepository();
  EditRepositoryDialog dialog = new EditRepositoryDialog( getShell(), repo );
  if ( dialog.open() == Window.OK ) {
    repoFactory.saveElement( repo );

    XulConfirmBox confirmBox = (XulConfirmBox) document.createElement( "confirmbox" );
    confirmBox.setTitle( "Success" );
    confirmBox.setMessage( "Open now?" );
    confirmBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );
    confirmBox.setCancelLabel( BaseMessages.getString( PKG, "Dialog.Cancel" ) );
    confirmBox.addDialogCallback( (XulDialogLambdaCallback<Object>) ( sender, returnCode, retVal ) -> {
      if ( returnCode == Status.ACCEPT ) {
        gitController.openGit( repo );
      }
    } );
    confirmBox.open();
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:21,代码来源:GitSpoonMenuController.java


示例2: editRepo

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
public void editRepo() throws MetaStoreException {
  MetaStoreFactory<GitRepository> repoFactory = getRepoFactory();

  List<String> names = repoFactory.getElementNames();
  Collections.sort( names );
  EnterSelectionDialog esd = new EnterSelectionDialog( getShell(), names.toArray( new String[names.size()] ), "Select Repository", "Select the repository to edit..." );
  String name = esd.open();

  if ( name == null ) {
    return;
  }
  GitRepository repo = repoFactory.loadElement( name );
  EditRepositoryDialog dialog = new EditRepositoryDialog( getShell(), repo );
  if ( dialog.open() == Window.OK ) {
    repoFactory.saveElement( repo );
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:18,代码来源:GitSpoonMenuController.java


示例3: removeService

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
protected boolean removeService( Shell shell, IMetaStore metaStore, String elementName ) {
  MessageDialog dialog = new MessageDialog( shell, "Confirm removal", shell.getDisplay().getSystemImage( SWT.ICON_QUESTION ),
    "Are you sure you want to remove streaming service '" + elementName + "'?", SWT.NONE, new String[] { "Yes", "No" }, 1 );
  int answerIndex = dialog.open();
  if ( answerIndex == 0 ) {
    try {
      MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, metaStore, PentahoDefaults.NAMESPACE );
      rtFactory.deleteElement( elementName );
      return true;
    } catch ( MetaStoreException e ) {
      new ErrorDialog( shell, "Error", "Error deleting streaming service with name '" + elementName + "'", e );
      return false;
    }

  }

  return false;
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-streaming,代码行数:19,代码来源:StreamingTransDialogTab.java


示例4: createNewService

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
protected String createNewService( Shell shell, IMetaStore metaStore ) {
  EnterStringDialog dialog = new EnterStringDialog( shell, "table1", "Enter service name", "Enter the name of the new streaming service" );
  String name = dialog.open();
  if ( name != null ) {

    try {
      MetaStoreFactory<StreamingService> rtFactory = new MetaStoreFactory<StreamingService>( StreamingService.class, metaStore, PentahoDefaults.NAMESPACE );
      if ( rtFactory.loadElement( name ) != null ) {
        throw new MetaStoreException( "The streaming service with name '" + name + "' already exists" );
      }
    } catch ( MetaStoreException e ) {
      new ErrorDialog( shell, "Error", "Error creating new streaming service", e );
      return null;
    }

    return name;
  } else {
    return null;
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-streaming,代码行数:21,代码来源:StreamingTransDialogTab.java


示例5: getData

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
private void getData() {
  
  try {
    MetaStoreFactory<StreamingService> factory = new MetaStoreFactory<StreamingService>(StreamingService.class, metaStore, PentahoDefaults.NAMESPACE);
    List<String> names = factory.getElementNames();
    Collections.sort(names);
    wServiceName.setItems(names.toArray(new String[names.size()]));
  } catch(MetaStoreException e) {
    LogChannel.GENERAL.logError("Error reading streaming service names from the metastore", e);
  }
  
  wServiceName.setText( Const.NVL(input.getServiceName(), ""));
  wIdField.setText(Const.NVL(input.getIdField(), ""));
  wTimeStampField.setText(Const.NVL(input.getTimestampField(), ""));
  
  String[] slaves = transMeta.getSlaveServerNames();
  Arrays.sort(slaves);
  wSlaveServer.setItems(slaves);
  wSlaveServer.setText(Const.NVL(input.getSlaveServer(), ""));
  
  wStepname.selectAll();
  wStepname.setFocus();
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-streaming,代码行数:24,代码来源:GetStreamingCacheDialog.java


示例6: getAMetaStore

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
private IMetaStore getAMetaStore() throws MetaStoreException {
  IMetaStore store = metaStore;
  // during exec of data service, metaStore is not passed down
  //
  if (store==null) {
    store = getTrans().getMetaStore();
  }
  if (store==null) {
    store = getTransMeta().getMetaStore();
  }
  if (store==null && getTrans().getParentTrans()!=null) {
    store = getTrans().getParentTrans().getMetaStore();
  }
  if (store==null) {
    log.logError("Unable to find the metastore, locating it ourselves...");
    if (repository!=null) {
      store = repository.getMetaStore();
    } else {
      store = MetaStoreConst.openLocalPentahoMetaStore();
    }
  }
  return store;
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-streaming,代码行数:24,代码来源:GetStreamingCache.java


示例7: readRep

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases)
    throws KettleException {

  String connectionName = rep.getStepAttributeString(id_step, TAG_CONNECTION);
  if (StringUtils.isNotEmpty(connectionName)) {
    try {
      connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
    } catch (MetaStoreException e) {
      // We just log the message but we don't abort the complete meta-data
      // loading.
      //
      log.logError(BaseMessages.getString(PKG, "HCPGetMeta.Error.HCPConnectionNotFound", connectionName));
      connection = null;
    }
  }
  sourceFileField = rep.getStepAttributeString(id_step, TAG_SOURCE_FILE);
  targetFileField = rep.getStepAttributeString(id_step, TAG_TARGET_FILE);
  responseCodeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_CODE_FIELD);
  responseTimeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_TIME_FIELD);
  responseSizeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_SIZE_FIELD);
}
 
开发者ID:mattcasters,项目名称:pdi-hcp-plugin,代码行数:23,代码来源:HCPGetMeta.java


示例8: readRep

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases)
    throws KettleException {

  String connectionName = rep.getStepAttributeString(id_step, TAG_CONNECTION);
  if (StringUtils.isNotEmpty(connectionName)) {
    try {
      connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
    } catch(MetaStoreException e) {
      // We just log the message but we don't abort the complete meta-data loading.
      //
      log.logError(BaseMessages.getString(PKG, "HCPPutMeta.Error.HCPConnectionNotFound", connectionName));
      connection = null;
    }
  }
  targetFileField = rep.getStepAttributeString(id_step, TAG_TARGET_FILE_FIELD);
  responseCodeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_CODE_FIELD);
  responseTimeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_TIME_FIELD);
}
 
开发者ID:mattcasters,项目名称:pdi-hcp-plugin,代码行数:20,代码来源:HCPDeleteMeta.java


示例9: readRep

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public void readRep(Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases)
    throws KettleException {

  String connectionName = rep.getStepAttributeString(id_step, TAG_CONNECTION);
  if (StringUtils.isNotEmpty(connectionName)) {
    try {
      connection = HCPConnectionUtils.getConnectionFactory(metaStore).loadElement(connectionName);
    } catch(MetaStoreException e) {
      // We just log the message but we don't abort the complete meta-data loading.
      //
      log.logError(BaseMessages.getString(PKG, "HCPPutMeta.Error.HCPConnectionNotFound", connectionName));
      connection = null;
    }
  }
  sourceFileField = rep.getStepAttributeString(id_step, TAG_SOURCE_FILE_FIELD);
  targetFileField = rep.getStepAttributeString(id_step, TAG_TARGET_FILE_FIELD);
  updating = rep.getStepAttributeBoolean(id_step, TAG_UPDATING);
  responseCodeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_CODE_FIELD);
  responseTimeField = rep.getStepAttributeString(id_step, TAG_RESPONSE_TIME_FIELD);
}
 
开发者ID:mattcasters,项目名称:pdi-hcp-plugin,代码行数:22,代码来源:HCPPutMeta.java


示例10: editDataSet

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
private void editDataSet( Spoon spoon, DataSet dataSet, List<DataSetGroup> groups, MetaStoreFactory<DataSet> setFactory, String setName ) throws MetaStoreException {
  
  try {
    DataSetDialog setDialog = new DataSetDialog( spoon.getShell(), setFactory.getMetaStore(), dataSet, groups, getAvailableDatabases(spoon.getRepository()) );
    while ( setDialog.open() ) {
      String message = validateDataSet( dataSet, setName, setFactory.getElementNames() );

      // Save the data set...
      //
      if ( message == null ) {
        setFactory.saveElement( dataSet );
        break;
      } else {
        MessageBox box = new MessageBox( spoon.getShell(), SWT.OK );
        box.setText( "Error" );
        box.setMessage( message );
        box.open();
      }
    }
  } catch(Exception e) {
    new ErrorDialog(spoon.getShell(), "Error", "Unable to edit data set", e);
  }

}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:25,代码来源:DataSetHelper.java


示例11: FactoriesHierarchy

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
public FactoriesHierarchy( IMetaStore metaStore, List<DatabaseMeta> databases ) throws MetaStoreException {
  this.metaStore = metaStore;
  this.databases = databases;
  groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
  groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
  List<DataSetGroup> groups = groupFactory.getElements();

  setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE );
  setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groups );
  List<DataSet> sets = setFactory.getElements();

  setFactory.addNameFactory( DataSetConst.GROUP_LIST_KEY, groupFactory );

  testFactory = new MetaStoreFactory<TransUnitTest>( TransUnitTest.class, metaStore, PentahoDefaults.NAMESPACE );
  testFactory.addNameList( DataSetConst.SET_LIST_KEY, sets );

}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:18,代码来源:FactoriesHierarchy.java


示例12: getMetastore

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public IMetaStore getMetastore( String providerKey ) {
  IMetaStore metaStore = getExplicitMetastore( MetastoreLocator.REPOSITORY_PROVIDER_KEY );
  if ( metaStore == null ) {
    metaStore = getExplicitMetastore( MetastoreLocator.LOCAL_PROVIDER_KEY );
  }
  if ( metaStore == null && providerKey != null ) {
    metaStore = getExplicitMetastore( providerKey );
  }
  if ( metaStore == null ) {
    try {
      metaStore = MetaStoreConst.openLocalPentahoMetaStore( false );
    } catch ( MetaStoreException e ) {
      return null;
    }
  }

  return metaStore;
}
 
开发者ID:pentaho,项目名称:pentaho-osgi-bundles,代码行数:20,代码来源:MetastoreLocatorImpl.java


示例13: importFromMetaStore

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
public void importFromMetaStore() throws MetaStoreException, KettlePluginException {
  // Read the databases...
  //
  if ( metaStore != null ) {
    IMetaStoreElementType databaseType =
      metaStore.getElementTypeByName(
        PentahoDefaults.NAMESPACE, PentahoDefaults.DATABASE_CONNECTION_ELEMENT_TYPE_NAME );
    if ( databaseType != null ) {
      List<IMetaStoreElement> databaseElements = metaStore.getElements( PentahoDefaults.NAMESPACE, databaseType );
      for ( IMetaStoreElement databaseElement : databaseElements ) {
        addDatabase( DatabaseMetaStoreUtil.loadDatabaseMetaFromDatabaseElement(
          metaStore, databaseElement ), false );
      }
    }

    // TODO: do the same for slaves, clusters, partition schemas
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:AbstractMeta.java


示例14: saveSharedDimension

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
public static void saveSharedDimension(IMetaStore metaStore, LogicalTable sharedDimension, String locale) throws MetaStoreException {
  IMetaStoreElementType elementType = getSharedDimensionElementType(metaStore);
  IMetaStoreElement element = null;
  if (sharedDimension.getId()!=null) {
    element = metaStore.getElement(namespace, elementType, sharedDimension.getId());
  }

  if (element!=null) {
    // Update the shared dimension!
    //
    populateElementWithSharedDimension(metaStore, sharedDimension, locale, elementType, element);
    metaStore.updateElement(namespace, elementType, sharedDimension.getId(), element);
  } else {
    // New shared dimension
    //
    element = metaStore.newElement();
    populateElementWithSharedDimension(metaStore, sharedDimension, locale, elementType, element);
    metaStore.createElement(namespace, elementType, element);
  }

  sharedDimension.setId(element.getId());
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:SharedDimensionMetaStoreUtil.java


示例15: deleteElementType

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public void deleteElementType( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {

  RepositoryFile namespaceRepositoryFile = validateNamespace( namespace );

  RepositoryFile elementTypeFile = findChildByName( namespaceRepositoryFile.getId(), elementType.getName() );
  List<RepositoryFile> children = getChildren( elementTypeFile.getId() );
  removeHiddenFilesFromList( children );

  if ( children.isEmpty() ) {
    pur.deleteFile( elementTypeFile.getId(), true, null );
  } else {
    List<String> ids = getElementIds( namespace, elementType );
    throw new MetaStoreDependenciesExistsException( ids, "Can't delete element type with name '"
        + elementType.getName() + "' because it is not empty" );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:PurRepositoryMetaStore.java


示例16: createElement

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public void createElement( String namespace, IMetaStoreElementType elementType, IMetaStoreElement element ) throws MetaStoreException, MetaStoreElementExistException {
  try {
    IMetaStoreElement exists = getElementByName( namespace, elementType, element.getId() );
    if ( exists != null ) {
      throw new MetaStoreException( "The shared objects meta store already contains an element with type name '"
        + elementType.getName() + "' and element name '" + element.getName() );
    }

    if ( elementType.getName().equals( databaseElementType.getName() ) ) {
      // convert the element to DatabaseMeta and store it in the shared objects file, then save the file
      //
      sharedObjects.storeObject( DatabaseMetaStoreUtil.loadDatabaseMetaFromDatabaseElement( this, element ) );
      sharedObjects.saveToFile();
      return;
    }
    throw new MetaStoreException( "Storing elements with element type name '"
      + elementType.getName() + "' is not supported in the shared objects meta store" );
  } catch ( Exception e ) {
    throw new MetaStoreException( "Unexpected error creating an element in the shared objects meta store", e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:SharedObjectsMetaStore.java


示例17: updateElement

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public synchronized void updateElement( String namespace, IMetaStoreElementType elementType, String elementId,
    IMetaStoreElement element ) throws MetaStoreException {

  // verify that the element type belongs to this meta store
  //
  if ( elementType.getMetaStoreName() == null || !elementType.getName().equals( getName() ) ) {
    String elementTypeName = elementType.getName();
    elementType = getElementTypeByName( namespace, elementTypeName );
    if ( elementType == null ) {
      throw new MetaStoreException( "The element type '" + elementTypeName
          + "' could not be found in the meta store in which you are updating." );
    }
  }

  RepositoryFile existingFile = pur.getFileById( elementId );
  if ( existingFile == null ) {
    throw new MetaStoreException( "The element to update with id " + elementId + " could not be found in the store" );
  }

  DataNode elementDataNode = new DataNode( PurRepository.checkAndSanitize( element.getName() ) );
  elementToDataNode( element, elementDataNode );

  RepositoryFile updatedFile = pur.updateFile( existingFile, new NodeRepositoryFileData( elementDataNode ), null );
  element.setId( updatedFile.getId().toString() );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:PurRepositoryMetaStore.java


示例18: getNamespaces

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public List<String> getNamespaces() throws MetaStoreException {

  try {
    List<String> namespaces = new ArrayList<String>();
    Collection<RowMetaAndData> namespaceRows = delegate.getNamespaces();
    for ( RowMetaAndData namespaceRow : namespaceRows ) {
      String namespace = namespaceRow.getString( KettleDatabaseRepository.FIELD_NAMESPACE_NAME, null );
      if ( !Utils.isEmpty( namespace ) ) {
        namespaces.add( namespace );
      }
    }
    return namespaces;

  } catch ( Exception e ) {
    throw new MetaStoreException( e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:KettleDatabaseRepositoryMetaStore.java


示例19: createNamespace

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public void createNamespace( String namespace ) throws MetaStoreException, MetaStoreNamespaceExistsException {
  try {
    ObjectId namespaceId = delegate.getNamespaceId( namespace );
    if ( namespaceId != null ) {
      throw new MetaStoreNamespaceExistsException( "Namespace with name '" + namespace + "' already exists" );
    }

    // insert namespace into R_NAMESPACE
    //
    delegate.insertNamespace( namespace );
    repository.commit();
  } catch ( Exception e ) {
    repository.rollback();
    throw new MetaStoreException( e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:KettleDatabaseRepositoryMetaStore.java


示例20: getElementTypes

import org.pentaho.metastore.api.exceptions.MetaStoreException; //导入依赖的package包/类
@Override
public List<IMetaStoreElementType> getElementTypes( String namespace ) throws MetaStoreException {
  try {
    LongObjectId namespaceId = delegate.getNamespaceId( namespace );
    if ( namespaceId == null ) {
      return new ArrayList<IMetaStoreElementType>();
    }

    Collection<RowMetaAndData> elementTypeRows = delegate.getElementTypes( namespaceId );

    List<IMetaStoreElementType> list = new ArrayList<IMetaStoreElementType>();
    for ( RowMetaAndData elementTypeRow : elementTypeRows ) {
      KDBRMetaStoreElementType elementType = delegate.parseElementType( namespace, namespaceId, elementTypeRow );
      list.add( elementType );
    }

    return list;
  } catch ( Exception e ) {
    throw new MetaStoreException( "Unable to get list of element types for namespace '" + namespace + "'", e );
  }

}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:23,代码来源:KettleDatabaseRepositoryMetaStore.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java DisplaytagColumnDecorator类代码示例发布时间:2022-05-22
下一篇:
Java ListProviderCreator类代码示例发布时间: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