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