Package org.teiid.dqp.internal.datamgr

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


  public void deploy(DeploymentUnit unit, VDBMetaData deployment) throws DeploymentException {
    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();
      if (errors != null && !errors.isEmpty()) {
        throw new DeploymentException(RuntimePlugin.Util.getString("validity_errors_in_vdb", deployment)); //$NON-NLS-1$
      }
    }
   
    // get the metadata store of the VDB (this is build in parse stage)
    MetadataStoreGroup store = unit.getAttachment(MetadataStoreGroup.class);
   
    // add required connector managers; if they are not already there
    for (Translator t: deployment.getOverrideTranslators()) {
      VDBTranslatorMetaData data = (VDBTranslatorMetaData)t;
     
      String type = data.getType();
      Translator parent = this.translatorRepository.getTranslatorMetaData(type);
      if ( parent == null) {
        throw new DeploymentException(RuntimePlugin.Util.getString("translator_type_not_found", unit.getName())); //$NON-NLS-1$
      }
     
      Set<String> keys = parent.getProperties().stringPropertyNames();
      for (String key:keys) {
        if (data.getPropertyValue(key) == null && parent.getPropertyValue(key) != null) {
          data.addProperty(key, parent.getPropertyValue(key));
        }
      }
      repo.addTranslatorMetadata(data.getName(), data);
    }
    createConnectorManagers(cmr, repo, deployment);
    boolean asynchLoad = false;
    // if store is null and vdb dynamic vdb then try to get the metadata
    if (store == null && deployment.isDynamic()) {
View Full Code Here

TOP

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

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.