Search in sources :

Example 1 with ConnectionType

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

the class TestEmbeddedServerAdmin method testChangeVDBConnectionType.

@Test
public void testChangeVDBConnectionType() throws AdminException {
    ConnectionType previous = admin.getVDB("AdminAPITestVDB", 1).getConnectionType();
    admin.changeVDBConnectionType("AdminAPITestVDB", 1, ConnectionType.ANY);
    assertEquals(ConnectionType.ANY, admin.getVDB("AdminAPITestVDB", 1).getConnectionType());
    admin.changeVDBConnectionType("AdminAPITestVDB", 1, previous);
}
Also used : ConnectionType(org.teiid.adminapi.VDB.ConnectionType) Test(org.junit.Test)

Example 2 with ConnectionType

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

the class RuntimeVDB method changeConnectionType.

public void changeConnectionType(ConnectionType type) throws AdminProcessingException {
    synchronized (this.vdb) {
        ConnectionType previous = this.vdb.getConnectionType();
        this.vdb.setConnectionType(type);
        try {
            this.listener.connectionTypeChanged();
        } catch (AdminProcessingException e) {
            this.vdb.setConnectionType(previous);
            throw e;
        }
    }
}
Also used : ConnectionType(org.teiid.adminapi.VDB.ConnectionType) AdminProcessingException(org.teiid.adminapi.AdminProcessingException)

Aggregations

ConnectionType (org.teiid.adminapi.VDB.ConnectionType)2 Test (org.junit.Test)1 AdminProcessingException (org.teiid.adminapi.AdminProcessingException)1