airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: code generation for AIRAVATA-1661
Date Mon, 13 Apr 2015 19:35:49 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 97d31b4da -> 71a94a06e


code generation for AIRAVATA-1661


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/71a94a06
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/71a94a06
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/71a94a06

Branch: refs/heads/master
Commit: 71a94a06eb30fcd8bfe587a97094b49cbb3b8c99
Parents: 97d31b4
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Mon Apr 13 15:35:44 2015 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Mon Apr 13 15:35:44 2015 -0400

----------------------------------------------------------------------
 .../orchestrator/cpi/OrchestratorService.java   | 125 +++++++++++++++++--
 .../generate-orchestrator-stubs.sh              |   2 +-
 2 files changed, 114 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/71a94a06/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
b/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
index fdd07a2..ad3edb3 100644
--- a/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
+++ b/modules/orchestrator/airavata-orchestrator-stubs/src/main/java/org/apache/airavata/orchestrator/cpi/OrchestratorService.java
@@ -111,8 +111,9 @@ import org.slf4j.LoggerFactory;
      * *
      * 
      * @param experimentId
+     * @param tokenId
      */
-    public boolean terminateExperiment(String experimentId) throws org.apache.thrift.TException;
+    public boolean terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException;
 
   }
 
@@ -126,7 +127,7 @@ import org.slf4j.LoggerFactory;
 
     public void validateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException;
 
-    public void terminateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException;
+    public void terminateExperiment(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException;
 
   }
 
@@ -246,16 +247,17 @@ import org.slf4j.LoggerFactory;
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT,
"validateExperiment failed: unknown result");
     }
 
-    public boolean terminateExperiment(String experimentId) throws org.apache.thrift.TException
+    public boolean terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException
     {
-      send_terminateExperiment(experimentId);
+      send_terminateExperiment(experimentId, tokenId);
       return recv_terminateExperiment();
     }
 
-    public void send_terminateExperiment(String experimentId) throws org.apache.thrift.TException
+    public void send_terminateExperiment(String experimentId, String tokenId) throws org.apache.thrift.TException
     {
       terminateExperiment_args args = new terminateExperiment_args();
       args.setExperimentId(experimentId);
+      args.setTokenId(tokenId);
       sendBase("terminateExperiment", args);
     }
 
@@ -418,24 +420,27 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    public void terminateExperiment(String experimentId, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException {
+    public void terminateExperiment(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      terminateExperiment_call method_call = new terminateExperiment_call(experimentId, resultHandler,
this, ___protocolFactory, ___transport);
+      terminateExperiment_call method_call = new terminateExperiment_call(experimentId, tokenId,
resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
 
     public static class terminateExperiment_call extends org.apache.thrift.async.TAsyncMethodCall
{
       private String experimentId;
-      public terminateExperiment_call(String experimentId, org.apache.thrift.async.AsyncMethodCallback
resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory
protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException
{
+      private String tokenId;
+      public terminateExperiment_call(String experimentId, String tokenId, org.apache.thrift.async.AsyncMethodCallback
resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory
protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException
{
         super(client, protocolFactory, transport, resultHandler, false);
         this.experimentId = experimentId;
+        this.tokenId = tokenId;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException
{
         prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("terminateExperiment",
org.apache.thrift.protocol.TMessageType.CALL, 0));
         terminateExperiment_args args = new terminateExperiment_args();
         args.setExperimentId(experimentId);
+        args.setTokenId(tokenId);
         args.write(prot);
         prot.writeMessageEnd();
       }
@@ -573,7 +578,7 @@ import org.slf4j.LoggerFactory;
 
       public terminateExperiment_result getResult(I iface, terminateExperiment_args args)
throws org.apache.thrift.TException {
         terminateExperiment_result result = new terminateExperiment_result();
-        result.success = iface.terminateExperiment(args.experimentId);
+        result.success = iface.terminateExperiment(args.experimentId, args.tokenId);
         result.setSuccessIsSet(true);
         return result;
       }
@@ -861,7 +866,7 @@ import org.slf4j.LoggerFactory;
       }
 
       public void start(I iface, terminateExperiment_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean>
resultHandler) throws TException {
-        iface.terminateExperiment(args.experimentId,resultHandler);
+        iface.terminateExperiment(args.experimentId, args.tokenId,resultHandler);
       }
     }
 
@@ -3868,6 +3873,7 @@ import org.slf4j.LoggerFactory;
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("terminateExperiment_args");
 
     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)1);
+    private static final org.apache.thrift.protocol.TField TOKEN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tokenId",
org.apache.thrift.protocol.TType.STRING, (short)2);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes
= new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -3876,10 +3882,12 @@ import org.slf4j.LoggerFactory;
     }
 
     public String experimentId; // required
+    public String tokenId; // 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
{
-      EXPERIMENT_ID((short)1, "experimentId");
+      EXPERIMENT_ID((short)1, "experimentId"),
+      TOKEN_ID((short)2, "tokenId");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -3896,6 +3904,8 @@ import org.slf4j.LoggerFactory;
         switch(fieldId) {
           case 1: // EXPERIMENT_ID
             return EXPERIMENT_ID;
+          case 2: // TOKEN_ID
+            return TOKEN_ID;
           default:
             return null;
         }
@@ -3941,6 +3951,8 @@ import org.slf4j.LoggerFactory;
       Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields,
org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
       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)));
+      tmpMap.put(_Fields.TOKEN_ID, new org.apache.thrift.meta_data.FieldMetaData("tokenId",
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(terminateExperiment_args.class,
metaDataMap);
     }
@@ -3949,10 +3961,12 @@ import org.slf4j.LoggerFactory;
     }
 
     public terminateExperiment_args(
-      String experimentId)
+      String experimentId,
+      String tokenId)
     {
       this();
       this.experimentId = experimentId;
+      this.tokenId = tokenId;
     }
 
     /**
@@ -3962,6 +3976,9 @@ import org.slf4j.LoggerFactory;
       if (other.isSetExperimentId()) {
         this.experimentId = other.experimentId;
       }
+      if (other.isSetTokenId()) {
+        this.tokenId = other.tokenId;
+      }
     }
 
     public terminateExperiment_args deepCopy() {
@@ -3971,6 +3988,7 @@ import org.slf4j.LoggerFactory;
     @Override
     public void clear() {
       this.experimentId = null;
+      this.tokenId = null;
     }
 
     public String getExperimentId() {
@@ -3997,6 +4015,30 @@ import org.slf4j.LoggerFactory;
       }
     }
 
+    public String getTokenId() {
+      return this.tokenId;
+    }
+
+    public terminateExperiment_args setTokenId(String tokenId) {
+      this.tokenId = tokenId;
+      return this;
+    }
+
+    public void unsetTokenId() {
+      this.tokenId = null;
+    }
+
+    /** Returns true if field tokenId is set (has been assigned a value) and false otherwise
*/
+    public boolean isSetTokenId() {
+      return this.tokenId != null;
+    }
+
+    public void setTokenIdIsSet(boolean value) {
+      if (!value) {
+        this.tokenId = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case EXPERIMENT_ID:
@@ -4007,6 +4049,14 @@ import org.slf4j.LoggerFactory;
         }
         break;
 
+      case TOKEN_ID:
+        if (value == null) {
+          unsetTokenId();
+        } else {
+          setTokenId((String)value);
+        }
+        break;
+
       }
     }
 
@@ -4015,6 +4065,9 @@ import org.slf4j.LoggerFactory;
       case EXPERIMENT_ID:
         return getExperimentId();
 
+      case TOKEN_ID:
+        return getTokenId();
+
       }
       throw new IllegalStateException();
     }
@@ -4028,6 +4081,8 @@ import org.slf4j.LoggerFactory;
       switch (field) {
       case EXPERIMENT_ID:
         return isSetExperimentId();
+      case TOKEN_ID:
+        return isSetTokenId();
       }
       throw new IllegalStateException();
     }
@@ -4054,6 +4109,15 @@ import org.slf4j.LoggerFactory;
           return false;
       }
 
+      boolean this_present_tokenId = true && this.isSetTokenId();
+      boolean that_present_tokenId = true && that.isSetTokenId();
+      if (this_present_tokenId || that_present_tokenId) {
+        if (!(this_present_tokenId && that_present_tokenId))
+          return false;
+        if (!this.tokenId.equals(that.tokenId))
+          return false;
+      }
+
       return true;
     }
 
@@ -4080,6 +4144,16 @@ import org.slf4j.LoggerFactory;
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetTokenId()).compareTo(other.isSetTokenId());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetTokenId()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tokenId, other.tokenId);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -4107,6 +4181,14 @@ import org.slf4j.LoggerFactory;
         sb.append(this.experimentId);
       }
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("tokenId:");
+      if (this.tokenId == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.tokenId);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -4116,6 +4198,9 @@ import org.slf4j.LoggerFactory;
       if (experimentId == null) {
         throw new org.apache.thrift.protocol.TProtocolException("Required field 'experimentId'
was not present! Struct: " + toString());
       }
+      if (tokenId == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'tokenId'
was not present! Struct: " + toString());
+      }
       // check for sub-struct validity
     }
 
@@ -4161,6 +4246,14 @@ import org.slf4j.LoggerFactory;
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 2: // TOKEN_ID
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.tokenId = iprot.readString();
+                struct.setTokenIdIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -4181,6 +4274,11 @@ import org.slf4j.LoggerFactory;
           oprot.writeString(struct.experimentId);
           oprot.writeFieldEnd();
         }
+        if (struct.tokenId != null) {
+          oprot.writeFieldBegin(TOKEN_ID_FIELD_DESC);
+          oprot.writeString(struct.tokenId);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -4199,6 +4297,7 @@ import org.slf4j.LoggerFactory;
       public void write(org.apache.thrift.protocol.TProtocol prot, terminateExperiment_args
struct) throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
         oprot.writeString(struct.experimentId);
+        oprot.writeString(struct.tokenId);
       }
 
       @Override
@@ -4206,6 +4305,8 @@ import org.slf4j.LoggerFactory;
         TTupleProtocol iprot = (TTupleProtocol) prot;
         struct.experimentId = iprot.readString();
         struct.setExperimentIdIsSet(true);
+        struct.tokenId = iprot.readString();
+        struct.setTokenIdIsSet(true);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/71a94a06/modules/orchestrator/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh
b/modules/orchestrator/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh
index 5bb1ff9..a7f2659 100755
--- a/modules/orchestrator/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh
+++ b/modules/orchestrator/orchestrator-thrift-descriptions/generate-orchestrator-stubs.sh
@@ -21,7 +21,7 @@
 # Global Constants used across the script
 REQUIRED_THRIFT_VERSION='0.9.1'
 BASE_TARGET_DIR='target'
-ORCHESTRATOR_SERVICE_DIR='../airavata-orchestrator-service/src/main/java'
+ORCHESTRATOR_SERVICE_DIR='../airavata-orchestrator-stubs/src/main/java'
 
 # The Funcation fail prints error messages on failure and quits the script.
 fail() {


Mime
View raw message