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


Java VDBMetaData.setStatus方法代码示例

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


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

示例1: metadataLoaded

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
protected void metadataLoaded(final VDBMetaData vdb,
		final ModelMetaData model,
		final MetadataStore vdbMetadataStore,
		final AtomicInteger loadCount, MetadataFactory factory, boolean success, boolean reloading) {
	if (success) {
		// merge into VDB metadata
		factory.mergeInto(vdbMetadataStore);
	
		//TODO: this is not quite correct, the source may be missing
		model.clearRuntimeMessages();
		model.setMetadataStatus(Model.MetadataStatus.LOADED);
	} else {
		model.setMetadataStatus(Model.MetadataStatus.FAILED);
		vdb.setStatus(Status.FAILED);
		//TODO: abort the other loads
	}
	
	if (loadCount.decrementAndGet() == 0 || vdb.getStatus() == Status.FAILED) {
		getVDBRepository().finishDeployment(vdb.getName(), vdb.getVersion(), reloading);
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:22,代码来源:AbstractVDBDeployer.java

示例2: testActiveVDBWithNoVersion

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testActiveVDBWithNoVersion() throws Exception {
	VDBRepository repo = Mockito.mock(VDBRepository.class);
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName("name");
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	
	
	Mockito.stub(repo.getLiveVDB("name")).toReturn(vdb);
	
	ssi.setVDBRepository(repo);
	
	ssi.getActiveVDB("name", null);
	
	Mockito.verify(repo, Mockito.times(1)).getLiveVDB("name");
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:18,代码来源:TestSessionServiceImpl.java

示例3: testActiveVDBWithVersion

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testActiveVDBWithVersion() throws Exception {
	VDBRepository repo = Mockito.mock(VDBRepository.class);
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName("name");
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	
	
	Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
	
	ssi.setVDBRepository(repo);
	
	ssi.getActiveVDB("name", "1");
	
	Mockito.verify(repo, Mockito.times(1)).getLiveVDB("name", 1);
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:18,代码来源:TestSessionServiceImpl.java

示例4: testActiveVDBNameWithVersion

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testActiveVDBNameWithVersion() throws Exception {
	VDBRepository repo = Mockito.mock(VDBRepository.class);
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName("name");
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	
	
	Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
	
	ssi.setVDBRepository(repo);
	
	ssi.getActiveVDB("name.1", null);
	
	Mockito.verify(repo, Mockito.times(1)).getLiveVDB("name", 1);
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:18,代码来源:TestSessionServiceImpl.java

示例5: testActiveVDBNameWithVersionNonInteger

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testActiveVDBNameWithVersionNonInteger() throws Exception {
	VDBRepository repo = Mockito.mock(VDBRepository.class);
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName("name");
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	
	
	Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
	
	ssi.setVDBRepository(repo);
	
	try {
		ssi.getActiveVDB("name.x", null);
		fail("must have failed with non integer version");
	} catch (SessionServiceException e) {
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:20,代码来源:TestSessionServiceImpl.java

示例6: testSecurityDomain

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test public void testSecurityDomain() throws Exception {
	VDBRepository repo = Mockito.mock(VDBRepository.class);
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName("name");
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	vdb.addProperty(SessionServiceImpl.SECURITY_DOMAIN_PROPERTY, "domain");
	
	Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
	
	ssi.setVDBRepository(repo);
	
	Properties properties = new Properties();
	properties.setProperty(TeiidURL.JDBC.VDB_NAME, "name.1");
	SessionMetadata s = ssi.createSession("name", "1", AuthenticationType.USERPASSWORD, "x", new Credentials(new char[] {'y'}), "z", properties);
	assertEquals("domain", s.getSecurityDomain());
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:18,代码来源:TestSessionServiceImpl.java

示例7: finishDeployment

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
public void finishDeployment(String name, int version, boolean reload) {
	VDBKey key = new VDBKey(name, version);
	CompositeVDB v = this.vdbRepo.get(key);
	if (v == null) {
		return;
	}
	VDBMetaData metadataAwareVDB = v.getVDB();			
	if (v.getOriginalVDB().getStatus() == Status.FAILED) {
		if (v.getOriginalVDB() != metadataAwareVDB && metadataAwareVDB.getStatus() == Status.LOADING) {
			metadataAwareVDB.setStatus(Status.FAILED);
		}
		return;
	}
	v.metadataLoadFinished();
	synchronized (metadataAwareVDB) {
		try {
			ValidatorReport report = new MetadataValidator().validate(metadataAwareVDB, metadataAwareVDB.removeAttachment(MetadataStore.class));

			if (report.hasItems()) {
				LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40073, name, version));
				if (!metadataAwareVDB.isPreview() && !processMetadataValidatorReport(key, report)) {
					metadataAwareVDB.setStatus(Status.FAILED);
					notifyFinished(name, version, v, reload);
					return;
				}
			} 
			validateDataSources(metadataAwareVDB);
			metadataAwareVDB.setStatus(Status.ACTIVE);
			notifyFinished(name, version, v, reload);
		} finally {
			if (metadataAwareVDB.getStatus() != Status.ACTIVE && metadataAwareVDB.getStatus() != Status.FAILED) {
				//guard against an unexpected exception - probably bad validation logic
				metadataAwareVDB.setStatus(Status.FAILED);
				notifyFinished(name, version, v, reload);
			}
		}
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:39,代码来源:VDBRepository.java

示例8: addVdb

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
private VDBMetaData addVdb(VDBRepository repo, String name, String sc, String authenticationType) {
	VDBMetaData vdb = new VDBMetaData();
	vdb.setName(name);
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	Mockito.stub(repo.getLiveVDB(name, 1)).toReturn(vdb);
	vdb.addProperty(SessionServiceImpl.SECURITY_DOMAIN_PROPERTY, sc);
	vdb.addProperty(SessionServiceImpl.AUTHENTICATION_TYPE_PROPERTY, authenticationType);
	return vdb;
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:11,代码来源:TestLogonImpl.java

示例9: testLogonAuthenticationType

import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testLogonAuthenticationType() throws Exception {
	VDBRepository repo = Mockito.mock(VDBRepository.class);
	VDBMetaData vdb = new VDBMetaData();
	vdb.addProperty(SessionServiceImpl.GSS_PATTERN_PROPERTY, "GSS");
	vdb.setName("name");
	vdb.setVersion(1);
	vdb.setStatus(Status.ACTIVE);
	Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
	
	ssi.setVDBRepository(repo);
	ssi.setSecurityDomain("SC");
	
	// default transport - what Teiid has before TEIID-2863
	ssi.setAuthenticationType(AuthenticationType.USERPASSWORD); // this is transport default		
	DQPWorkContext.setWorkContext(new DQPWorkContext());
	Properties p = buildProperties("fred", "name");		
	LogonImpl impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
	LogonResult result = impl.logon(p);
	assertEquals("[email protected]", result.getUserName());
	
	// if no preference then choose USERPASSWORD
	ssi.setAuthenticationType(AuthenticationType.USERPASSWORD); // this is transport default		
	DQPWorkContext.setWorkContext(new DQPWorkContext());
	p = buildProperties("fred", "name");		
	impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
	result = impl.logon(p);
	assertEquals("[email protected]", result.getUserName());

	// if user name is set to "GSS", then the preference is set to "GSS"
	ssi.setAuthenticationType(AuthenticationType.USERPASSWORD); // this is transport default		
	DQPWorkContext.setWorkContext(new DQPWorkContext());
	p = buildProperties("GSS", "name");		
	FakeGssLogonImpl fimpl = new FakeGssLogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
	fimpl.addToken("bytes".getBytes(), "SecurityContext");
	p.put(ILogon.KRB5TOKEN, "bytes".getBytes());
	result = fimpl.logon(p);
	assertEquals("[email protected]", result.getUserName());
	
	// if the transport default defined as GSS, then preference is USERPASSWORD, throw exception
	ssi.setAuthenticationType(AuthenticationType.GSS); 		
	try {
		DQPWorkContext.setWorkContext(new DQPWorkContext());
		p = buildProperties("fred", "name");		
		impl = new LogonImpl(ssi, "fakeCluster"); //$NON-NLS-1$
		result = impl.logon(p);
		fail("should have failed due server does not support USERPASSWORD");
	} catch(LogonException e) {
		// pass
	}
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:52,代码来源:TestLogonImpl.java


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