当前位置: 首页>>代码示例>>Java>>正文


Java VDBMetadataParser类代码示例

本文整理汇总了Java中org.teiid.adminapi.impl.VDBMetadataParser的典型用法代码示例。如果您正苦于以下问题:Java VDBMetadataParser类的具体用法?Java VDBMetadataParser怎么用?Java VDBMetadataParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VDBMetadataParser类属于org.teiid.adminapi.impl包,在下文中一共展示了VDBMetadataParser类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getVdbByteArray

import org.teiid.adminapi.impl.VDBMetadataParser; //导入依赖的package包/类
/**
 * Get the bytearray version of the VDBMetaData object
 * @param vdb the VDB
 * @return the vdb in bytearray form
 */
public byte[] getVdbByteArray(VDBMetaData vdb) throws Exception {
	ByteArrayOutputStream out = new ByteArrayOutputStream();
	VDBMetadataParser.marshell(vdb, out);

	return out.toByteArray();
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:12,代码来源:VdbHelper.java

示例2: getVDBMetadata

import org.teiid.adminapi.impl.VDBMetadataParser; //导入依赖的package包/类
public static TransformationMetadata getVDBMetadata(String vdbName, URL vdbURL, URL udfFile) throws IOException {
TransformationMetadata vdbmetadata = VDB_CACHE.get(vdbURL);
if (vdbmetadata != null) {
	return vdbmetadata;
}

try {
	IndexVDB imf = loadMetadata(vdbName, vdbURL);
	Resource r = imf.resources.getEntriesPlusVisibilities().get("/META-INF/vdb.xml");
	VDBMetaData vdb = null;
	if (r != null) {
		vdb = VDBMetadataParser.unmarshell(r.openStream());
	}
	Collection <FunctionMethod> methods = null;
	Collection<FunctionTree> trees = null;
	if (udfFile != null) {
		String schema = FileUtils.getFilenameWithoutExtension(udfFile.getPath());
		methods = FunctionMetadataReader.loadFunctionMethods(udfFile.openStream());
		trees = Arrays.asList(new FunctionTree(schema, new UDFSource(methods), true));
	}
	SystemFunctionManager sfm = new SystemFunctionManager();
	vdbmetadata = new TransformationMetadata(vdb, new CompositeMetadataStore(Arrays.asList(SystemMetadata.getInstance().getSystemStore(), imf.store)), imf.resources.getEntriesPlusVisibilities(), sfm.getSystemFunctions(), trees); 
	VDB_CACHE.put(vdbURL, vdbmetadata);
	return vdbmetadata;
} catch (XMLStreamException e) {
	throw new IOException(e);
}
  }
 
开发者ID:kenweezy,项目名称:teiid,代码行数:29,代码来源:VDBMetadataFactory.java

示例3: testBuildArchive

import org.teiid.adminapi.impl.VDBMetadataParser; //导入依赖的package包/类
@Test
public void testBuildArchive() throws Exception {
	VDBMetaData vdb = VDBMetadataParser.unmarshell(new FileInputStream(UnitTestUtil.getTestDataFile("sample-vdb.xml")));
	MetadataStore ms = new MetadataStore();
	for (ModelMetaData model: vdb.getModelMetaDatas().values()) {
		MetadataFactory mf = TestDDLParser.helpParse(model.getSchemaText(), model.getName());
		ms.addSchema(mf.getSchema());
	}
	
	TransformationMetadata metadata = RealMetadataFactory.createTransformationMetadata(ms, "Rest");
	vdb.addAttchment(QueryMetadataInterface.class, metadata);
	vdb.addAttchment(TransformationMetadata.class, metadata);
	vdb.addAttchment(MetadataStore.class, ms);
	
	RestASMBasedWebArchiveBuilder builder = new RestASMBasedWebArchiveBuilder();
	byte[] contents = builder.createRestArchive(vdb);
	
	ArrayList<String> files = new ArrayList<String>();
	files.add("WEB-INF/web.xml");
	files.add("WEB-INF/jboss-web.xml");
	files.add("WEB-INF/classes/org/teiid/jboss/rest/View.class");
	files.add("WEB-INF/classes/org/teiid/jboss/rest/TeiidRestApplication.class");
	files.add("META-INF/MANIFEST.MF");
	
	ZipInputStream zipIn = new ZipInputStream(new ByteArrayInputStream(contents));
	ZipEntry ze;
	while ((ze = zipIn.getNextEntry()) != null) {
		assertTrue(files.contains(ze.getName()));
		zipIn.closeEntry();
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:32,代码来源:TestRestWebArchiveBuilder.java


注:本文中的org.teiid.adminapi.impl.VDBMetadataParser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。