Search in sources :

Example 1 with GbAppMapException

use of com.vmware.connectors.airwatch.exceptions.GbAppMapException in project connectors-workspace-one by vmware.

the class AirWatchController method toGreenBoxApp.

private GreenBoxApp toGreenBoxApp(JsonDocument document, String appName) {
    int RIGHT_APP_COUNT = 1;
    JSONArray jsonArray = document.read("$._embedded.entitlements");
    if (jsonArray.size() != RIGHT_APP_COUNT) {
        throw new GbAppMapException("Unable to map " + appName + " to a single GreenBox app");
    }
    return new GreenBoxApp(document.read("$._embedded.entitlements[0].name"), document.read("$._embedded.entitlements[0]._links.install.href"));
}
Also used : GreenBoxApp(com.vmware.connectors.airwatch.greenbox.GreenBoxApp) GbAppMapException(com.vmware.connectors.airwatch.exceptions.GbAppMapException) JSONArray(net.minidev.json.JSONArray)

Aggregations

GbAppMapException (com.vmware.connectors.airwatch.exceptions.GbAppMapException)1 GreenBoxApp (com.vmware.connectors.airwatch.greenbox.GreenBoxApp)1 JSONArray (net.minidev.json.JSONArray)1