1 22 23 28 29 package org.xquark.mapper.metadata; 30 31 import java.util.List ; 32 33 import org.xquark.mapper.dbms._RepositoryConnection; 34 import org.xquark.xml.xdbc.*; 35 import org.xquark.xquery.xdbc.AbstractXMLDataSourceMetaData; 36 import org.xquark.xquery.xdbc.PathSetXMLDocument; 37 38 41 public class DataSourceMetaData extends AbstractXMLDataSourceMetaData 42 { 43 private static final String RCSRevision = "$Revision: 1.1 $"; 44 private static final String RCSName = "$Name: $"; 45 46 private _RepositoryConnection repConn; 47 48 49 public DataSourceMetaData(_RepositoryConnection repConn) 50 throws XMLDBCException 51 { 52 this(repConn, false); 53 } 54 55 public DataSourceMetaData(_RepositoryConnection repConn, boolean refresh) 56 throws XMLDBCException 57 { 58 super(repConn); 59 this.repConn = repConn; 60 if (refresh) 61 repConn.getMetadata().refresh(); 62 } 63 64 public List getCollectionNames() throws XMLDBCException, XMLDBCNotSupportedException 65 { 66 return repConn.getMetadata().getCollectionList(); } 68 69 public List getSchemaNamespaces() throws XMLDBCException 70 { 71 return repConn.getSchemaCollection().getIdentifierList(); 72 } 73 74 public XMLDocument getPathSet(String colName) throws XMLDBCException 75 { 76 return new PathSetXMLDocument(colName, repConn.getMetadata().getCollection(colName).getPathSet()); 78 } 79 80 85 public Object getProperty(String propertyId) throws XMLDBCNotRecognizedException 86 { 87 throw new XMLDBCNotRecognizedException("Properties are not supported yet."); 88 } 89 90 public XMLDocument getSchema(String targetNamespace) throws XMLDBCException 91 { 92 return repConn.getSchemaCollection().getDocument(targetNamespace); 93 } 94 95 } 96 | Popular Tags |