Search in sources :

Example 1 with Status

use of org.teiid.adminapi.VDB.Status in project teiid by teiid.

the class EngineStatistics method checkVDB.

static VDBMetaData checkVDB(OperationContext context, String vdbName, String 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(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50102, vdbName, vdbVersion));
    }
    Status status = vdb.getStatus();
    if (status != VDB.Status.ACTIVE) {
        throw new OperationFailedException(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50096, vdbName, vdbVersion));
    }
    return vdb;
}
Also used : Status(org.teiid.adminapi.VDB.Status) VDBMetaData(org.teiid.adminapi.impl.VDBMetaData) OperationFailedException(org.jboss.as.controller.OperationFailedException) VDBRepository(org.teiid.deployers.VDBRepository)

Example 2 with Status

use of org.teiid.adminapi.VDB.Status in project teiid by teiid.

the class EmbeddedAdminImpl method checkVDB.

private VDBMetaData checkVDB(String vdbName, String vdbVersion) throws AdminProcessingException {
    VDBMetaData vdb = this.embeddedServer.repo.getLiveVDB(vdbName, vdbVersion);
    if (vdb == null) {
        throw new AdminProcessingException(RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40131, vdbName, vdbVersion));
    }
    Status status = vdb.getStatus();
    if (status != VDB.Status.ACTIVE) {
        throw new AdminProcessingException(RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40132, vdbName, vdbVersion, status));
    }
    return vdb;
}
Also used : Status(org.teiid.adminapi.VDB.Status) VDBMetaData(org.teiid.adminapi.impl.VDBMetaData)

Aggregations

Status (org.teiid.adminapi.VDB.Status)2 VDBMetaData (org.teiid.adminapi.impl.VDBMetaData)2 OperationFailedException (org.jboss.as.controller.OperationFailedException)1 VDBRepository (org.teiid.deployers.VDBRepository)1