Package org.teiid.dqp.internal.datamgr

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


    if (this.vdbRepository.removeVDB(deployment.getName(), deployment.getVersion())) {
      LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("redeploying_vdb", deployment)); //$NON-NLS-1$
    }
   
    TranslatorRepository repo = new TranslatorRepository();
    ConnectorManagerRepository cmr = new ConnectorManagerRepository();
   
    boolean preview = deployment.isPreview();
   
    if (!preview) {
      List<String> errors = deployment.getValidityErrors();
View Full Code Here


    newMergedVDB.setDataPolicies(this.vdb.getDataPolicies());
    newMergedVDB.setDescription(this.vdb.getDescription());
    newMergedVDB.setStatus(this.vdb.getStatus());
    newMergedVDB.setJAXBProperties(this.vdb.getJAXBProperties());
    newMergedVDB.setConnectionType(this.vdb.getConnectionType());
    ConnectorManagerRepository mergedRepo = new ConnectorManagerRepository();
    mergedRepo.getConnectorManagers().putAll(this.cmr.getConnectorManagers());
    for (CompositeVDB child:this.children.values()) {
     
      // add models
      for (Model m:child.getVDB().getModels()) {
        newMergedVDB.addModel((ModelMetaData)m);
      }
     
      for (DataPolicy p:child.getVDB().getDataPolicies()) {
        newMergedVDB.addDataPolicy((DataPolicyMetadata)p);
      }
      mergedRepo.getConnectorManagers().putAll(child.cmr.getConnectorManagers());
    }
    newMergedVDB.addAttchment(ConnectorManagerRepository.class, mergedRepo);
    return newMergedVDB;
  }
View Full Code Here

      if (vdb.getStatus() == VDB.Status.ACTIVE || vdb.isPreview()) {
        continue;
      }
      LinkedList<Runnable> runnables = new LinkedList<Runnable>();
      synchronized (vdb) {
        ConnectorManagerRepository cmr = vdb.getAttachment(ConnectorManagerRepository.class);
       
        for (Model m:vdb.getModels()) {
          ModelMetaData model = (ModelMetaData)m;
          if (model.getErrors().isEmpty()) {
            continue;
          }
 
          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 {
View Full Code Here

        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, vdb);
        workContext.getSession().setSessionId(String.valueOf(conn));
       
        PreparedStatementRequest serverRequest = new PreparedStatementRequest(prepPlanCache);
       
        ConnectorManagerRepository repo = Mockito.mock(ConnectorManagerRepository.class);
        Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(new AutoGenDataService());
       
        serverRequest.initialize(request, BufferManagerFactory.getStandaloneBufferManager(), null, new FakeTransactionService(), null, workContext, prepPlanCache);
        serverRequest.setMetadata(capFinder, metadata, null);
        serverRequest.setAuthorizationValidator(new DataRoleAuthorizationValidator(false, true, true));
        serverRequest.processRequest();
View Full Code Here

        if (cache != null) {
          request = new PreparedStatementRequest(cache);
        } else {
          request = new Request();
        }
        ConnectorManagerRepository repo = Mockito.mock(ConnectorManagerRepository.class);
        workContext.getVDB().addAttchment(ConnectorManagerRepository.class, repo);
        Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(new AutoGenDataService());
       
        request.initialize(message, Mockito.mock(BufferManager.class),
        new FakeDataManager(), new FakeTransactionService(), TEMP_TABLE_STORE, workContext, null);
        request.setAuthorizationValidator(new DataRoleAuthorizationValidator(false, true, true));
        request.processRequest();
View Full Code Here

      vdbMetaData.addModel(FakeMetadataFactory.createModel(schema.getName(), schema.isPhysical()));
    }
      MetadataStoreGroup metaGroup = new MetadataStoreGroup();
      metaGroup.addStore(metadataStore);
     
      ConnectorManagerRepository cmr = new ConnectorManagerRepository();
      cmr.addConnectorManager("source", getConnectorManager("bqt1", "FakeTranslator", "FakeConnection", getFuncsOne()));
      cmr.addConnectorManager("source2", getConnectorManager("bqt2", "FakeTranslator2", "FakeConnection2", getFuncsTwo()));
     
      CompositeVDB cvdb = new CompositeVDB(vdbMetaData, metaGroup, null, null, FakeMetadataFactory.SFM.getSystemFunctions(),cmr);
      VDBMetaData vdb = cvdb.getVDB();
      return vdb.getAttachment(TransformationMetadata.class);
  }
View Full Code Here

        Mockito.stub(model.getSourceNames()).toReturn(bindings);
       
        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
        SourceCapabilities actual = finder.findCapabilities(modelName);
View Full Code Here

        rm.setBufferService(new FakeBufferService());
        rm.setCacheFactory(new DefaultCacheFactory());
        rm.start(new DQPConfiguration());
        FakeBufferService bs = new FakeBufferService();

        ConnectorManagerRepository repo = Mockito.mock(ConnectorManagerRepository.class);
        Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(connectorManager);
       
       
        dtm = new DataTierManagerImpl(rm,
                                  bs, true);
        command = helpGetCommand(sql, metadata);
View Full Code Here

      agds = new AutoGenDataService();
        DQPWorkContext context = FakeMetadataFactory.buildWorkContext(RealMetadataFactory.createTransformationMetadata(RealMetadataFactory.exampleBQTCached().getMetadataStore(), "bqt"));
        context.getVDB().getModel("BQT3").setVisible(false); //$NON-NLS-1$
        context.getVDB().getModel("VQT").setVisible(false); //$NON-NLS-1$

        ConnectorManagerRepository repo = Mockito.mock(ConnectorManagerRepository.class);
        context.getVDB().addAttchment(ConnectorManagerRepository.class, repo);
        Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(agds);
       
        core = new DQPCore();
        core.setBufferService(new BufferService() {
     
      @Override
View Full Code Here

    if (context.getDataObjects() != null) {
      for (GroupSymbol gs : GroupCollectorVisitor.getGroupsIgnoreInlineViews(command, false)) {
        context.accessedDataObject(gs.getMetadataID());
      }
    }
    ConnectorManagerRepository cmr = workItem.getDqpWorkContext().getVDB().getAttachment(ConnectorManagerRepository.class);
    ConnectorWork work = cmr.getConnectorManager(aqr.getConnectorName()).registerRequest(aqr);
        return new DataTierTupleSource(aqr, workItem, work, this, limit);
  }
View Full Code Here

TOP

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

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.