use of org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef in project kie-wb-common by kiegroup.
the class WildflyDriverProvider method getDeploymentsInfo.
/**
* Gets the deployment information for all the drivers currently deployed on the Wildfly server.
* @return a list with the deployment information for all the drivers.
* @throws Exception exceptions may be thrown if e.g. communication with the Wildfly server fails, etc.
*/
public List<DriverDeploymentInfo> getDeploymentsInfo() throws Exception {
List<DriverDeploymentInfo> deploymentsInfo = new ArrayList<>();
DriverDeploymentInfo deploymentInfo;
String uuid;
boolean managed;
for (WildflyDriverDef internalDef : driverMgmtClient.getDeployedDrivers()) {
try {
uuid = DeploymentIdGenerator.extractUuid(internalDef.getDriverName());
} catch (Exception e) {
uuid = internalDef.getDriverName();
}
managed = managedDrivers.containsKey(internalDef.getDriverName());
deploymentInfo = new DriverDeploymentInfo(internalDef.getDriverName(), internalDef.getDriverName(), managed, uuid, internalDef.getDriverClass());
deploymentsInfo.add(deploymentInfo);
}
return deploymentsInfo;
}
use of org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef in project kie-wb-common by kiegroup.
the class WildflyDriverProvider method getDeployments.
/**
* Gets the list of driver definitions for the currently deployed drivers.
* @return list with the definitions for the deployed drivers.
* @throws Exception exceptions may be thrown if e.g. communication with the Wildfly server fails, etc.
*/
public List<DriverDef> getDeployments() throws Exception {
List<DriverDef> driverDefs = new ArrayList<>();
DriverDef driverDef;
String uuid;
for (WildflyDriverDef internalDef : driverMgmtClient.getDeployedDrivers()) {
driverDef = new DriverDef();
try {
uuid = DeploymentIdGenerator.extractUuid(internalDef.getDriverName());
} catch (Exception e) {
uuid = internalDef.getDriverName();
}
driverDef.setUuid(uuid);
driverDef.setName(internalDef.getDeploymentName());
driverDef.setDriverClass(internalDef.getDriverClass());
driverDefs.add(driverDef);
}
return driverDefs;
}
use of org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef in project kie-wb-common by kiegroup.
the class WildflyDriverProviderTest method createWFDrivers.
private List<WildflyDriverDef> createWFDrivers() {
// emulates the deployments information returned by the WF server.
List<WildflyDriverDef> result = new ArrayList<>();
WildflyDriverDef driverDef = new WildflyDriverDef();
driverDef.setDeploymentName(DRIVER1_DEPLOYMENT_ID);
driverDef.setDriverName(DRIVER1_DEPLOYMENT_ID);
driverDef.setDriverClass(DRIVER1_CLASS);
result.add(driverDef);
driverDef = new WildflyDriverDef();
driverDef.setDeploymentName(UUID2_DEPLOYMENT_ID);
driverDef.setDriverName(UUID2_DEPLOYMENT_ID);
driverDef.setDriverClass(DRIVER2_CLASS);
result.add(driverDef);
return result;
}
Aggregations