Search in sources :

Example 1 with WildflyDriverDef

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;
}
Also used : DriverDeploymentInfo(org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo) ArrayList(java.util.ArrayList) WildflyDriverDef(org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef)

Example 2 with WildflyDriverDef

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;
}
Also used : ArrayList(java.util.ArrayList) WildflyDriverDef(org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef) WildflyDriverDef(org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef) DriverDef(org.kie.workbench.common.screens.datasource.management.model.DriverDef)

Example 3 with WildflyDriverDef

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;
}
Also used : WildflyDriverDef(org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)3 WildflyDriverDef (org.kie.workbench.common.screens.datasource.management.backend.integration.wildfly.WildflyDriverDef)3 DriverDef (org.kie.workbench.common.screens.datasource.management.model.DriverDef)1 DriverDeploymentInfo (org.kie.workbench.common.screens.datasource.management.model.DriverDeploymentInfo)1