You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2014/09/26 22:04:07 UTC
[1/4] removing recursively calling publish
Repository: airavata
Updated Branches:
refs/heads/messaging_framework cc71bac08 -> 255dd9e39
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowIdentity.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowIdentity.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowIdentity.java
deleted file mode 100644
index 7c57a56..0000000
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowIdentity.java
+++ /dev/null
@@ -1,492 +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.
- */
-
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.airavata.model.messaging.event;
-
-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.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 org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class WorkflowIdentity implements org.apache.thrift.TBase<WorkflowIdentity, WorkflowIdentity._Fields>, java.io.Serializable, Cloneable, Comparable<WorkflowIdentity> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkflowIdentity");
-
- private static final org.apache.thrift.protocol.TField WORKFLOW_NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowNodeId", org.apache.thrift.protocol.TType.STRING, (short)1);
- 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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new WorkflowIdentityStandardSchemeFactory());
- schemes.put(TupleScheme.class, new WorkflowIdentityTupleSchemeFactory());
- }
-
- private String workflowNodeId; // required
- private String experimentId; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- WORKFLOW_NODE_ID((short)1, "workflowNodeId"),
- EXPERIMENT_ID((short)2, "experimentId");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // WORKFLOW_NODE_ID
- return WORKFLOW_NODE_ID;
- case 2: // EXPERIMENT_ID
- return EXPERIMENT_ID;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- 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);
- tmpMap.put(_Fields.WORKFLOW_NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("workflowNodeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkflowIdentity.class, metaDataMap);
- }
-
- public WorkflowIdentity() {
- }
-
- public WorkflowIdentity(
- String workflowNodeId,
- String experimentId)
- {
- this();
- this.workflowNodeId = workflowNodeId;
- this.experimentId = experimentId;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public WorkflowIdentity(WorkflowIdentity other) {
- if (other.isSetWorkflowNodeId()) {
- this.workflowNodeId = other.workflowNodeId;
- }
- if (other.isSetExperimentId()) {
- this.experimentId = other.experimentId;
- }
- }
-
- public WorkflowIdentity deepCopy() {
- return new WorkflowIdentity(this);
- }
-
- @Override
- public void clear() {
- this.workflowNodeId = null;
- this.experimentId = null;
- }
-
- public String getWorkflowNodeId() {
- return this.workflowNodeId;
- }
-
- public void setWorkflowNodeId(String workflowNodeId) {
- this.workflowNodeId = workflowNodeId;
- }
-
- public void unsetWorkflowNodeId() {
- this.workflowNodeId = null;
- }
-
- /** Returns true if field workflowNodeId is set (has been assigned a value) and false otherwise */
- public boolean isSetWorkflowNodeId() {
- return this.workflowNodeId != null;
- }
-
- public void setWorkflowNodeIdIsSet(boolean value) {
- if (!value) {
- this.workflowNodeId = null;
- }
- }
-
- public String getExperimentId() {
- return this.experimentId;
- }
-
- public void setExperimentId(String experimentId) {
- this.experimentId = experimentId;
- }
-
- public void unsetExperimentId() {
- this.experimentId = null;
- }
-
- /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
- public boolean isSetExperimentId() {
- return this.experimentId != null;
- }
-
- public void setExperimentIdIsSet(boolean value) {
- if (!value) {
- this.experimentId = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case WORKFLOW_NODE_ID:
- if (value == null) {
- unsetWorkflowNodeId();
- } else {
- setWorkflowNodeId((String)value);
- }
- break;
-
- case EXPERIMENT_ID:
- if (value == null) {
- unsetExperimentId();
- } else {
- setExperimentId((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case WORKFLOW_NODE_ID:
- return getWorkflowNodeId();
-
- case EXPERIMENT_ID:
- return getExperimentId();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case WORKFLOW_NODE_ID:
- return isSetWorkflowNodeId();
- case EXPERIMENT_ID:
- return isSetExperimentId();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof WorkflowIdentity)
- return this.equals((WorkflowIdentity)that);
- return false;
- }
-
- public boolean equals(WorkflowIdentity that) {
- if (that == null)
- return false;
-
- boolean this_present_workflowNodeId = true && this.isSetWorkflowNodeId();
- boolean that_present_workflowNodeId = true && that.isSetWorkflowNodeId();
- if (this_present_workflowNodeId || that_present_workflowNodeId) {
- if (!(this_present_workflowNodeId && that_present_workflowNodeId))
- return false;
- if (!this.workflowNodeId.equals(that.workflowNodeId))
- return false;
- }
-
- boolean this_present_experimentId = true && this.isSetExperimentId();
- boolean that_present_experimentId = true && that.isSetExperimentId();
- if (this_present_experimentId || that_present_experimentId) {
- if (!(this_present_experimentId && that_present_experimentId))
- return false;
- if (!this.experimentId.equals(that.experimentId))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(WorkflowIdentity other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetWorkflowNodeId()).compareTo(other.isSetWorkflowNodeId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetWorkflowNodeId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowNodeId, other.workflowNodeId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetExperimentId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("WorkflowIdentity(");
- boolean first = true;
-
- sb.append("workflowNodeId:");
- if (this.workflowNodeId == null) {
- sb.append("null");
- } else {
- sb.append(this.workflowNodeId);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("experimentId:");
- if (this.experimentId == null) {
- sb.append("null");
- } else {
- sb.append(this.experimentId);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!isSetWorkflowNodeId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'workflowNodeId' is unset! Struct:" + toString());
- }
-
- if (!isSetExperimentId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class WorkflowIdentityStandardSchemeFactory implements SchemeFactory {
- public WorkflowIdentityStandardScheme getScheme() {
- return new WorkflowIdentityStandardScheme();
- }
- }
-
- private static class WorkflowIdentityStandardScheme extends StandardScheme<WorkflowIdentity> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, WorkflowIdentity struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // WORKFLOW_NODE_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.workflowNodeId = iprot.readString();
- struct.setWorkflowNodeIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // EXPERIMENT_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.experimentId = iprot.readString();
- struct.setExperimentIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, WorkflowIdentity struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.workflowNodeId != null) {
- oprot.writeFieldBegin(WORKFLOW_NODE_ID_FIELD_DESC);
- oprot.writeString(struct.workflowNodeId);
- oprot.writeFieldEnd();
- }
- if (struct.experimentId != null) {
- oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
- oprot.writeString(struct.experimentId);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class WorkflowIdentityTupleSchemeFactory implements SchemeFactory {
- public WorkflowIdentityTupleScheme getScheme() {
- return new WorkflowIdentityTupleScheme();
- }
- }
-
- private static class WorkflowIdentityTupleScheme extends TupleScheme<WorkflowIdentity> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, WorkflowIdentity struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.workflowNodeId);
- oprot.writeString(struct.experimentId);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, WorkflowIdentity struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.workflowNodeId = iprot.readString();
- struct.setWorkflowNodeIdIsSet(true);
- struct.experimentId = iprot.readString();
- struct.setExperimentIdIsSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowNodeStatusChangeEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowNodeStatusChangeEvent.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowNodeStatusChangeEvent.java
index 305ff19..519d8cc 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowNodeStatusChangeEvent.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowNodeStatusChangeEvent.java
@@ -62,7 +62,7 @@ import org.slf4j.LoggerFactory;
}
private org.apache.airavata.model.workspace.experiment.WorkflowNodeState state; // required
- private WorkflowIdentity workflowNodeIdentity; // required
+ private WorkflowIdentifier workflowNodeIdentity; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -136,7 +136,7 @@ import org.slf4j.LoggerFactory;
tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.airavata.model.workspace.experiment.WorkflowNodeState.class)));
tmpMap.put(_Fields.WORKFLOW_NODE_IDENTITY, new org.apache.thrift.meta_data.FieldMetaData("workflowNodeIdentity", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkflowIdentity.class)));
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, WorkflowIdentifier.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkflowNodeStatusChangeEvent.class, metaDataMap);
}
@@ -146,7 +146,7 @@ import org.slf4j.LoggerFactory;
public WorkflowNodeStatusChangeEvent(
org.apache.airavata.model.workspace.experiment.WorkflowNodeState state,
- WorkflowIdentity workflowNodeIdentity)
+ WorkflowIdentifier workflowNodeIdentity)
{
this();
this.state = state;
@@ -161,7 +161,7 @@ import org.slf4j.LoggerFactory;
this.state = other.state;
}
if (other.isSetWorkflowNodeIdentity()) {
- this.workflowNodeIdentity = new WorkflowIdentity(other.workflowNodeIdentity);
+ this.workflowNodeIdentity = new WorkflowIdentifier(other.workflowNodeIdentity);
}
}
@@ -206,11 +206,11 @@ import org.slf4j.LoggerFactory;
}
}
- public WorkflowIdentity getWorkflowNodeIdentity() {
+ public WorkflowIdentifier getWorkflowNodeIdentity() {
return this.workflowNodeIdentity;
}
- public void setWorkflowNodeIdentity(WorkflowIdentity workflowNodeIdentity) {
+ public void setWorkflowNodeIdentity(WorkflowIdentifier workflowNodeIdentity) {
this.workflowNodeIdentity = workflowNodeIdentity;
}
@@ -243,7 +243,7 @@ import org.slf4j.LoggerFactory;
if (value == null) {
unsetWorkflowNodeIdentity();
} else {
- setWorkflowNodeIdentity((WorkflowIdentity)value);
+ setWorkflowNodeIdentity((WorkflowIdentifier)value);
}
break;
@@ -443,7 +443,7 @@ import org.slf4j.LoggerFactory;
break;
case 2: // WORKFLOW_NODE_IDENTITY
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.workflowNodeIdentity = new WorkflowIdentity();
+ struct.workflowNodeIdentity = new WorkflowIdentifier();
struct.workflowNodeIdentity.read(iprot);
struct.setWorkflowNodeIdentityIsSet(true);
} else {
@@ -499,7 +499,7 @@ import org.slf4j.LoggerFactory;
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.state = org.apache.airavata.model.workspace.experiment.WorkflowNodeState.findByValue(iprot.readI32());
struct.setStateIsSet(true);
- struct.workflowNodeIdentity = new WorkflowIdentity();
+ struct.workflowNodeIdentity = new WorkflowIdentifier();
struct.workflowNodeIdentity.read(iprot);
struct.setWorkflowNodeIdentityIsSet(true);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/thrift-interface-descriptions/messagingEvents.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/messagingEvents.thrift b/airavata-api/thrift-interface-descriptions/messagingEvents.thrift
index 8eaddcb..aceca83 100644
--- a/airavata-api/thrift-interface-descriptions/messagingEvents.thrift
+++ b/airavata-api/thrift-interface-descriptions/messagingEvents.thrift
@@ -45,17 +45,17 @@ struct ExperimentStatusChangeEvent {
2: required string experimentId;
}
-struct WorkflowIdentity {
+struct WorkflowIdentifier {
1: required string workflowNodeId;
2: required string experimentId;
}
struct WorkflowNodeStatusChangeEvent {
1: required experimentModel.WorkflowNodeState state;
- 2: required WorkflowIdentity workflowNodeIdentity;
+ 2: required WorkflowIdentifier workflowNodeIdentity;
}
-struct TaskIdentity {
+struct TaskIdentifier {
1: required string taskId;
2: required string workflowNodeId;
3: required string experimentId;
@@ -63,15 +63,20 @@ struct TaskIdentity {
struct TaskStatusChangeEvent {
1: required experimentModel.TaskState state;
- 2: required TaskIdentity taskIdentity;
+ 2: required TaskIdentifier taskIdentity;
+}
+
+struct TaskStatusChangeRequestEvent {
+ 1: required experimentModel.TaskState state;
+ 2: required TaskIdentifier taskIdentity;
}
struct TaskOutputChangeEvent {
1: required list<experimentModel.DataObjectType> output;
- 2: required TaskIdentity taskIdentity;
+ 2: required TaskIdentifier taskIdentity;
}
-struct JobIdentity {
+struct JobIdentifier {
1: required string jobId;
2: required string taskId;
3: required string workflowNodeId;
@@ -92,8 +97,12 @@ struct JobIdentity {
struct JobStatusChangeEvent {
1: required experimentModel.JobState state;
- 2: required JobIdentity jobIdentity;
-// 3: required JobMonitor jobMonitor;
+ 2: required JobIdentifier jobIdentity;
+}
+
+struct JobStatusChangeRequestEvent {
+ 1: required experimentModel.JobState state;
+ 2: required JobIdentifier jobIdentity;
}
struct Message {
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/airavata-server.properties b/modules/configuration/server/src/main/resources/airavata-server.properties
index 9e54f9f..d303dbd 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -190,7 +190,7 @@ connection.name=xsede
activity.listeners=org.apache.airavata.gfac.core.monitor.AiravataJobStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataTaskStatusUpdator,org.apache.airavata.gfac.core.monitor.AiravataWorkflowNodeStatusUpdator,org.apache.airavata.api.server.listener.AiravataExperimentStatusUpdator,org.apache.airavata.gfac.core.monitor.GfacInternalStatusUpdator,org.apache.airavata.workflow.engine.util.ProxyMonitorPublisher
publish.rabbitmq=false
activity.publisher=org.apache.airavata.messaging.core.impl.RabbitMQPublisher
-rabbitmq.broker.url=http://localhost
+rabbitmq.broker.url=amqp://localhost:5672
rabbitmq.exchange.name=airavata_rabbitmq_exchange
###---------------------------Orchestrator module Configurations---------------------------###
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 75f5694..c70c8a8 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -57,7 +57,9 @@ import org.apache.airavata.model.appcatalog.appinterface.InputDataObjectType;
import org.apache.airavata.model.appcatalog.appinterface.OutputDataObjectType;
import org.apache.airavata.model.appcatalog.computeresource.*;
import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
+import org.apache.airavata.model.messaging.event.JobIdentifier;
import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
+import org.apache.airavata.model.messaging.event.TaskIdentifier;
import org.apache.airavata.model.messaging.event.TaskStatusChangeEvent;
import org.apache.airavata.model.workspace.experiment.*;
import org.apache.airavata.registry.api.AiravataRegistry2;
@@ -128,8 +130,11 @@ public class BetterGfacImpl implements GFac {
try {
String[] listenerClassList = ServerSettings.getActivityListeners();
String activityPublisher = ServerSettings.getActivityPublisher();
- Class<? extends Publisher> aPublisher = Class.forName(activityPublisher).asSubclass(Publisher.class);
- Publisher rabbitMQPublisher = aPublisher.newInstance();
+ Publisher rabbitMQPublisher = null;
+ if (ServerSettings.isRabbitMqPublishEnabled()){
+ Class<? extends Publisher> aPublisher = Class.forName(activityPublisher).asSubclass(Publisher.class);
+ rabbitMQPublisher = aPublisher.newInstance();
+ }
for (String listenerClass : listenerClassList) {
Class<? extends AbstractActivityListener> aClass = Class.forName(listenerClass).asSubclass(AbstractActivityListener.class);
AbstractActivityListener abstractActivityListener = aClass.newInstance();
@@ -556,7 +561,7 @@ public class BetterGfacImpl implements GFac {
// jobExecutionContext.getTaskData().getTaskID()),
// TaskState.FAILED
// ));
- org.apache.airavata.model.messaging.event.JobIdentity jobIdentity = new org.apache.airavata.model.messaging.event.JobIdentity(
+ JobIdentifier jobIdentity = new JobIdentifier(
jobExecutionContext.getJobDetails().getJobID(), jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
@@ -567,7 +572,7 @@ public class BetterGfacImpl implements GFac {
// monitorPublisher
// .publish(new ExperimentStatusChangedEvent(new ExperimentIdentity(jobExecutionContext.getExperimentID()), ExperimentState.FAILED));
// Updating the task status if there's any task associated
- org.apache.airavata.model.messaging.event.TaskIdentity taskIdentity = new org.apache.airavata.model.messaging.event.TaskIdentity(jobExecutionContext.getTaskData().getTaskID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
monitorPublisher.publish(new TaskStatusChangeEvent(TaskState.FAILED, taskIdentity));
@@ -618,7 +623,7 @@ public class BetterGfacImpl implements GFac {
// jobExecutionContext.getTaskData().getTaskID()),
// TaskState.FAILED
// ));
- org.apache.airavata.model.messaging.event.JobIdentity jobIdentity = new org.apache.airavata.model.messaging.event.JobIdentity(
+ JobIdentifier jobIdentity = new JobIdentifier(
jobExecutionContext.getJobDetails().getJobID(),jobExecutionContext.getTaskData().getTaskID(),jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
monitorPublisher.publish(new JobStatusChangeEvent(JobState.FAILED, jobIdentity));
@@ -627,7 +632,7 @@ public class BetterGfacImpl implements GFac {
+ "NullPointerException occurred because at this point there might not have Job Created", e1, e);
//monitorPublisher.publish(new ExperimentStatusChangedEvent(new ExperimentIdentity(jobExecutionContext.getExperimentID()), ExperimentState.FAILED));
// Updating the task status if there's any task associated
- org.apache.airavata.model.messaging.event.TaskIdentity taskIdentity = new org.apache.airavata.model.messaging.event.TaskIdentity(jobExecutionContext.getTaskData().getTaskID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
monitorPublisher.publish(new TaskStatusChangeEvent(TaskState.FAILED, taskIdentity));
@@ -805,7 +810,7 @@ public class BetterGfacImpl implements GFac {
// ExperimentStatusChangedEvent(new ExperimentIdentity(jobExecutionContext.getExperimentID()),
// ExperimentState.COMPLETED));
// Updating the task status if there's any task associated
- org.apache.airavata.model.messaging.event.TaskIdentity taskIdentity = new org.apache.airavata.model.messaging.event.TaskIdentity(jobExecutionContext.getTaskData().getTaskID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
monitorPublisher.publish(new TaskStatusChangeEvent(TaskState.COMPLETED, taskIdentity));
@@ -934,7 +939,7 @@ public class BetterGfacImpl implements GFac {
// ExperimentState.COMPLETED));
// Updating the task status if there's any task associated
- org.apache.airavata.model.messaging.event.TaskIdentity taskIdentity = new org.apache.airavata.model.messaging.event.TaskIdentity(jobExecutionContext.getTaskData().getTaskID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
monitorPublisher.publish(new TaskStatusChangeEvent(TaskState.COMPLETED, taskIdentity));
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java
index 4a58f68..9062df9 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/GFacImpl.java
@@ -57,9 +57,9 @@ import org.apache.airavata.gfac.core.provider.GFacProvider;
import org.apache.airavata.gfac.core.scheduler.HostScheduler;
import org.apache.airavata.gfac.core.states.GfacExperimentState;
import org.apache.airavata.gfac.core.utils.GFacUtils;
-import org.apache.airavata.model.messaging.event.JobIdentity;
+import org.apache.airavata.model.messaging.event.JobIdentifier;
import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
-import org.apache.airavata.model.messaging.event.TaskIdentity;
+import org.apache.airavata.model.messaging.event.TaskIdentifier;
import org.apache.airavata.model.messaging.event.TaskStatusChangeEvent;
import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.model.workspace.experiment.Experiment;
@@ -326,7 +326,7 @@ public class GFacImpl implements GFac {
}
} catch (Exception e) {
try {
- JobIdentity jobIdentity = new JobIdentity(jobExecutionContext.getJobDetails().getJobID(),
+ JobIdentifier jobIdentity = new JobIdentifier(jobExecutionContext.getJobDetails().getJobID(),
jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
@@ -338,7 +338,7 @@ public class GFacImpl implements GFac {
// monitorPublisher
// .publish(new ExperimentStatusChangedEvent(new ExperimentIdentity(jobExecutionContext.getExperimentID()), ExperimentState.FAILED));
// Updating the task status if there's any task associated
- TaskIdentity taskIdentity = new TaskIdentity(jobExecutionContext.getTaskData().getTaskID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
monitorPublisher.publish(new TaskStatusChangeEvent(TaskState.FAILED, taskIdentity));
@@ -458,7 +458,7 @@ public class GFacImpl implements GFac {
// ExperimentStatusChangedEvent(new ExperimentIdentity(jobExecutionContext.getExperimentID()),
// ExperimentState.COMPLETED));
// Updating the task status if there's any task associated
- TaskIdentity taskIdentity = new TaskIdentity(jobExecutionContext.getTaskData().getTaskID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
monitorPublisher.publish(new TaskStatusChangeEvent(TaskState.COMPLETED, taskIdentity));
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java
index c31aee3..784973e 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataJobStatusUpdator.java
@@ -27,7 +27,9 @@ import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.common.utils.listener.AbstractActivityListener;
import org.apache.airavata.messaging.core.MessageContext;
import org.apache.airavata.messaging.core.Publisher;
+import org.apache.airavata.messaging.core.impl.RabbitMQPublisher;
import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
+import org.apache.airavata.model.messaging.event.JobStatusChangeRequestEvent;
import org.apache.airavata.model.messaging.event.MessageType;
import org.apache.airavata.model.workspace.experiment.JobDetails;
import org.apache.airavata.model.workspace.experiment.JobState;
@@ -57,7 +59,7 @@ public class AiravataJobStatusUpdator implements AbstractActivityListener {
@Subscribe
- public void updateRegistry(JobStatusChangeEvent jobStatus) throws Exception{
+ public void updateRegistry(JobStatusChangeRequestEvent jobStatus) throws Exception{
/* Here we need to parse the jobStatus message and update
the registry accordingly, for now we are just printing to standard Out
*/
@@ -68,10 +70,10 @@ public class AiravataJobStatusUpdator implements AbstractActivityListener {
String jobID = jobStatus.getJobIdentity().getJobId();
updateJobStatus(taskID, jobID, state);
logger.debug("Publishing job status for "+jobStatus.getJobIdentity().getJobId()+":"+state.toString());
- monitorPublisher.publish(new JobStatusChangeEvent(jobStatus.getState(), jobStatus.getJobIdentity()));
- JobStatusChangeEvent changeEvent = new JobStatusChangeEvent(jobStatus.getState(), jobStatus.getJobIdentity());
+ JobStatusChangeEvent event = new JobStatusChangeEvent(jobStatus.getState(), jobStatus.getJobIdentity());
+ monitorPublisher.publish(event);
String messageId = AiravataUtils.getId("JOB");
- MessageContext msgCntxt = new MessageContext(changeEvent, MessageType.JOB, messageId);
+ MessageContext msgCntxt = new MessageContext(event, MessageType.JOB, messageId);
msgCntxt.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
if ( ServerSettings.isRabbitMqPublishEnabled()){
publisher.publish(msgCntxt);
@@ -84,7 +86,7 @@ public class AiravataJobStatusUpdator implements AbstractActivityListener {
}
public void updateJobStatus(String taskId, String jobID, JobState state) throws Exception {
- logger.debug("Updating job status for "+jobID+":"+state.toString());
+ logger.info("Updating job status for " + jobID + ":" + state.toString());
CompositeIdentifier ids = new CompositeIdentifier(taskId, jobID);
JobDetails details = (JobDetails)airavataRegistry.get(RegistryModelType.JOB_DETAIL, ids);
if(details == null) {
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java
index c9a9b03..4e44372 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataTaskStatusUpdator.java
@@ -27,10 +27,7 @@ import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.common.utils.listener.AbstractActivityListener;
import org.apache.airavata.messaging.core.MessageContext;
import org.apache.airavata.messaging.core.Publisher;
-import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
-import org.apache.airavata.model.messaging.event.MessageType;
-import org.apache.airavata.model.messaging.event.TaskIdentity;
-import org.apache.airavata.model.messaging.event.TaskStatusChangeEvent;
+import org.apache.airavata.model.messaging.event.*;
import org.apache.airavata.model.workspace.experiment.TaskDetails;
import org.apache.airavata.model.workspace.experiment.TaskState;
import org.apache.airavata.registry.cpi.Registry;
@@ -53,17 +50,26 @@ public class AiravataTaskStatusUpdator implements AbstractActivityListener {
public void setAiravataRegistry(Registry airavataRegistry) {
this.airavataRegistry = airavataRegistry;
}
-//
-// @Subscribe
-// public void setupTaskStatus(TaskStatusChangeRequest taskStatus){
-// try {
-// updateTaskStatus(taskStatus.getIdentity().getTaskId(), taskStatus.getState());
-// logger.debug("Publishing task status for "+taskStatus.getIdentity().getTaskId()+":"+taskStatus.getState().toString());
-// monitorPublisher.publish(new TaskStatusChangedEvent(taskStatus.getIdentity(),taskStatus.getState()));
-// } catch (Exception e) {
-// logger.error("Error persisting data" + e.getLocalizedMessage(), e);
-// }
-// }
+
+ @Subscribe
+ public void setupTaskStatus(TaskStatusChangeRequestEvent taskStatus) throws Exception{
+ try {
+ updateTaskStatus(taskStatus.getTaskIdentity().getTaskId(), taskStatus.getState());
+ logger.debug("Publishing task status for "+taskStatus.getTaskIdentity().getTaskId()+":"+taskStatus.getState().toString());
+ TaskStatusChangeEvent event = new TaskStatusChangeEvent(taskStatus.getState(), taskStatus.getTaskIdentity());
+ monitorPublisher.publish(event);
+ String messageId = AiravataUtils.getId("TASK");
+ MessageContext msgCntxt = new MessageContext(event, MessageType.TASK, messageId);
+ msgCntxt.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
+ if ( ServerSettings.isRabbitMqPublishEnabled()){
+ publisher.publish(msgCntxt);
+ }
+ } catch (Exception e) {
+ String msg = "Error persisting data task status to database...";
+ logger.error(msg + e.getLocalizedMessage(), e);
+ throw new Exception(msg, e);
+ }
+ }
@Subscribe
public void setupTaskStatus(JobStatusChangeEvent jobStatus) throws Exception{
@@ -93,13 +99,13 @@ public class AiravataTaskStatusUpdator implements AbstractActivityListener {
try {
updateTaskStatus(jobStatus.getJobIdentity().getTaskId(), state);
logger.debug("Publishing task status for "+jobStatus.getJobIdentity().getTaskId()+":"+state.toString());
- TaskIdentity taskIdentity = new TaskIdentity(jobStatus.getJobIdentity().getTaskId(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(jobStatus.getJobIdentity().getTaskId(),
jobStatus.getJobIdentity().getWorkflowNodeId(),
jobStatus.getJobIdentity().getExperimentId());
- monitorPublisher.publish(new TaskStatusChangeEvent(state, taskIdentity));
- TaskStatusChangeEvent changeEvent = new TaskStatusChangeEvent(state, taskIdentity);
+ TaskStatusChangeEvent event = new TaskStatusChangeEvent(state, taskIdentity);
+ monitorPublisher.publish(event);
String messageId = AiravataUtils.getId("TASK");
- MessageContext msgCntxt = new MessageContext(changeEvent, MessageType.TASK, messageId);
+ MessageContext msgCntxt = new MessageContext(event, MessageType.TASK, messageId);
msgCntxt.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
if ( ServerSettings.isRabbitMqPublishEnabled()){
publisher.publish(msgCntxt);
@@ -112,7 +118,7 @@ public class AiravataTaskStatusUpdator implements AbstractActivityListener {
}
public void updateTaskStatus(String taskId, TaskState state) throws Exception {
- logger.debug("Updating task status for "+taskId+":"+state.toString());
+ logger.info("Updating task status for " + taskId + ":" + state.toString());
TaskDetails details = (TaskDetails)airavataRegistry.get(RegistryModelType.TASK_DETAIL, taskId);
if(details == null) {
details = new TaskDetails();
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java
index 5632ef9..2ba08e1 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/AiravataWorkflowNodeStatusUpdator.java
@@ -29,7 +29,7 @@ import org.apache.airavata.messaging.core.MessageContext;
import org.apache.airavata.messaging.core.Publisher;
import org.apache.airavata.model.messaging.event.MessageType;
import org.apache.airavata.model.messaging.event.TaskStatusChangeEvent;
-import org.apache.airavata.model.messaging.event.WorkflowIdentity;
+import org.apache.airavata.model.messaging.event.WorkflowIdentifier;
import org.apache.airavata.model.messaging.event.WorkflowNodeStatusChangeEvent;
import org.apache.airavata.model.workspace.experiment.WorkflowNodeDetails;
import org.apache.airavata.model.workspace.experiment.WorkflowNodeState;
@@ -81,11 +81,11 @@ public class AiravataWorkflowNodeStatusUpdator implements AbstractActivityListen
try {
updateWorkflowNodeStatus(taskStatus.getTaskIdentity().getWorkflowNodeId(), state);
logger.debug("Publishing workflow node status for "+taskStatus.getTaskIdentity().getWorkflowNodeId()+":"+state.toString());
- WorkflowIdentity workflowIdentity = new WorkflowIdentity(taskStatus.getTaskIdentity().getWorkflowNodeId(), taskStatus.getTaskIdentity().getExperimentId());
- monitorPublisher.publish(new WorkflowNodeStatusChangeEvent(state, workflowIdentity));
- WorkflowNodeStatusChangeEvent changeEvent = new WorkflowNodeStatusChangeEvent(state, workflowIdentity);
+ WorkflowIdentifier workflowIdentity = new WorkflowIdentifier(taskStatus.getTaskIdentity().getWorkflowNodeId(), taskStatus.getTaskIdentity().getExperimentId());
+ WorkflowNodeStatusChangeEvent event = new WorkflowNodeStatusChangeEvent(state, workflowIdentity);
+ monitorPublisher.publish(event);
String messageId = AiravataUtils.getId("WFNODE");
- MessageContext msgCntxt = new MessageContext(changeEvent, MessageType.WORKFLOWNODE, messageId);
+ MessageContext msgCntxt = new MessageContext(event, MessageType.WORKFLOWNODE, messageId);
msgCntxt.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
if ( ServerSettings.isRabbitMqPublishEnabled()){
@@ -98,7 +98,7 @@ public class AiravataWorkflowNodeStatusUpdator implements AbstractActivityListen
}
public void updateWorkflowNodeStatus(String workflowNodeId, WorkflowNodeState state) throws Exception {
- logger.debug("Updating workflow node status for "+workflowNodeId+":"+state.toString());
+ logger.info("Updating workflow node status for "+workflowNodeId+":"+state.toString());
WorkflowNodeDetails details = (WorkflowNodeDetails)airavataRegistry.get(RegistryModelType.WORKFLOW_NODE_DETAIL, workflowNodeId);
if(details == null) {
details = new WorkflowNodeDetails();
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/ExperimentIdentity.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/ExperimentIdentity.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/ExperimentIdentity.java
index d5f043f..dd1d9d8 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/ExperimentIdentity.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/ExperimentIdentity.java
@@ -1,36 +1,36 @@
-/*
-*
-* 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.gfac.core.monitor;
-
-public class ExperimentIdentity {
- private String experimentID;
- public ExperimentIdentity(String experimentId) {
- setExperimentID(experimentId);
- }
- public String getExperimentID() {
- return experimentID;
- }
-
- public void setExperimentID(String experimentID) {
- this.experimentID = experimentID;
- }
-}
+///*
+//*
+//* 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.gfac.core.monitor;
+//
+//public class ExperimentIdentity {
+// private String experimentID;
+// public ExperimentIdentity(String experimentId) {
+// setExperimentID(experimentId);
+// }
+// public String getExperimentID() {
+// return experimentID;
+// }
+//
+// public void setExperimentID(String experimentID) {
+// this.experimentID = experimentID;
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/JobIdentity.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/JobIdentity.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/JobIdentity.java
index 304e3eb..881dacd 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/JobIdentity.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/JobIdentity.java
@@ -1,39 +1,39 @@
-/*
-*
-* 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.gfac.core.monitor;
-
-public class JobIdentity extends TaskIdentity {
- private String jobId;
-
- public JobIdentity(String experimentId, String workflowNodeId, String taskId, String jobId) {
- super(experimentId,workflowNodeId,taskId);
- setJobId(jobId);
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public void setJobId(String jobId) {
- this.jobId = jobId;
- }
-}
+///*
+//*
+//* 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.gfac.core.monitor;
+//
+//public class JobIdentity extends TaskIdentity {
+// private String jobId;
+//
+// public JobIdentity(String experimentId, String workflowNodeId, String taskId, String jobId) {
+// super(experimentId,workflowNodeId,taskId);
+// setJobId(jobId);
+// }
+//
+// public String getJobId() {
+// return jobId;
+// }
+//
+// public void setJobId(String jobId) {
+// this.jobId = jobId;
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/TaskIdentity.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/TaskIdentity.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/TaskIdentity.java
index db03348..369b7a0 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/TaskIdentity.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/TaskIdentity.java
@@ -1,38 +1,38 @@
-/*
-*
-* 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.gfac.core.monitor;
-
-public class TaskIdentity extends WorkflowNodeIdentity {
- private String taskId;
-
- public TaskIdentity(String experimentId, String workflowNodeId, String taskId) {
- super(experimentId,workflowNodeId);
- setTaskId(taskId);
- }
- public String getTaskId() {
- return taskId;
- }
-
- public void setTaskId(String taskId) {
- this.taskId = taskId;
- }
-}
+///*
+//*
+//* 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.gfac.core.monitor;
+//
+//public class TaskIdentity extends WorkflowNodeIdentity {
+// private String taskId;
+//
+// public TaskIdentity(String experimentId, String workflowNodeId, String taskId) {
+// super(experimentId,workflowNodeId);
+// setTaskId(taskId);
+// }
+// public String getTaskId() {
+// return taskId;
+// }
+//
+// public void setTaskId(String taskId) {
+// this.taskId = taskId;
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/WorkflowNodeIdentity.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/WorkflowNodeIdentity.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/WorkflowNodeIdentity.java
index e15f733..ba6f828 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/WorkflowNodeIdentity.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/WorkflowNodeIdentity.java
@@ -1,37 +1,37 @@
-/*
-*
-* 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.gfac.core.monitor;
-
-public class WorkflowNodeIdentity extends ExperimentIdentity {
- private String workflowNodeID;
- public WorkflowNodeIdentity(String experimentId, String workflowNodeId) {
- super(experimentId);
- setWorkflowNodeID(workflowNodeId);
- }
- public String getWorkflowNodeID() {
- return workflowNodeID;
- }
-
- public void setWorkflowNodeID(String workflowNodeID) {
- this.workflowNodeID = workflowNodeID;
- }
-}
+///*
+//*
+//* 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.gfac.core.monitor;
+//
+//public class WorkflowNodeIdentity extends ExperimentIdentity {
+// private String workflowNodeID;
+// public WorkflowNodeIdentity(String experimentId, String workflowNodeId) {
+// super(experimentId);
+// setWorkflowNodeID(workflowNodeId);
+// }
+// public String getWorkflowNodeID() {
+// return workflowNodeID;
+// }
+//
+// public void setWorkflowNodeID(String workflowNodeID) {
+// this.workflowNodeID = workflowNodeID;
+// }
+//}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java
index 704bf26..386424e 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/monitor/state/GfacExperimentStateChangeRequest.java
@@ -20,25 +20,25 @@
*/
package org.apache.airavata.gfac.core.monitor.state;
-import org.apache.airavata.gfac.core.monitor.JobIdentity;
import org.apache.airavata.gfac.core.monitor.MonitorID;
import org.apache.airavata.gfac.core.states.GfacExperimentState;
+import org.apache.airavata.model.messaging.event.JobIdentifier;
public class GfacExperimentStateChangeRequest {
private GfacExperimentState state;
- private JobIdentity identity;
+ private JobIdentifier identity;
private MonitorID monitorID;
public GfacExperimentStateChangeRequest(MonitorID monitorID, GfacExperimentState state) {
- setIdentity(new JobIdentity(monitorID.getExperimentID(), monitorID.getWorkflowNodeID(),
+ setIdentity(new JobIdentifier(monitorID.getExperimentID(), monitorID.getWorkflowNodeID(),
monitorID.getTaskID(), monitorID.getJobID()));
setMonitorID(monitorID);
this.state = state;
}
- public GfacExperimentStateChangeRequest(MonitorID monitorID, JobIdentity jobId, GfacExperimentState state) {
+ public GfacExperimentStateChangeRequest(MonitorID monitorID, JobIdentifier jobId, GfacExperimentState state) {
setIdentity(jobId);
setMonitorID(monitorID);
this.state = state;
@@ -53,11 +53,11 @@ public class GfacExperimentStateChangeRequest {
this.state = state;
}
- public JobIdentity getIdentity() {
+ public JobIdentifier getIdentity() {
return identity;
}
- public void setIdentity(JobIdentity identity) {
+ public void setIdentity(JobIdentifier identity) {
this.identity = identity;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
index 5c86560..c48a0ea 100644
--- a/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
+++ b/modules/gfac/gfac-local/src/main/java/org/apache/airavata/gfac/local/provider/impl/LocalProvider.java
@@ -37,9 +37,9 @@ import org.apache.airavata.gfac.core.utils.GFacUtils;
import org.apache.airavata.gfac.core.utils.OutputUtils;
import org.apache.airavata.gfac.local.utils.InputStreamToFileWriter;
import org.apache.airavata.gfac.local.utils.InputUtils;
-import org.apache.airavata.model.messaging.event.JobIdentity;
+import org.apache.airavata.model.messaging.event.JobIdentifier;
import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
-import org.apache.airavata.model.messaging.event.TaskIdentity;
+import org.apache.airavata.model.messaging.event.TaskIdentifier;
import org.apache.airavata.model.messaging.event.TaskOutputChangeEvent;
import org.apache.airavata.model.workspace.experiment.DataObjectType;
import org.apache.airavata.model.workspace.experiment.JobDetails;
@@ -174,7 +174,7 @@ public class LocalProvider extends AbstractProvider {
// updating the job status to complete because there's nothing to monitor in local jobs
// MonitorID monitorID = createMonitorID(jobExecutionContext);
- JobIdentity jobIdentity = new JobIdentity(jobExecutionContext.getJobDetails().getJobID(),
+ JobIdentifier jobIdentity = new JobIdentifier(jobExecutionContext.getJobDetails().getJobID(),
jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
@@ -232,7 +232,7 @@ public class LocalProvider extends AbstractProvider {
registry.update(RegistryModelType.TASK_DETAIL, taskDetails, taskDetails.getTaskID());
}
registry.add(ChildDataType.EXPERIMENT_OUTPUT, outputArray, jobExecutionContext.getExperimentID());
- TaskIdentity taskIdentity = new TaskIdentity(jobExecutionContext.getTaskData().getTaskID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(jobExecutionContext.getTaskData().getTaskID(),
jobExecutionContext.getWorkflowNodeDetails().getNodeInstanceId(),
jobExecutionContext.getExperimentID());
getMonitorPublisher().publish(new TaskOutputChangeEvent(outputArray, taskIdentity));
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
index 591bca6..2fa5f62 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
@@ -20,16 +20,7 @@
*/
package org.apache.airavata.gfac.monitor.impl.pull.qstat;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingDeque;
-
+import com.google.common.eventbus.EventBus;
import org.apache.airavata.common.utils.MonitorPublisher;
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.commons.gfac.type.HostDescription;
@@ -43,8 +34,9 @@ import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
import org.apache.airavata.gfac.monitor.util.CommonUtils;
import org.apache.airavata.gsi.ssh.api.SSHApiException;
import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
-import org.apache.airavata.model.messaging.event.JobIdentity;
-import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
+import org.apache.airavata.model.messaging.event.JobIdentifier;
+import org.apache.airavata.model.messaging.event.JobStatusChangeRequestEvent;
+import org.apache.airavata.model.messaging.event.TaskIdentifier;
import org.apache.airavata.model.messaging.event.TaskStatusChangeEvent;
import org.apache.airavata.model.workspace.experiment.JobState;
import org.apache.airavata.model.workspace.experiment.TaskState;
@@ -53,7 +45,10 @@ import org.apache.airavata.schemas.gfac.SSHHostType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.eventbus.EventBus;
+import java.sql.Timestamp;
+import java.util.*;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingDeque;
/**
* This monitor is based on qstat command which can be run
@@ -139,7 +134,7 @@ public class HPCPullMonitor extends PullMonitor {
//todo this polling will not work with multiple usernames but with single user
// and multiple hosts, currently monitoring will work
UserMonitorData take = null;
- JobStatusChangeEvent jobStatus = new JobStatusChangeEvent();
+ JobStatusChangeRequestEvent jobStatus = new JobStatusChangeRequestEvent();
MonitorID currentMonitorID = null;
HostDescription currentHostDescription = null;
try {
@@ -164,7 +159,7 @@ public class HPCPullMonitor extends PullMonitor {
for (MonitorID iMonitorID : monitorID) {
currentMonitorID = iMonitorID;
iMonitorID.setStatus(jobStatuses.get(iMonitorID.getJobID()+","+iMonitorID.getJobName())); //IMPORTANT this is not a simple setter we have a logic
- jobStatus.setJobIdentity(new JobIdentity(iMonitorID.getJobID(), iMonitorID.getTaskID(), iMonitorID.getWorkflowNodeID(), iMonitorID.getExperimentID()));
+ jobStatus.setJobIdentity(new JobIdentifier(iMonitorID.getJobID(), iMonitorID.getTaskID(), iMonitorID.getWorkflowNodeID(), iMonitorID.getExperimentID()));
jobStatus.setState(iMonitorID.getStatus());
// we have this JobStatus class to handle amqp monitoring
@@ -178,7 +173,7 @@ public class HPCPullMonitor extends PullMonitor {
try {
gfac.invokeOutFlowHandlers(iMonitorID.getJobExecutionContext());
} catch (GFacException e) {
- org.apache.airavata.model.messaging.event.TaskIdentity taskIdentity = new org.apache.airavata.model.messaging.event.TaskIdentity(iMonitorID.getTaskID(), iMonitorID.getWorkflowNodeID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(iMonitorID.getTaskID(), iMonitorID.getWorkflowNodeID(),
iMonitorID.getExperimentID());
publisher.publish(new TaskStatusChangeEvent(TaskState.FAILED, taskIdentity));
//FIXME this is a case where the output retrieving fails even if the job execution was a success. Thus updating the task status
@@ -195,7 +190,7 @@ public class HPCPullMonitor extends PullMonitor {
logger.error("Launching outflow handlers to check output are genereated or not");
gfac.invokeOutFlowHandlers(iMonitorID.getJobExecutionContext());
} catch (GFacException e) {
- org.apache.airavata.model.messaging.event.TaskIdentity taskIdentity = new org.apache.airavata.model.messaging.event.TaskIdentity(iMonitorID.getTaskID(), iMonitorID.getWorkflowNodeID(),
+ TaskIdentifier taskIdentity = new TaskIdentifier(iMonitorID.getTaskID(), iMonitorID.getWorkflowNodeID(),
iMonitorID.getExperimentID());
publisher.publish(new TaskStatusChangeEvent(TaskState.FAILED, taskIdentity));
logger.info(e.getLocalizedMessage(), e);
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java
index 72338fe..9422d05 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/push/amqp/AMQPMonitor.java
@@ -31,12 +31,12 @@ import java.util.concurrent.BlockingQueue;
import org.apache.airavata.common.utils.MonitorPublisher;
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.gfac.core.monitor.JobIdentity;
import org.apache.airavata.gfac.core.monitor.MonitorID;
import org.apache.airavata.gfac.monitor.core.PushMonitor;
import org.apache.airavata.gfac.monitor.exception.AiravataMonitorException;
import org.apache.airavata.gfac.monitor.util.AMQPConnectionUtil;
import org.apache.airavata.gfac.monitor.util.CommonUtils;
+import org.apache.airavata.model.messaging.event.JobIdentifier;
import org.apache.airavata.model.messaging.event.JobStatusChangeEvent;
import org.apache.airavata.model.workspace.experiment.JobState;
import org.slf4j.Logger;
@@ -202,7 +202,7 @@ public class AMQPMonitor extends PushMonitor {
}
}
next.setStatus(monitorID.getStatus());
- org.apache.airavata.model.messaging.event.JobIdentity jobIdentity = new org.apache.airavata.model.messaging.event.JobIdentity(next.getJobID(),
+ JobIdentifier jobIdentity = new JobIdentifier(next.getJobID(),
next.getTaskID(), next.getWorkflowNodeID(), next.getExperimentID());
publisher.publish(new JobStatusChangeEvent(next.getStatus(),jobIdentity));
return true;
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQPublisher.java
----------------------------------------------------------------------
diff --git a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQPublisher.java b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQPublisher.java
index 490d33c..edbb28d 100644
--- a/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQPublisher.java
+++ b/modules/messaging/core/src/main/java/org/apache/airavata/messaging/core/impl/RabbitMQPublisher.java
@@ -52,11 +52,12 @@ public class RabbitMQPublisher implements Publisher {
throw new AiravataException(message, e);
}
rabbitMQProducer = new RabbitMQProducer(brokerUrl, exchangeName);
+ rabbitMQProducer.open();
}
public void publish(MessageContext msgCtx) throws AiravataException {
try {
- rabbitMQProducer.open();
+ log.info("Publishing status to rabbitmq...");
byte[] body = ThriftUtils.serializeThriftObject(msgCtx.getEvent());
Message message = new Message();
message.setEvent(body);
@@ -73,11 +74,11 @@ public class RabbitMQPublisher implements Publisher {
event.getTaskIdentity().getWorkflowNodeId() + "." + event.getTaskIdentity().getTaskId();
}else if (msgCtx.getType().equals(MessageType.WORKFLOWNODE)){
WorkflowNodeStatusChangeEvent event = (WorkflowNodeStatusChangeEvent) msgCtx.getEvent();
- WorkflowIdentity workflowNodeIdentity = event.getWorkflowNodeIdentity();
+ WorkflowIdentifier workflowNodeIdentity = event.getWorkflowNodeIdentity();
routingKey = workflowNodeIdentity.getExperimentId() + "." + workflowNodeIdentity.getWorkflowNodeId();
}else if (msgCtx.getType().equals(MessageType.JOB)){
JobStatusChangeEvent event = (JobStatusChangeEvent)msgCtx.getEvent();
- JobIdentity identity = event.getJobIdentity();
+ JobIdentifier identity = event.getJobIdentity();
routingKey = identity.getExperimentId() + "." +
identity.getWorkflowNodeId() + "." +
identity.getTaskId() + "." +
[2/4] removing recursively calling publish
Posted by ch...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskIdentifier.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskIdentifier.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskIdentifier.java
new file mode 100644
index 0000000..f33173a
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskIdentifier.java
@@ -0,0 +1,588 @@
+/**
+ * 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.
+ */
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.messaging.event;
+
+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.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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class TaskIdentifier implements org.apache.thrift.TBase<TaskIdentifier, TaskIdentifier._Fields>, java.io.Serializable, Cloneable, Comparable<TaskIdentifier> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskIdentifier");
+
+ private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("taskId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField WORKFLOW_NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowNodeId", org.apache.thrift.protocol.TType.STRING, (short)2);
+ 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)3);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TaskIdentifierStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TaskIdentifierTupleSchemeFactory());
+ }
+
+ private String taskId; // required
+ private String workflowNodeId; // required
+ private String experimentId; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ TASK_ID((short)1, "taskId"),
+ WORKFLOW_NODE_ID((short)2, "workflowNodeId"),
+ EXPERIMENT_ID((short)3, "experimentId");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // TASK_ID
+ return TASK_ID;
+ case 2: // WORKFLOW_NODE_ID
+ return WORKFLOW_NODE_ID;
+ case 3: // EXPERIMENT_ID
+ return EXPERIMENT_ID;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ 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);
+ tmpMap.put(_Fields.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("taskId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.WORKFLOW_NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("workflowNodeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskIdentifier.class, metaDataMap);
+ }
+
+ public TaskIdentifier() {
+ }
+
+ public TaskIdentifier(
+ String taskId,
+ String workflowNodeId,
+ String experimentId)
+ {
+ this();
+ this.taskId = taskId;
+ this.workflowNodeId = workflowNodeId;
+ this.experimentId = experimentId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TaskIdentifier(TaskIdentifier other) {
+ if (other.isSetTaskId()) {
+ this.taskId = other.taskId;
+ }
+ if (other.isSetWorkflowNodeId()) {
+ this.workflowNodeId = other.workflowNodeId;
+ }
+ if (other.isSetExperimentId()) {
+ this.experimentId = other.experimentId;
+ }
+ }
+
+ public TaskIdentifier deepCopy() {
+ return new TaskIdentifier(this);
+ }
+
+ @Override
+ public void clear() {
+ this.taskId = null;
+ this.workflowNodeId = null;
+ this.experimentId = null;
+ }
+
+ public String getTaskId() {
+ return this.taskId;
+ }
+
+ public void setTaskId(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public void unsetTaskId() {
+ this.taskId = null;
+ }
+
+ /** Returns true if field taskId is set (has been assigned a value) and false otherwise */
+ public boolean isSetTaskId() {
+ return this.taskId != null;
+ }
+
+ public void setTaskIdIsSet(boolean value) {
+ if (!value) {
+ this.taskId = null;
+ }
+ }
+
+ public String getWorkflowNodeId() {
+ return this.workflowNodeId;
+ }
+
+ public void setWorkflowNodeId(String workflowNodeId) {
+ this.workflowNodeId = workflowNodeId;
+ }
+
+ public void unsetWorkflowNodeId() {
+ this.workflowNodeId = null;
+ }
+
+ /** Returns true if field workflowNodeId is set (has been assigned a value) and false otherwise */
+ public boolean isSetWorkflowNodeId() {
+ return this.workflowNodeId != null;
+ }
+
+ public void setWorkflowNodeIdIsSet(boolean value) {
+ if (!value) {
+ this.workflowNodeId = null;
+ }
+ }
+
+ public String getExperimentId() {
+ return this.experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ public void unsetExperimentId() {
+ this.experimentId = null;
+ }
+
+ /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
+ public boolean isSetExperimentId() {
+ return this.experimentId != null;
+ }
+
+ public void setExperimentIdIsSet(boolean value) {
+ if (!value) {
+ this.experimentId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case TASK_ID:
+ if (value == null) {
+ unsetTaskId();
+ } else {
+ setTaskId((String)value);
+ }
+ break;
+
+ case WORKFLOW_NODE_ID:
+ if (value == null) {
+ unsetWorkflowNodeId();
+ } else {
+ setWorkflowNodeId((String)value);
+ }
+ break;
+
+ case EXPERIMENT_ID:
+ if (value == null) {
+ unsetExperimentId();
+ } else {
+ setExperimentId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case TASK_ID:
+ return getTaskId();
+
+ case WORKFLOW_NODE_ID:
+ return getWorkflowNodeId();
+
+ case EXPERIMENT_ID:
+ return getExperimentId();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case TASK_ID:
+ return isSetTaskId();
+ case WORKFLOW_NODE_ID:
+ return isSetWorkflowNodeId();
+ case EXPERIMENT_ID:
+ return isSetExperimentId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TaskIdentifier)
+ return this.equals((TaskIdentifier)that);
+ return false;
+ }
+
+ public boolean equals(TaskIdentifier that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_taskId = true && this.isSetTaskId();
+ boolean that_present_taskId = true && that.isSetTaskId();
+ if (this_present_taskId || that_present_taskId) {
+ if (!(this_present_taskId && that_present_taskId))
+ return false;
+ if (!this.taskId.equals(that.taskId))
+ return false;
+ }
+
+ boolean this_present_workflowNodeId = true && this.isSetWorkflowNodeId();
+ boolean that_present_workflowNodeId = true && that.isSetWorkflowNodeId();
+ if (this_present_workflowNodeId || that_present_workflowNodeId) {
+ if (!(this_present_workflowNodeId && that_present_workflowNodeId))
+ return false;
+ if (!this.workflowNodeId.equals(that.workflowNodeId))
+ return false;
+ }
+
+ boolean this_present_experimentId = true && this.isSetExperimentId();
+ boolean that_present_experimentId = true && that.isSetExperimentId();
+ if (this_present_experimentId || that_present_experimentId) {
+ if (!(this_present_experimentId && that_present_experimentId))
+ return false;
+ if (!this.experimentId.equals(that.experimentId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(TaskIdentifier other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetTaskId()).compareTo(other.isSetTaskId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetTaskId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskId, other.taskId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetWorkflowNodeId()).compareTo(other.isSetWorkflowNodeId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetWorkflowNodeId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowNodeId, other.workflowNodeId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetExperimentId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TaskIdentifier(");
+ boolean first = true;
+
+ sb.append("taskId:");
+ if (this.taskId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.taskId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("workflowNodeId:");
+ if (this.workflowNodeId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.workflowNodeId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("experimentId:");
+ if (this.experimentId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.experimentId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetTaskId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetWorkflowNodeId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'workflowNodeId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetExperimentId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class TaskIdentifierStandardSchemeFactory implements SchemeFactory {
+ public TaskIdentifierStandardScheme getScheme() {
+ return new TaskIdentifierStandardScheme();
+ }
+ }
+
+ private static class TaskIdentifierStandardScheme extends StandardScheme<TaskIdentifier> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TaskIdentifier struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // TASK_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.taskId = iprot.readString();
+ struct.setTaskIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // WORKFLOW_NODE_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.workflowNodeId = iprot.readString();
+ struct.setWorkflowNodeIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // EXPERIMENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TaskIdentifier struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.taskId != null) {
+ oprot.writeFieldBegin(TASK_ID_FIELD_DESC);
+ oprot.writeString(struct.taskId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.workflowNodeId != null) {
+ oprot.writeFieldBegin(WORKFLOW_NODE_ID_FIELD_DESC);
+ oprot.writeString(struct.workflowNodeId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.experimentId != null) {
+ oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
+ oprot.writeString(struct.experimentId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TaskIdentifierTupleSchemeFactory implements SchemeFactory {
+ public TaskIdentifierTupleScheme getScheme() {
+ return new TaskIdentifierTupleScheme();
+ }
+ }
+
+ private static class TaskIdentifierTupleScheme extends TupleScheme<TaskIdentifier> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TaskIdentifier struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.taskId);
+ oprot.writeString(struct.workflowNodeId);
+ oprot.writeString(struct.experimentId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TaskIdentifier struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.taskId = iprot.readString();
+ struct.setTaskIdIsSet(true);
+ struct.workflowNodeId = iprot.readString();
+ struct.setWorkflowNodeIdIsSet(true);
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskIdentity.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskIdentity.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskIdentity.java
deleted file mode 100644
index 91cb600..0000000
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskIdentity.java
+++ /dev/null
@@ -1,588 +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.
- */
-
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.airavata.model.messaging.event;
-
-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.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 org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class TaskIdentity implements org.apache.thrift.TBase<TaskIdentity, TaskIdentity._Fields>, java.io.Serializable, Cloneable, Comparable<TaskIdentity> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskIdentity");
-
- private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("taskId", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField WORKFLOW_NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowNodeId", org.apache.thrift.protocol.TType.STRING, (short)2);
- 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)3);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new TaskIdentityStandardSchemeFactory());
- schemes.put(TupleScheme.class, new TaskIdentityTupleSchemeFactory());
- }
-
- private String taskId; // required
- private String workflowNodeId; // required
- private String experimentId; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- TASK_ID((short)1, "taskId"),
- WORKFLOW_NODE_ID((short)2, "workflowNodeId"),
- EXPERIMENT_ID((short)3, "experimentId");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // TASK_ID
- return TASK_ID;
- case 2: // WORKFLOW_NODE_ID
- return WORKFLOW_NODE_ID;
- case 3: // EXPERIMENT_ID
- return EXPERIMENT_ID;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- 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);
- tmpMap.put(_Fields.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("taskId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.WORKFLOW_NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("workflowNodeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskIdentity.class, metaDataMap);
- }
-
- public TaskIdentity() {
- }
-
- public TaskIdentity(
- String taskId,
- String workflowNodeId,
- String experimentId)
- {
- this();
- this.taskId = taskId;
- this.workflowNodeId = workflowNodeId;
- this.experimentId = experimentId;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public TaskIdentity(TaskIdentity other) {
- if (other.isSetTaskId()) {
- this.taskId = other.taskId;
- }
- if (other.isSetWorkflowNodeId()) {
- this.workflowNodeId = other.workflowNodeId;
- }
- if (other.isSetExperimentId()) {
- this.experimentId = other.experimentId;
- }
- }
-
- public TaskIdentity deepCopy() {
- return new TaskIdentity(this);
- }
-
- @Override
- public void clear() {
- this.taskId = null;
- this.workflowNodeId = null;
- this.experimentId = null;
- }
-
- public String getTaskId() {
- return this.taskId;
- }
-
- public void setTaskId(String taskId) {
- this.taskId = taskId;
- }
-
- public void unsetTaskId() {
- this.taskId = null;
- }
-
- /** Returns true if field taskId is set (has been assigned a value) and false otherwise */
- public boolean isSetTaskId() {
- return this.taskId != null;
- }
-
- public void setTaskIdIsSet(boolean value) {
- if (!value) {
- this.taskId = null;
- }
- }
-
- public String getWorkflowNodeId() {
- return this.workflowNodeId;
- }
-
- public void setWorkflowNodeId(String workflowNodeId) {
- this.workflowNodeId = workflowNodeId;
- }
-
- public void unsetWorkflowNodeId() {
- this.workflowNodeId = null;
- }
-
- /** Returns true if field workflowNodeId is set (has been assigned a value) and false otherwise */
- public boolean isSetWorkflowNodeId() {
- return this.workflowNodeId != null;
- }
-
- public void setWorkflowNodeIdIsSet(boolean value) {
- if (!value) {
- this.workflowNodeId = null;
- }
- }
-
- public String getExperimentId() {
- return this.experimentId;
- }
-
- public void setExperimentId(String experimentId) {
- this.experimentId = experimentId;
- }
-
- public void unsetExperimentId() {
- this.experimentId = null;
- }
-
- /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
- public boolean isSetExperimentId() {
- return this.experimentId != null;
- }
-
- public void setExperimentIdIsSet(boolean value) {
- if (!value) {
- this.experimentId = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case TASK_ID:
- if (value == null) {
- unsetTaskId();
- } else {
- setTaskId((String)value);
- }
- break;
-
- case WORKFLOW_NODE_ID:
- if (value == null) {
- unsetWorkflowNodeId();
- } else {
- setWorkflowNodeId((String)value);
- }
- break;
-
- case EXPERIMENT_ID:
- if (value == null) {
- unsetExperimentId();
- } else {
- setExperimentId((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case TASK_ID:
- return getTaskId();
-
- case WORKFLOW_NODE_ID:
- return getWorkflowNodeId();
-
- case EXPERIMENT_ID:
- return getExperimentId();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case TASK_ID:
- return isSetTaskId();
- case WORKFLOW_NODE_ID:
- return isSetWorkflowNodeId();
- case EXPERIMENT_ID:
- return isSetExperimentId();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof TaskIdentity)
- return this.equals((TaskIdentity)that);
- return false;
- }
-
- public boolean equals(TaskIdentity that) {
- if (that == null)
- return false;
-
- boolean this_present_taskId = true && this.isSetTaskId();
- boolean that_present_taskId = true && that.isSetTaskId();
- if (this_present_taskId || that_present_taskId) {
- if (!(this_present_taskId && that_present_taskId))
- return false;
- if (!this.taskId.equals(that.taskId))
- return false;
- }
-
- boolean this_present_workflowNodeId = true && this.isSetWorkflowNodeId();
- boolean that_present_workflowNodeId = true && that.isSetWorkflowNodeId();
- if (this_present_workflowNodeId || that_present_workflowNodeId) {
- if (!(this_present_workflowNodeId && that_present_workflowNodeId))
- return false;
- if (!this.workflowNodeId.equals(that.workflowNodeId))
- return false;
- }
-
- boolean this_present_experimentId = true && this.isSetExperimentId();
- boolean that_present_experimentId = true && that.isSetExperimentId();
- if (this_present_experimentId || that_present_experimentId) {
- if (!(this_present_experimentId && that_present_experimentId))
- return false;
- if (!this.experimentId.equals(that.experimentId))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(TaskIdentity other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetTaskId()).compareTo(other.isSetTaskId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetTaskId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskId, other.taskId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetWorkflowNodeId()).compareTo(other.isSetWorkflowNodeId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetWorkflowNodeId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowNodeId, other.workflowNodeId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetExperimentId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("TaskIdentity(");
- boolean first = true;
-
- sb.append("taskId:");
- if (this.taskId == null) {
- sb.append("null");
- } else {
- sb.append(this.taskId);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("workflowNodeId:");
- if (this.workflowNodeId == null) {
- sb.append("null");
- } else {
- sb.append(this.workflowNodeId);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("experimentId:");
- if (this.experimentId == null) {
- sb.append("null");
- } else {
- sb.append(this.experimentId);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!isSetTaskId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskId' is unset! Struct:" + toString());
- }
-
- if (!isSetWorkflowNodeId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'workflowNodeId' is unset! Struct:" + toString());
- }
-
- if (!isSetExperimentId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class TaskIdentityStandardSchemeFactory implements SchemeFactory {
- public TaskIdentityStandardScheme getScheme() {
- return new TaskIdentityStandardScheme();
- }
- }
-
- private static class TaskIdentityStandardScheme extends StandardScheme<TaskIdentity> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, TaskIdentity struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // TASK_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.taskId = iprot.readString();
- struct.setTaskIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // WORKFLOW_NODE_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.workflowNodeId = iprot.readString();
- struct.setWorkflowNodeIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // EXPERIMENT_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.experimentId = iprot.readString();
- struct.setExperimentIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, TaskIdentity struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.taskId != null) {
- oprot.writeFieldBegin(TASK_ID_FIELD_DESC);
- oprot.writeString(struct.taskId);
- oprot.writeFieldEnd();
- }
- if (struct.workflowNodeId != null) {
- oprot.writeFieldBegin(WORKFLOW_NODE_ID_FIELD_DESC);
- oprot.writeString(struct.workflowNodeId);
- oprot.writeFieldEnd();
- }
- if (struct.experimentId != null) {
- oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
- oprot.writeString(struct.experimentId);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class TaskIdentityTupleSchemeFactory implements SchemeFactory {
- public TaskIdentityTupleScheme getScheme() {
- return new TaskIdentityTupleScheme();
- }
- }
-
- private static class TaskIdentityTupleScheme extends TupleScheme<TaskIdentity> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, TaskIdentity struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.taskId);
- oprot.writeString(struct.workflowNodeId);
- oprot.writeString(struct.experimentId);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, TaskIdentity struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.taskId = iprot.readString();
- struct.setTaskIdIsSet(true);
- struct.workflowNodeId = iprot.readString();
- struct.setWorkflowNodeIdIsSet(true);
- struct.experimentId = iprot.readString();
- struct.setExperimentIdIsSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskOutputChangeEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskOutputChangeEvent.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskOutputChangeEvent.java
index d73ab63..fbbd6c0 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskOutputChangeEvent.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskOutputChangeEvent.java
@@ -62,7 +62,7 @@ import org.slf4j.LoggerFactory;
}
private List<org.apache.airavata.model.workspace.experiment.DataObjectType> output; // required
- private TaskIdentity taskIdentity; // required
+ private TaskIdentifier taskIdentity; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -133,7 +133,7 @@ import org.slf4j.LoggerFactory;
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.workspace.experiment.DataObjectType.class))));
tmpMap.put(_Fields.TASK_IDENTITY, new org.apache.thrift.meta_data.FieldMetaData("taskIdentity", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskIdentity.class)));
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskIdentifier.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskOutputChangeEvent.class, metaDataMap);
}
@@ -143,7 +143,7 @@ import org.slf4j.LoggerFactory;
public TaskOutputChangeEvent(
List<org.apache.airavata.model.workspace.experiment.DataObjectType> output,
- TaskIdentity taskIdentity)
+ TaskIdentifier taskIdentity)
{
this();
this.output = output;
@@ -162,7 +162,7 @@ import org.slf4j.LoggerFactory;
this.output = __this__output;
}
if (other.isSetTaskIdentity()) {
- this.taskIdentity = new TaskIdentity(other.taskIdentity);
+ this.taskIdentity = new TaskIdentifier(other.taskIdentity);
}
}
@@ -214,11 +214,11 @@ import org.slf4j.LoggerFactory;
}
}
- public TaskIdentity getTaskIdentity() {
+ public TaskIdentifier getTaskIdentity() {
return this.taskIdentity;
}
- public void setTaskIdentity(TaskIdentity taskIdentity) {
+ public void setTaskIdentity(TaskIdentifier taskIdentity) {
this.taskIdentity = taskIdentity;
}
@@ -251,7 +251,7 @@ import org.slf4j.LoggerFactory;
if (value == null) {
unsetTaskIdentity();
} else {
- setTaskIdentity((TaskIdentity)value);
+ setTaskIdentity((TaskIdentifier)value);
}
break;
@@ -462,7 +462,7 @@ import org.slf4j.LoggerFactory;
break;
case 2: // TASK_IDENTITY
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.taskIdentity = new TaskIdentity();
+ struct.taskIdentity = new TaskIdentifier();
struct.taskIdentity.read(iprot);
struct.setTaskIdentityIsSet(true);
} else {
@@ -541,7 +541,7 @@ import org.slf4j.LoggerFactory;
}
}
struct.setOutputIsSet(true);
- struct.taskIdentity = new TaskIdentity();
+ struct.taskIdentity = new TaskIdentifier();
struct.taskIdentity.read(iprot);
struct.setTaskIdentityIsSet(true);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeEvent.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeEvent.java
index a206f0b..cc0adcc 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeEvent.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeEvent.java
@@ -62,7 +62,7 @@ import org.slf4j.LoggerFactory;
}
private org.apache.airavata.model.workspace.experiment.TaskState state; // required
- private TaskIdentity taskIdentity; // required
+ private TaskIdentifier taskIdentity; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -136,7 +136,7 @@ import org.slf4j.LoggerFactory;
tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.airavata.model.workspace.experiment.TaskState.class)));
tmpMap.put(_Fields.TASK_IDENTITY, new org.apache.thrift.meta_data.FieldMetaData("taskIdentity", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskIdentity.class)));
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskIdentifier.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskStatusChangeEvent.class, metaDataMap);
}
@@ -146,7 +146,7 @@ import org.slf4j.LoggerFactory;
public TaskStatusChangeEvent(
org.apache.airavata.model.workspace.experiment.TaskState state,
- TaskIdentity taskIdentity)
+ TaskIdentifier taskIdentity)
{
this();
this.state = state;
@@ -161,7 +161,7 @@ import org.slf4j.LoggerFactory;
this.state = other.state;
}
if (other.isSetTaskIdentity()) {
- this.taskIdentity = new TaskIdentity(other.taskIdentity);
+ this.taskIdentity = new TaskIdentifier(other.taskIdentity);
}
}
@@ -206,11 +206,11 @@ import org.slf4j.LoggerFactory;
}
}
- public TaskIdentity getTaskIdentity() {
+ public TaskIdentifier getTaskIdentity() {
return this.taskIdentity;
}
- public void setTaskIdentity(TaskIdentity taskIdentity) {
+ public void setTaskIdentity(TaskIdentifier taskIdentity) {
this.taskIdentity = taskIdentity;
}
@@ -243,7 +243,7 @@ import org.slf4j.LoggerFactory;
if (value == null) {
unsetTaskIdentity();
} else {
- setTaskIdentity((TaskIdentity)value);
+ setTaskIdentity((TaskIdentifier)value);
}
break;
@@ -443,7 +443,7 @@ import org.slf4j.LoggerFactory;
break;
case 2: // TASK_IDENTITY
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.taskIdentity = new TaskIdentity();
+ struct.taskIdentity = new TaskIdentifier();
struct.taskIdentity.read(iprot);
struct.setTaskIdentityIsSet(true);
} else {
@@ -499,7 +499,7 @@ import org.slf4j.LoggerFactory;
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.state = org.apache.airavata.model.workspace.experiment.TaskState.findByValue(iprot.readI32());
struct.setStateIsSet(true);
- struct.taskIdentity = new TaskIdentity();
+ struct.taskIdentity = new TaskIdentifier();
struct.taskIdentity.read(iprot);
struct.setTaskIdentityIsSet(true);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeRequestEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeRequestEvent.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeRequestEvent.java
new file mode 100644
index 0000000..d63a602
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/TaskStatusChangeRequestEvent.java
@@ -0,0 +1,509 @@
+/**
+ * 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.
+ */
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.messaging.event;
+
+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.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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class TaskStatusChangeRequestEvent implements org.apache.thrift.TBase<TaskStatusChangeRequestEvent, TaskStatusChangeRequestEvent._Fields>, java.io.Serializable, Cloneable, Comparable<TaskStatusChangeRequestEvent> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskStatusChangeRequestEvent");
+
+ private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("state", org.apache.thrift.protocol.TType.I32, (short)1);
+ private static final org.apache.thrift.protocol.TField TASK_IDENTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("taskIdentity", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TaskStatusChangeRequestEventStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TaskStatusChangeRequestEventTupleSchemeFactory());
+ }
+
+ private org.apache.airavata.model.workspace.experiment.TaskState state; // required
+ private TaskIdentifier taskIdentity; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.TaskState
+ */
+ STATE((short)1, "state"),
+ TASK_IDENTITY((short)2, "taskIdentity");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // STATE
+ return STATE;
+ case 2: // TASK_IDENTITY
+ return TASK_IDENTITY;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ 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);
+ tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.airavata.model.workspace.experiment.TaskState.class)));
+ tmpMap.put(_Fields.TASK_IDENTITY, new org.apache.thrift.meta_data.FieldMetaData("taskIdentity", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TaskIdentifier.class)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskStatusChangeRequestEvent.class, metaDataMap);
+ }
+
+ public TaskStatusChangeRequestEvent() {
+ }
+
+ public TaskStatusChangeRequestEvent(
+ org.apache.airavata.model.workspace.experiment.TaskState state,
+ TaskIdentifier taskIdentity)
+ {
+ this();
+ this.state = state;
+ this.taskIdentity = taskIdentity;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TaskStatusChangeRequestEvent(TaskStatusChangeRequestEvent other) {
+ if (other.isSetState()) {
+ this.state = other.state;
+ }
+ if (other.isSetTaskIdentity()) {
+ this.taskIdentity = new TaskIdentifier(other.taskIdentity);
+ }
+ }
+
+ public TaskStatusChangeRequestEvent deepCopy() {
+ return new TaskStatusChangeRequestEvent(this);
+ }
+
+ @Override
+ public void clear() {
+ this.state = null;
+ this.taskIdentity = null;
+ }
+
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.TaskState
+ */
+ public org.apache.airavata.model.workspace.experiment.TaskState getState() {
+ return this.state;
+ }
+
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.TaskState
+ */
+ public void setState(org.apache.airavata.model.workspace.experiment.TaskState state) {
+ this.state = state;
+ }
+
+ public void unsetState() {
+ this.state = null;
+ }
+
+ /** Returns true if field state is set (has been assigned a value) and false otherwise */
+ public boolean isSetState() {
+ return this.state != null;
+ }
+
+ public void setStateIsSet(boolean value) {
+ if (!value) {
+ this.state = null;
+ }
+ }
+
+ public TaskIdentifier getTaskIdentity() {
+ return this.taskIdentity;
+ }
+
+ public void setTaskIdentity(TaskIdentifier taskIdentity) {
+ this.taskIdentity = taskIdentity;
+ }
+
+ public void unsetTaskIdentity() {
+ this.taskIdentity = null;
+ }
+
+ /** Returns true if field taskIdentity is set (has been assigned a value) and false otherwise */
+ public boolean isSetTaskIdentity() {
+ return this.taskIdentity != null;
+ }
+
+ public void setTaskIdentityIsSet(boolean value) {
+ if (!value) {
+ this.taskIdentity = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case STATE:
+ if (value == null) {
+ unsetState();
+ } else {
+ setState((org.apache.airavata.model.workspace.experiment.TaskState)value);
+ }
+ break;
+
+ case TASK_IDENTITY:
+ if (value == null) {
+ unsetTaskIdentity();
+ } else {
+ setTaskIdentity((TaskIdentifier)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case STATE:
+ return getState();
+
+ case TASK_IDENTITY:
+ return getTaskIdentity();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case STATE:
+ return isSetState();
+ case TASK_IDENTITY:
+ return isSetTaskIdentity();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TaskStatusChangeRequestEvent)
+ return this.equals((TaskStatusChangeRequestEvent)that);
+ return false;
+ }
+
+ public boolean equals(TaskStatusChangeRequestEvent that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_state = true && this.isSetState();
+ boolean that_present_state = true && that.isSetState();
+ if (this_present_state || that_present_state) {
+ if (!(this_present_state && that_present_state))
+ return false;
+ if (!this.state.equals(that.state))
+ return false;
+ }
+
+ boolean this_present_taskIdentity = true && this.isSetTaskIdentity();
+ boolean that_present_taskIdentity = true && that.isSetTaskIdentity();
+ if (this_present_taskIdentity || that_present_taskIdentity) {
+ if (!(this_present_taskIdentity && that_present_taskIdentity))
+ return false;
+ if (!this.taskIdentity.equals(that.taskIdentity))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(TaskStatusChangeRequestEvent other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetState()).compareTo(other.isSetState());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetState()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetTaskIdentity()).compareTo(other.isSetTaskIdentity());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetTaskIdentity()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskIdentity, other.taskIdentity);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TaskStatusChangeRequestEvent(");
+ boolean first = true;
+
+ sb.append("state:");
+ if (this.state == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.state);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("taskIdentity:");
+ if (this.taskIdentity == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.taskIdentity);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetState()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'state' is unset! Struct:" + toString());
+ }
+
+ if (!isSetTaskIdentity()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskIdentity' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ if (taskIdentity != null) {
+ taskIdentity.validate();
+ }
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class TaskStatusChangeRequestEventStandardSchemeFactory implements SchemeFactory {
+ public TaskStatusChangeRequestEventStandardScheme getScheme() {
+ return new TaskStatusChangeRequestEventStandardScheme();
+ }
+ }
+
+ private static class TaskStatusChangeRequestEventStandardScheme extends StandardScheme<TaskStatusChangeRequestEvent> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TaskStatusChangeRequestEvent struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // STATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.state = org.apache.airavata.model.workspace.experiment.TaskState.findByValue(iprot.readI32());
+ struct.setStateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // TASK_IDENTITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.taskIdentity = new TaskIdentifier();
+ struct.taskIdentity.read(iprot);
+ struct.setTaskIdentityIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TaskStatusChangeRequestEvent struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.state != null) {
+ oprot.writeFieldBegin(STATE_FIELD_DESC);
+ oprot.writeI32(struct.state.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.taskIdentity != null) {
+ oprot.writeFieldBegin(TASK_IDENTITY_FIELD_DESC);
+ struct.taskIdentity.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TaskStatusChangeRequestEventTupleSchemeFactory implements SchemeFactory {
+ public TaskStatusChangeRequestEventTupleScheme getScheme() {
+ return new TaskStatusChangeRequestEventTupleScheme();
+ }
+ }
+
+ private static class TaskStatusChangeRequestEventTupleScheme extends TupleScheme<TaskStatusChangeRequestEvent> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TaskStatusChangeRequestEvent struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeI32(struct.state.getValue());
+ struct.taskIdentity.write(oprot);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TaskStatusChangeRequestEvent struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.state = org.apache.airavata.model.workspace.experiment.TaskState.findByValue(iprot.readI32());
+ struct.setStateIsSet(true);
+ struct.taskIdentity = new TaskIdentifier();
+ struct.taskIdentity.read(iprot);
+ struct.setTaskIdentityIsSet(true);
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowIdentifier.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowIdentifier.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowIdentifier.java
new file mode 100644
index 0000000..afa498f
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/WorkflowIdentifier.java
@@ -0,0 +1,492 @@
+/**
+ * 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.
+ */
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.messaging.event;
+
+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.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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class WorkflowIdentifier implements org.apache.thrift.TBase<WorkflowIdentifier, WorkflowIdentifier._Fields>, java.io.Serializable, Cloneable, Comparable<WorkflowIdentifier> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("WorkflowIdentifier");
+
+ private static final org.apache.thrift.protocol.TField WORKFLOW_NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowNodeId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ 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 Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new WorkflowIdentifierStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new WorkflowIdentifierTupleSchemeFactory());
+ }
+
+ private String workflowNodeId; // required
+ private String experimentId; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ WORKFLOW_NODE_ID((short)1, "workflowNodeId"),
+ EXPERIMENT_ID((short)2, "experimentId");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // WORKFLOW_NODE_ID
+ return WORKFLOW_NODE_ID;
+ case 2: // EXPERIMENT_ID
+ return EXPERIMENT_ID;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ 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);
+ tmpMap.put(_Fields.WORKFLOW_NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("workflowNodeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(WorkflowIdentifier.class, metaDataMap);
+ }
+
+ public WorkflowIdentifier() {
+ }
+
+ public WorkflowIdentifier(
+ String workflowNodeId,
+ String experimentId)
+ {
+ this();
+ this.workflowNodeId = workflowNodeId;
+ this.experimentId = experimentId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public WorkflowIdentifier(WorkflowIdentifier other) {
+ if (other.isSetWorkflowNodeId()) {
+ this.workflowNodeId = other.workflowNodeId;
+ }
+ if (other.isSetExperimentId()) {
+ this.experimentId = other.experimentId;
+ }
+ }
+
+ public WorkflowIdentifier deepCopy() {
+ return new WorkflowIdentifier(this);
+ }
+
+ @Override
+ public void clear() {
+ this.workflowNodeId = null;
+ this.experimentId = null;
+ }
+
+ public String getWorkflowNodeId() {
+ return this.workflowNodeId;
+ }
+
+ public void setWorkflowNodeId(String workflowNodeId) {
+ this.workflowNodeId = workflowNodeId;
+ }
+
+ public void unsetWorkflowNodeId() {
+ this.workflowNodeId = null;
+ }
+
+ /** Returns true if field workflowNodeId is set (has been assigned a value) and false otherwise */
+ public boolean isSetWorkflowNodeId() {
+ return this.workflowNodeId != null;
+ }
+
+ public void setWorkflowNodeIdIsSet(boolean value) {
+ if (!value) {
+ this.workflowNodeId = null;
+ }
+ }
+
+ public String getExperimentId() {
+ return this.experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ public void unsetExperimentId() {
+ this.experimentId = null;
+ }
+
+ /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
+ public boolean isSetExperimentId() {
+ return this.experimentId != null;
+ }
+
+ public void setExperimentIdIsSet(boolean value) {
+ if (!value) {
+ this.experimentId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case WORKFLOW_NODE_ID:
+ if (value == null) {
+ unsetWorkflowNodeId();
+ } else {
+ setWorkflowNodeId((String)value);
+ }
+ break;
+
+ case EXPERIMENT_ID:
+ if (value == null) {
+ unsetExperimentId();
+ } else {
+ setExperimentId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case WORKFLOW_NODE_ID:
+ return getWorkflowNodeId();
+
+ case EXPERIMENT_ID:
+ return getExperimentId();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case WORKFLOW_NODE_ID:
+ return isSetWorkflowNodeId();
+ case EXPERIMENT_ID:
+ return isSetExperimentId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof WorkflowIdentifier)
+ return this.equals((WorkflowIdentifier)that);
+ return false;
+ }
+
+ public boolean equals(WorkflowIdentifier that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_workflowNodeId = true && this.isSetWorkflowNodeId();
+ boolean that_present_workflowNodeId = true && that.isSetWorkflowNodeId();
+ if (this_present_workflowNodeId || that_present_workflowNodeId) {
+ if (!(this_present_workflowNodeId && that_present_workflowNodeId))
+ return false;
+ if (!this.workflowNodeId.equals(that.workflowNodeId))
+ return false;
+ }
+
+ boolean this_present_experimentId = true && this.isSetExperimentId();
+ boolean that_present_experimentId = true && that.isSetExperimentId();
+ if (this_present_experimentId || that_present_experimentId) {
+ if (!(this_present_experimentId && that_present_experimentId))
+ return false;
+ if (!this.experimentId.equals(that.experimentId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(WorkflowIdentifier other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetWorkflowNodeId()).compareTo(other.isSetWorkflowNodeId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetWorkflowNodeId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowNodeId, other.workflowNodeId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetExperimentId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("WorkflowIdentifier(");
+ boolean first = true;
+
+ sb.append("workflowNodeId:");
+ if (this.workflowNodeId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.workflowNodeId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("experimentId:");
+ if (this.experimentId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.experimentId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetWorkflowNodeId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'workflowNodeId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetExperimentId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class WorkflowIdentifierStandardSchemeFactory implements SchemeFactory {
+ public WorkflowIdentifierStandardScheme getScheme() {
+ return new WorkflowIdentifierStandardScheme();
+ }
+ }
+
+ private static class WorkflowIdentifierStandardScheme extends StandardScheme<WorkflowIdentifier> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, WorkflowIdentifier struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // WORKFLOW_NODE_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.workflowNodeId = iprot.readString();
+ struct.setWorkflowNodeIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // EXPERIMENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, WorkflowIdentifier struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.workflowNodeId != null) {
+ oprot.writeFieldBegin(WORKFLOW_NODE_ID_FIELD_DESC);
+ oprot.writeString(struct.workflowNodeId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.experimentId != null) {
+ oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
+ oprot.writeString(struct.experimentId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class WorkflowIdentifierTupleSchemeFactory implements SchemeFactory {
+ public WorkflowIdentifierTupleScheme getScheme() {
+ return new WorkflowIdentifierTupleScheme();
+ }
+ }
+
+ private static class WorkflowIdentifierTupleScheme extends TupleScheme<WorkflowIdentifier> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, WorkflowIdentifier struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.workflowNodeId);
+ oprot.writeString(struct.experimentId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, WorkflowIdentifier struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.workflowNodeId = iprot.readString();
+ struct.setWorkflowNodeIdIsSet(true);
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ }
+ }
+
+}
+
[4/4] git commit: removing recursively calling publish
Posted by ch...@apache.org.
removing recursively calling publish
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/255dd9e3
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/255dd9e3
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/255dd9e3
Branch: refs/heads/messaging_framework
Commit: 255dd9e397890ac24aa7853e382613e10102164f
Parents: cc71bac
Author: chathuriw <ka...@gmail.com>
Authored: Fri Sep 26 16:03:52 2014 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Sep 26 16:03:52 2014 -0400
----------------------------------------------------------------------
.../AiravataExperimentStatusUpdator.java | 6 +-
.../lib/airavata/messagingEvents_types.cpp | 238 +++-
.../lib/airavata/messagingEvents_types.h | 146 ++-
.../Airavata/Model/Messaging/Event/Types.php | 228 +++-
.../client/samples/CreateLaunchExperiment.java | 12 +-
.../model/messaging/event/JobIdentifier.java | 684 ++++++++++++
.../model/messaging/event/JobIdentity.java | 684 ------------
.../model/messaging/event/JobMonitor.java | 1043 ------------------
.../messaging/event/JobStatusChangeEvent.java | 18 +-
.../event/JobStatusChangeRequestEvent.java | 509 +++++++++
.../model/messaging/event/TaskIdentifier.java | 588 ++++++++++
.../model/messaging/event/TaskIdentity.java | 588 ----------
.../messaging/event/TaskOutputChangeEvent.java | 18 +-
.../messaging/event/TaskStatusChangeEvent.java | 18 +-
.../event/TaskStatusChangeRequestEvent.java | 509 +++++++++
.../messaging/event/WorkflowIdentifier.java | 492 +++++++++
.../model/messaging/event/WorkflowIdentity.java | 492 ---------
.../event/WorkflowNodeStatusChangeEvent.java | 18 +-
.../messagingEvents.thrift | 25 +-
.../main/resources/airavata-server.properties | 2 +-
.../airavata/gfac/core/cpi/BetterGfacImpl.java | 21 +-
.../apache/airavata/gfac/core/cpi/GFacImpl.java | 10 +-
.../core/monitor/AiravataJobStatusUpdator.java | 12 +-
.../core/monitor/AiravataTaskStatusUpdator.java | 46 +-
.../AiravataWorkflowNodeStatusUpdator.java | 12 +-
.../gfac/core/monitor/ExperimentIdentity.java | 72 +-
.../airavata/gfac/core/monitor/JobIdentity.java | 78 +-
.../gfac/core/monitor/TaskIdentity.java | 76 +-
.../gfac/core/monitor/WorkflowNodeIdentity.java | 74 +-
.../state/GfacExperimentStateChangeRequest.java | 12 +-
.../gfac/local/provider/impl/LocalProvider.java | 8 +-
.../monitor/impl/pull/qstat/HPCPullMonitor.java | 29 +-
.../monitor/impl/push/amqp/AMQPMonitor.java | 4 +-
.../messaging/core/impl/RabbitMQPublisher.java | 7 +-
34 files changed, 3609 insertions(+), 3170 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
index e448fec..5d0996f 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/listener/AiravataExperimentStatusUpdator.java
@@ -89,10 +89,10 @@ public class AiravataExperimentStatusUpdator implements AbstractActivityListener
}
updateExperimentStatus(nodeStatus.getWorkflowNodeIdentity().getExperimentId(), state);
logger.debug("Publishing experiment status for "+nodeStatus.getWorkflowNodeIdentity().getExperimentId()+":"+state.toString());
- monitorPublisher.publish(new ExperimentStatusChangeEvent(state, nodeStatus.getWorkflowNodeIdentity().getExperimentId()));
- ExperimentStatusChangeEvent experimentStatusChangeEvent = new ExperimentStatusChangeEvent(state, nodeStatus.getWorkflowNodeIdentity().getExperimentId());
+ ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(state, nodeStatus.getWorkflowNodeIdentity().getExperimentId());
+ monitorPublisher.publish(event);
String messageId = AiravataUtils.getId("EXPERIMENT");
- MessageContext msgCntxt = new MessageContext(experimentStatusChangeEvent, MessageType.EXPERIMENT, messageId);
+ MessageContext msgCntxt = new MessageContext(event, MessageType.EXPERIMENT, messageId);
msgCntxt.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
if ( ServerSettings.isRabbitMqPublishEnabled()){
publisher.publish(msgCntxt);
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.cpp b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.cpp
index fae1f5d..f7c123a 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.cpp
@@ -137,10 +137,10 @@ void swap(ExperimentStatusChangeEvent &a, ExperimentStatusChangeEvent &b) {
swap(a.experimentId, b.experimentId);
}
-const char* WorkflowIdentity::ascii_fingerprint = "07A9615F837F7D0A952B595DD3020972";
-const uint8_t WorkflowIdentity::binary_fingerprint[16] = {0x07,0xA9,0x61,0x5F,0x83,0x7F,0x7D,0x0A,0x95,0x2B,0x59,0x5D,0xD3,0x02,0x09,0x72};
+const char* WorkflowIdentifier::ascii_fingerprint = "07A9615F837F7D0A952B595DD3020972";
+const uint8_t WorkflowIdentifier::binary_fingerprint[16] = {0x07,0xA9,0x61,0x5F,0x83,0x7F,0x7D,0x0A,0x95,0x2B,0x59,0x5D,0xD3,0x02,0x09,0x72};
-uint32_t WorkflowIdentity::read(::apache::thrift::protocol::TProtocol* iprot) {
+uint32_t WorkflowIdentifier::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
@@ -194,9 +194,9 @@ uint32_t WorkflowIdentity::read(::apache::thrift::protocol::TProtocol* iprot) {
return xfer;
}
-uint32_t WorkflowIdentity::write(::apache::thrift::protocol::TProtocol* oprot) const {
+uint32_t WorkflowIdentifier::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("WorkflowIdentity");
+ xfer += oprot->writeStructBegin("WorkflowIdentifier");
xfer += oprot->writeFieldBegin("workflowNodeId", ::apache::thrift::protocol::T_STRING, 1);
xfer += oprot->writeString(this->workflowNodeId);
@@ -211,7 +211,7 @@ uint32_t WorkflowIdentity::write(::apache::thrift::protocol::TProtocol* oprot) c
return xfer;
}
-void swap(WorkflowIdentity &a, WorkflowIdentity &b) {
+void swap(WorkflowIdentifier &a, WorkflowIdentifier &b) {
using ::std::swap;
swap(a.workflowNodeId, b.workflowNodeId);
swap(a.experimentId, b.experimentId);
@@ -299,10 +299,10 @@ void swap(WorkflowNodeStatusChangeEvent &a, WorkflowNodeStatusChangeEvent &b) {
swap(a.workflowNodeIdentity, b.workflowNodeIdentity);
}
-const char* TaskIdentity::ascii_fingerprint = "AB879940BD15B6B25691265F7384B271";
-const uint8_t TaskIdentity::binary_fingerprint[16] = {0xAB,0x87,0x99,0x40,0xBD,0x15,0xB6,0xB2,0x56,0x91,0x26,0x5F,0x73,0x84,0xB2,0x71};
+const char* TaskIdentifier::ascii_fingerprint = "AB879940BD15B6B25691265F7384B271";
+const uint8_t TaskIdentifier::binary_fingerprint[16] = {0xAB,0x87,0x99,0x40,0xBD,0x15,0xB6,0xB2,0x56,0x91,0x26,0x5F,0x73,0x84,0xB2,0x71};
-uint32_t TaskIdentity::read(::apache::thrift::protocol::TProtocol* iprot) {
+uint32_t TaskIdentifier::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
@@ -367,9 +367,9 @@ uint32_t TaskIdentity::read(::apache::thrift::protocol::TProtocol* iprot) {
return xfer;
}
-uint32_t TaskIdentity::write(::apache::thrift::protocol::TProtocol* oprot) const {
+uint32_t TaskIdentifier::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("TaskIdentity");
+ xfer += oprot->writeStructBegin("TaskIdentifier");
xfer += oprot->writeFieldBegin("taskId", ::apache::thrift::protocol::T_STRING, 1);
xfer += oprot->writeString(this->taskId);
@@ -388,7 +388,7 @@ uint32_t TaskIdentity::write(::apache::thrift::protocol::TProtocol* oprot) const
return xfer;
}
-void swap(TaskIdentity &a, TaskIdentity &b) {
+void swap(TaskIdentifier &a, TaskIdentifier &b) {
using ::std::swap;
swap(a.taskId, b.taskId);
swap(a.workflowNodeId, b.workflowNodeId);
@@ -477,6 +477,88 @@ void swap(TaskStatusChangeEvent &a, TaskStatusChangeEvent &b) {
swap(a.taskIdentity, b.taskIdentity);
}
+const char* TaskStatusChangeRequestEvent::ascii_fingerprint = "9686679C94D43D75F2B35A0BED2E4003";
+const uint8_t TaskStatusChangeRequestEvent::binary_fingerprint[16] = {0x96,0x86,0x67,0x9C,0x94,0xD4,0x3D,0x75,0xF2,0xB3,0x5A,0x0B,0xED,0x2E,0x40,0x03};
+
+uint32_t TaskStatusChangeRequestEvent::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_state = false;
+ bool isset_taskIdentity = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast3;
+ xfer += iprot->readI32(ecast3);
+ this->state = ( ::apache::airavata::model::workspace::experiment::TaskState::type)ecast3;
+ isset_state = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->taskIdentity.read(iprot);
+ isset_taskIdentity = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_state)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_taskIdentity)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t TaskStatusChangeRequestEvent::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("TaskStatusChangeRequestEvent");
+
+ xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 1);
+ xfer += oprot->writeI32((int32_t)this->state);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("taskIdentity", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->taskIdentity.write(oprot);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(TaskStatusChangeRequestEvent &a, TaskStatusChangeRequestEvent &b) {
+ using ::std::swap;
+ swap(a.state, b.state);
+ swap(a.taskIdentity, b.taskIdentity);
+}
+
const char* TaskOutputChangeEvent::ascii_fingerprint = "6488123A3A8B4CF758D069C9B693C7EB";
const uint8_t TaskOutputChangeEvent::binary_fingerprint[16] = {0x64,0x88,0x12,0x3A,0x3A,0x8B,0x4C,0xF7,0x58,0xD0,0x69,0xC9,0xB6,0x93,0xC7,0xEB};
@@ -506,14 +588,14 @@ uint32_t TaskOutputChangeEvent::read(::apache::thrift::protocol::TProtocol* ipro
if (ftype == ::apache::thrift::protocol::T_LIST) {
{
this->output.clear();
- uint32_t _size3;
- ::apache::thrift::protocol::TType _etype6;
- xfer += iprot->readListBegin(_etype6, _size3);
- this->output.resize(_size3);
- uint32_t _i7;
- for (_i7 = 0; _i7 < _size3; ++_i7)
+ uint32_t _size4;
+ ::apache::thrift::protocol::TType _etype7;
+ xfer += iprot->readListBegin(_etype7, _size4);
+ this->output.resize(_size4);
+ uint32_t _i8;
+ for (_i8 = 0; _i8 < _size4; ++_i8)
{
- xfer += this->output[_i7].read(iprot);
+ xfer += this->output[_i8].read(iprot);
}
xfer += iprot->readListEnd();
}
@@ -553,10 +635,10 @@ uint32_t TaskOutputChangeEvent::write(::apache::thrift::protocol::TProtocol* opr
xfer += oprot->writeFieldBegin("output", ::apache::thrift::protocol::T_LIST, 1);
{
xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->output.size()));
- std::vector< ::apache::airavata::model::workspace::experiment::DataObjectType> ::const_iterator _iter8;
- for (_iter8 = this->output.begin(); _iter8 != this->output.end(); ++_iter8)
+ std::vector< ::apache::airavata::model::workspace::experiment::DataObjectType> ::const_iterator _iter9;
+ for (_iter9 = this->output.begin(); _iter9 != this->output.end(); ++_iter9)
{
- xfer += (*_iter8).write(oprot);
+ xfer += (*_iter9).write(oprot);
}
xfer += oprot->writeListEnd();
}
@@ -577,10 +659,10 @@ void swap(TaskOutputChangeEvent &a, TaskOutputChangeEvent &b) {
swap(a.taskIdentity, b.taskIdentity);
}
-const char* JobIdentity::ascii_fingerprint = "C93D890311F28844166CF6E571EB3AC2";
-const uint8_t JobIdentity::binary_fingerprint[16] = {0xC9,0x3D,0x89,0x03,0x11,0xF2,0x88,0x44,0x16,0x6C,0xF6,0xE5,0x71,0xEB,0x3A,0xC2};
+const char* JobIdentifier::ascii_fingerprint = "C93D890311F28844166CF6E571EB3AC2";
+const uint8_t JobIdentifier::binary_fingerprint[16] = {0xC9,0x3D,0x89,0x03,0x11,0xF2,0x88,0x44,0x16,0x6C,0xF6,0xE5,0x71,0xEB,0x3A,0xC2};
-uint32_t JobIdentity::read(::apache::thrift::protocol::TProtocol* iprot) {
+uint32_t JobIdentifier::read(::apache::thrift::protocol::TProtocol* iprot) {
uint32_t xfer = 0;
std::string fname;
@@ -656,9 +738,9 @@ uint32_t JobIdentity::read(::apache::thrift::protocol::TProtocol* iprot) {
return xfer;
}
-uint32_t JobIdentity::write(::apache::thrift::protocol::TProtocol* oprot) const {
+uint32_t JobIdentifier::write(::apache::thrift::protocol::TProtocol* oprot) const {
uint32_t xfer = 0;
- xfer += oprot->writeStructBegin("JobIdentity");
+ xfer += oprot->writeStructBegin("JobIdentifier");
xfer += oprot->writeFieldBegin("jobId", ::apache::thrift::protocol::T_STRING, 1);
xfer += oprot->writeString(this->jobId);
@@ -681,7 +763,7 @@ uint32_t JobIdentity::write(::apache::thrift::protocol::TProtocol* oprot) const
return xfer;
}
-void swap(JobIdentity &a, JobIdentity &b) {
+void swap(JobIdentifier &a, JobIdentifier &b) {
using ::std::swap;
swap(a.jobId, b.jobId);
swap(a.taskId, b.taskId);
@@ -716,9 +798,9 @@ uint32_t JobStatusChangeEvent::read(::apache::thrift::protocol::TProtocol* iprot
{
case 1:
if (ftype == ::apache::thrift::protocol::T_I32) {
- int32_t ecast9;
- xfer += iprot->readI32(ecast9);
- this->state = ( ::apache::airavata::model::workspace::experiment::JobState::type)ecast9;
+ int32_t ecast10;
+ xfer += iprot->readI32(ecast10);
+ this->state = ( ::apache::airavata::model::workspace::experiment::JobState::type)ecast10;
isset_state = true;
} else {
xfer += iprot->skip(ftype);
@@ -771,6 +853,88 @@ void swap(JobStatusChangeEvent &a, JobStatusChangeEvent &b) {
swap(a.jobIdentity, b.jobIdentity);
}
+const char* JobStatusChangeRequestEvent::ascii_fingerprint = "8D18A3CD1822DBC67D7BD8CB98E7B4F1";
+const uint8_t JobStatusChangeRequestEvent::binary_fingerprint[16] = {0x8D,0x18,0xA3,0xCD,0x18,0x22,0xDB,0xC6,0x7D,0x7B,0xD8,0xCB,0x98,0xE7,0xB4,0xF1};
+
+uint32_t JobStatusChangeRequestEvent::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_state = false;
+ bool isset_jobIdentity = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast11;
+ xfer += iprot->readI32(ecast11);
+ this->state = ( ::apache::airavata::model::workspace::experiment::JobState::type)ecast11;
+ isset_state = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->jobIdentity.read(iprot);
+ isset_jobIdentity = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_state)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_jobIdentity)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t JobStatusChangeRequestEvent::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ xfer += oprot->writeStructBegin("JobStatusChangeRequestEvent");
+
+ xfer += oprot->writeFieldBegin("state", ::apache::thrift::protocol::T_I32, 1);
+ xfer += oprot->writeI32((int32_t)this->state);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("jobIdentity", ::apache::thrift::protocol::T_STRUCT, 2);
+ xfer += this->jobIdentity.write(oprot);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(JobStatusChangeRequestEvent &a, JobStatusChangeRequestEvent &b) {
+ using ::std::swap;
+ swap(a.state, b.state);
+ swap(a.jobIdentity, b.jobIdentity);
+}
+
const char* Message::ascii_fingerprint = "6904C391426E568AF9DEAF69860C076A";
const uint8_t Message::binary_fingerprint[16] = {0x69,0x04,0xC3,0x91,0x42,0x6E,0x56,0x8A,0xF9,0xDE,0xAF,0x69,0x86,0x0C,0x07,0x6A};
@@ -815,9 +979,9 @@ uint32_t Message::read(::apache::thrift::protocol::TProtocol* iprot) {
break;
case 3:
if (ftype == ::apache::thrift::protocol::T_I32) {
- int32_t ecast10;
- xfer += iprot->readI32(ecast10);
- this->messageType = (MessageType::type)ecast10;
+ int32_t ecast12;
+ xfer += iprot->readI32(ecast12);
+ this->messageType = (MessageType::type)ecast12;
isset_messageType = true;
} else {
xfer += iprot->skip(ftype);
@@ -833,9 +997,9 @@ uint32_t Message::read(::apache::thrift::protocol::TProtocol* iprot) {
break;
case 5:
if (ftype == ::apache::thrift::protocol::T_I32) {
- int32_t ecast11;
- xfer += iprot->readI32(ecast11);
- this->messageLevel = (MessageLevel::type)ecast11;
+ int32_t ecast13;
+ xfer += iprot->readI32(ecast13);
+ this->messageLevel = (MessageLevel::type)ecast13;
this->__isset.messageLevel = true;
} else {
xfer += iprot->skip(ftype);
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.h b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.h
index fe80785..3ce8e79 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/messagingEvents_types.h
@@ -102,16 +102,16 @@ class ExperimentStatusChangeEvent {
void swap(ExperimentStatusChangeEvent &a, ExperimentStatusChangeEvent &b);
-class WorkflowIdentity {
+class WorkflowIdentifier {
public:
static const char* ascii_fingerprint; // = "07A9615F837F7D0A952B595DD3020972";
static const uint8_t binary_fingerprint[16]; // = {0x07,0xA9,0x61,0x5F,0x83,0x7F,0x7D,0x0A,0x95,0x2B,0x59,0x5D,0xD3,0x02,0x09,0x72};
- WorkflowIdentity() : workflowNodeId(), experimentId() {
+ WorkflowIdentifier() : workflowNodeId(), experimentId() {
}
- virtual ~WorkflowIdentity() throw() {}
+ virtual ~WorkflowIdentifier() throw() {}
std::string workflowNodeId;
std::string experimentId;
@@ -124,7 +124,7 @@ class WorkflowIdentity {
experimentId = val;
}
- bool operator == (const WorkflowIdentity & rhs) const
+ bool operator == (const WorkflowIdentifier & rhs) const
{
if (!(workflowNodeId == rhs.workflowNodeId))
return false;
@@ -132,18 +132,18 @@ class WorkflowIdentity {
return false;
return true;
}
- bool operator != (const WorkflowIdentity &rhs) const {
+ bool operator != (const WorkflowIdentifier &rhs) const {
return !(*this == rhs);
}
- bool operator < (const WorkflowIdentity & ) const;
+ bool operator < (const WorkflowIdentifier & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
-void swap(WorkflowIdentity &a, WorkflowIdentity &b);
+void swap(WorkflowIdentifier &a, WorkflowIdentifier &b);
class WorkflowNodeStatusChangeEvent {
@@ -158,13 +158,13 @@ class WorkflowNodeStatusChangeEvent {
virtual ~WorkflowNodeStatusChangeEvent() throw() {}
::apache::airavata::model::workspace::experiment::WorkflowNodeState::type state;
- WorkflowIdentity workflowNodeIdentity;
+ WorkflowIdentifier workflowNodeIdentity;
void __set_state(const ::apache::airavata::model::workspace::experiment::WorkflowNodeState::type val) {
state = val;
}
- void __set_workflowNodeIdentity(const WorkflowIdentity& val) {
+ void __set_workflowNodeIdentity(const WorkflowIdentifier& val) {
workflowNodeIdentity = val;
}
@@ -190,16 +190,16 @@ class WorkflowNodeStatusChangeEvent {
void swap(WorkflowNodeStatusChangeEvent &a, WorkflowNodeStatusChangeEvent &b);
-class TaskIdentity {
+class TaskIdentifier {
public:
static const char* ascii_fingerprint; // = "AB879940BD15B6B25691265F7384B271";
static const uint8_t binary_fingerprint[16]; // = {0xAB,0x87,0x99,0x40,0xBD,0x15,0xB6,0xB2,0x56,0x91,0x26,0x5F,0x73,0x84,0xB2,0x71};
- TaskIdentity() : taskId(), workflowNodeId(), experimentId() {
+ TaskIdentifier() : taskId(), workflowNodeId(), experimentId() {
}
- virtual ~TaskIdentity() throw() {}
+ virtual ~TaskIdentifier() throw() {}
std::string taskId;
std::string workflowNodeId;
@@ -217,7 +217,7 @@ class TaskIdentity {
experimentId = val;
}
- bool operator == (const TaskIdentity & rhs) const
+ bool operator == (const TaskIdentifier & rhs) const
{
if (!(taskId == rhs.taskId))
return false;
@@ -227,18 +227,18 @@ class TaskIdentity {
return false;
return true;
}
- bool operator != (const TaskIdentity &rhs) const {
+ bool operator != (const TaskIdentifier &rhs) const {
return !(*this == rhs);
}
- bool operator < (const TaskIdentity & ) const;
+ bool operator < (const TaskIdentifier & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
-void swap(TaskIdentity &a, TaskIdentity &b);
+void swap(TaskIdentifier &a, TaskIdentifier &b);
class TaskStatusChangeEvent {
@@ -253,13 +253,13 @@ class TaskStatusChangeEvent {
virtual ~TaskStatusChangeEvent() throw() {}
::apache::airavata::model::workspace::experiment::TaskState::type state;
- TaskIdentity taskIdentity;
+ TaskIdentifier taskIdentity;
void __set_state(const ::apache::airavata::model::workspace::experiment::TaskState::type val) {
state = val;
}
- void __set_taskIdentity(const TaskIdentity& val) {
+ void __set_taskIdentity(const TaskIdentifier& val) {
taskIdentity = val;
}
@@ -285,6 +285,50 @@ class TaskStatusChangeEvent {
void swap(TaskStatusChangeEvent &a, TaskStatusChangeEvent &b);
+class TaskStatusChangeRequestEvent {
+ public:
+
+ static const char* ascii_fingerprint; // = "9686679C94D43D75F2B35A0BED2E4003";
+ static const uint8_t binary_fingerprint[16]; // = {0x96,0x86,0x67,0x9C,0x94,0xD4,0x3D,0x75,0xF2,0xB3,0x5A,0x0B,0xED,0x2E,0x40,0x03};
+
+ TaskStatusChangeRequestEvent() : state(( ::apache::airavata::model::workspace::experiment::TaskState::type)0) {
+ }
+
+ virtual ~TaskStatusChangeRequestEvent() throw() {}
+
+ ::apache::airavata::model::workspace::experiment::TaskState::type state;
+ TaskIdentifier taskIdentity;
+
+ void __set_state(const ::apache::airavata::model::workspace::experiment::TaskState::type val) {
+ state = val;
+ }
+
+ void __set_taskIdentity(const TaskIdentifier& val) {
+ taskIdentity = val;
+ }
+
+ bool operator == (const TaskStatusChangeRequestEvent & rhs) const
+ {
+ if (!(state == rhs.state))
+ return false;
+ if (!(taskIdentity == rhs.taskIdentity))
+ return false;
+ return true;
+ }
+ bool operator != (const TaskStatusChangeRequestEvent &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TaskStatusChangeRequestEvent & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(TaskStatusChangeRequestEvent &a, TaskStatusChangeRequestEvent &b);
+
+
class TaskOutputChangeEvent {
public:
@@ -297,13 +341,13 @@ class TaskOutputChangeEvent {
virtual ~TaskOutputChangeEvent() throw() {}
std::vector< ::apache::airavata::model::workspace::experiment::DataObjectType> output;
- TaskIdentity taskIdentity;
+ TaskIdentifier taskIdentity;
void __set_output(const std::vector< ::apache::airavata::model::workspace::experiment::DataObjectType> & val) {
output = val;
}
- void __set_taskIdentity(const TaskIdentity& val) {
+ void __set_taskIdentity(const TaskIdentifier& val) {
taskIdentity = val;
}
@@ -329,16 +373,16 @@ class TaskOutputChangeEvent {
void swap(TaskOutputChangeEvent &a, TaskOutputChangeEvent &b);
-class JobIdentity {
+class JobIdentifier {
public:
static const char* ascii_fingerprint; // = "C93D890311F28844166CF6E571EB3AC2";
static const uint8_t binary_fingerprint[16]; // = {0xC9,0x3D,0x89,0x03,0x11,0xF2,0x88,0x44,0x16,0x6C,0xF6,0xE5,0x71,0xEB,0x3A,0xC2};
- JobIdentity() : jobId(), taskId(), workflowNodeId(), experimentId() {
+ JobIdentifier() : jobId(), taskId(), workflowNodeId(), experimentId() {
}
- virtual ~JobIdentity() throw() {}
+ virtual ~JobIdentifier() throw() {}
std::string jobId;
std::string taskId;
@@ -361,7 +405,7 @@ class JobIdentity {
experimentId = val;
}
- bool operator == (const JobIdentity & rhs) const
+ bool operator == (const JobIdentifier & rhs) const
{
if (!(jobId == rhs.jobId))
return false;
@@ -373,18 +417,18 @@ class JobIdentity {
return false;
return true;
}
- bool operator != (const JobIdentity &rhs) const {
+ bool operator != (const JobIdentifier &rhs) const {
return !(*this == rhs);
}
- bool operator < (const JobIdentity & ) const;
+ bool operator < (const JobIdentifier & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
-void swap(JobIdentity &a, JobIdentity &b);
+void swap(JobIdentifier &a, JobIdentifier &b);
class JobStatusChangeEvent {
@@ -399,13 +443,13 @@ class JobStatusChangeEvent {
virtual ~JobStatusChangeEvent() throw() {}
::apache::airavata::model::workspace::experiment::JobState::type state;
- JobIdentity jobIdentity;
+ JobIdentifier jobIdentity;
void __set_state(const ::apache::airavata::model::workspace::experiment::JobState::type val) {
state = val;
}
- void __set_jobIdentity(const JobIdentity& val) {
+ void __set_jobIdentity(const JobIdentifier& val) {
jobIdentity = val;
}
@@ -430,6 +474,50 @@ class JobStatusChangeEvent {
void swap(JobStatusChangeEvent &a, JobStatusChangeEvent &b);
+
+class JobStatusChangeRequestEvent {
+ public:
+
+ static const char* ascii_fingerprint; // = "8D18A3CD1822DBC67D7BD8CB98E7B4F1";
+ static const uint8_t binary_fingerprint[16]; // = {0x8D,0x18,0xA3,0xCD,0x18,0x22,0xDB,0xC6,0x7D,0x7B,0xD8,0xCB,0x98,0xE7,0xB4,0xF1};
+
+ JobStatusChangeRequestEvent() : state(( ::apache::airavata::model::workspace::experiment::JobState::type)0) {
+ }
+
+ virtual ~JobStatusChangeRequestEvent() throw() {}
+
+ ::apache::airavata::model::workspace::experiment::JobState::type state;
+ JobIdentifier jobIdentity;
+
+ void __set_state(const ::apache::airavata::model::workspace::experiment::JobState::type val) {
+ state = val;
+ }
+
+ void __set_jobIdentity(const JobIdentifier& val) {
+ jobIdentity = val;
+ }
+
+ bool operator == (const JobStatusChangeRequestEvent & rhs) const
+ {
+ if (!(state == rhs.state))
+ return false;
+ if (!(jobIdentity == rhs.jobIdentity))
+ return false;
+ return true;
+ }
+ bool operator != (const JobStatusChangeRequestEvent &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const JobStatusChangeRequestEvent & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+void swap(JobStatusChangeRequestEvent &a, JobStatusChangeRequestEvent &b);
+
typedef struct _Message__isset {
_Message__isset() : updatedTime(false), messageLevel(false) {}
bool updatedTime;
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php
index 989e7b2..bb950ab 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Messaging/Event/Types.php
@@ -135,7 +135,7 @@ class ExperimentStatusChangeEvent {
}
-class WorkflowIdentity {
+class WorkflowIdentifier {
static $_TSPEC;
public $workflowNodeId = null;
@@ -165,7 +165,7 @@ class WorkflowIdentity {
}
public function getName() {
- return 'WorkflowIdentity';
+ return 'WorkflowIdentifier';
}
public function read($input)
@@ -209,7 +209,7 @@ class WorkflowIdentity {
public function write($output) {
$xfer = 0;
- $xfer += $output->writeStructBegin('WorkflowIdentity');
+ $xfer += $output->writeStructBegin('WorkflowIdentifier');
if ($this->workflowNodeId !== null) {
$xfer += $output->writeFieldBegin('workflowNodeId', TType::STRING, 1);
$xfer += $output->writeString($this->workflowNodeId);
@@ -243,7 +243,7 @@ class WorkflowNodeStatusChangeEvent {
2 => array(
'var' => 'workflowNodeIdentity',
'type' => TType::STRUCT,
- 'class' => '\Airavata\Model\Messaging\Event\WorkflowIdentity',
+ 'class' => '\Airavata\Model\Messaging\Event\WorkflowIdentifier',
),
);
}
@@ -285,7 +285,7 @@ class WorkflowNodeStatusChangeEvent {
break;
case 2:
if ($ftype == TType::STRUCT) {
- $this->workflowNodeIdentity = new \Airavata\Model\Messaging\Event\WorkflowIdentity();
+ $this->workflowNodeIdentity = new \Airavata\Model\Messaging\Event\WorkflowIdentifier();
$xfer += $this->workflowNodeIdentity->read($input);
} else {
$xfer += $input->skip($ftype);
@@ -324,7 +324,7 @@ class WorkflowNodeStatusChangeEvent {
}
-class TaskIdentity {
+class TaskIdentifier {
static $_TSPEC;
public $taskId = null;
@@ -362,7 +362,7 @@ class TaskIdentity {
}
public function getName() {
- return 'TaskIdentity';
+ return 'TaskIdentifier';
}
public function read($input)
@@ -413,7 +413,7 @@ class TaskIdentity {
public function write($output) {
$xfer = 0;
- $xfer += $output->writeStructBegin('TaskIdentity');
+ $xfer += $output->writeStructBegin('TaskIdentifier');
if ($this->taskId !== null) {
$xfer += $output->writeFieldBegin('taskId', TType::STRING, 1);
$xfer += $output->writeString($this->taskId);
@@ -452,7 +452,7 @@ class TaskStatusChangeEvent {
2 => array(
'var' => 'taskIdentity',
'type' => TType::STRUCT,
- 'class' => '\Airavata\Model\Messaging\Event\TaskIdentity',
+ 'class' => '\Airavata\Model\Messaging\Event\TaskIdentifier',
),
);
}
@@ -494,7 +494,7 @@ class TaskStatusChangeEvent {
break;
case 2:
if ($ftype == TType::STRUCT) {
- $this->taskIdentity = new \Airavata\Model\Messaging\Event\TaskIdentity();
+ $this->taskIdentity = new \Airavata\Model\Messaging\Event\TaskIdentifier();
$xfer += $this->taskIdentity->read($input);
} else {
$xfer += $input->skip($ftype);
@@ -533,6 +533,103 @@ class TaskStatusChangeEvent {
}
+class TaskStatusChangeRequestEvent {
+ static $_TSPEC;
+
+ public $state = null;
+ public $taskIdentity = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'state',
+ 'type' => TType::I32,
+ ),
+ 2 => array(
+ 'var' => 'taskIdentity',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Messaging\Event\TaskIdentifier',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['state'])) {
+ $this->state = $vals['state'];
+ }
+ if (isset($vals['taskIdentity'])) {
+ $this->taskIdentity = $vals['taskIdentity'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'TaskStatusChangeRequestEvent';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->state);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->taskIdentity = new \Airavata\Model\Messaging\Event\TaskIdentifier();
+ $xfer += $this->taskIdentity->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('TaskStatusChangeRequestEvent');
+ if ($this->state !== null) {
+ $xfer += $output->writeFieldBegin('state', TType::I32, 1);
+ $xfer += $output->writeI32($this->state);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->taskIdentity !== null) {
+ if (!is_object($this->taskIdentity)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('taskIdentity', TType::STRUCT, 2);
+ $xfer += $this->taskIdentity->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
class TaskOutputChangeEvent {
static $_TSPEC;
@@ -554,7 +651,7 @@ class TaskOutputChangeEvent {
2 => array(
'var' => 'taskIdentity',
'type' => TType::STRUCT,
- 'class' => '\Airavata\Model\Messaging\Event\TaskIdentity',
+ 'class' => '\Airavata\Model\Messaging\Event\TaskIdentifier',
),
);
}
@@ -607,7 +704,7 @@ class TaskOutputChangeEvent {
break;
case 2:
if ($ftype == TType::STRUCT) {
- $this->taskIdentity = new \Airavata\Model\Messaging\Event\TaskIdentity();
+ $this->taskIdentity = new \Airavata\Model\Messaging\Event\TaskIdentifier();
$xfer += $this->taskIdentity->read($input);
} else {
$xfer += $input->skip($ftype);
@@ -658,7 +755,7 @@ class TaskOutputChangeEvent {
}
-class JobIdentity {
+class JobIdentifier {
static $_TSPEC;
public $jobId = null;
@@ -704,7 +801,7 @@ class JobIdentity {
}
public function getName() {
- return 'JobIdentity';
+ return 'JobIdentifier';
}
public function read($input)
@@ -762,7 +859,7 @@ class JobIdentity {
public function write($output) {
$xfer = 0;
- $xfer += $output->writeStructBegin('JobIdentity');
+ $xfer += $output->writeStructBegin('JobIdentifier');
if ($this->jobId !== null) {
$xfer += $output->writeFieldBegin('jobId', TType::STRING, 1);
$xfer += $output->writeString($this->jobId);
@@ -806,7 +903,7 @@ class JobStatusChangeEvent {
2 => array(
'var' => 'jobIdentity',
'type' => TType::STRUCT,
- 'class' => '\Airavata\Model\Messaging\Event\JobIdentity',
+ 'class' => '\Airavata\Model\Messaging\Event\JobIdentifier',
),
);
}
@@ -848,7 +945,7 @@ class JobStatusChangeEvent {
break;
case 2:
if ($ftype == TType::STRUCT) {
- $this->jobIdentity = new \Airavata\Model\Messaging\Event\JobIdentity();
+ $this->jobIdentity = new \Airavata\Model\Messaging\Event\JobIdentifier();
$xfer += $this->jobIdentity->read($input);
} else {
$xfer += $input->skip($ftype);
@@ -887,6 +984,103 @@ class JobStatusChangeEvent {
}
+class JobStatusChangeRequestEvent {
+ static $_TSPEC;
+
+ public $state = null;
+ public $jobIdentity = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'state',
+ 'type' => TType::I32,
+ ),
+ 2 => array(
+ 'var' => 'jobIdentity',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Messaging\Event\JobIdentifier',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['state'])) {
+ $this->state = $vals['state'];
+ }
+ if (isset($vals['jobIdentity'])) {
+ $this->jobIdentity = $vals['jobIdentity'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'JobStatusChangeRequestEvent';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->state);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->jobIdentity = new \Airavata\Model\Messaging\Event\JobIdentifier();
+ $xfer += $this->jobIdentity->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('JobStatusChangeRequestEvent');
+ if ($this->state !== null) {
+ $xfer += $output->writeFieldBegin('state', TType::I32, 1);
+ $xfer += $output->writeI32($this->state);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->jobIdentity !== null) {
+ if (!is_object($this->jobIdentity)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('jobIdentity', TType::STRUCT, 2);
+ $xfer += $this->jobIdentity->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
class Message {
static $_TSPEC;
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 967577c..e9b74f5 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -58,10 +58,10 @@ public class CreateLaunchExperiment {
private static final String DEFAULT_USER = "default.registry.user";
private static final String DEFAULT_GATEWAY = "default.registry.gateway";
private static Airavata.Client client;
- private static String localHostAppId = "localhost_9c5b098c-8906-4be1-9ef3-a7706c9b1e2c,SimpleEcho0_315d9b93-2cdb-4c1b-8dc3-d2077936f5ae";
+ private static String localHostAppId = "localhost_de131adb-fd50-492e-a68d-292b17db4faf,SimpleEcho0_23670b88-3ea2-48ff-9b6d-cca9d7b297e6";
private static String sshHostAppId;
- private static String pbsEchoAppId = "trestles.sdsc.edu_849a1136-7e0a-4f4a-b835-322a83b967b6,SimpleEcho2_f89d3b8c-6f22-4a77-a9f5-a4df88785ab6";
- private static String pbsWRFAppId = "trestles.sdsc.edu_00482169-8fc4-4633-b779-5ca1f66f27c1,WRF_0f1e90d3-5915-4629-a5a4-73346c1e7535";
+ private static String pbsEchoAppId = "trestles.sdsc.edu_07053ec9-2e8f-4d72-bb4d-3a12fe4360de,SimpleEcho2_c81741d5-47d0-4aa7-9ee5-2a6ad5f586e2";
+ private static String pbsWRFAppId = "trestles.sdsc.edu_5fc718ca-b298-4284-a99b-b23e06b10f06,WRF_e304f95a-83d7-46ba-8292-083aa6a46880";
private static String slurmAppId = "stampede.tacc.xsede.org_b2ef59cb-f626-4767-9ca0-601f94c42ba4,SimpleEcho3_b81c2559-a088-42a3-84ce-40119d874918";
private static String sgeAppId;
private static String br2EchoAppId = "bigred2_9c1e6be8-f7d8-4494-98f2-bf508790e8c6,SimpleEchoBR_149fd613-98e2-46e7-ac7c-4d393349469e";
@@ -77,12 +77,12 @@ public class CreateLaunchExperiment {
AiravataUtils.setExecutionAsClient();
client = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST, THRIFT_SERVER_PORT);
System.out.println("API version is " + client.getAPIVersion());
- addDescriptors();
+// addDescriptors();
//// final String expId = createExperimentForSSHHost(airavata);
-//// final String expId = createExperimentForTrestles(client);
+ final String expId = createExperimentForTrestles(client);
//// final String expId = createExperimentForStampede(client);
- final String expId = createExperimentForLocalHost(client);
+// final String expId = createExperimentForLocalHost(client);
// final String expId = createExperimentForLonestar(airavata);
// final String expId = createExperimentWRFTrestles(client);
// final String expId = createExperimentForBR2(client);
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentifier.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentifier.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentifier.java
new file mode 100644
index 0000000..ef2eb40
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentifier.java
@@ -0,0 +1,684 @@
+/**
+ * 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.
+ */
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.messaging.event;
+
+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.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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class JobIdentifier implements org.apache.thrift.TBase<JobIdentifier, JobIdentifier._Fields>, java.io.Serializable, Cloneable, Comparable<JobIdentifier> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobIdentifier");
+
+ private static final org.apache.thrift.protocol.TField JOB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("jobId", org.apache.thrift.protocol.TType.STRING, (short)1);
+ private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("taskId", org.apache.thrift.protocol.TType.STRING, (short)2);
+ private static final org.apache.thrift.protocol.TField WORKFLOW_NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowNodeId", org.apache.thrift.protocol.TType.STRING, (short)3);
+ 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)4);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new JobIdentifierStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new JobIdentifierTupleSchemeFactory());
+ }
+
+ private String jobId; // required
+ private String taskId; // required
+ private String workflowNodeId; // required
+ private String experimentId; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ JOB_ID((short)1, "jobId"),
+ TASK_ID((short)2, "taskId"),
+ WORKFLOW_NODE_ID((short)3, "workflowNodeId"),
+ EXPERIMENT_ID((short)4, "experimentId");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // JOB_ID
+ return JOB_ID;
+ case 2: // TASK_ID
+ return TASK_ID;
+ case 3: // WORKFLOW_NODE_ID
+ return WORKFLOW_NODE_ID;
+ case 4: // EXPERIMENT_ID
+ return EXPERIMENT_ID;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ 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);
+ tmpMap.put(_Fields.JOB_ID, new org.apache.thrift.meta_data.FieldMetaData("jobId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("taskId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.WORKFLOW_NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("workflowNodeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobIdentifier.class, metaDataMap);
+ }
+
+ public JobIdentifier() {
+ }
+
+ public JobIdentifier(
+ String jobId,
+ String taskId,
+ String workflowNodeId,
+ String experimentId)
+ {
+ this();
+ this.jobId = jobId;
+ this.taskId = taskId;
+ this.workflowNodeId = workflowNodeId;
+ this.experimentId = experimentId;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public JobIdentifier(JobIdentifier other) {
+ if (other.isSetJobId()) {
+ this.jobId = other.jobId;
+ }
+ if (other.isSetTaskId()) {
+ this.taskId = other.taskId;
+ }
+ if (other.isSetWorkflowNodeId()) {
+ this.workflowNodeId = other.workflowNodeId;
+ }
+ if (other.isSetExperimentId()) {
+ this.experimentId = other.experimentId;
+ }
+ }
+
+ public JobIdentifier deepCopy() {
+ return new JobIdentifier(this);
+ }
+
+ @Override
+ public void clear() {
+ this.jobId = null;
+ this.taskId = null;
+ this.workflowNodeId = null;
+ this.experimentId = null;
+ }
+
+ public String getJobId() {
+ return this.jobId;
+ }
+
+ public void setJobId(String jobId) {
+ this.jobId = jobId;
+ }
+
+ public void unsetJobId() {
+ this.jobId = null;
+ }
+
+ /** Returns true if field jobId is set (has been assigned a value) and false otherwise */
+ public boolean isSetJobId() {
+ return this.jobId != null;
+ }
+
+ public void setJobIdIsSet(boolean value) {
+ if (!value) {
+ this.jobId = null;
+ }
+ }
+
+ public String getTaskId() {
+ return this.taskId;
+ }
+
+ public void setTaskId(String taskId) {
+ this.taskId = taskId;
+ }
+
+ public void unsetTaskId() {
+ this.taskId = null;
+ }
+
+ /** Returns true if field taskId is set (has been assigned a value) and false otherwise */
+ public boolean isSetTaskId() {
+ return this.taskId != null;
+ }
+
+ public void setTaskIdIsSet(boolean value) {
+ if (!value) {
+ this.taskId = null;
+ }
+ }
+
+ public String getWorkflowNodeId() {
+ return this.workflowNodeId;
+ }
+
+ public void setWorkflowNodeId(String workflowNodeId) {
+ this.workflowNodeId = workflowNodeId;
+ }
+
+ public void unsetWorkflowNodeId() {
+ this.workflowNodeId = null;
+ }
+
+ /** Returns true if field workflowNodeId is set (has been assigned a value) and false otherwise */
+ public boolean isSetWorkflowNodeId() {
+ return this.workflowNodeId != null;
+ }
+
+ public void setWorkflowNodeIdIsSet(boolean value) {
+ if (!value) {
+ this.workflowNodeId = null;
+ }
+ }
+
+ public String getExperimentId() {
+ return this.experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ public void unsetExperimentId() {
+ this.experimentId = null;
+ }
+
+ /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
+ public boolean isSetExperimentId() {
+ return this.experimentId != null;
+ }
+
+ public void setExperimentIdIsSet(boolean value) {
+ if (!value) {
+ this.experimentId = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case JOB_ID:
+ if (value == null) {
+ unsetJobId();
+ } else {
+ setJobId((String)value);
+ }
+ break;
+
+ case TASK_ID:
+ if (value == null) {
+ unsetTaskId();
+ } else {
+ setTaskId((String)value);
+ }
+ break;
+
+ case WORKFLOW_NODE_ID:
+ if (value == null) {
+ unsetWorkflowNodeId();
+ } else {
+ setWorkflowNodeId((String)value);
+ }
+ break;
+
+ case EXPERIMENT_ID:
+ if (value == null) {
+ unsetExperimentId();
+ } else {
+ setExperimentId((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case JOB_ID:
+ return getJobId();
+
+ case TASK_ID:
+ return getTaskId();
+
+ case WORKFLOW_NODE_ID:
+ return getWorkflowNodeId();
+
+ case EXPERIMENT_ID:
+ return getExperimentId();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case JOB_ID:
+ return isSetJobId();
+ case TASK_ID:
+ return isSetTaskId();
+ case WORKFLOW_NODE_ID:
+ return isSetWorkflowNodeId();
+ case EXPERIMENT_ID:
+ return isSetExperimentId();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof JobIdentifier)
+ return this.equals((JobIdentifier)that);
+ return false;
+ }
+
+ public boolean equals(JobIdentifier that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_jobId = true && this.isSetJobId();
+ boolean that_present_jobId = true && that.isSetJobId();
+ if (this_present_jobId || that_present_jobId) {
+ if (!(this_present_jobId && that_present_jobId))
+ return false;
+ if (!this.jobId.equals(that.jobId))
+ return false;
+ }
+
+ boolean this_present_taskId = true && this.isSetTaskId();
+ boolean that_present_taskId = true && that.isSetTaskId();
+ if (this_present_taskId || that_present_taskId) {
+ if (!(this_present_taskId && that_present_taskId))
+ return false;
+ if (!this.taskId.equals(that.taskId))
+ return false;
+ }
+
+ boolean this_present_workflowNodeId = true && this.isSetWorkflowNodeId();
+ boolean that_present_workflowNodeId = true && that.isSetWorkflowNodeId();
+ if (this_present_workflowNodeId || that_present_workflowNodeId) {
+ if (!(this_present_workflowNodeId && that_present_workflowNodeId))
+ return false;
+ if (!this.workflowNodeId.equals(that.workflowNodeId))
+ return false;
+ }
+
+ boolean this_present_experimentId = true && this.isSetExperimentId();
+ boolean that_present_experimentId = true && that.isSetExperimentId();
+ if (this_present_experimentId || that_present_experimentId) {
+ if (!(this_present_experimentId && that_present_experimentId))
+ return false;
+ if (!this.experimentId.equals(that.experimentId))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(JobIdentifier other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetJobId()).compareTo(other.isSetJobId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetJobId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobId, other.jobId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetTaskId()).compareTo(other.isSetTaskId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetTaskId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskId, other.taskId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetWorkflowNodeId()).compareTo(other.isSetWorkflowNodeId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetWorkflowNodeId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowNodeId, other.workflowNodeId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetExperimentId()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("JobIdentifier(");
+ boolean first = true;
+
+ sb.append("jobId:");
+ if (this.jobId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.jobId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("taskId:");
+ if (this.taskId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.taskId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("workflowNodeId:");
+ if (this.workflowNodeId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.workflowNodeId);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("experimentId:");
+ if (this.experimentId == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.experimentId);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetJobId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'jobId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetTaskId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetWorkflowNodeId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'workflowNodeId' is unset! Struct:" + toString());
+ }
+
+ if (!isSetExperimentId()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class JobIdentifierStandardSchemeFactory implements SchemeFactory {
+ public JobIdentifierStandardScheme getScheme() {
+ return new JobIdentifierStandardScheme();
+ }
+ }
+
+ private static class JobIdentifierStandardScheme extends StandardScheme<JobIdentifier> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, JobIdentifier struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // JOB_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.jobId = iprot.readString();
+ struct.setJobIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // TASK_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.taskId = iprot.readString();
+ struct.setTaskIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // WORKFLOW_NODE_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.workflowNodeId = iprot.readString();
+ struct.setWorkflowNodeIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // EXPERIMENT_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, JobIdentifier struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.jobId != null) {
+ oprot.writeFieldBegin(JOB_ID_FIELD_DESC);
+ oprot.writeString(struct.jobId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.taskId != null) {
+ oprot.writeFieldBegin(TASK_ID_FIELD_DESC);
+ oprot.writeString(struct.taskId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.workflowNodeId != null) {
+ oprot.writeFieldBegin(WORKFLOW_NODE_ID_FIELD_DESC);
+ oprot.writeString(struct.workflowNodeId);
+ oprot.writeFieldEnd();
+ }
+ if (struct.experimentId != null) {
+ oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
+ oprot.writeString(struct.experimentId);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class JobIdentifierTupleSchemeFactory implements SchemeFactory {
+ public JobIdentifierTupleScheme getScheme() {
+ return new JobIdentifierTupleScheme();
+ }
+ }
+
+ private static class JobIdentifierTupleScheme extends TupleScheme<JobIdentifier> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, JobIdentifier struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeString(struct.jobId);
+ oprot.writeString(struct.taskId);
+ oprot.writeString(struct.workflowNodeId);
+ oprot.writeString(struct.experimentId);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, JobIdentifier struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.jobId = iprot.readString();
+ struct.setJobIdIsSet(true);
+ struct.taskId = iprot.readString();
+ struct.setTaskIdIsSet(true);
+ struct.workflowNodeId = iprot.readString();
+ struct.setWorkflowNodeIdIsSet(true);
+ struct.experimentId = iprot.readString();
+ struct.setExperimentIdIsSet(true);
+ }
+ }
+
+}
+
[3/4] removing recursively calling publish
Posted by ch...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentity.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentity.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentity.java
deleted file mode 100644
index af97076..0000000
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobIdentity.java
+++ /dev/null
@@ -1,684 +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.
- */
-
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.airavata.model.messaging.event;
-
-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.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 org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class JobIdentity implements org.apache.thrift.TBase<JobIdentity, JobIdentity._Fields>, java.io.Serializable, Cloneable, Comparable<JobIdentity> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobIdentity");
-
- private static final org.apache.thrift.protocol.TField JOB_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("jobId", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField TASK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("taskId", org.apache.thrift.protocol.TType.STRING, (short)2);
- private static final org.apache.thrift.protocol.TField WORKFLOW_NODE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("workflowNodeId", org.apache.thrift.protocol.TType.STRING, (short)3);
- 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)4);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new JobIdentityStandardSchemeFactory());
- schemes.put(TupleScheme.class, new JobIdentityTupleSchemeFactory());
- }
-
- private String jobId; // required
- private String taskId; // required
- private String workflowNodeId; // required
- private String experimentId; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- JOB_ID((short)1, "jobId"),
- TASK_ID((short)2, "taskId"),
- WORKFLOW_NODE_ID((short)3, "workflowNodeId"),
- EXPERIMENT_ID((short)4, "experimentId");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // JOB_ID
- return JOB_ID;
- case 2: // TASK_ID
- return TASK_ID;
- case 3: // WORKFLOW_NODE_ID
- return WORKFLOW_NODE_ID;
- case 4: // EXPERIMENT_ID
- return EXPERIMENT_ID;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- 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);
- tmpMap.put(_Fields.JOB_ID, new org.apache.thrift.meta_data.FieldMetaData("jobId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.TASK_ID, new org.apache.thrift.meta_data.FieldMetaData("taskId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.WORKFLOW_NODE_ID, new org.apache.thrift.meta_data.FieldMetaData("workflowNodeId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.EXPERIMENT_ID, new org.apache.thrift.meta_data.FieldMetaData("experimentId", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobIdentity.class, metaDataMap);
- }
-
- public JobIdentity() {
- }
-
- public JobIdentity(
- String jobId,
- String taskId,
- String workflowNodeId,
- String experimentId)
- {
- this();
- this.jobId = jobId;
- this.taskId = taskId;
- this.workflowNodeId = workflowNodeId;
- this.experimentId = experimentId;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public JobIdentity(JobIdentity other) {
- if (other.isSetJobId()) {
- this.jobId = other.jobId;
- }
- if (other.isSetTaskId()) {
- this.taskId = other.taskId;
- }
- if (other.isSetWorkflowNodeId()) {
- this.workflowNodeId = other.workflowNodeId;
- }
- if (other.isSetExperimentId()) {
- this.experimentId = other.experimentId;
- }
- }
-
- public JobIdentity deepCopy() {
- return new JobIdentity(this);
- }
-
- @Override
- public void clear() {
- this.jobId = null;
- this.taskId = null;
- this.workflowNodeId = null;
- this.experimentId = null;
- }
-
- public String getJobId() {
- return this.jobId;
- }
-
- public void setJobId(String jobId) {
- this.jobId = jobId;
- }
-
- public void unsetJobId() {
- this.jobId = null;
- }
-
- /** Returns true if field jobId is set (has been assigned a value) and false otherwise */
- public boolean isSetJobId() {
- return this.jobId != null;
- }
-
- public void setJobIdIsSet(boolean value) {
- if (!value) {
- this.jobId = null;
- }
- }
-
- public String getTaskId() {
- return this.taskId;
- }
-
- public void setTaskId(String taskId) {
- this.taskId = taskId;
- }
-
- public void unsetTaskId() {
- this.taskId = null;
- }
-
- /** Returns true if field taskId is set (has been assigned a value) and false otherwise */
- public boolean isSetTaskId() {
- return this.taskId != null;
- }
-
- public void setTaskIdIsSet(boolean value) {
- if (!value) {
- this.taskId = null;
- }
- }
-
- public String getWorkflowNodeId() {
- return this.workflowNodeId;
- }
-
- public void setWorkflowNodeId(String workflowNodeId) {
- this.workflowNodeId = workflowNodeId;
- }
-
- public void unsetWorkflowNodeId() {
- this.workflowNodeId = null;
- }
-
- /** Returns true if field workflowNodeId is set (has been assigned a value) and false otherwise */
- public boolean isSetWorkflowNodeId() {
- return this.workflowNodeId != null;
- }
-
- public void setWorkflowNodeIdIsSet(boolean value) {
- if (!value) {
- this.workflowNodeId = null;
- }
- }
-
- public String getExperimentId() {
- return this.experimentId;
- }
-
- public void setExperimentId(String experimentId) {
- this.experimentId = experimentId;
- }
-
- public void unsetExperimentId() {
- this.experimentId = null;
- }
-
- /** Returns true if field experimentId is set (has been assigned a value) and false otherwise */
- public boolean isSetExperimentId() {
- return this.experimentId != null;
- }
-
- public void setExperimentIdIsSet(boolean value) {
- if (!value) {
- this.experimentId = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case JOB_ID:
- if (value == null) {
- unsetJobId();
- } else {
- setJobId((String)value);
- }
- break;
-
- case TASK_ID:
- if (value == null) {
- unsetTaskId();
- } else {
- setTaskId((String)value);
- }
- break;
-
- case WORKFLOW_NODE_ID:
- if (value == null) {
- unsetWorkflowNodeId();
- } else {
- setWorkflowNodeId((String)value);
- }
- break;
-
- case EXPERIMENT_ID:
- if (value == null) {
- unsetExperimentId();
- } else {
- setExperimentId((String)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case JOB_ID:
- return getJobId();
-
- case TASK_ID:
- return getTaskId();
-
- case WORKFLOW_NODE_ID:
- return getWorkflowNodeId();
-
- case EXPERIMENT_ID:
- return getExperimentId();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case JOB_ID:
- return isSetJobId();
- case TASK_ID:
- return isSetTaskId();
- case WORKFLOW_NODE_ID:
- return isSetWorkflowNodeId();
- case EXPERIMENT_ID:
- return isSetExperimentId();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof JobIdentity)
- return this.equals((JobIdentity)that);
- return false;
- }
-
- public boolean equals(JobIdentity that) {
- if (that == null)
- return false;
-
- boolean this_present_jobId = true && this.isSetJobId();
- boolean that_present_jobId = true && that.isSetJobId();
- if (this_present_jobId || that_present_jobId) {
- if (!(this_present_jobId && that_present_jobId))
- return false;
- if (!this.jobId.equals(that.jobId))
- return false;
- }
-
- boolean this_present_taskId = true && this.isSetTaskId();
- boolean that_present_taskId = true && that.isSetTaskId();
- if (this_present_taskId || that_present_taskId) {
- if (!(this_present_taskId && that_present_taskId))
- return false;
- if (!this.taskId.equals(that.taskId))
- return false;
- }
-
- boolean this_present_workflowNodeId = true && this.isSetWorkflowNodeId();
- boolean that_present_workflowNodeId = true && that.isSetWorkflowNodeId();
- if (this_present_workflowNodeId || that_present_workflowNodeId) {
- if (!(this_present_workflowNodeId && that_present_workflowNodeId))
- return false;
- if (!this.workflowNodeId.equals(that.workflowNodeId))
- return false;
- }
-
- boolean this_present_experimentId = true && this.isSetExperimentId();
- boolean that_present_experimentId = true && that.isSetExperimentId();
- if (this_present_experimentId || that_present_experimentId) {
- if (!(this_present_experimentId && that_present_experimentId))
- return false;
- if (!this.experimentId.equals(that.experimentId))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(JobIdentity other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetJobId()).compareTo(other.isSetJobId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetJobId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobId, other.jobId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetTaskId()).compareTo(other.isSetTaskId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetTaskId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskId, other.taskId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetWorkflowNodeId()).compareTo(other.isSetWorkflowNodeId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetWorkflowNodeId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.workflowNodeId, other.workflowNodeId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetExperimentId()).compareTo(other.isSetExperimentId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetExperimentId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.experimentId, other.experimentId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("JobIdentity(");
- boolean first = true;
-
- sb.append("jobId:");
- if (this.jobId == null) {
- sb.append("null");
- } else {
- sb.append(this.jobId);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("taskId:");
- if (this.taskId == null) {
- sb.append("null");
- } else {
- sb.append(this.taskId);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("workflowNodeId:");
- if (this.workflowNodeId == null) {
- sb.append("null");
- } else {
- sb.append(this.workflowNodeId);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("experimentId:");
- if (this.experimentId == null) {
- sb.append("null");
- } else {
- sb.append(this.experimentId);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- if (!isSetJobId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'jobId' is unset! Struct:" + toString());
- }
-
- if (!isSetTaskId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'taskId' is unset! Struct:" + toString());
- }
-
- if (!isSetWorkflowNodeId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'workflowNodeId' is unset! Struct:" + toString());
- }
-
- if (!isSetExperimentId()) {
- throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId' is unset! Struct:" + toString());
- }
-
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class JobIdentityStandardSchemeFactory implements SchemeFactory {
- public JobIdentityStandardScheme getScheme() {
- return new JobIdentityStandardScheme();
- }
- }
-
- private static class JobIdentityStandardScheme extends StandardScheme<JobIdentity> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, JobIdentity struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // JOB_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.jobId = iprot.readString();
- struct.setJobIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // TASK_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.taskId = iprot.readString();
- struct.setTaskIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // WORKFLOW_NODE_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.workflowNodeId = iprot.readString();
- struct.setWorkflowNodeIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // EXPERIMENT_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.experimentId = iprot.readString();
- struct.setExperimentIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, JobIdentity struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.jobId != null) {
- oprot.writeFieldBegin(JOB_ID_FIELD_DESC);
- oprot.writeString(struct.jobId);
- oprot.writeFieldEnd();
- }
- if (struct.taskId != null) {
- oprot.writeFieldBegin(TASK_ID_FIELD_DESC);
- oprot.writeString(struct.taskId);
- oprot.writeFieldEnd();
- }
- if (struct.workflowNodeId != null) {
- oprot.writeFieldBegin(WORKFLOW_NODE_ID_FIELD_DESC);
- oprot.writeString(struct.workflowNodeId);
- oprot.writeFieldEnd();
- }
- if (struct.experimentId != null) {
- oprot.writeFieldBegin(EXPERIMENT_ID_FIELD_DESC);
- oprot.writeString(struct.experimentId);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class JobIdentityTupleSchemeFactory implements SchemeFactory {
- public JobIdentityTupleScheme getScheme() {
- return new JobIdentityTupleScheme();
- }
- }
-
- private static class JobIdentityTupleScheme extends TupleScheme<JobIdentity> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, JobIdentity struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- oprot.writeString(struct.jobId);
- oprot.writeString(struct.taskId);
- oprot.writeString(struct.workflowNodeId);
- oprot.writeString(struct.experimentId);
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, JobIdentity struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- struct.jobId = iprot.readString();
- struct.setJobIdIsSet(true);
- struct.taskId = iprot.readString();
- struct.setTaskIdIsSet(true);
- struct.workflowNodeId = iprot.readString();
- struct.setWorkflowNodeIdIsSet(true);
- struct.experimentId = iprot.readString();
- struct.setExperimentIdIsSet(true);
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobMonitor.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobMonitor.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobMonitor.java
deleted file mode 100644
index f92c7bb..0000000
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobMonitor.java
+++ /dev/null
@@ -1,1043 +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.
- */
-
-/**
- * Autogenerated by Thrift Compiler (0.9.1)
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- * @generated
- */
-package org.apache.airavata.model.messaging.event;
-
-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.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 org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-@SuppressWarnings("all") public class JobMonitor implements org.apache.thrift.TBase<JobMonitor, JobMonitor._Fields>, java.io.Serializable, Cloneable, Comparable<JobMonitor> {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobMonitor");
-
- private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)1);
- private static final org.apache.thrift.protocol.TField JOB_STARTED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("jobStartedTime", org.apache.thrift.protocol.TType.I64, (short)2);
- private static final org.apache.thrift.protocol.TField LAST_MONITORED_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastMonitoredTime", org.apache.thrift.protocol.TType.I64, (short)3);
- private static final org.apache.thrift.protocol.TField HOST_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("hostId", org.apache.thrift.protocol.TType.STRING, (short)4);
- private static final org.apache.thrift.protocol.TField PARAMETERS_FIELD_DESC = new org.apache.thrift.protocol.TField("parameters", org.apache.thrift.protocol.TType.MAP, (short)5);
- private static final org.apache.thrift.protocol.TField JOB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("jobName", org.apache.thrift.protocol.TType.STRING, (short)6);
- private static final org.apache.thrift.protocol.TField FAILED_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("failedCount", org.apache.thrift.protocol.TType.I32, (short)7);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new JobMonitorStandardSchemeFactory());
- schemes.put(TupleScheme.class, new JobMonitorTupleSchemeFactory());
- }
-
- private String username; // optional
- private long jobStartedTime; // optional
- private long lastMonitoredTime; // optional
- private String hostId; // optional
- private Map<String,String> parameters; // optional
- private String jobName; // optional
- private int failedCount; // optional
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- USERNAME((short)1, "username"),
- JOB_STARTED_TIME((short)2, "jobStartedTime"),
- LAST_MONITORED_TIME((short)3, "lastMonitoredTime"),
- HOST_ID((short)4, "hostId"),
- PARAMETERS((short)5, "parameters"),
- JOB_NAME((short)6, "jobName"),
- FAILED_COUNT((short)7, "failedCount");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 1: // USERNAME
- return USERNAME;
- case 2: // JOB_STARTED_TIME
- return JOB_STARTED_TIME;
- case 3: // LAST_MONITORED_TIME
- return LAST_MONITORED_TIME;
- case 4: // HOST_ID
- return HOST_ID;
- case 5: // PARAMETERS
- return PARAMETERS;
- case 6: // JOB_NAME
- return JOB_NAME;
- case 7: // FAILED_COUNT
- return FAILED_COUNT;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- private static final int __JOBSTARTEDTIME_ISSET_ID = 0;
- private static final int __LASTMONITOREDTIME_ISSET_ID = 1;
- private static final int __FAILEDCOUNT_ISSET_ID = 2;
- private byte __isset_bitfield = 0;
- private _Fields optionals[] = {_Fields.USERNAME,_Fields.JOB_STARTED_TIME,_Fields.LAST_MONITORED_TIME,_Fields.HOST_ID,_Fields.PARAMETERS,_Fields.JOB_NAME,_Fields.FAILED_COUNT};
- 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);
- tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.JOB_STARTED_TIME, new org.apache.thrift.meta_data.FieldMetaData("jobStartedTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.LAST_MONITORED_TIME, new org.apache.thrift.meta_data.FieldMetaData("lastMonitoredTime", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
- tmpMap.put(_Fields.HOST_ID, new org.apache.thrift.meta_data.FieldMetaData("hostId", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.PARAMETERS, new org.apache.thrift.meta_data.FieldMetaData("parameters", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
- tmpMap.put(_Fields.JOB_NAME, new org.apache.thrift.meta_data.FieldMetaData("jobName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.FAILED_COUNT, new org.apache.thrift.meta_data.FieldMetaData("failedCount", org.apache.thrift.TFieldRequirementType.OPTIONAL,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobMonitor.class, metaDataMap);
- }
-
- public JobMonitor() {
- this.failedCount = 0;
-
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public JobMonitor(JobMonitor other) {
- __isset_bitfield = other.__isset_bitfield;
- if (other.isSetUsername()) {
- this.username = other.username;
- }
- this.jobStartedTime = other.jobStartedTime;
- this.lastMonitoredTime = other.lastMonitoredTime;
- if (other.isSetHostId()) {
- this.hostId = other.hostId;
- }
- if (other.isSetParameters()) {
- Map<String,String> __this__parameters = new HashMap<String,String>(other.parameters);
- this.parameters = __this__parameters;
- }
- if (other.isSetJobName()) {
- this.jobName = other.jobName;
- }
- this.failedCount = other.failedCount;
- }
-
- public JobMonitor deepCopy() {
- return new JobMonitor(this);
- }
-
- @Override
- public void clear() {
- this.username = null;
- setJobStartedTimeIsSet(false);
- this.jobStartedTime = 0;
- setLastMonitoredTimeIsSet(false);
- this.lastMonitoredTime = 0;
- this.hostId = null;
- this.parameters = null;
- this.jobName = null;
- this.failedCount = 0;
-
- }
-
- public String getUsername() {
- return this.username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- public void unsetUsername() {
- this.username = null;
- }
-
- /** Returns true if field username is set (has been assigned a value) and false otherwise */
- public boolean isSetUsername() {
- return this.username != null;
- }
-
- public void setUsernameIsSet(boolean value) {
- if (!value) {
- this.username = null;
- }
- }
-
- public long getJobStartedTime() {
- return this.jobStartedTime;
- }
-
- public void setJobStartedTime(long jobStartedTime) {
- this.jobStartedTime = jobStartedTime;
- setJobStartedTimeIsSet(true);
- }
-
- public void unsetJobStartedTime() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __JOBSTARTEDTIME_ISSET_ID);
- }
-
- /** Returns true if field jobStartedTime is set (has been assigned a value) and false otherwise */
- public boolean isSetJobStartedTime() {
- return EncodingUtils.testBit(__isset_bitfield, __JOBSTARTEDTIME_ISSET_ID);
- }
-
- public void setJobStartedTimeIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __JOBSTARTEDTIME_ISSET_ID, value);
- }
-
- public long getLastMonitoredTime() {
- return this.lastMonitoredTime;
- }
-
- public void setLastMonitoredTime(long lastMonitoredTime) {
- this.lastMonitoredTime = lastMonitoredTime;
- setLastMonitoredTimeIsSet(true);
- }
-
- public void unsetLastMonitoredTime() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTMONITOREDTIME_ISSET_ID);
- }
-
- /** Returns true if field lastMonitoredTime is set (has been assigned a value) and false otherwise */
- public boolean isSetLastMonitoredTime() {
- return EncodingUtils.testBit(__isset_bitfield, __LASTMONITOREDTIME_ISSET_ID);
- }
-
- public void setLastMonitoredTimeIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTMONITOREDTIME_ISSET_ID, value);
- }
-
- public String getHostId() {
- return this.hostId;
- }
-
- public void setHostId(String hostId) {
- this.hostId = hostId;
- }
-
- public void unsetHostId() {
- this.hostId = null;
- }
-
- /** Returns true if field hostId is set (has been assigned a value) and false otherwise */
- public boolean isSetHostId() {
- return this.hostId != null;
- }
-
- public void setHostIdIsSet(boolean value) {
- if (!value) {
- this.hostId = null;
- }
- }
-
- public int getParametersSize() {
- return (this.parameters == null) ? 0 : this.parameters.size();
- }
-
- public void putToParameters(String key, String val) {
- if (this.parameters == null) {
- this.parameters = new HashMap<String,String>();
- }
- this.parameters.put(key, val);
- }
-
- public Map<String,String> getParameters() {
- return this.parameters;
- }
-
- public void setParameters(Map<String,String> parameters) {
- this.parameters = parameters;
- }
-
- public void unsetParameters() {
- this.parameters = null;
- }
-
- /** Returns true if field parameters is set (has been assigned a value) and false otherwise */
- public boolean isSetParameters() {
- return this.parameters != null;
- }
-
- public void setParametersIsSet(boolean value) {
- if (!value) {
- this.parameters = null;
- }
- }
-
- public String getJobName() {
- return this.jobName;
- }
-
- public void setJobName(String jobName) {
- this.jobName = jobName;
- }
-
- public void unsetJobName() {
- this.jobName = null;
- }
-
- /** Returns true if field jobName is set (has been assigned a value) and false otherwise */
- public boolean isSetJobName() {
- return this.jobName != null;
- }
-
- public void setJobNameIsSet(boolean value) {
- if (!value) {
- this.jobName = null;
- }
- }
-
- public int getFailedCount() {
- return this.failedCount;
- }
-
- public void setFailedCount(int failedCount) {
- this.failedCount = failedCount;
- setFailedCountIsSet(true);
- }
-
- public void unsetFailedCount() {
- __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FAILEDCOUNT_ISSET_ID);
- }
-
- /** Returns true if field failedCount is set (has been assigned a value) and false otherwise */
- public boolean isSetFailedCount() {
- return EncodingUtils.testBit(__isset_bitfield, __FAILEDCOUNT_ISSET_ID);
- }
-
- public void setFailedCountIsSet(boolean value) {
- __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FAILEDCOUNT_ISSET_ID, value);
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case USERNAME:
- if (value == null) {
- unsetUsername();
- } else {
- setUsername((String)value);
- }
- break;
-
- case JOB_STARTED_TIME:
- if (value == null) {
- unsetJobStartedTime();
- } else {
- setJobStartedTime((Long)value);
- }
- break;
-
- case LAST_MONITORED_TIME:
- if (value == null) {
- unsetLastMonitoredTime();
- } else {
- setLastMonitoredTime((Long)value);
- }
- break;
-
- case HOST_ID:
- if (value == null) {
- unsetHostId();
- } else {
- setHostId((String)value);
- }
- break;
-
- case PARAMETERS:
- if (value == null) {
- unsetParameters();
- } else {
- setParameters((Map<String,String>)value);
- }
- break;
-
- case JOB_NAME:
- if (value == null) {
- unsetJobName();
- } else {
- setJobName((String)value);
- }
- break;
-
- case FAILED_COUNT:
- if (value == null) {
- unsetFailedCount();
- } else {
- setFailedCount((Integer)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case USERNAME:
- return getUsername();
-
- case JOB_STARTED_TIME:
- return Long.valueOf(getJobStartedTime());
-
- case LAST_MONITORED_TIME:
- return Long.valueOf(getLastMonitoredTime());
-
- case HOST_ID:
- return getHostId();
-
- case PARAMETERS:
- return getParameters();
-
- case JOB_NAME:
- return getJobName();
-
- case FAILED_COUNT:
- return Integer.valueOf(getFailedCount());
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case USERNAME:
- return isSetUsername();
- case JOB_STARTED_TIME:
- return isSetJobStartedTime();
- case LAST_MONITORED_TIME:
- return isSetLastMonitoredTime();
- case HOST_ID:
- return isSetHostId();
- case PARAMETERS:
- return isSetParameters();
- case JOB_NAME:
- return isSetJobName();
- case FAILED_COUNT:
- return isSetFailedCount();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof JobMonitor)
- return this.equals((JobMonitor)that);
- return false;
- }
-
- public boolean equals(JobMonitor that) {
- if (that == null)
- return false;
-
- boolean this_present_username = true && this.isSetUsername();
- boolean that_present_username = true && that.isSetUsername();
- if (this_present_username || that_present_username) {
- if (!(this_present_username && that_present_username))
- return false;
- if (!this.username.equals(that.username))
- return false;
- }
-
- boolean this_present_jobStartedTime = true && this.isSetJobStartedTime();
- boolean that_present_jobStartedTime = true && that.isSetJobStartedTime();
- if (this_present_jobStartedTime || that_present_jobStartedTime) {
- if (!(this_present_jobStartedTime && that_present_jobStartedTime))
- return false;
- if (this.jobStartedTime != that.jobStartedTime)
- return false;
- }
-
- boolean this_present_lastMonitoredTime = true && this.isSetLastMonitoredTime();
- boolean that_present_lastMonitoredTime = true && that.isSetLastMonitoredTime();
- if (this_present_lastMonitoredTime || that_present_lastMonitoredTime) {
- if (!(this_present_lastMonitoredTime && that_present_lastMonitoredTime))
- return false;
- if (this.lastMonitoredTime != that.lastMonitoredTime)
- return false;
- }
-
- boolean this_present_hostId = true && this.isSetHostId();
- boolean that_present_hostId = true && that.isSetHostId();
- if (this_present_hostId || that_present_hostId) {
- if (!(this_present_hostId && that_present_hostId))
- return false;
- if (!this.hostId.equals(that.hostId))
- return false;
- }
-
- boolean this_present_parameters = true && this.isSetParameters();
- boolean that_present_parameters = true && that.isSetParameters();
- if (this_present_parameters || that_present_parameters) {
- if (!(this_present_parameters && that_present_parameters))
- return false;
- if (!this.parameters.equals(that.parameters))
- return false;
- }
-
- boolean this_present_jobName = true && this.isSetJobName();
- boolean that_present_jobName = true && that.isSetJobName();
- if (this_present_jobName || that_present_jobName) {
- if (!(this_present_jobName && that_present_jobName))
- return false;
- if (!this.jobName.equals(that.jobName))
- return false;
- }
-
- boolean this_present_failedCount = true && this.isSetFailedCount();
- boolean that_present_failedCount = true && that.isSetFailedCount();
- if (this_present_failedCount || that_present_failedCount) {
- if (!(this_present_failedCount && that_present_failedCount))
- return false;
- if (this.failedCount != that.failedCount)
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- @Override
- public int compareTo(JobMonitor other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
-
- lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetUsername()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetJobStartedTime()).compareTo(other.isSetJobStartedTime());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetJobStartedTime()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobStartedTime, other.jobStartedTime);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetLastMonitoredTime()).compareTo(other.isSetLastMonitoredTime());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetLastMonitoredTime()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastMonitoredTime, other.lastMonitoredTime);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetHostId()).compareTo(other.isSetHostId());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetHostId()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hostId, other.hostId);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetParameters()).compareTo(other.isSetParameters());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetParameters()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parameters, other.parameters);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetJobName()).compareTo(other.isSetJobName());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetJobName()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobName, other.jobName);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetFailedCount()).compareTo(other.isSetFailedCount());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetFailedCount()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.failedCount, other.failedCount);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("JobMonitor(");
- boolean first = true;
-
- if (isSetUsername()) {
- sb.append("username:");
- if (this.username == null) {
- sb.append("null");
- } else {
- sb.append(this.username);
- }
- first = false;
- }
- if (isSetJobStartedTime()) {
- if (!first) sb.append(", ");
- sb.append("jobStartedTime:");
- sb.append(this.jobStartedTime);
- first = false;
- }
- if (isSetLastMonitoredTime()) {
- if (!first) sb.append(", ");
- sb.append("lastMonitoredTime:");
- sb.append(this.lastMonitoredTime);
- first = false;
- }
- if (isSetHostId()) {
- if (!first) sb.append(", ");
- sb.append("hostId:");
- if (this.hostId == null) {
- sb.append("null");
- } else {
- sb.append(this.hostId);
- }
- first = false;
- }
- if (isSetParameters()) {
- if (!first) sb.append(", ");
- sb.append("parameters:");
- if (this.parameters == null) {
- sb.append("null");
- } else {
- sb.append(this.parameters);
- }
- first = false;
- }
- if (isSetJobName()) {
- if (!first) sb.append(", ");
- sb.append("jobName:");
- if (this.jobName == null) {
- sb.append("null");
- } else {
- sb.append(this.jobName);
- }
- first = false;
- }
- if (isSetFailedCount()) {
- if (!first) sb.append(", ");
- sb.append("failedCount:");
- sb.append(this.failedCount);
- first = false;
- }
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
- __isset_bitfield = 0;
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class JobMonitorStandardSchemeFactory implements SchemeFactory {
- public JobMonitorStandardScheme getScheme() {
- return new JobMonitorStandardScheme();
- }
- }
-
- private static class JobMonitorStandardScheme extends StandardScheme<JobMonitor> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, JobMonitor struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 1: // USERNAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.username = iprot.readString();
- struct.setUsernameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 2: // JOB_STARTED_TIME
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.jobStartedTime = iprot.readI64();
- struct.setJobStartedTimeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 3: // LAST_MONITORED_TIME
- if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
- struct.lastMonitoredTime = iprot.readI64();
- struct.setLastMonitoredTimeIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 4: // HOST_ID
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.hostId = iprot.readString();
- struct.setHostIdIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 5: // PARAMETERS
- if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
- {
- org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
- struct.parameters = new HashMap<String,String>(2*_map0.size);
- for (int _i1 = 0; _i1 < _map0.size; ++_i1)
- {
- String _key2;
- String _val3;
- _key2 = iprot.readString();
- _val3 = iprot.readString();
- struct.parameters.put(_key2, _val3);
- }
- iprot.readMapEnd();
- }
- struct.setParametersIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 6: // JOB_NAME
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.jobName = iprot.readString();
- struct.setJobNameIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 7: // FAILED_COUNT
- if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
- struct.failedCount = iprot.readI32();
- struct.setFailedCountIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, JobMonitor struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.username != null) {
- if (struct.isSetUsername()) {
- oprot.writeFieldBegin(USERNAME_FIELD_DESC);
- oprot.writeString(struct.username);
- oprot.writeFieldEnd();
- }
- }
- if (struct.isSetJobStartedTime()) {
- oprot.writeFieldBegin(JOB_STARTED_TIME_FIELD_DESC);
- oprot.writeI64(struct.jobStartedTime);
- oprot.writeFieldEnd();
- }
- if (struct.isSetLastMonitoredTime()) {
- oprot.writeFieldBegin(LAST_MONITORED_TIME_FIELD_DESC);
- oprot.writeI64(struct.lastMonitoredTime);
- oprot.writeFieldEnd();
- }
- if (struct.hostId != null) {
- if (struct.isSetHostId()) {
- oprot.writeFieldBegin(HOST_ID_FIELD_DESC);
- oprot.writeString(struct.hostId);
- oprot.writeFieldEnd();
- }
- }
- if (struct.parameters != null) {
- if (struct.isSetParameters()) {
- oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
- {
- oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.parameters.size()));
- for (Map.Entry<String, String> _iter4 : struct.parameters.entrySet())
- {
- oprot.writeString(_iter4.getKey());
- oprot.writeString(_iter4.getValue());
- }
- oprot.writeMapEnd();
- }
- oprot.writeFieldEnd();
- }
- }
- if (struct.jobName != null) {
- if (struct.isSetJobName()) {
- oprot.writeFieldBegin(JOB_NAME_FIELD_DESC);
- oprot.writeString(struct.jobName);
- oprot.writeFieldEnd();
- }
- }
- if (struct.isSetFailedCount()) {
- oprot.writeFieldBegin(FAILED_COUNT_FIELD_DESC);
- oprot.writeI32(struct.failedCount);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class JobMonitorTupleSchemeFactory implements SchemeFactory {
- public JobMonitorTupleScheme getScheme() {
- return new JobMonitorTupleScheme();
- }
- }
-
- private static class JobMonitorTupleScheme extends TupleScheme<JobMonitor> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, JobMonitor struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetUsername()) {
- optionals.set(0);
- }
- if (struct.isSetJobStartedTime()) {
- optionals.set(1);
- }
- if (struct.isSetLastMonitoredTime()) {
- optionals.set(2);
- }
- if (struct.isSetHostId()) {
- optionals.set(3);
- }
- if (struct.isSetParameters()) {
- optionals.set(4);
- }
- if (struct.isSetJobName()) {
- optionals.set(5);
- }
- if (struct.isSetFailedCount()) {
- optionals.set(6);
- }
- oprot.writeBitSet(optionals, 7);
- if (struct.isSetUsername()) {
- oprot.writeString(struct.username);
- }
- if (struct.isSetJobStartedTime()) {
- oprot.writeI64(struct.jobStartedTime);
- }
- if (struct.isSetLastMonitoredTime()) {
- oprot.writeI64(struct.lastMonitoredTime);
- }
- if (struct.isSetHostId()) {
- oprot.writeString(struct.hostId);
- }
- if (struct.isSetParameters()) {
- {
- oprot.writeI32(struct.parameters.size());
- for (Map.Entry<String, String> _iter5 : struct.parameters.entrySet())
- {
- oprot.writeString(_iter5.getKey());
- oprot.writeString(_iter5.getValue());
- }
- }
- }
- if (struct.isSetJobName()) {
- oprot.writeString(struct.jobName);
- }
- if (struct.isSetFailedCount()) {
- oprot.writeI32(struct.failedCount);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, JobMonitor struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(7);
- if (incoming.get(0)) {
- struct.username = iprot.readString();
- struct.setUsernameIsSet(true);
- }
- if (incoming.get(1)) {
- struct.jobStartedTime = iprot.readI64();
- struct.setJobStartedTimeIsSet(true);
- }
- if (incoming.get(2)) {
- struct.lastMonitoredTime = iprot.readI64();
- struct.setLastMonitoredTimeIsSet(true);
- }
- if (incoming.get(3)) {
- struct.hostId = iprot.readString();
- struct.setHostIdIsSet(true);
- }
- if (incoming.get(4)) {
- {
- org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.parameters = new HashMap<String,String>(2*_map6.size);
- for (int _i7 = 0; _i7 < _map6.size; ++_i7)
- {
- String _key8;
- String _val9;
- _key8 = iprot.readString();
- _val9 = iprot.readString();
- struct.parameters.put(_key8, _val9);
- }
- }
- struct.setParametersIsSet(true);
- }
- if (incoming.get(5)) {
- struct.jobName = iprot.readString();
- struct.setJobNameIsSet(true);
- }
- if (incoming.get(6)) {
- struct.failedCount = iprot.readI32();
- struct.setFailedCountIsSet(true);
- }
- }
- }
-
-}
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeEvent.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeEvent.java
index 1dbbaa4..86ac46c 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeEvent.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeEvent.java
@@ -62,7 +62,7 @@ import org.slf4j.LoggerFactory;
}
private org.apache.airavata.model.workspace.experiment.JobState state; // required
- private JobIdentity jobIdentity; // required
+ private JobIdentifier jobIdentity; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
@SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -136,7 +136,7 @@ import org.slf4j.LoggerFactory;
tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.airavata.model.workspace.experiment.JobState.class)));
tmpMap.put(_Fields.JOB_IDENTITY, new org.apache.thrift.meta_data.FieldMetaData("jobIdentity", org.apache.thrift.TFieldRequirementType.REQUIRED,
- new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobIdentity.class)));
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobIdentifier.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobStatusChangeEvent.class, metaDataMap);
}
@@ -146,7 +146,7 @@ import org.slf4j.LoggerFactory;
public JobStatusChangeEvent(
org.apache.airavata.model.workspace.experiment.JobState state,
- JobIdentity jobIdentity)
+ JobIdentifier jobIdentity)
{
this();
this.state = state;
@@ -161,7 +161,7 @@ import org.slf4j.LoggerFactory;
this.state = other.state;
}
if (other.isSetJobIdentity()) {
- this.jobIdentity = new JobIdentity(other.jobIdentity);
+ this.jobIdentity = new JobIdentifier(other.jobIdentity);
}
}
@@ -206,11 +206,11 @@ import org.slf4j.LoggerFactory;
}
}
- public JobIdentity getJobIdentity() {
+ public JobIdentifier getJobIdentity() {
return this.jobIdentity;
}
- public void setJobIdentity(JobIdentity jobIdentity) {
+ public void setJobIdentity(JobIdentifier jobIdentity) {
this.jobIdentity = jobIdentity;
}
@@ -243,7 +243,7 @@ import org.slf4j.LoggerFactory;
if (value == null) {
unsetJobIdentity();
} else {
- setJobIdentity((JobIdentity)value);
+ setJobIdentity((JobIdentifier)value);
}
break;
@@ -443,7 +443,7 @@ import org.slf4j.LoggerFactory;
break;
case 2: // JOB_IDENTITY
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.jobIdentity = new JobIdentity();
+ struct.jobIdentity = new JobIdentifier();
struct.jobIdentity.read(iprot);
struct.setJobIdentityIsSet(true);
} else {
@@ -499,7 +499,7 @@ import org.slf4j.LoggerFactory;
TTupleProtocol iprot = (TTupleProtocol) prot;
struct.state = org.apache.airavata.model.workspace.experiment.JobState.findByValue(iprot.readI32());
struct.setStateIsSet(true);
- struct.jobIdentity = new JobIdentity();
+ struct.jobIdentity = new JobIdentifier();
struct.jobIdentity.read(iprot);
struct.setJobIdentityIsSet(true);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/255dd9e3/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeRequestEvent.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeRequestEvent.java b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeRequestEvent.java
new file mode 100644
index 0000000..ed4f1da
--- /dev/null
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/messaging/event/JobStatusChangeRequestEvent.java
@@ -0,0 +1,509 @@
+/**
+ * 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.
+ */
+
+/**
+ * Autogenerated by Thrift Compiler (0.9.1)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.airavata.model.messaging.event;
+
+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.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 org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings("all") public class JobStatusChangeRequestEvent implements org.apache.thrift.TBase<JobStatusChangeRequestEvent, JobStatusChangeRequestEvent._Fields>, java.io.Serializable, Cloneable, Comparable<JobStatusChangeRequestEvent> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("JobStatusChangeRequestEvent");
+
+ private static final org.apache.thrift.protocol.TField STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("state", org.apache.thrift.protocol.TType.I32, (short)1);
+ private static final org.apache.thrift.protocol.TField JOB_IDENTITY_FIELD_DESC = new org.apache.thrift.protocol.TField("jobIdentity", org.apache.thrift.protocol.TType.STRUCT, (short)2);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new JobStatusChangeRequestEventStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new JobStatusChangeRequestEventTupleSchemeFactory());
+ }
+
+ private org.apache.airavata.model.workspace.experiment.JobState state; // required
+ private JobIdentifier jobIdentity; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.JobState
+ */
+ STATE((short)1, "state"),
+ JOB_IDENTITY((short)2, "jobIdentity");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // STATE
+ return STATE;
+ case 2: // JOB_IDENTITY
+ return JOB_IDENTITY;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ 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);
+ tmpMap.put(_Fields.STATE, new org.apache.thrift.meta_data.FieldMetaData("state", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, org.apache.airavata.model.workspace.experiment.JobState.class)));
+ tmpMap.put(_Fields.JOB_IDENTITY, new org.apache.thrift.meta_data.FieldMetaData("jobIdentity", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, JobIdentifier.class)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(JobStatusChangeRequestEvent.class, metaDataMap);
+ }
+
+ public JobStatusChangeRequestEvent() {
+ }
+
+ public JobStatusChangeRequestEvent(
+ org.apache.airavata.model.workspace.experiment.JobState state,
+ JobIdentifier jobIdentity)
+ {
+ this();
+ this.state = state;
+ this.jobIdentity = jobIdentity;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public JobStatusChangeRequestEvent(JobStatusChangeRequestEvent other) {
+ if (other.isSetState()) {
+ this.state = other.state;
+ }
+ if (other.isSetJobIdentity()) {
+ this.jobIdentity = new JobIdentifier(other.jobIdentity);
+ }
+ }
+
+ public JobStatusChangeRequestEvent deepCopy() {
+ return new JobStatusChangeRequestEvent(this);
+ }
+
+ @Override
+ public void clear() {
+ this.state = null;
+ this.jobIdentity = null;
+ }
+
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.JobState
+ */
+ public org.apache.airavata.model.workspace.experiment.JobState getState() {
+ return this.state;
+ }
+
+ /**
+ *
+ * @see org.apache.airavata.model.workspace.experiment.JobState
+ */
+ public void setState(org.apache.airavata.model.workspace.experiment.JobState state) {
+ this.state = state;
+ }
+
+ public void unsetState() {
+ this.state = null;
+ }
+
+ /** Returns true if field state is set (has been assigned a value) and false otherwise */
+ public boolean isSetState() {
+ return this.state != null;
+ }
+
+ public void setStateIsSet(boolean value) {
+ if (!value) {
+ this.state = null;
+ }
+ }
+
+ public JobIdentifier getJobIdentity() {
+ return this.jobIdentity;
+ }
+
+ public void setJobIdentity(JobIdentifier jobIdentity) {
+ this.jobIdentity = jobIdentity;
+ }
+
+ public void unsetJobIdentity() {
+ this.jobIdentity = null;
+ }
+
+ /** Returns true if field jobIdentity is set (has been assigned a value) and false otherwise */
+ public boolean isSetJobIdentity() {
+ return this.jobIdentity != null;
+ }
+
+ public void setJobIdentityIsSet(boolean value) {
+ if (!value) {
+ this.jobIdentity = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case STATE:
+ if (value == null) {
+ unsetState();
+ } else {
+ setState((org.apache.airavata.model.workspace.experiment.JobState)value);
+ }
+ break;
+
+ case JOB_IDENTITY:
+ if (value == null) {
+ unsetJobIdentity();
+ } else {
+ setJobIdentity((JobIdentifier)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case STATE:
+ return getState();
+
+ case JOB_IDENTITY:
+ return getJobIdentity();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case STATE:
+ return isSetState();
+ case JOB_IDENTITY:
+ return isSetJobIdentity();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof JobStatusChangeRequestEvent)
+ return this.equals((JobStatusChangeRequestEvent)that);
+ return false;
+ }
+
+ public boolean equals(JobStatusChangeRequestEvent that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_state = true && this.isSetState();
+ boolean that_present_state = true && that.isSetState();
+ if (this_present_state || that_present_state) {
+ if (!(this_present_state && that_present_state))
+ return false;
+ if (!this.state.equals(that.state))
+ return false;
+ }
+
+ boolean this_present_jobIdentity = true && this.isSetJobIdentity();
+ boolean that_present_jobIdentity = true && that.isSetJobIdentity();
+ if (this_present_jobIdentity || that_present_jobIdentity) {
+ if (!(this_present_jobIdentity && that_present_jobIdentity))
+ return false;
+ if (!this.jobIdentity.equals(that.jobIdentity))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(JobStatusChangeRequestEvent other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetState()).compareTo(other.isSetState());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetState()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.state, other.state);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetJobIdentity()).compareTo(other.isSetJobIdentity());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetJobIdentity()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jobIdentity, other.jobIdentity);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("JobStatusChangeRequestEvent(");
+ boolean first = true;
+
+ sb.append("state:");
+ if (this.state == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.state);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("jobIdentity:");
+ if (this.jobIdentity == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.jobIdentity);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetState()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'state' is unset! Struct:" + toString());
+ }
+
+ if (!isSetJobIdentity()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'jobIdentity' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ if (jobIdentity != null) {
+ jobIdentity.validate();
+ }
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class JobStatusChangeRequestEventStandardSchemeFactory implements SchemeFactory {
+ public JobStatusChangeRequestEventStandardScheme getScheme() {
+ return new JobStatusChangeRequestEventStandardScheme();
+ }
+ }
+
+ private static class JobStatusChangeRequestEventStandardScheme extends StandardScheme<JobStatusChangeRequestEvent> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, JobStatusChangeRequestEvent struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 1: // STATE
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.state = org.apache.airavata.model.workspace.experiment.JobState.findByValue(iprot.readI32());
+ struct.setStateIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // JOB_IDENTITY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.jobIdentity = new JobIdentifier();
+ struct.jobIdentity.read(iprot);
+ struct.setJobIdentityIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, JobStatusChangeRequestEvent struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.state != null) {
+ oprot.writeFieldBegin(STATE_FIELD_DESC);
+ oprot.writeI32(struct.state.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.jobIdentity != null) {
+ oprot.writeFieldBegin(JOB_IDENTITY_FIELD_DESC);
+ struct.jobIdentity.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class JobStatusChangeRequestEventTupleSchemeFactory implements SchemeFactory {
+ public JobStatusChangeRequestEventTupleScheme getScheme() {
+ return new JobStatusChangeRequestEventTupleScheme();
+ }
+ }
+
+ private static class JobStatusChangeRequestEventTupleScheme extends TupleScheme<JobStatusChangeRequestEvent> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, JobStatusChangeRequestEvent struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ oprot.writeI32(struct.state.getValue());
+ struct.jobIdentity.write(oprot);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, JobStatusChangeRequestEvent struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ struct.state = org.apache.airavata.model.workspace.experiment.JobState.findByValue(iprot.readI32());
+ struct.setStateIsSet(true);
+ struct.jobIdentity = new JobIdentifier();
+ struct.jobIdentity.read(iprot);
+ struct.setJobIdentityIsSet(true);
+ }
+ }
+
+}
+