Search in sources :

Example 51 with DataAccessException

use of com.centurylink.mdw.common.exception.DataAccessException in project mdw-designer by CenturyLinkCloud.

the class DesignerDataAccess method callTaskManager.

public String callTaskManager(String taskManagerUrl, String request) throws DataAccessException {
    try {
        HttpHelper httpHelper = currentServer.getHttpHelper(taskManagerUrl);
        String response = httpHelper.post(request);
        httpHelper.setConnectTimeout(getConnectTimeout());
        httpHelper.setReadTimeout(getReadTimeout());
        return response;
    } catch (IOException ex) {
        throw new DataAccessException(0, IOEXCEPTION, ex);
    }
}
Also used : IOException(java.io.IOException) HttpHelper(com.centurylink.mdw.common.utilities.HttpHelper) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Example 52 with DataAccessException

use of com.centurylink.mdw.common.exception.DataAccessException in project mdw-designer by CenturyLinkCloud.

the class DesignerDataAccess method importFromVcs.

public void importFromVcs(String mdwWebUrl) throws DataAccessException {
    try {
        HttpHelper httpHelper = currentServer.getHttpHelper(mdwWebUrl + "/Services/GitVcs/*");
        Map<String, String> hdrs = new HashMap<>();
        hdrs.put("request-query-string", "gitAction=pull");
        httpHelper.setHeaders(hdrs);
        httpHelper.setConnectTimeout(getConnectTimeout());
        httpHelper.setReadTimeout(getReadTimeout());
        httpHelper.post("{}");
    } catch (IOException ex) {
        throw new DataAccessException(0, IOEXCEPTION, ex);
    }
}
Also used : HashMap(java.util.HashMap) IOException(java.io.IOException) HttpHelper(com.centurylink.mdw.common.utilities.HttpHelper) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Example 53 with DataAccessException

use of com.centurylink.mdw.common.exception.DataAccessException in project mdw-designer by CenturyLinkCloud.

the class DesignerDataAccess method getServerSchemaVersion.

private int[] getServerSchemaVersion() throws DataAccessException, RemoteException {
    String response = this.engineCall("<_mdw_dbschema_version></_mdw_dbschema_version>");
    if (response.startsWith(ERROR))
        throw new DataAccessException("Failed to get database schema version from server");
    int k = response.indexOf(',');
    int[] versions = new int[2];
    if (k > 0) {
        versions[0] = Integer.parseInt(response.substring(0, k));
        versions[1] = Integer.parseInt(response.substring(k + 1));
    } else {
        versions[0] = Integer.parseInt(response);
        versions[1] = versions[0] >= DataAccess.schemaVersion52 ? versions[0] : DataAccess.schemaVersion4;
    }
    return versions;
}
Also used : DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Example 54 with DataAccessException

use of com.centurylink.mdw.common.exception.DataAccessException in project mdw-designer by CenturyLinkCloud.

the class WorkflowAccessRest method getVariableTypes.

public List<VariableTypeVO> getVariableTypes() throws DataAccessException {
    try {
        String variableTypesJson = getServer().invokeResourceService("BaseData/VariableTypes?format=json");
        JSONArray jsonArray = new JSONArray(variableTypesJson);
        List<VariableTypeVO> variableTypes = new ArrayList<VariableTypeVO>();
        for (int i = 0; i < jsonArray.length(); i++) variableTypes.add(new VariableTypeVO(jsonArray.getJSONObject(i)));
        return variableTypes;
    } catch (Exception ex) {
        throw new DataAccessException("Error retrieving variable types", ex);
    }
}
Also used : VariableTypeVO(com.centurylink.mdw.model.value.variable.VariableTypeVO) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) IOException(java.io.IOException) JSONException(org.json.JSONException) DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Example 55 with DataAccessException

use of com.centurylink.mdw.common.exception.DataAccessException in project mdw-designer by CenturyLinkCloud.

the class WorkflowAccessRest method getTaskCategories.

public List<TaskCategory> getTaskCategories() throws DataAccessException {
    try {
        String taskCategoriesJson = getServer().invokeResourceService("BaseData/TaskCategories?format=json");
        JSONArray jsonArray = new JSONArray(taskCategoriesJson);
        List<TaskCategory> taskCategories = new ArrayList<TaskCategory>();
        for (int i = 0; i < jsonArray.length(); i++) taskCategories.add(new TaskCategory(jsonArray.getJSONObject(i)));
        return taskCategories;
    } catch (Exception ex) {
        throw new DataAccessException("Error retrieving task categories", ex);
    }
}
Also used : TaskCategory(com.centurylink.mdw.model.data.task.TaskCategory) JSONArray(org.json.JSONArray) ArrayList(java.util.ArrayList) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException) IOException(java.io.IOException) JSONException(org.json.JSONException) DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Aggregations

DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)61 IOException (java.io.IOException)32 DataAccessOfflineException (com.centurylink.mdw.dataaccess.DataAccessOfflineException)25 JSONException (org.json.JSONException)21 XmlException (org.apache.xmlbeans.XmlException)19 RemoteException (java.rmi.RemoteException)18 JSONObject (org.json.JSONObject)12 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)10 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)10 HttpHelper (com.centurylink.mdw.common.utilities.HttpHelper)8 FileNotFoundException (java.io.FileNotFoundException)8 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)7 RestfulServer (com.centurylink.mdw.designer.utils.RestfulServer)6 PackageVO (com.centurylink.mdw.model.value.process.PackageVO)5 Graph (com.centurylink.mdw.designer.display.Graph)4 SubGraph (com.centurylink.mdw.designer.display.SubGraph)4 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)4 File (java.io.File)4 MDWStatusMessageDocument (com.centurylink.mdw.bpm.MDWStatusMessageDocument)3