1 24 25 package org.objectweb.cjdbc.controller.virtualdatabase; 26 27 import org.objectweb.cjdbc.common.log.Trace; 28 import org.objectweb.cjdbc.common.sql.metadata.MetadataContainer; 29 import org.objectweb.cjdbc.controller.backend.DatabaseBackend; 30 31 40 public class VirtualDatabaseStaticMetaData 41 { 42 private String vdbName; 43 private Trace logger; 44 private MetadataContainer metadataContainer = null; 45 46 52 public VirtualDatabaseStaticMetaData(VirtualDatabase database) 53 { 54 this.vdbName = database.getVirtualDatabaseName(); 55 this.logger = Trace 56 .getLogger("org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread." 57 + vdbName + ".metadata"); 58 } 59 60 66 public void gatherStaticMetadata(DatabaseBackend backend) 67 { 68 MetadataContainer newContainer = backend.getDatabaseStaticMetadata(); 69 if (logger.isDebugEnabled()) 70 logger.debug("fetching static metadata for backend:" + backend.getName()); 71 if (metadataContainer == null) 72 metadataContainer = newContainer; 73 else 74 { 75 boolean isCompatible = metadataContainer.isCompatible(newContainer, 76 logger); 77 if (logger.isDebugEnabled()) 78 logger.debug("Backend static metadata is compatible with current ones:" 79 + isCompatible); 80 } 81 } 82 83 88 public MetadataContainer getMetadataContainer() 89 { 90 return metadataContainer; 91 } 92 } | Popular Tags |