Package org.teiid.adminapi

Examples of org.teiid.adminapi.AdminProcessingException


  }
 
  public void mergeVDBs(String sourceVDBName, int sourceVDBVersion, String targetVDBName, int targetVDBVersion) throws AdminException{
    CompositeVDB source = this.vdbRepo.get(new VDBKey(sourceVDBName, sourceVDBVersion));
    if (source == null) {
      throw new AdminProcessingException(RuntimePlugin.Util.getString("vdb_not_found", sourceVDBName, sourceVDBVersion)); //$NON-NLS-1$
    }
   
    CompositeVDB target = this.vdbRepo.get(new VDBKey(targetVDBName, targetVDBVersion));
    if (target == null) {
      throw new AdminProcessingException(RuntimePlugin.Util.getString("vdb_not_found", sourceVDBName, sourceVDBVersion)); //$NON-NLS-1$
    }   
   
    // merge them
    target.addChild(source);
  }
View Full Code Here


  public static void handleException(Exception e) throws AdminProcessingException {
    if (e instanceof AdminProcessingException) {
      throw (AdminProcessingException)e;
    }
    throw new AdminProcessingException(e.getMessage(), e);
  }
View Full Code Here

      progress.run();
      DeploymentStatus status =  progress.getDeploymentStatus();
     
    if (status.isFailed()) {
      if (status.getFailure() != null) {
        throw new AdminProcessingException(status.getFailure().getMessage(), status.getFailure());
      }
      throw new AdminProcessingException(errorMessage);       
    }
  }
View Full Code Here

   
    SessionMetadata session = null;
    try {
      session = this.sessionService.createSession(user, null, "JOPR", properties, false, false); //$NON-NLS-1$
    } catch (SessionServiceException e1) {
      throw new AdminProcessingException(e1);
    } catch (LoginException e1) {
      throw new AdminProcessingException(e1);
    }

    final long requestID =  0L;
   
    DQPWorkContext context = new DQPWorkContext();
    context.setSession(session);
   
    try {
      return context.runInContext(new Callable<List<List>>() {
        @Override
        public List<List> call() throws Exception {
          ArrayList<List> results = new ArrayList<List>();
         
          long start = System.currentTimeMillis();
          RequestMessage request = new RequestMessage(command);
          request.setExecutionId(0L);
          request.setRowLimit(getMaxRowsFetchSize()); // this would limit the number of rows that are returned.
          Future<ResultsMessage> message = dqpCore.executeRequest(requestID, request);
          ResultsMessage rm = message.get(timoutInMilli, TimeUnit.MILLISECONDS);
         
              if (rm.getException() != null) {
                  throw new AdminProcessingException(rm.getException());
              }
             
              if (rm.isUpdateResult()) {
                results.addAll(new ArrayList(Arrays.asList("update count"))); //$NON-NLS-1$
                results.addAll(Arrays.asList(rm.getResults()));               
              }
              else {
                results.addAll(new ArrayList(Arrays.asList(rm.getColumnNames())));
                results.addAll(Arrays.asList(fixResults(rm.getResults())));
               
                while (rm.getFinalRow() == -1 || rm.getLastRow() < rm.getFinalRow()) {
                  long elapsed = System.currentTimeMillis() - start;
              message = dqpCore.processCursorRequest(requestID, rm.getLastRow()+1, 1024);
              rm = message.get(timoutInMilli-elapsed, TimeUnit.MILLISECONDS);
              results.addAll(Arrays.asList(fixResults(rm.getResults())));
                }
              }

              long elapsed = System.currentTimeMillis() - start;
              ResultsFuture<?> response = dqpCore.closeRequest(requestID);
              response.get(timoutInMilli-elapsed, TimeUnit.MILLISECONDS);
          return results;
        }
      });
    } catch (Throwable t) {
      throw new AdminProcessingException(t);
    } finally {
      try {
        sessionService.closeSession(session.getSessionId());
      } catch (InvalidSessionException e) { //ignore
      }     
View Full Code Here

        }
  }
 
  private ManagementView getView() throws AdminProcessingException {
    if (this.view == null) {
      throw new AdminProcessingException(IntegrationPlugin.Util.getString("admin_connection_closed")); //$NON-NLS-1$
    }
    this.view.load();
    return this.view;
  }
View Full Code Here

    return this.view;
  }
 
  private DeploymentManager getDeploymentManager() throws AdminProcessingException{
    if (this.deploymentMgr == null) {
      throw new AdminProcessingException(IntegrationPlugin.Util.getString("admin_connection_closed")); //$NON-NLS-1$
    }
    return this.deploymentMgr;
  }
View Full Code Here

      if (mc != null) {
        return AdminObjectBuilder.buildAO(mc, TranslatorMetaData.class);
      }
      return null;
    } catch(Exception e) {
      throw new AdminProcessingException(e.getMessage(), e);
    }
  }
View Full Code Here

   
   
  @Override
  public void deployVDB(String fileName, InputStream vdb) throws AdminException {
    if (!fileName.endsWith(".vdb") && !fileName.endsWith("-vdb.xml")) {//$NON-NLS-1$ //$NON-NLS-2$
      throw new AdminProcessingException(IntegrationPlugin.Util.getString("bad_vdb_extension")); //$NON-NLS-1$
    }
    ManagedUtil.deployArchive(getDeploymentManager(), fileName, vdb, false);
  }
View Full Code Here

     
      if (info == null && !templateName.startsWith(TranslatorMetaData.TRANSLATOR_PREFIX)) {
        info = getView().getTemplate(TranslatorMetaData.TRANSLATOR_PREFIX+templateName);
      }
      if(info == null) {
        throw new AdminProcessingException(IntegrationPlugin.Util.getString("template_not_found", templateName)); //$NON-NLS-1$
      }
     
      ArrayList<PropertyDefinition> props = new ArrayList<PropertyDefinition>();
      Map<String, ManagedProperty> propertyMap = info.getProperties();
     
View Full Code Here

    @Override
    public void changeVDBConnectionType(String vdbName, int vdbVersion,
        ConnectionType type) throws AdminException {
      ManagedComponent mc = getVDBManagedComponent(vdbName, vdbVersion);
    if (mc == null) {
      throw new AdminProcessingException(IntegrationPlugin.Util.getString("vdb_not_found", vdbName, vdbVersion)); //$NON-NLS-1$
    }
   
      ManagedProperty connectionTypeProperty = mc.getProperty("connectionType"); //$NON-NLS-1$
      if (connectionTypeProperty != null) {
        connectionTypeProperty.setValue(ManagedUtil.wrap(new EnumMetaType(ConnectionType.values()), type != null ?type.name():ConnectionType.BY_VERSION.name()));
View Full Code Here

TOP

Related Classes of org.teiid.adminapi.AdminProcessingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.