Package org.teiid.vdb.runtime

Examples of org.teiid.vdb.runtime.VDBKey


    }
    metadataRepository.endLoadVdb(vdbName, vdbVersion);
  }

  public VDBMetaData getVDB(String name, int version) {
    CompositeVDB v = this.vdbRepo.get(new VDBKey(name, version));
    if (v != null) {
      return v.getVDB();
    }
    return null;
  }
View Full Code Here


    }
    return vdbs;
  }

    protected VDBKey vdbId(VDBMetaData vdb) {
        return new VDBKey(vdb.getName(), vdb.getVersion());
    }  
View Full Code Here

        return new VDBKey(vdb.getName(), vdb.getVersion());
    }  
   
  public VDBMetaData getVDB(String vdbName) {
      int latestVersion = 0;
        for (VDBKey key:this.vdbRepo.tailMap(new VDBKey(vdbName, 0)).keySet()) {
            if(!key.getName().equalsIgnoreCase(vdbName)) {
              break;
            }
          VDBMetaData vdb = this.vdbRepo.get(key).getVDB();
          switch (vdb.getConnectionType()) {
View Full Code Here

  public void odbcEnabled() {
    this.odbcEnabled = true;
  }
 
  public boolean removeVDB(String vdbName, int vdbVersion) {
    VDBKey key = new VDBKey(vdbName, vdbVersion);
    CompositeVDB removed = this.vdbRepo.remove(key);
    if (removed != null) {
      // if this VDB was part of another VDB; then remove them.
      for (CompositeVDB other:this.vdbRepo.values()) {
        other.removeChild(key);
      }
      notifyRemove(key.getName(), key.getVersion());
      return true;
    }
    return false;
 
View Full Code Here

    }
    return datatypeMap;
  }
 
  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
View Full Code Here

      this.odbcStore = getODBCMetadataStore();
    }
  }
 
  public void finishDeployment(String name, int version) {
    CompositeVDB v = this.vdbRepo.get(new VDBKey(name, version));
    if (v!= null) {
      updateFromMetadataRepository(v);
      v.update();
    }
  }
View Full Code Here

  public void addChild(CompositeVDB child) {
    if (this.children == null) {
      this.children = new LinkedHashMap<VDBKey, CompositeVDB>();
    }
    VDBMetaData childVDB = child.getVDB();
    this.children.put(new VDBKey(childVDB.getName(), childVDB.getVersion()), child);
    this.mergedVDB = null;
  }
View Full Code Here

     
      private Set<VDBKey> recentlyRemoved = Collections.newSetFromMap(new LRUCache<VDBKey, Boolean>(10000));
     
      @Override
      public void removed(String name, int version) {
        recentlyRemoved.add(new VDBKey(name, version));
      }
     
      @Override
      public void added(String name, int version) {
        if (!recentlyRemoved.remove(new VDBKey(name, version))) {
          return;
        }
        // terminate all the previous sessions
        try {
          Collection<SessionMetadata> sessions = sessionService.getActiveSessions();
View Full Code Here

import junit.framework.TestCase;

public class TestVDBKey extends TestCase {
   
    public void testCaseInsensitive() {
        VDBKey key = new VDBKey("foo", "1")//$NON-NLS-1$ //$NON-NLS-2$
        VDBKey key1 = new VDBKey("FOO", "1"); //$NON-NLS-1$ //$NON-NLS-2$
        UnitTestUtil.helpTestEquivalence(0, key, key1);
    }
View Full Code Here

        VDBKey key1 = new VDBKey("FOO", "1"); //$NON-NLS-1$ //$NON-NLS-2$
        UnitTestUtil.helpTestEquivalence(0, key, key1);
    }
   
    public void testNotEqual() {
        VDBKey key = new VDBKey("a", "1")//$NON-NLS-1$ //$NON-NLS-2$
        VDBKey key1 = new VDBKey("b", "1"); //$NON-NLS-1$ //$NON-NLS-2$
        assertFalse(key.equals(key1));
    }
View Full Code Here

TOP

Related Classes of org.teiid.vdb.runtime.VDBKey

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.