Search in sources :

Example 21 with DriverDeploymentInfo

use of org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo in project kie-wb-common by kiegroup.

the class WildflyDataSourceProvider method deploy.

/**
 * Creates a data source in the Wildfly server.
 * @param dataSourceDef Data source definition to be created.
 * @param jndi jndi name to be use the Wildly server to bound the data source in the jndi context.
 * @return returns the deployment information for the created data source.
 * @throws Exception exceptions may be thrown if the data source couldn't be created.
 */
private DataSourceDeploymentInfo deploy(final DataSourceDef dataSourceDef, final String jndi, String deploymentId) throws Exception {
    DriverDeploymentInfo driverDeploymentInfo = driverProvider.getDeploymentInfo(dataSourceDef.getDriverUuid());
    if (driverDeploymentInfo == null) {
        throw new Exception("Required driver: " + dataSourceDef.getDriverUuid() + " is not deployed.");
    }
    WildflyDataSourceDef wfDataSourceDef = buildWFDataSource(deploymentId, jndi, dataSourceDef, driverDeploymentInfo.getDriverDeploymentId());
    dataSourceMgmtClient.createDataSource(wfDataSourceDef);
    return new DataSourceDeploymentInfo(deploymentId, true, dataSourceDef.getUuid(), jndi, false);
}
Also used : DriverDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo) WildflyDataSourceDef(org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceDef) DataSourceDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DataSourceDeploymentInfo)

Aggregations

DriverDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo)21 Test (org.junit.Test)8 DataSourceDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DataSourceDeploymentInfo)4 DriverProviderBaseTest (org.kie.workbench.common.screens.datasource.management.backend.core.DriverProviderBaseTest)3 URI (java.net.URI)2 ExpectedException (org.junit.rules.ExpectedException)2 DataSourceDef (org.kie.workbench.common.screens.datasource.management.model.DataSourceDef)2 DriverDef (org.kie.workbench.common.screens.datasource.management.model.DriverDef)2 ArrayList (java.util.ArrayList)1 Before (org.junit.Before)1 WildflyDataSourceDef (org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDataSourceDef)1 WildflyDriverDef (org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef)1 DriverDefInfo (org.kie.workbench.common.screens.datasource.management.model.DriverDefInfo)1