本文整理汇总了Java中org.teiid.adminapi.impl.VDBMetaData.getStatus方法的典型用法代码示例。如果您正苦于以下问题:Java VDBMetaData.getStatus方法的具体用法?Java VDBMetaData.getStatus怎么用?Java VDBMetaData.getStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.teiid.adminapi.impl.VDBMetaData
的用法示例。
在下文中一共展示了VDBMetaData.getStatus方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getVdbStatus
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
/**
* Get the VDB Status that will be displayed in the UI. This may be different from the VDBMetaData object status to simplify
* @param vdb the VDBMetaData
* @return the vdb status
*/
public String getVdbStatus(VDBMetaData vdb) {
VDB.Status status = vdb.getStatus();
String vdbStatus = Constants.STATUS_UNKNOWN;
// Change FAILED, REMOVED, LOADING status to INACTIVE
if(status!=null) {
vdbStatus = status.toString();
if( status==VDB.Status.FAILED || status==VDB.Status.REMOVED || status==VDB.Status.LOADING ) {
vdbStatus=Constants.STATUS_INACTIVE;
}
}
// If no models, change status to INACTIVE
List<Model> models = vdb.getModels();
if(models.isEmpty()) vdbStatus = Constants.STATUS_INACTIVE;
return vdbStatus;
}
示例2: getVDBStatusMessage
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
public String getVDBStatusMessage(VDBMetaData vdb) throws DataVirtUiException {
if(vdb!=null) {
Status vdbStatus = vdb.getStatus();
if(vdbStatus!=Status.ACTIVE) {
List<String> allErrors = vdb.getValidityErrors();
if(allErrors!=null && !allErrors.isEmpty()) {
StringBuffer sb = new StringBuffer();
for(String errorMsg : allErrors) {
sb.append("ERROR: " +errorMsg+"<br>");
}
return sb.toString();
}
}
}
return Constants.SUCCESS;
}
示例3: getVDBStatusMessage
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
private String getVDBStatusMessage(String vdbName) throws DataVirtUiException {
// Get deployed VDB and check status
VDBMetaData theVDB;
try {
theVDB = clientAccessor.getClient().getVDB(vdbName,1);
} catch (AdminApiClientException e) {
throw new DataVirtUiException(e.getMessage());
}
if(theVDB!=null) {
Status vdbStatus = theVDB.getStatus();
if(vdbStatus!=Status.ACTIVE) {
List<String> allErrors = theVDB.getValidityErrors();
if(allErrors!=null && !allErrors.isEmpty()) {
StringBuffer sb = new StringBuffer();
for(String errorMsg : allErrors) {
sb.append("ERROR: " +errorMsg);
}
return sb.toString();
}
}
}
return Constants.SUCCESS;
}
示例4: 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);
}
}
示例5: updateSource
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
/**
* @return true if the datasource is new to the vdb
* @throws AdminProcessingException
*/
public boolean updateSource(String vdbName, int vdbVersion, SourceMappingMetadata mapping, boolean replace) throws AdminProcessingException {
String dsName = stripContext(mapping.getConnectionJndiName());
VDBMetaData vdb = getVDBRepository().getLiveVDB(vdbName, vdbVersion);
if (vdb == null || vdb.getStatus() == Status.FAILED) {
return false;
}
synchronized (vdb) {
ConnectorManagerRepository cmr = vdb.getAttachment(ConnectorManagerRepository.class);
ConnectorManager existing = cmr.getConnectorManager(mapping.getName());
try {
cmr.createConnectorManager(vdb, cmr.getProvider(), mapping, replace);
} catch (TeiidException e) {
throw new AdminProcessingException(RuntimePlugin.Event.TEIID40033, e);
}
if (mapping.getConnectionJndiName() != null && (existing == null || !dsName.equals(existing.getConnectionName()))) {
List<Runnable> runnables = new ArrayList<Runnable>();
resourceAdded(dsName, runnables, vdb);
return true;
}
return false;
}
}
示例6: checkStatus
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
private void checkStatus(List<Runnable> runnables, VDBMetaData vdb,
ModelMetaData model, ConnectorManager cm) {
//get the pending metadata load
Runnable r = model.removeAttachment(Runnable.class);
if (r != null) {
runnables.add(r);
} else {
String status = cm.getStausMessage();
if (status != null && status.length() > 0) {
Severity severity = vdb.getStatus() == Status.LOADING?Severity.WARNING:Severity.ERROR;
model.addRuntimeMessage(severity, status);
LogManager.logInfo(LogConstants.CTX_RUNTIME, status);
} else if (vdb.getStatus() != Status.LOADING){
model.clearRuntimeMessages();
}
}
}
示例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);
}
}
}
}
示例8: dataSourceRemoved
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
/**
*
* @param dataSourceName
* @param vdbKey which cannot be null
*/
public void dataSourceRemoved(String dataSourceName, VDBKey vdbKey) {
dataSourceName = stripContext(dataSourceName);
CompositeVDB cvdb = getVDBRepository().getCompositeVDB(vdbKey);
if (cvdb == null) {
return;
}
VDBMetaData vdb = cvdb.getVDB();
if (vdb.getStatus() == Status.FAILED) {
return;
}
synchronized (vdb) {
ConnectorManagerRepository cmr = vdb.getAttachment(ConnectorManagerRepository.class);
for (ModelMetaData model:vdb.getModelMetaDatas().values()) {
String sourceName = getSourceName(dataSourceName, model);
if (sourceName == null) {
continue;
}
Severity severity = Severity.WARNING;
ConnectorManager cm = cmr.getConnectorManager(sourceName);
if (cm.getExecutionFactory().isSourceRequired() && vdb.getStatus() == Status.ACTIVE) {
severity = Severity.ERROR;
}
String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40012, vdb.getName(), vdb.getVersion(), dataSourceName);
model.addRuntimeMessage(severity, msg);
LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
}
}
}
示例9: resourceAdded
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
void resourceAdded(String resourceName) {
List<Runnable> runnables = new ArrayList<Runnable>();
for (CompositeVDB cvdb:getVDBRepository().getCompositeVDBs()) {
VDBMetaData vdb = cvdb.getVDB();
if (vdb.getStatus() == Status.FAILED) {
continue;
}
resourceAdded(resourceName, runnables, vdb);
}
}
示例10: checkVDB
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
static VDBMetaData checkVDB(OperationContext context, String vdbName,
int vdbVersion) throws OperationFailedException {
ServiceController<?> sc = context.getServiceRegistry(false).getRequiredService(TeiidServiceNames.VDB_REPO);
VDBRepository repo = VDBRepository.class.cast(sc.getValue());
VDBMetaData vdb = repo.getLiveVDB(vdbName, vdbVersion);
if (vdb == null) {
throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50102, vdb, vdbVersion)));
}
Status status = vdb.getStatus();
if (status != VDB.Status.ACTIVE) {
throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50096, vdbName, vdbVersion, status)));
}
return vdb;
}
示例11: executeOperation
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Override
protected void executeOperation(OperationContext context, VDBRepository repo, ModelNode operation) throws OperationFailedException {
if (!operation.hasDefined(OperationsConstants.VDB_NAME.getName())) {
throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.getString(OperationsConstants.VDB_NAME.getName()+MISSING)));
}
if (!operation.hasDefined(OperationsConstants.VDB_VERSION.getName())) {
throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.getString(OperationsConstants.VDB_VERSION.getName()+MISSING)));
}
if (!operation.hasDefined(OperationsConstants.MODEL_NAME.getName())) {
throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.getString(OperationsConstants.MODEL_NAME.getName()+MISSING)));
}
ModelNode result = context.getResult();
String vdbName = operation.get(OperationsConstants.VDB_NAME.getName()).asString();
int vdbVersion = operation.get(OperationsConstants.VDB_VERSION.getName()).asInt();
String modelName = operation.get(OperationsConstants.MODEL_NAME.getName()).asString();
VDBMetaData vdb = repo.getLiveVDB(vdbName, vdbVersion);
if (vdb == null || (vdb.getStatus() != VDB.Status.ACTIVE)) {
throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50096, vdbName, vdbVersion)));
}
EnumSet<SchemaObjectType> schemaTypes = null;
if (vdb.getModel(modelName) == null){
throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50097, vdbName, vdbVersion, modelName)));
}
if (operation.hasDefined(OperationsConstants.ENTITY_TYPE.getName())) {
String[] types = operation.get(OperationsConstants.ENTITY_TYPE.getName()).asString().toUpperCase().split(","); //$NON-NLS-1$
if (types.length > 0) {
ArrayList<SchemaObjectType> sot = new ArrayList<Admin.SchemaObjectType>();
for (int i = 1; i < types.length; i++) {
sot.add(SchemaObjectType.valueOf(types[i]));
}
schemaTypes = EnumSet.of(SchemaObjectType.valueOf(types[0]), sot.toArray(new SchemaObjectType[sot.size()]));
}
else {
schemaTypes = EnumSet.of(SchemaObjectType.valueOf(types[0]));
}
}
String regEx = null;
if (operation.hasDefined(OperationsConstants.ENTITY_PATTERN.getName())) {
regEx = operation.get(OperationsConstants.ENTITY_PATTERN.getName()).asString();
}
MetadataStore metadataStore = vdb.getAttachment(TransformationMetadata.class).getMetadataStore();
Schema schema = metadataStore.getSchema(modelName);
String ddl = DDLStringVisitor.getDDLString(schema, schemaTypes, regEx);
result.set(ddl);
}