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);
}
Aggregations