Search in sources :

Example 1 with AdminException

use of org.teiid.adminapi.AdminException in project teiid by teiid.

the class IntegrationTestRestWebserviceGeneration method deployVDB.

private void deployVDB() throws AdminException, FileNotFoundException {
    // we'll remove the war from the previous test as we are now lazily removing it on the server side
    try {
        admin.undeploy("sample_1.war");
    } catch (AdminException e) {
    }
    admin.deploy("sample-vdb.xml", new FileInputStream(UnitTestUtil.getTestDataFile("sample-vdb.xml")));
    assertTrue(AdminUtil.waitForVDBLoad(admin, "sample", 1, 3));
}
Also used : AdminException(org.teiid.adminapi.AdminException) FileInputStream(java.io.FileInputStream)

Example 2 with AdminException

use of org.teiid.adminapi.AdminException in project teiid by teiid.

the class ResteasyEnabler method finishedDeployment.

@Override
public void finishedDeployment(String name, CompositeVDB cvdb) {
    final VDBMetaData vdb = cvdb.getVDB();
    if (!vdb.getStatus().equals(Status.ACTIVE)) {
        return;
    }
    final String warName = buildName(name, cvdb.getVDB().getVersion());
    if (generator.hasRestMetadata(vdb)) {
        final Runnable job = new Runnable() {

            @Override
            public void run() {
                try {
                    byte[] warContents = generator.getContent(vdb);
                    if (!vdb.getStatus().equals(Status.ACTIVE)) {
                        return;
                    }
                    if (warContents != null) {
                        // make it a non-persistent deployment
                        getAdmin().deploy(warName, new ByteArrayInputStream(warContents), false);
                    }
                } catch (IOException e) {
                    LogManager.logWarning(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50109, warName));
                } catch (AdminException e) {
                    LogManager.logWarning(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50109, warName));
                }
            }
        };
        getExecutor().execute(job);
    }
}
Also used : AdminException(org.teiid.adminapi.AdminException) ByteArrayInputStream(java.io.ByteArrayInputStream) VDBMetaData(org.teiid.adminapi.impl.VDBMetaData) IOException(java.io.IOException)

Aggregations

AdminException (org.teiid.adminapi.AdminException)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 VDBMetaData (org.teiid.adminapi.impl.VDBMetaData)1