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


Java MetaStoreException类代码示例

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


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


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