http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java index 158edb0..471d7c5 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java @@ -68,17 +68,17 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce private static final org.apache.thrift.protocol.TField EXPERIMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("experimentId", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField CREATION_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("creationTime", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField LAST_UPDATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastUpdateTime", org.apache.thrift.protocol.TType.I64, (short)4); - private static final org.apache.thrift.protocol.TField PROCESS_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("processStatus", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final org.apache.thrift.protocol.TField PROCESS_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("processStatus", org.apache.thrift.protocol.TType.LIST, (short)5); private static final org.apache.thrift.protocol.TField PROCESS_DETAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("processDetail", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField APPLICATION_INTERFACE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationInterfaceId", org.apache.thrift.protocol.TType.STRING, (short)7); private static final org.apache.thrift.protocol.TField APPLICATION_DEPLOYMENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("applicationDeploymentId", org.apache.thrift.protocol.TType.STRING, (short)8); private static final org.apache.thrift.protocol.TField COMPUTE_RESOURCE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("computeResourceId", org.apache.thrift.protocol.TType.STRING, (short)9); private static final org.apache.thrift.protocol.TField PROCESS_INPUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("processInputs", org.apache.thrift.protocol.TType.LIST, (short)10); private static final org.apache.thrift.protocol.TField PROCESS_OUTPUTS_FIELD_DESC = new org.apache.thrift.protocol.TField("processOutputs", org.apache.thrift.protocol.TType.LIST, (short)11); - private static final org.apache.thrift.protocol.TField RESOURCE_SCHEDULE_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceSchedule", org.apache.thrift.protocol.TType.STRUCT, (short)12); + private static final org.apache.thrift.protocol.TField PROCESS_RESOURCE_SCHEDULE_FIELD_DESC = new org.apache.thrift.protocol.TField("processResourceSchedule", org.apache.thrift.protocol.TType.STRUCT, (short)12); private static final org.apache.thrift.protocol.TField TASKS_FIELD_DESC = new org.apache.thrift.protocol.TField("tasks", org.apache.thrift.protocol.TType.LIST, (short)13); private static final org.apache.thrift.protocol.TField TASK_DAG_FIELD_DESC = new org.apache.thrift.protocol.TField("taskDag", org.apache.thrift.protocol.TType.STRING, (short)14); - private static final org.apache.thrift.protocol.TField PROCESS_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("processError", org.apache.thrift.protocol.TType.STRUCT, (short)15); + private static final org.apache.thrift.protocol.TField PROCESS_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("processError", org.apache.thrift.protocol.TType.LIST, (short)15); private static final org.apache.thrift.protocol.TField GATEWAY_EXECUTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("gatewayExecutionId", org.apache.thrift.protocol.TType.STRING, (short)16); private static final org.apache.thrift.protocol.TField ENABLE_EMAIL_NOTIFICATION_FIELD_DESC = new org.apache.thrift.protocol.TField("enableEmailNotification", org.apache.thrift.protocol.TType.BOOL, (short)17); private static final org.apache.thrift.protocol.TField EMAIL_ADDRESSES_FIELD_DESC = new org.apache.thrift.protocol.TField("emailAddresses", org.apache.thrift.protocol.TType.LIST, (short)18); @@ -98,17 +98,17 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce private String experimentId; // required private long creationTime; // optional private long lastUpdateTime; // optional - private org.apache.airavata.model.status.ProcessStatus processStatus; // optional + private List<org.apache.airavata.model.status.ProcessStatus> processStatus; // optional private String processDetail; // optional private String applicationInterfaceId; // optional private String applicationDeploymentId; // optional private String computeResourceId; // optional private List<org.apache.airavata.model.application.io.InputDataObjectType> processInputs; // optional private List<org.apache.airavata.model.application.io.OutputDataObjectType> processOutputs; // optional - private org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel resourceSchedule; // optional + private org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel processResourceSchedule; // optional private List<org.apache.airavata.model.task.TaskModel> tasks; // optional private String taskDag; // optional - private org.apache.airavata.model.commons.ErrorModel processError; // optional + private List<org.apache.airavata.model.commons.ErrorModel> processError; // optional private String gatewayExecutionId; // optional private boolean enableEmailNotification; // optional private List<String> emailAddresses; // optional @@ -131,7 +131,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce COMPUTE_RESOURCE_ID((short)9, "computeResourceId"), PROCESS_INPUTS((short)10, "processInputs"), PROCESS_OUTPUTS((short)11, "processOutputs"), - RESOURCE_SCHEDULE((short)12, "resourceSchedule"), + PROCESS_RESOURCE_SCHEDULE((short)12, "processResourceSchedule"), TASKS((short)13, "tasks"), TASK_DAG((short)14, "taskDag"), PROCESS_ERROR((short)15, "processError"), @@ -179,8 +179,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce return PROCESS_INPUTS; case 11: // PROCESS_OUTPUTS return PROCESS_OUTPUTS; - case 12: // RESOURCE_SCHEDULE - return RESOURCE_SCHEDULE; + case 12: // PROCESS_RESOURCE_SCHEDULE + return PROCESS_RESOURCE_SCHEDULE; case 13: // TASKS return TASKS; case 14: // TASK_DAG @@ -248,7 +248,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce private static final int __ENABLEEMAILNOTIFICATION_ISSET_ID = 2; private static final int __GENERATECERT_ISSET_ID = 3; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.LAST_UPDATE_TIME,_Fields.PROCESS_STATUS,_Fields.PROCESS_DETAIL,_Fields.APPLICATION_INTERFACE_ID,_Fields.APPLICATION_DEPLOYMENT_ID,_Fields.COMPUTE_RESOURCE_ID,_Fields.PROCESS_INPUTS,_Fields.PROCESS_OUTPUTS,_Fields.RESOURCE_SCHEDULE,_Fields.TASKS,_Fields.TASK_DAG,_Fields.PROCESS_ERROR,_Fields.GATEWAY_EXECUTION_ID,_Fields.ENABLE_EMAIL_NOTIFICATION,_Fields.EMAIL_ADDRESSES,_Fields.STORAGE_RESOURCE_ID,_Fields.USER_DN,_Fields.GENERATE_CERT,_Fields.EXPERIMENT_DATA_DIR,_Fields.USER_NAME}; + private static final _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.LAST_UPDATE_TIME,_Fields.PROCESS_STATUS,_Fields.PROCESS_DETAIL,_Fields.APPLICATION_INTERFACE_ID,_Fields.APPLICATION_DEPLOYMENT_ID,_Fields.COMPUTE_RESOURCE_ID,_Fields.PROCESS_INPUTS,_Fields.PROCESS_OUTPUTS,_Fields.PROCESS_RESOURCE_SCHEDULE,_Fields.TASKS,_Fields.TASK_DAG,_Fields.PROCESS_ERROR,_Fields.GATEWAY_EXECUTION_ID,_Fields.ENABLE_EMAIL_NOTIFICATION,_Fields.EMAIL_ADDRESSES,_Fields.STORAGE_RESOURCE_ID,_Fields.USER_DN,_Fields.GENERATE_CERT,_Fields.EXPERIMENT_DATA_DIR,_Fields.USER_NAME}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -261,7 +261,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce tmpMap.put(_Fields.LAST_UPDATE_TIME, new org.apache.thrift.meta_data.FieldMetaData("lastUpdateTime", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.PROCESS_STATUS, new org.apache.thrift.meta_data.FieldMetaData("processStatus", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.status.ProcessStatus.class))); + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.status.ProcessStatus.class)))); tmpMap.put(_Fields.PROCESS_DETAIL, new org.apache.thrift.meta_data.FieldMetaData("processDetail", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.APPLICATION_INTERFACE_ID, new org.apache.thrift.meta_data.FieldMetaData("applicationInterfaceId", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -276,7 +277,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce tmpMap.put(_Fields.PROCESS_OUTPUTS, new org.apache.thrift.meta_data.FieldMetaData("processOutputs", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.application.io.OutputDataObjectType.class)))); - tmpMap.put(_Fields.RESOURCE_SCHEDULE, new org.apache.thrift.meta_data.FieldMetaData("resourceSchedule", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.PROCESS_RESOURCE_SCHEDULE, new org.apache.thrift.meta_data.FieldMetaData("processResourceSchedule", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel.class))); tmpMap.put(_Fields.TASKS, new org.apache.thrift.meta_data.FieldMetaData("tasks", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, @@ -284,7 +285,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce tmpMap.put(_Fields.TASK_DAG, new org.apache.thrift.meta_data.FieldMetaData("taskDag", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PROCESS_ERROR, new org.apache.thrift.meta_data.FieldMetaData("processError", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.commons.ErrorModel.class))); + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.apache.airavata.model.commons.ErrorModel.class)))); tmpMap.put(_Fields.GATEWAY_EXECUTION_ID, new org.apache.thrift.meta_data.FieldMetaData("gatewayExecutionId", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.ENABLE_EMAIL_NOTIFICATION, new org.apache.thrift.meta_data.FieldMetaData("enableEmailNotification", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -336,7 +338,11 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce this.creationTime = other.creationTime; this.lastUpdateTime = other.lastUpdateTime; if (other.isSetProcessStatus()) { - this.processStatus = new org.apache.airavata.model.status.ProcessStatus(other.processStatus); + List<org.apache.airavata.model.status.ProcessStatus> __this__processStatus = new ArrayList<org.apache.airavata.model.status.ProcessStatus>(other.processStatus.size()); + for (org.apache.airavata.model.status.ProcessStatus other_element : other.processStatus) { + __this__processStatus.add(new org.apache.airavata.model.status.ProcessStatus(other_element)); + } + this.processStatus = __this__processStatus; } if (other.isSetProcessDetail()) { this.processDetail = other.processDetail; @@ -364,8 +370,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } this.processOutputs = __this__processOutputs; } - if (other.isSetResourceSchedule()) { - this.resourceSchedule = new org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel(other.resourceSchedule); + if (other.isSetProcessResourceSchedule()) { + this.processResourceSchedule = new org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel(other.processResourceSchedule); } if (other.isSetTasks()) { List<org.apache.airavata.model.task.TaskModel> __this__tasks = new ArrayList<org.apache.airavata.model.task.TaskModel>(other.tasks.size()); @@ -378,7 +384,11 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce this.taskDag = other.taskDag; } if (other.isSetProcessError()) { - this.processError = new org.apache.airavata.model.commons.ErrorModel(other.processError); + List<org.apache.airavata.model.commons.ErrorModel> __this__processError = new ArrayList<org.apache.airavata.model.commons.ErrorModel>(other.processError.size()); + for (org.apache.airavata.model.commons.ErrorModel other_element : other.processError) { + __this__processError.add(new org.apache.airavata.model.commons.ErrorModel(other_element)); + } + this.processError = __this__processError; } if (other.isSetGatewayExecutionId()) { this.gatewayExecutionId = other.gatewayExecutionId; @@ -423,7 +433,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce this.computeResourceId = null; this.processInputs = null; this.processOutputs = null; - this.resourceSchedule = null; + this.processResourceSchedule = null; this.tasks = null; this.taskDag = null; this.processError = null; @@ -529,11 +539,26 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTUPDATETIME_ISSET_ID, value); } - public org.apache.airavata.model.status.ProcessStatus getProcessStatus() { + public int getProcessStatusSize() { + return (this.processStatus == null) ? 0 : this.processStatus.size(); + } + + public java.util.Iterator<org.apache.airavata.model.status.ProcessStatus> getProcessStatusIterator() { + return (this.processStatus == null) ? null : this.processStatus.iterator(); + } + + public void addToProcessStatus(org.apache.airavata.model.status.ProcessStatus elem) { + if (this.processStatus == null) { + this.processStatus = new ArrayList<org.apache.airavata.model.status.ProcessStatus>(); + } + this.processStatus.add(elem); + } + + public List<org.apache.airavata.model.status.ProcessStatus> getProcessStatus() { return this.processStatus; } - public void setProcessStatus(org.apache.airavata.model.status.ProcessStatus processStatus) { + public void setProcessStatus(List<org.apache.airavata.model.status.ProcessStatus> processStatus) { this.processStatus = processStatus; } @@ -720,26 +745,26 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } } - public org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel getResourceSchedule() { - return this.resourceSchedule; + public org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel getProcessResourceSchedule() { + return this.processResourceSchedule; } - public void setResourceSchedule(org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel resourceSchedule) { - this.resourceSchedule = resourceSchedule; + public void setProcessResourceSchedule(org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel processResourceSchedule) { + this.processResourceSchedule = processResourceSchedule; } - public void unsetResourceSchedule() { - this.resourceSchedule = null; + public void unsetProcessResourceSchedule() { + this.processResourceSchedule = null; } - /** Returns true if field resourceSchedule is set (has been assigned a value) and false otherwise */ - public boolean isSetResourceSchedule() { - return this.resourceSchedule != null; + /** Returns true if field processResourceSchedule is set (has been assigned a value) and false otherwise */ + public boolean isSetProcessResourceSchedule() { + return this.processResourceSchedule != null; } - public void setResourceScheduleIsSet(boolean value) { + public void setProcessResourceScheduleIsSet(boolean value) { if (!value) { - this.resourceSchedule = null; + this.processResourceSchedule = null; } } @@ -804,11 +829,26 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } } - public org.apache.airavata.model.commons.ErrorModel getProcessError() { + public int getProcessErrorSize() { + return (this.processError == null) ? 0 : this.processError.size(); + } + + public java.util.Iterator<org.apache.airavata.model.commons.ErrorModel> getProcessErrorIterator() { + return (this.processError == null) ? null : this.processError.iterator(); + } + + public void addToProcessError(org.apache.airavata.model.commons.ErrorModel elem) { + if (this.processError == null) { + this.processError = new ArrayList<org.apache.airavata.model.commons.ErrorModel>(); + } + this.processError.add(elem); + } + + public List<org.apache.airavata.model.commons.ErrorModel> getProcessError() { return this.processError; } - public void setProcessError(org.apache.airavata.model.commons.ErrorModel processError) { + public void setProcessError(List<org.apache.airavata.model.commons.ErrorModel> processError) { this.processError = processError; } @@ -1062,7 +1102,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce if (value == null) { unsetProcessStatus(); } else { - setProcessStatus((org.apache.airavata.model.status.ProcessStatus)value); + setProcessStatus((List<org.apache.airavata.model.status.ProcessStatus>)value); } break; @@ -1114,11 +1154,11 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } break; - case RESOURCE_SCHEDULE: + case PROCESS_RESOURCE_SCHEDULE: if (value == null) { - unsetResourceSchedule(); + unsetProcessResourceSchedule(); } else { - setResourceSchedule((org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel)value); + setProcessResourceSchedule((org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel)value); } break; @@ -1142,7 +1182,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce if (value == null) { unsetProcessError(); } else { - setProcessError((org.apache.airavata.model.commons.ErrorModel)value); + setProcessError((List<org.apache.airavata.model.commons.ErrorModel>)value); } break; @@ -1248,8 +1288,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce case PROCESS_OUTPUTS: return getProcessOutputs(); - case RESOURCE_SCHEDULE: - return getResourceSchedule(); + case PROCESS_RESOURCE_SCHEDULE: + return getProcessResourceSchedule(); case TASKS: return getTasks(); @@ -1317,8 +1357,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce return isSetProcessInputs(); case PROCESS_OUTPUTS: return isSetProcessOutputs(); - case RESOURCE_SCHEDULE: - return isSetResourceSchedule(); + case PROCESS_RESOURCE_SCHEDULE: + return isSetProcessResourceSchedule(); case TASKS: return isSetTasks(); case TASK_DAG: @@ -1457,12 +1497,12 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce return false; } - boolean this_present_resourceSchedule = true && this.isSetResourceSchedule(); - boolean that_present_resourceSchedule = true && that.isSetResourceSchedule(); - if (this_present_resourceSchedule || that_present_resourceSchedule) { - if (!(this_present_resourceSchedule && that_present_resourceSchedule)) + boolean this_present_processResourceSchedule = true && this.isSetProcessResourceSchedule(); + boolean that_present_processResourceSchedule = true && that.isSetProcessResourceSchedule(); + if (this_present_processResourceSchedule || that_present_processResourceSchedule) { + if (!(this_present_processResourceSchedule && that_present_processResourceSchedule)) return false; - if (!this.resourceSchedule.equals(that.resourceSchedule)) + if (!this.processResourceSchedule.equals(that.processResourceSchedule)) return false; } @@ -1627,10 +1667,10 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce if (present_processOutputs) list.add(processOutputs); - boolean present_resourceSchedule = true && (isSetResourceSchedule()); - list.add(present_resourceSchedule); - if (present_resourceSchedule) - list.add(resourceSchedule); + boolean present_processResourceSchedule = true && (isSetProcessResourceSchedule()); + list.add(present_processResourceSchedule); + if (present_processResourceSchedule) + list.add(processResourceSchedule); boolean present_tasks = true && (isSetTasks()); list.add(present_tasks); @@ -1808,12 +1848,12 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce return lastComparison; } } - lastComparison = Boolean.valueOf(isSetResourceSchedule()).compareTo(other.isSetResourceSchedule()); + lastComparison = Boolean.valueOf(isSetProcessResourceSchedule()).compareTo(other.isSetProcessResourceSchedule()); if (lastComparison != 0) { return lastComparison; } - if (isSetResourceSchedule()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceSchedule, other.resourceSchedule); + if (isSetProcessResourceSchedule()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.processResourceSchedule, other.processResourceSchedule); if (lastComparison != 0) { return lastComparison; } @@ -2045,13 +2085,13 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } first = false; } - if (isSetResourceSchedule()) { + if (isSetProcessResourceSchedule()) { if (!first) sb.append(", "); - sb.append("resourceSchedule:"); - if (this.resourceSchedule == null) { + sb.append("processResourceSchedule:"); + if (this.processResourceSchedule == null) { sb.append("null"); } else { - sb.append(this.resourceSchedule); + sb.append(this.processResourceSchedule); } first = false; } @@ -2172,14 +2212,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } // check for sub-struct validity - if (processStatus != null) { - processStatus.validate(); - } - if (resourceSchedule != null) { - resourceSchedule.validate(); - } - if (processError != null) { - processError.validate(); + if (processResourceSchedule != null) { + processResourceSchedule.validate(); } } @@ -2252,9 +2286,19 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } break; case 5: // PROCESS_STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.processStatus = new org.apache.airavata.model.status.ProcessStatus(); - struct.processStatus.read(iprot); + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.processStatus = new ArrayList<org.apache.airavata.model.status.ProcessStatus>(_list0.size); + org.apache.airavata.model.status.ProcessStatus _elem1; + for (int _i2 = 0; _i2 < _list0.size; ++_i2) + { + _elem1 = new org.apache.airavata.model.status.ProcessStatus(); + _elem1.read(iprot); + struct.processStatus.add(_elem1); + } + iprot.readListEnd(); + } struct.setProcessStatusIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -2295,14 +2339,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce case 10: // PROCESS_INPUTS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - struct.processInputs = new ArrayList<org.apache.airavata.model.application.io.InputDataObjectType>(_list0.size); - org.apache.airavata.model.application.io.InputDataObjectType _elem1; - for (int _i2 = 0; _i2 < _list0.size; ++_i2) + org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); + struct.processInputs = new ArrayList<org.apache.airavata.model.application.io.InputDataObjectType>(_list3.size); + org.apache.airavata.model.application.io.InputDataObjectType _elem4; + for (int _i5 = 0; _i5 < _list3.size; ++_i5) { - _elem1 = new org.apache.airavata.model.application.io.InputDataObjectType(); - _elem1.read(iprot); - struct.processInputs.add(_elem1); + _elem4 = new org.apache.airavata.model.application.io.InputDataObjectType(); + _elem4.read(iprot); + struct.processInputs.add(_elem4); } iprot.readListEnd(); } @@ -2314,14 +2358,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce case 11: // PROCESS_OUTPUTS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); - struct.processOutputs = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list3.size); - org.apache.airavata.model.application.io.OutputDataObjectType _elem4; - for (int _i5 = 0; _i5 < _list3.size; ++_i5) + org.apache.thrift.protocol.TList _list6 = iprot.readListBegin(); + struct.processOutputs = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list6.size); + org.apache.airavata.model.application.io.OutputDataObjectType _elem7; + for (int _i8 = 0; _i8 < _list6.size; ++_i8) { - _elem4 = new org.apache.airavata.model.application.io.OutputDataObjectType(); - _elem4.read(iprot); - struct.processOutputs.add(_elem4); + _elem7 = new org.apache.airavata.model.application.io.OutputDataObjectType(); + _elem7.read(iprot); + struct.processOutputs.add(_elem7); } iprot.readListEnd(); } @@ -2330,11 +2374,11 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 12: // RESOURCE_SCHEDULE + case 12: // PROCESS_RESOURCE_SCHEDULE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.resourceSchedule = new org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel(); - struct.resourceSchedule.read(iprot); - struct.setResourceScheduleIsSet(true); + struct.processResourceSchedule = new org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel(); + struct.processResourceSchedule.read(iprot); + struct.setProcessResourceScheduleIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -2342,14 +2386,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce case 13: // TASKS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list6 = iprot.readListBegin(); - struct.tasks = new ArrayList<org.apache.airavata.model.task.TaskModel>(_list6.size); - org.apache.airavata.model.task.TaskModel _elem7; - for (int _i8 = 0; _i8 < _list6.size; ++_i8) + org.apache.thrift.protocol.TList _list9 = iprot.readListBegin(); + struct.tasks = new ArrayList<org.apache.airavata.model.task.TaskModel>(_list9.size); + org.apache.airavata.model.task.TaskModel _elem10; + for (int _i11 = 0; _i11 < _list9.size; ++_i11) { - _elem7 = new org.apache.airavata.model.task.TaskModel(); - _elem7.read(iprot); - struct.tasks.add(_elem7); + _elem10 = new org.apache.airavata.model.task.TaskModel(); + _elem10.read(iprot); + struct.tasks.add(_elem10); } iprot.readListEnd(); } @@ -2367,9 +2411,19 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } break; case 15: // PROCESS_ERROR - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.processError = new org.apache.airavata.model.commons.ErrorModel(); - struct.processError.read(iprot); + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list12 = iprot.readListBegin(); + struct.processError = new ArrayList<org.apache.airavata.model.commons.ErrorModel>(_list12.size); + org.apache.airavata.model.commons.ErrorModel _elem13; + for (int _i14 = 0; _i14 < _list12.size; ++_i14) + { + _elem13 = new org.apache.airavata.model.commons.ErrorModel(); + _elem13.read(iprot); + struct.processError.add(_elem13); + } + iprot.readListEnd(); + } struct.setProcessErrorIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -2394,13 +2448,13 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce case 18: // EMAIL_ADDRESSES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list9 = iprot.readListBegin(); - struct.emailAddresses = new ArrayList<String>(_list9.size); - String _elem10; - for (int _i11 = 0; _i11 < _list9.size; ++_i11) + org.apache.thrift.protocol.TList _list15 = iprot.readListBegin(); + struct.emailAddresses = new ArrayList<String>(_list15.size); + String _elem16; + for (int _i17 = 0; _i17 < _list15.size; ++_i17) { - _elem10 = iprot.readString(); - struct.emailAddresses.add(_elem10); + _elem16 = iprot.readString(); + struct.emailAddresses.add(_elem16); } iprot.readListEnd(); } @@ -2485,7 +2539,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce if (struct.processStatus != null) { if (struct.isSetProcessStatus()) { oprot.writeFieldBegin(PROCESS_STATUS_FIELD_DESC); - struct.processStatus.write(oprot); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.processStatus.size())); + for (org.apache.airavata.model.status.ProcessStatus _iter18 : struct.processStatus) + { + _iter18.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } } @@ -2522,9 +2583,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce oprot.writeFieldBegin(PROCESS_INPUTS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.processInputs.size())); - for (org.apache.airavata.model.application.io.InputDataObjectType _iter12 : struct.processInputs) + for (org.apache.airavata.model.application.io.InputDataObjectType _iter19 : struct.processInputs) { - _iter12.write(oprot); + _iter19.write(oprot); } oprot.writeListEnd(); } @@ -2536,19 +2597,19 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce oprot.writeFieldBegin(PROCESS_OUTPUTS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.processOutputs.size())); - for (org.apache.airavata.model.application.io.OutputDataObjectType _iter13 : struct.processOutputs) + for (org.apache.airavata.model.application.io.OutputDataObjectType _iter20 : struct.processOutputs) { - _iter13.write(oprot); + _iter20.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } } - if (struct.resourceSchedule != null) { - if (struct.isSetResourceSchedule()) { - oprot.writeFieldBegin(RESOURCE_SCHEDULE_FIELD_DESC); - struct.resourceSchedule.write(oprot); + if (struct.processResourceSchedule != null) { + if (struct.isSetProcessResourceSchedule()) { + oprot.writeFieldBegin(PROCESS_RESOURCE_SCHEDULE_FIELD_DESC); + struct.processResourceSchedule.write(oprot); oprot.writeFieldEnd(); } } @@ -2557,9 +2618,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce oprot.writeFieldBegin(TASKS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.tasks.size())); - for (org.apache.airavata.model.task.TaskModel _iter14 : struct.tasks) + for (org.apache.airavata.model.task.TaskModel _iter21 : struct.tasks) { - _iter14.write(oprot); + _iter21.write(oprot); } oprot.writeListEnd(); } @@ -2576,7 +2637,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce if (struct.processError != null) { if (struct.isSetProcessError()) { oprot.writeFieldBegin(PROCESS_ERROR_FIELD_DESC); - struct.processError.write(oprot); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.processError.size())); + for (org.apache.airavata.model.commons.ErrorModel _iter22 : struct.processError) + { + _iter22.write(oprot); + } + oprot.writeListEnd(); + } oprot.writeFieldEnd(); } } @@ -2597,9 +2665,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce oprot.writeFieldBegin(EMAIL_ADDRESSES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.emailAddresses.size())); - for (String _iter15 : struct.emailAddresses) + for (String _iter23 : struct.emailAddresses) { - oprot.writeString(_iter15); + oprot.writeString(_iter23); } oprot.writeListEnd(); } @@ -2686,7 +2754,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce if (struct.isSetProcessOutputs()) { optionals.set(8); } - if (struct.isSetResourceSchedule()) { + if (struct.isSetProcessResourceSchedule()) { optionals.set(9); } if (struct.isSetTasks()) { @@ -2730,7 +2798,13 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce oprot.writeI64(struct.lastUpdateTime); } if (struct.isSetProcessStatus()) { - struct.processStatus.write(oprot); + { + oprot.writeI32(struct.processStatus.size()); + for (org.apache.airavata.model.status.ProcessStatus _iter24 : struct.processStatus) + { + _iter24.write(oprot); + } + } } if (struct.isSetProcessDetail()) { oprot.writeString(struct.processDetail); @@ -2747,30 +2821,30 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce if (struct.isSetProcessInputs()) { { oprot.writeI32(struct.processInputs.size()); - for (org.apache.airavata.model.application.io.InputDataObjectType _iter16 : struct.processInputs) + for (org.apache.airavata.model.application.io.InputDataObjectType _iter25 : struct.processInputs) { - _iter16.write(oprot); + _iter25.write(oprot); } } } if (struct.isSetProcessOutputs()) { { oprot.writeI32(struct.processOutputs.size()); - for (org.apache.airavata.model.application.io.OutputDataObjectType _iter17 : struct.processOutputs) + for (org.apache.airavata.model.application.io.OutputDataObjectType _iter26 : struct.processOutputs) { - _iter17.write(oprot); + _iter26.write(oprot); } } } - if (struct.isSetResourceSchedule()) { - struct.resourceSchedule.write(oprot); + if (struct.isSetProcessResourceSchedule()) { + struct.processResourceSchedule.write(oprot); } if (struct.isSetTasks()) { { oprot.writeI32(struct.tasks.size()); - for (org.apache.airavata.model.task.TaskModel _iter18 : struct.tasks) + for (org.apache.airavata.model.task.TaskModel _iter27 : struct.tasks) { - _iter18.write(oprot); + _iter27.write(oprot); } } } @@ -2778,7 +2852,13 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce oprot.writeString(struct.taskDag); } if (struct.isSetProcessError()) { - struct.processError.write(oprot); + { + oprot.writeI32(struct.processError.size()); + for (org.apache.airavata.model.commons.ErrorModel _iter28 : struct.processError) + { + _iter28.write(oprot); + } + } } if (struct.isSetGatewayExecutionId()) { oprot.writeString(struct.gatewayExecutionId); @@ -2789,9 +2869,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce if (struct.isSetEmailAddresses()) { { oprot.writeI32(struct.emailAddresses.size()); - for (String _iter19 : struct.emailAddresses) + for (String _iter29 : struct.emailAddresses) { - oprot.writeString(_iter19); + oprot.writeString(_iter29); } } } @@ -2829,8 +2909,17 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce struct.setLastUpdateTimeIsSet(true); } if (incoming.get(2)) { - struct.processStatus = new org.apache.airavata.model.status.ProcessStatus(); - struct.processStatus.read(iprot); + { + org.apache.thrift.protocol.TList _list30 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.processStatus = new ArrayList<org.apache.airavata.model.status.ProcessStatus>(_list30.size); + org.apache.airavata.model.status.ProcessStatus _elem31; + for (int _i32 = 0; _i32 < _list30.size; ++_i32) + { + _elem31 = new org.apache.airavata.model.status.ProcessStatus(); + _elem31.read(iprot); + struct.processStatus.add(_elem31); + } + } struct.setProcessStatusIsSet(true); } if (incoming.get(3)) { @@ -2851,47 +2940,47 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } if (incoming.get(7)) { { - org.apache.thrift.protocol.TList _list20 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.processInputs = new ArrayList<org.apache.airavata.model.application.io.InputDataObjectType>(_list20.size); - org.apache.airavata.model.application.io.InputDataObjectType _elem21; - for (int _i22 = 0; _i22 < _list20.size; ++_i22) + org.apache.thrift.protocol.TList _list33 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.processInputs = new ArrayList<org.apache.airavata.model.application.io.InputDataObjectType>(_list33.size); + org.apache.airavata.model.application.io.InputDataObjectType _elem34; + for (int _i35 = 0; _i35 < _list33.size; ++_i35) { - _elem21 = new org.apache.airavata.model.application.io.InputDataObjectType(); - _elem21.read(iprot); - struct.processInputs.add(_elem21); + _elem34 = new org.apache.airavata.model.application.io.InputDataObjectType(); + _elem34.read(iprot); + struct.processInputs.add(_elem34); } } struct.setProcessInputsIsSet(true); } if (incoming.get(8)) { { - org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.processOutputs = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list23.size); - org.apache.airavata.model.application.io.OutputDataObjectType _elem24; - for (int _i25 = 0; _i25 < _list23.size; ++_i25) + org.apache.thrift.protocol.TList _list36 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.processOutputs = new ArrayList<org.apache.airavata.model.application.io.OutputDataObjectType>(_list36.size); + org.apache.airavata.model.application.io.OutputDataObjectType _elem37; + for (int _i38 = 0; _i38 < _list36.size; ++_i38) { - _elem24 = new org.apache.airavata.model.application.io.OutputDataObjectType(); - _elem24.read(iprot); - struct.processOutputs.add(_elem24); + _elem37 = new org.apache.airavata.model.application.io.OutputDataObjectType(); + _elem37.read(iprot); + struct.processOutputs.add(_elem37); } } struct.setProcessOutputsIsSet(true); } if (incoming.get(9)) { - struct.resourceSchedule = new org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel(); - struct.resourceSchedule.read(iprot); - struct.setResourceScheduleIsSet(true); + struct.processResourceSchedule = new org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel(); + struct.processResourceSchedule.read(iprot); + struct.setProcessResourceScheduleIsSet(true); } if (incoming.get(10)) { { - org.apache.thrift.protocol.TList _list26 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.tasks = new ArrayList<org.apache.airavata.model.task.TaskModel>(_list26.size); - org.apache.airavata.model.task.TaskModel _elem27; - for (int _i28 = 0; _i28 < _list26.size; ++_i28) + org.apache.thrift.protocol.TList _list39 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.tasks = new ArrayList<org.apache.airavata.model.task.TaskModel>(_list39.size); + org.apache.airavata.model.task.TaskModel _elem40; + for (int _i41 = 0; _i41 < _list39.size; ++_i41) { - _elem27 = new org.apache.airavata.model.task.TaskModel(); - _elem27.read(iprot); - struct.tasks.add(_elem27); + _elem40 = new org.apache.airavata.model.task.TaskModel(); + _elem40.read(iprot); + struct.tasks.add(_elem40); } } struct.setTasksIsSet(true); @@ -2901,8 +2990,17 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce struct.setTaskDagIsSet(true); } if (incoming.get(12)) { - struct.processError = new org.apache.airavata.model.commons.ErrorModel(); - struct.processError.read(iprot); + { + org.apache.thrift.protocol.TList _list42 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.processError = new ArrayList<org.apache.airavata.model.commons.ErrorModel>(_list42.size); + org.apache.airavata.model.commons.ErrorModel _elem43; + for (int _i44 = 0; _i44 < _list42.size; ++_i44) + { + _elem43 = new org.apache.airavata.model.commons.ErrorModel(); + _elem43.read(iprot); + struct.processError.add(_elem43); + } + } struct.setProcessErrorIsSet(true); } if (incoming.get(13)) { @@ -2915,13 +3013,13 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel, Proce } if (incoming.get(15)) { { - org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.emailAddresses = new ArrayList<String>(_list29.size); - String _elem30; - for (int _i31 = 0; _i31 < _list29.size; ++_i31) + org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.emailAddresses = new ArrayList<String>(_list45.size); + String _elem46; + for (int _i47 = 0; _i47 < _list45.size; ++_i47) { - _elem30 = iprot.readString(); - struct.emailAddresses.add(_elem30); + _elem46 = iprot.readString(); + struct.emailAddresses.add(_elem46); } } struct.setEmailAddressesIsSet(true);
http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java index 321d31c..ef18235 100644 --- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java +++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/user/UserProfile.java @@ -23,14 +23,32 @@ */ package org.apache.airavata.model.user; -import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; -import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; import javax.annotation.Generated; -import java.util.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) /** http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java ---------------------------------------------------------------------- diff --git a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java index d1b25b0..07f38e4 100644 --- a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java +++ b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java @@ -103,7 +103,7 @@ public class ExperimentModelUtil { processModel.setUserDn(configData.getUserDN()); ComputationalResourceSchedulingModel scheduling = configData.getComputationalResourceScheduling(); if (scheduling != null){ - processModel.setResourceSchedule(scheduling); + processModel.setProcessResourceSchedule(scheduling); processModel.setComputeResourceId(scheduling.getResourceHostId()); } } http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java index 0ed836f..0015a21 100644 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java +++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java @@ -449,7 +449,7 @@ public class GFacUtils { log.error("Error while getting job submissiont sub task model", e); } - ComputationalResourceSchedulingModel scheduling = processModel.getResourceSchedule(); + ComputationalResourceSchedulingModel scheduling = processModel.getProcessResourceSchedule(); if (scheduling != null) { int totalNodeCount = scheduling.getNodeCount(); int totalCPUCount = scheduling.getTotalCPUCount(); http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java index 4181b47..0e8c1f0 100644 --- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java +++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/context/ProcessContext.java @@ -46,6 +46,7 @@ import org.apache.curator.framework.CuratorFramework; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -162,11 +163,11 @@ public class ProcessContext { public String getWorkingDir() { if (workingDir == null) { - if (processModel.getResourceSchedule().getStaticWorkingDir() != null){ - workingDir = processModel.getResourceSchedule().getStaticWorkingDir(); + if (processModel.getProcessResourceSchedule().getStaticWorkingDir() != null){ + workingDir = processModel.getProcessResourceSchedule().getStaticWorkingDir(); }else { String scratchLocation = null; - String overrideScratchLocation = processModel.getResourceSchedule().getOverrideScratchLocation(); + String overrideScratchLocation = processModel.getProcessResourceSchedule().getOverrideScratchLocation(); if (overrideScratchLocation != null && !overrideScratchLocation.equals("")) { scratchLocation = overrideScratchLocation; } else { @@ -361,19 +362,27 @@ public class ProcessContext { } public ProcessState getProcessState() { - return processModel.getProcessStatus().getState(); + if(processModel.getProcessStatus() != null && processModel.getProcessStatus().size() > 0) + return processModel.getProcessStatus().get(0).getState(); + else + return null; } public void setProcessStatus(ProcessStatus status) { if (status != null) { log.info("expId: {}, processId: {} :- Process status changed {} -> {}", getExperimentId(), processId, getProcessState().name(), status.getState().name()); - processModel.setProcessStatus(status); + List<ProcessStatus> processStatuses = new ArrayList<>(); + processStatuses.add(status); + processModel.setProcessStatus(processStatuses); } } public ProcessStatus getProcessStatus(){ - return processModel.getProcessStatus(); + if(processModel.getProcessStatus() != null) + return processModel.getProcessStatus().get(0); + else + return null; } public String getComputeResourceId() { http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java index 6ed6de3..4aaf93b 100644 --- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java +++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/Factory.java @@ -335,7 +335,7 @@ public abstract class Factory { try { ProcessModel processModel = processContext.getProcessModel(); String loginUserName = null; - String overrideLoginUserName = processModel.getResourceSchedule().getOverrideLoginUserName(); + String overrideLoginUserName = processModel.getProcessResourceSchedule().getOverrideLoginUserName(); if (overrideLoginUserName != null && !overrideLoginUserName.equals("")) { loginUserName = overrideLoginUserName; } else { @@ -352,7 +352,7 @@ public abstract class Factory { try { ProcessModel processModel = processContext.getProcessModel(); String scratchLocation = null; - String overrideScratchLocation = processModel.getResourceSchedule().getOverrideScratchLocation(); + String overrideScratchLocation = processModel.getProcessResourceSchedule().getOverrideScratchLocation(); if (overrideScratchLocation != null && !overrideScratchLocation.equals("")) { scratchLocation = overrideScratchLocation; } else { http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStreamingTask.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStreamingTask.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStreamingTask.java index da29a26..ebe3bab 100644 --- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStreamingTask.java +++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DataStreamingTask.java @@ -76,7 +76,7 @@ public class DataStreamingTask implements Task { if (processOutput != null) { if (processOutput.isOutputStreaming()) { // stream output periodically - ComputationalResourceSchedulingModel resourceSchedule = taskContext.getParentProcessContext().getProcessModel().getResourceSchedule(); + ComputationalResourceSchedulingModel resourceSchedule = taskContext.getParentProcessContext().getProcessModel().getProcessResourceSchedule(); int wallTimeLimit = resourceSchedule.getWallTimeLimit(); if (wallTimeLimit > 10) { int period = wallTimeLimit / 10; http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ApplicationProcessor.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ApplicationProcessor.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ApplicationProcessor.java index d9ef7e2..d6b32e7 100644 --- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ApplicationProcessor.java +++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ApplicationProcessor.java @@ -108,7 +108,7 @@ public class ApplicationProcessor { // do nothing } - int totalThreadCount = context.getProcessModel().getResourceSchedule().getNumberOfThreads(); + int totalThreadCount = context.getProcessModel().getProcessResourceSchedule().getNumberOfThreads(); // we take it as threads per processes if(totalThreadCount > 0){ ThreadsPerProcessType tpp = ThreadsPerProcessType.Factory.newInstance(); http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ResourceProcessor.java ---------------------------------------------------------------------- diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ResourceProcessor.java b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ResourceProcessor.java index a5586db..ea2ccdc 100644 --- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ResourceProcessor.java +++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/utils/bes/ResourceProcessor.java @@ -37,7 +37,7 @@ public class ResourceProcessor { ProcessModel processModel = context.getProcessModel(); if (processModel != null) { try { - ComputationalResourceSchedulingModel crs = processModel.getResourceSchedule(); + ComputationalResourceSchedulingModel crs = processModel.getProcessResourceSchedule(); if (crs.getTotalPhysicalMemory() > 0) { RangeValueType rangeType = new RangeValueType(); http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java index 95ff86e..74bd2db 100644 --- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java +++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/utils/OrchestratorUtils.java @@ -124,7 +124,7 @@ public class OrchestratorUtils { public static String getLoginUserName(OrchestratorContext context, ProcessModel processModel, String gatewayId) throws RegistryException { try { String loginUserName = null; - String overrideLoginUserName = processModel.getResourceSchedule().getOverrideLoginUserName(); + String overrideLoginUserName = processModel.getProcessResourceSchedule().getOverrideLoginUserName(); if (overrideLoginUserName != null && !overrideLoginUserName.equals("")) { loginUserName = overrideLoginUserName; } else { @@ -141,7 +141,7 @@ public class OrchestratorUtils { public static String getScratchLocation(OrchestratorContext context, ProcessModel processModel, String gatewayId) throws RegistryException { try { String scratchLocation = null; - String overrideScratchLocation = processModel.getResourceSchedule().getOverrideScratchLocation(); + String overrideScratchLocation = processModel.getProcessResourceSchedule().getOverrideScratchLocation(); if (overrideScratchLocation != null && !overrideScratchLocation.equals("")) { scratchLocation = overrideScratchLocation; } else { http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java index 212426d..173552e 100644 --- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java +++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/validator/impl/BatchQueueValidator.java @@ -82,7 +82,7 @@ public class BatchQueueValidator implements JobMetadataValidator { if (processModel == null) { computeResource = appCatalog.getComputeResource().getComputeResource(experiment.getUserConfigurationData().getComputationalResourceScheduling().getResourceHostId()); } else { - computeResource = appCatalog.getComputeResource().getComputeResource(processModel.getResourceSchedule().getResourceHostId()); + computeResource = appCatalog.getComputeResource().getComputeResource(processModel.getProcessResourceSchedule().getResourceHostId()); } List<BatchQueue> batchQueues = computeResource.getBatchQueues(); http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java index 3e057cb..73a6aef 100644 --- a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java +++ b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/cpi/impl/SimpleOrchestratorImpl.java @@ -275,7 +275,7 @@ public class SimpleOrchestratorImpl extends AbstractOrchestrator{ try { ExperimentCatalog experimentCatalog = orchestratorContext.getRegistry().getExperimentCatalog(); AppCatalog appCatalog = orchestratorContext.getRegistry().getAppCatalog(); - ComputationalResourceSchedulingModel resourceSchedule = processModel.getResourceSchedule(); + ComputationalResourceSchedulingModel resourceSchedule = processModel.getProcessResourceSchedule(); String userGivenQueueName = resourceSchedule.getQueueName(); int userGivenWallTime = resourceSchedule.getWallTimeLimit(); String resourceHostId = resourceSchedule.getResourceHostId(); http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java ---------------------------------------------------------------------- diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java index 1a6ac25..725a0b1 100644 --- a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java +++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java @@ -330,7 +330,7 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface { ApplicationDeploymentDescription applicationDeploymentDescription = getAppDeployment(processModel, applicationId); processModel.setApplicationDeploymentId(applicationDeploymentDescription.getAppDeploymentId()); // set compute resource id to process model, default we set the same in the user preferred compute host id - processModel.setComputeResourceId(processModel.getResourceSchedule().getResourceHostId()); + processModel.setComputeResourceId(processModel.getProcessResourceSchedule().getResourceHostId()); experimentCatalog.update(ExperimentCatalogModelType.PROCESS, processModel,processModel.getProcessId()); return orchestrator.launchProcess(processModel, airavataCredStoreToken); } catch (Exception e) { @@ -353,8 +353,8 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface { IllegalAccessException { Map<String, String> moduleIdFilter = new HashMap<String, String>(); moduleIdFilter.put(AppCatAbstractResource.ApplicationDeploymentConstants.APP_MODULE_ID, selectedModuleId); - if (processModel.getResourceSchedule() != null && processModel.getResourceSchedule().getResourceHostId() != null) { - moduleIdFilter.put(AppCatAbstractResource.ApplicationDeploymentConstants.COMPUTE_HOST_ID, processModel.getResourceSchedule().getResourceHostId()); + if (processModel.getProcessResourceSchedule() != null && processModel.getProcessResourceSchedule().getResourceHostId() != null) { + moduleIdFilter.put(AppCatAbstractResource.ApplicationDeploymentConstants.COMPUTE_HOST_ID, processModel.getProcessResourceSchedule().getResourceHostId()); } List<ApplicationDeploymentDescription> applicationDeployements = appCatalog.getApplicationDeployment().getApplicationDeployements(moduleIdFilter); Map<ComputeResourceDescription, ApplicationDeploymentDescription> deploymentMap = new HashMap<ComputeResourceDescription, ApplicationDeploymentDescription>(); http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/Main.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/Main.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/Main.java deleted file mode 100644 index e509b47..0000000 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/Main.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ -package org.apache.airavata.registry.core; - -import org.apache.airavata.model.user.NSFDemographics; -import org.apache.airavata.model.workspace.Gateway; -import org.apache.airavata.model.workspace.GatewayApprovalStatus; -import org.apache.airavata.model.workspace.Notification; -import org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity; -import org.apache.airavata.registry.core.entities.workspacecatalog.NotificationEntity; -import org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity; -import org.apache.airavata.registry.core.repositories.workspacecatalog.GatewayRepository; -import org.apache.airavata.registry.core.repositories.workspacecatalog.NotificationRepository; -import org.apache.airavata.registry.core.utils.JPAUtils; -import org.apache.airavata.registry.core.utils.ObjectMapperSingleton; -import org.dozer.Mapper; - -import java.io.IOException; -import java.util.UUID; - -public class Main { - - public static void main(String[] args) throws IOException { - org.apache.airavata.model.user.UserProfile userProfile = new org.apache.airavata.model.user.UserProfile(); - userProfile.setAiravataInternalUserId("I don't know"); - NSFDemographics nsfDemographics = new NSFDemographics(); - nsfDemographics.setGender("sdfsf"); - userProfile.setNsfDemographics(nsfDemographics); - - Mapper mapper = ObjectMapperSingleton.getInstance(); - UserProfileEntity destObject = - mapper.map(userProfile, UserProfileEntity.class); - - System.out.println(destObject.getNsfDemographics().getGender()); - - userProfile = mapper.map(destObject, org.apache.airavata.model.user.UserProfile.class); - System.out.println(userProfile.getNsfDemographics().getGender()); - - JPAUtils.getEntityManager(); - - Gateway gateway = new Gateway(); - gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE); - gateway.setGatewayId("test.com" + System.currentTimeMillis()); - gateway.setDomain("test.com"); - - GatewayRepository gatewayRepository = new GatewayRepository(Gateway.class, GatewayEntity.class); - gateway = gatewayRepository.create(gateway); - System.out.println(gateway.getGatewayId()); - - Notification notification = new Notification(); - notification.setNotificationId(UUID.randomUUID().toString()); - notification.setGatewayId(gateway.getGatewayId()); - - NotificationRepository notificationRepository = new NotificationRepository(Notification.class, NotificationEntity.class); - notificationRepository.create(notification); - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java index 796253f..a0686f8 100644 --- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ExperimentEntity.java @@ -47,6 +47,8 @@ public class ExperimentEntity { private UserConfigurationEntity userConfigurationData; + private List<ProcessEntity> processes; + @Id @Column(name = "EXPERIMENT_ID") public String getExperimentId() { @@ -210,4 +212,13 @@ public class ExperimentEntity { public void setExperimentStatuses(List<ExperimentStatusEntity> experimentStatuses) { this.experimentStatuses = experimentStatuses; } + + @OneToMany(targetEntity = ProcessEntity.class, cascade = CascadeType.ALL, mappedBy = "experiment") + public List<ProcessEntity> getProcesses() { + return processes; + } + + public void setProcesses(List<ProcessEntity> processes) { + this.processes = processes; + } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java new file mode 100644 index 0000000..d7c6cca --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessEntity.java @@ -0,0 +1,266 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + + +import javax.persistence.*; +import java.util.List; + +@Entity +@Table(name = "PROCESS") +public class ProcessEntity { + private String processId; + private String experimentId; + private long creationTime; + private long lastUpdateTime; + private String processDetail; + private String applicationInterfaceId; + private String applicationDeploymentId; + private String computeResourceId; + private String taskDag; + private String gatewayExecutionId; + private boolean enableEmailNotification; + private List<String> emailAddresses; + private String storageResourceId; + private String userDn; + private boolean generateCert; + private String experimentDataDir; + private String userName; + + private List<ProcessStatusEntity> processStatus; + private List<ProcessErrorEntity> processError; + private List<ProcessInputEntity> processInputs; + private List<ProcessOutputEntity> processOutputs; + private ProcessResourceSchedulingEntity processResourceSchedule; + + private ExperimentEntity experiment; + + @Id + @Column(name = "PROCESS_ID") + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + @Column(name = "EXPERIMENT_ID") + public String getExperimentId() { + return experimentId; + } + + public void setExperimentId(String experimentId) { + this.experimentId = experimentId; + } + + @Column(name = "CREATION_TIME") + public long getCreationTime() { + return creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + } + + @Column(name = "LAST_UPDATE_TIME") + public long getLastUpdateTime() { + return lastUpdateTime; + } + + public void setLastUpdateTime(long lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + + @Column(name = "PROCESS_DETAIL") + public String getProcessDetail() { + return processDetail; + } + + public void setProcessDetail(String processDetail) { + this.processDetail = processDetail; + } + + @Column(name = "APPLICATION_INTERFACE_ID") + public String getApplicationInterfaceId() { + return applicationInterfaceId; + } + + public void setApplicationInterfaceId(String applicationInterfaceId) { + this.applicationInterfaceId = applicationInterfaceId; + } + + @Column(name = "APPLICATION_DEPLOYMENT_ID") + public String getApplicationDeploymentId() { + return applicationDeploymentId; + } + + public void setApplicationDeploymentId(String applicationDeploymentId) { + this.applicationDeploymentId = applicationDeploymentId; + } + + + @Column(name = "COMPUTE_RESOURCE_ID") + public String getComputeResourceId() { + return computeResourceId; + } + + public void setComputeResourceId(String computeResourceId) { + this.computeResourceId = computeResourceId; + } + + @Column(name = "TASK_DAG") + public String getTaskDag() { + return taskDag; + } + + public void setTaskDag(String taskDag) { + this.taskDag = taskDag; + } + + @Column(name = "GATEWAY_EXECUTION_ID") + public String getGatewayExecutionId() { + return gatewayExecutionId; + } + + public void setGatewayExecutionId(String gatewayExecutionId) { + this.gatewayExecutionId = gatewayExecutionId; + } + + @Column(name = "ENABLE_EMAIL_NOTIFICATION") + public boolean isEnableEmailNotification() { + return enableEmailNotification; + } + + public void setEnableEmailNotification(boolean enableEmailNotification) { + this.enableEmailNotification = enableEmailNotification; + } + + @ElementCollection + @CollectionTable(name="PROCESS_EMAIL", joinColumns = @JoinColumn(name="PROCESS_ID")) + public List<String> getEmailAddresses() { + return emailAddresses; + } + + public void setEmailAddresses(List<String> emailAddresses) { + this.emailAddresses = emailAddresses; + } + + @Column(name = "STORAGE_RESOURCE_ID") + public String getStorageResourceId() { + return storageResourceId; + } + + public void setStorageResourceId(String storageResourceId) { + this.storageResourceId = storageResourceId; + } + + @Column(name = "USER_DN") + public String getUserDn() { + return userDn; + } + + public void setUserDn(String userDn) { + this.userDn = userDn; + } + + @Column(name = "GENERATE_CERT") + public boolean isGenerateCert() { + return generateCert; + } + + public void setGenerateCert(boolean generateCert) { + this.generateCert = generateCert; + } + + @Column(name = "EXPERIMENT_DATA_DIR") + public String getExperimentDataDir() { + return experimentDataDir; + } + + public void setExperimentDataDir(String experimentDataDir) { + this.experimentDataDir = experimentDataDir; + } + + @Column(name = "USER_NAME") + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + @OneToMany(targetEntity = ProcessStatusEntity.class, cascade = CascadeType.ALL, mappedBy = "process") + public List<ProcessStatusEntity> getProcessStatus() { + return processStatus; + } + + public void setProcessStatus(List<ProcessStatusEntity> processStatus) { + this.processStatus = processStatus; + } + + @OneToMany(targetEntity = ProcessErrorEntity.class, cascade = CascadeType.ALL, mappedBy = "process") + public List<ProcessErrorEntity> getProcessError() { + return processError; + } + + public void setProcessError(List<ProcessErrorEntity> processError) { + this.processError = processError; + } + + @OneToMany(targetEntity = ProcessInputEntity.class, cascade = CascadeType.ALL, mappedBy = "process") + public List<ProcessInputEntity> getProcessInputs() { + return processInputs; + } + + public void setProcessInputs(List<ProcessInputEntity> processInputs) { + this.processInputs = processInputs; + } + + @OneToMany(targetEntity = ProcessOutputEntity.class, cascade = CascadeType.ALL, mappedBy = "process") + public List<ProcessOutputEntity> getProcessOutputs() { + return processOutputs; + } + + public void setProcessOutputs(List<ProcessOutputEntity> processOutputs) { + this.processOutputs = processOutputs; + } + + @OneToOne(targetEntity = ProcessResourceSchedulingEntity.class, cascade = CascadeType.ALL, mappedBy = "process") + public ProcessResourceSchedulingEntity getProcessResourceSchedule() { + return processResourceSchedule; + } + + public void setProcessResourceSchedule(ProcessResourceSchedulingEntity proceeResourceSchedule) { + this.processResourceSchedule = proceeResourceSchedule; + } + + @ManyToOne(targetEntity = ExperimentEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID") + public ExperimentEntity getExperiment() { + return experiment; + } + + public void setExperiment(ExperimentEntity experiment) { + this.experiment = experiment; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/171c0425/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessErrorEntity.java ---------------------------------------------------------------------- diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessErrorEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessErrorEntity.java new file mode 100644 index 0000000..bae331f --- /dev/null +++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/expcatalog/ProcessErrorEntity.java @@ -0,0 +1,118 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ +package org.apache.airavata.registry.core.entities.expcatalog; + +import javax.persistence.*; +import java.util.List; + +@Entity +@Table(name = "PROCESS_ERROR") +@IdClass(ProcessErrorPK.class) +public class ProcessErrorEntity { + private String errorId; + private String processId; + private long creationTime; + private String actualErrorMessage; + private String userFriendlyMessage; + private boolean transientOrPersistent; + private List<String> rootCauseErrorIdList; + + private ProcessEntity process; + + @Id + @Column(name = "ERROR_ID") + public String getErrorId() { + return errorId; + } + + public void setErrorId(String errorId) { + this.errorId = errorId; + } + + @Id + @Column(name = "PROCESS_ID") + public String getProcessId() { + return processId; + } + + public void setProcessId(String processId) { + this.processId = processId; + } + + @Column(name = "CREATION_TIME") + public long getCreationTime() { + return creationTime; + } + + public void setCreationTime(long creationTime) { + this.creationTime = creationTime; + } + + @Column(name = "ACTUAL_ERROR_MESSAGE") + public String getActualErrorMessage() { + return actualErrorMessage; + } + + public void setActualErrorMessage(String actualErrorMessage) { + this.actualErrorMessage = actualErrorMessage; + } + + @Column(name = "USER_FRIENDLY_MESSAGE") + public String getUserFriendlyMessage() { + return userFriendlyMessage; + } + + public void setUserFriendlyMessage(String userFriendlyMessage) { + this.userFriendlyMessage = userFriendlyMessage; + } + + + @Column(name = "TRANSIENT_OR_PERSISTENT") + public boolean isTransientOrPersistent() { + return transientOrPersistent; + } + + public void setTransientOrPersistent(boolean transientOrPersistent) { + this.transientOrPersistent = transientOrPersistent; + } + + + @ElementCollection + @CollectionTable(name="EXPERIMENT_ERROR_ROOT_CAUSE_ERROR_ID", joinColumns = @JoinColumn(name="ERROR_ID")) + public List<String> getRootCauseErrorIdList() { + return rootCauseErrorIdList; + } + + public void setRootCauseErrorIdList(List<String> rootCauseErrorIdList) { + this.rootCauseErrorIdList = rootCauseErrorIdList; + } + + + @ManyToOne(targetEntity = ProcessEntity.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID") + public ProcessEntity getProcess() { + return process; + } + + public void setProcess(ProcessEntity process) { + this.process = process; + } +} \ No newline at end of file
