Package org.teiid.dqp.internal.datamgr

Examples of org.teiid.dqp.internal.datamgr.ConnectorManager


        if (cmr.getConnectorManager(source) != null) {
          continue;
        }

        String name = model.getSourceTranslatorName(source);
        ConnectorManager cm = new ConnectorManager(name, model.getSourceConnectionJndiName(source));
        ExecutionFactory<Object, Object> ef = getExecutionFactory(name, repo, deployment, map, new HashSet<String>());
        cm.setExecutionFactory(ef);
        cm.setModelName(model.getName());
        cmr.addConnectorManager(source, cm);
      }
    }
  }
View Full Code Here


    boolean valid = true;
    for(Model m:deployment.getModels()) {
      ModelMetaData model = (ModelMetaData)m;
      List<SourceMappingMetadata> mappings = model.getSourceMappings();
      for (SourceMappingMetadata mapping:mappings) {
        ConnectorManager cm = cmr.getConnectorManager(mapping.getName());
        String msg = cm.getStausMessage();
        if (msg != null && msg.length() > 0) {
          valid = false;
          model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), cm.getStausMessage());
          LogManager.logInfo(LogConstants.CTX_RUNTIME, cm.getStausMessage());
        }
      }
     
      // in the dynamic case the metadata may be still loading.
      if (!model.getErrors().isEmpty()) {
View Full Code Here

    LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);

      String exceptionMessage = null;
      Boolean loaded = false;
      for (String sourceName: model.getSourceNames()) {
        ConnectorManager cm = cmr.getConnectorManager(sourceName);
        String status = cm.getStausMessage();
      if (status != null && status.length() > 0) {
        exceptionMessage = status;
        continue;
      }
      loaded = null;
        try {
          MetadataStore store = cm.getMetadata(model.getName(), this.vdbRepository.getBuiltinDatatypes(), model.getProperties());
          if (cache) {
            this.serializer.saveAttachment(cacheFile, store);
          }
          vdbStore.addStore(store);
          loaded = true;
View Full Code Here

 
          String sourceName = getSourceName(resourceName, model, translator);
          if (sourceName == null) {
            continue;
          }
          ConnectorManager cm = cmr.getConnectorManager(sourceName);
          String status = cm.getStausMessage();
          if (status != null && status.length() > 0) {
            model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), status);
            LogManager.logInfo(LogConstants.CTX_RUNTIME, status);         
          } else {
            //get the pending metadata load
View Full Code Here

       1. requestMsg.isTransactional() must be TRUE
       *  2. manager.isXa() must be FALSE  ()
       3. command must NOT be a SELECT
       *  4. Then, set isImmutable to TRUE, we should SUCCEED
       */
    ConnectorManager cm = TestConnectorManager.getConnectorManager();
    ((FakeConnector)cm.getExecutionFactory()).setImmutable(true);
   

    // command must not be a SELECT
    Command command = helpGetCommand("update bqt1.smalla set stringkey = 1 where stringkey = 2", EXAMPLE_BQT); //$NON-NLS-1$
    AtomicRequestMessage requestMsg = createNewAtomicRequestMessage(1, 1);
View Full Code Here

       1. requestMsg.isTransactional() must be TRUE
       *  2. manager.isXa() must be FALSE  ()
       3. command must NOT be a SELECT
       *  4. Then, set isImmutable to FALSE, and we should FAIL
       */
    ConnectorManager cm = TestConnectorManager.getConnectorManager();
    ((FakeConnector)cm.getExecutionFactory()).setImmutable(false);
   
       
    // command must not be a SELECT
    Command command = helpGetCommand("update bqt1.smalla set stringkey = 1 where stringkey = 2", EXAMPLE_BQT); //$NON-NLS-1$
    AtomicRequestMessage requestMsg = createNewAtomicRequestMessage(1, 1);
View Full Code Here

    private AtomicRequestMessage request;
    private ConnectorManager csm;
   
  static ConnectorManager getConnectorManager() throws Exception {
    final FakeConnector c = new FakeConnector();
    ConnectorManager cm = new ConnectorManager("FakeConnector","FakeConnector") { //$NON-NLS-1$ //$NON-NLS-2$
      protected ExecutionFactory getExecutionFactory() {
        return c;
      }
      protected Object getConnectionFactory(){
        return c.getConnection();
      }
    };
    cm.start();
    return cm;
  }
View Full Code Here

  private static ConnectorManager getConnectorManager(String modelName, String translatorName, String connectionName,  List<FunctionMethod> funcs) {
    final ExecutionFactory<Object, Object> ef = Mockito.mock(ExecutionFactory.class);
   
    Mockito.stub(ef.getPushDownFunctions()).toReturn(funcs);
   
    ConnectorManager cm = new ConnectorManager(translatorName,connectionName) {
      protected ExecutionFactory getExecutionFactory() {
        return ef;
      }
    };
    cm.setModelName(modelName);
    cm.start();
    return cm;
  }
View Full Code Here

       
        BasicSourceCapabilities basicSourceCapabilities = new BasicSourceCapabilities();
        basicSourceCapabilities.setFunctionSupport(functionName, true);

        ConnectorManagerRepository repo = Mockito.mock(ConnectorManagerRepository.class);
        ConnectorManager cm = Mockito.mock(ConnectorManager.class);
        Mockito.stub(cm.getCapabilities()).toReturn(basicSourceCapabilities);
        Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(cm);
       
        CachedFinder finder = new CachedFinder(repo, vdb);
       
        // Test
View Full Code Here

        this.dqp.setBufferService(new FakeBufferService());
        this.dqp.setCacheFactory(new DefaultCacheFactory());
        this.dqp.setTransactionService(new FakeTransactionService());
       
        cmr = Mockito.mock(ConnectorManagerRepository.class);
        Mockito.stub(cmr.getConnectorManager("source")).toReturn(new ConnectorManager("x", "x") {
          @Override
          public SourceCapabilities getCapabilities() {
            return new BasicSourceCapabilities();
          }
        });
View Full Code Here

TOP

Related Classes of org.teiid.dqp.internal.datamgr.ConnectorManager

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.