airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: change updateProject to have project ID
Date Thu, 22 May 2014 15:52:49 GMT
Repository: airavata
Updated Branches:
  refs/heads/master a36583050 -> 43a3761c6


change updateProject to have project ID


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

Branch: refs/heads/master
Commit: 43a3761c6f7b964a652f3fd1e6a250a586d8f214
Parents: a365830
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Thu May 22 11:52:44 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Thu May 22 11:52:44 2014 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |  46 ++--
 .../java/org/apache/airavata/api/Airavata.java  | 241 +++++++++++++------
 .../src/main/resources/lib/Airavata.cpp         |  46 +++-
 .../src/main/resources/lib/Airavata.h           |  34 ++-
 .../resources/lib/Airavata_server.skeleton.cpp  |   2 +-
 .../resources/lib/Airavata/API/Airavata.php     |  51 ++--
 .../client/samples/CreateLaunchExperiment.java  |  30 +--
 .../airavataAPI.thrift                          |   5 +-
 .../jpa/utils/ThriftDataModelConversion.java    |   2 +-
 9 files changed, 308 insertions(+), 149 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index d8a8392..3a7eca5 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -82,28 +82,27 @@ public class AiravataServerHandler implements Airavata.Iface {
         }
     }
 
-    private boolean validateString(String name){
-        boolean valid = true;
-        if (name == null || name.equals("") || name.trim().length() == 0){
-            valid = false;
-        }
-        return valid;
-    }
-
-    /**
-     * Update a Project
-     *
-     * @param project
-     */
-    @Override
-    public void updateProject(Project project) throws InvalidRequestException, AiravataClientException,
AiravataSystemException, TException {
-        if (!validateString(project.getName()) || !validateString(project.getOwner())){
-            logger.error("Project name and owner cannot be empty...");
-            throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
+    public void updateProject(String projectId, Project updatedProject) throws InvalidRequestException,
+                                                                               AiravataClientException,
+                                                                               AiravataSystemException,
+                                                                               TException
{
+        if (!validateString(projectId) || !validateString(projectId)){
+            logger.error("Project id cannot be empty...");
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Project id cannot be empty...");
+            throw exception;
         }
         try {
             registry = RegistryFactory.getDefaultRegistry();
-            registry.update(RegistryModelType.PROJECT, project, project.getProjectID());
+            if (!registry.isExist(RegistryModelType.PROJECT, projectId)){
+                logger.error("Project does not exist in the system. Please provide a valid
project ID...");
+                AiravataSystemException exception = new AiravataSystemException();
+                exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+                exception.setMessage("Project does not exist in the system. Please provide
a valid project ID...");
+                throw exception;
+            }
+            registry.update(RegistryModelType.PROJECT, updatedProject, projectId);
         } catch (RegistryException e) {
             logger.error("Error while updating the project", e);
             AiravataSystemException exception = new AiravataSystemException();
@@ -111,6 +110,15 @@ public class AiravataServerHandler implements Airavata.Iface {
             exception.setMessage("Error while updating the project. More info : " + e.getMessage());
             throw exception;
         }
+
+    }
+
+    private boolean validateString(String name){
+        boolean valid = true;
+        if (name == null || name.equals("") || name.trim().length() == 0){
+            valid = false;
+        }
+        return valid;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
index 3af0373..8460631 100644
--- a/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
+++ b/airavata-api/airavata-api-stubs/src/main/java/org/apache/airavata/api/Airavata.java
@@ -69,9 +69,10 @@ import org.slf4j.LoggerFactory;
      * Update a Project
      * 
      * 
-     * @param project
+     * @param projectId
+     * @param updatedProject
      */
-    public void updateProject(org.apache.airavata.model.workspace.Project project) throws
org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException,
org.apache.airavata.model.error.AiravataSystemException, org.apache.thrift.TException;
+    public void updateProject(String projectId, org.apache.airavata.model.workspace.Project
updatedProject) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException,
org.apache.airavata.model.error.AiravataSystemException, org.apache.thrift.TException;
 
     /**
      * Get a Project by ID
@@ -421,7 +422,7 @@ import org.slf4j.LoggerFactory;
 
     public void createProject(org.apache.airavata.model.workspace.Project project, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException;
 
-    public void updateProject(org.apache.airavata.model.workspace.Project project, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException;
+    public void updateProject(String projectId, org.apache.airavata.model.workspace.Project
updatedProject, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void getProject(String projectId, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException;
 
@@ -539,16 +540,17 @@ import org.slf4j.LoggerFactory;
       throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT,
"createProject failed: unknown result");
     }
 
-    public void updateProject(org.apache.airavata.model.workspace.Project project) throws
org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException,
org.apache.airavata.model.error.AiravataSystemException, org.apache.thrift.TException
+    public void updateProject(String projectId, org.apache.airavata.model.workspace.Project
updatedProject) throws org.apache.airavata.model.error.InvalidRequestException, org.apache.airavata.model.error.AiravataClientException,
org.apache.airavata.model.error.AiravataSystemException, org.apache.thrift.TException
     {
-      send_updateProject(project);
+      send_updateProject(projectId, updatedProject);
       recv_updateProject();
     }
 
-    public void send_updateProject(org.apache.airavata.model.workspace.Project project) throws
org.apache.thrift.TException
+    public void send_updateProject(String projectId, org.apache.airavata.model.workspace.Project
updatedProject) throws org.apache.thrift.TException
     {
       updateProject_args args = new updateProject_args();
-      args.setProject(project);
+      args.setProjectId(projectId);
+      args.setUpdatedProject(updatedProject);
       sendBase("updateProject", args);
     }
 
@@ -1269,24 +1271,27 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    public void updateProject(org.apache.airavata.model.workspace.Project project, org.apache.thrift.async.AsyncMethodCallback
resultHandler) throws org.apache.thrift.TException {
+    public void updateProject(String projectId, org.apache.airavata.model.workspace.Project
updatedProject, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException
{
       checkReady();
-      updateProject_call method_call = new updateProject_call(project, resultHandler, this,
___protocolFactory, ___transport);
+      updateProject_call method_call = new updateProject_call(projectId, updatedProject,
resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
 
     public static class updateProject_call extends org.apache.thrift.async.TAsyncMethodCall
{
-      private org.apache.airavata.model.workspace.Project project;
-      public updateProject_call(org.apache.airavata.model.workspace.Project project, 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 projectId;
+      private org.apache.airavata.model.workspace.Project updatedProject;
+      public updateProject_call(String projectId, org.apache.airavata.model.workspace.Project
updatedProject, 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.project = project;
+        this.projectId = projectId;
+        this.updatedProject = updatedProject;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException
{
         prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("updateProject", org.apache.thrift.protocol.TMessageType.CALL,
0));
         updateProject_args args = new updateProject_args();
-        args.setProject(project);
+        args.setProjectId(projectId);
+        args.setUpdatedProject(updatedProject);
         args.write(prot);
         prot.writeMessageEnd();
       }
@@ -2071,7 +2076,7 @@ import org.slf4j.LoggerFactory;
       public updateProject_result getResult(I iface, updateProject_args args) throws org.apache.thrift.TException
{
         updateProject_result result = new updateProject_result();
         try {
-          iface.updateProject(args.project);
+          iface.updateProject(args.projectId, args.updatedProject);
         } catch (org.apache.airavata.model.error.InvalidRequestException ire) {
           result.ire = ire;
         } catch (org.apache.airavata.model.error.AiravataClientException ace) {
@@ -2847,7 +2852,7 @@ import org.slf4j.LoggerFactory;
       }
 
       public void start(I iface, updateProject_args args, org.apache.thrift.async.AsyncMethodCallback<Void>
resultHandler) throws TException {
-        iface.updateProject(args.project,resultHandler);
+        iface.updateProject(args.projectId, args.updatedProject,resultHandler);
       }
     }
 
@@ -5780,7 +5785,8 @@ import org.slf4j.LoggerFactory;
   public static class updateProject_args implements org.apache.thrift.TBase<updateProject_args,
updateProject_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateProject_args>
  {
     private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateProject_args");
 
-    private static final org.apache.thrift.protocol.TField PROJECT_FIELD_DESC = new org.apache.thrift.protocol.TField("project",
org.apache.thrift.protocol.TType.STRUCT, (short)1);
+    private static final org.apache.thrift.protocol.TField PROJECT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("projectId",
org.apache.thrift.protocol.TType.STRING, (short)1);
+    private static final org.apache.thrift.protocol.TField UPDATED_PROJECT_FIELD_DESC = new
org.apache.thrift.protocol.TField("updatedProject", org.apache.thrift.protocol.TType.STRUCT,
(short)2);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes
= new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -5788,11 +5794,13 @@ import org.slf4j.LoggerFactory;
       schemes.put(TupleScheme.class, new updateProject_argsTupleSchemeFactory());
     }
 
-    public org.apache.airavata.model.workspace.Project project; // required
+    public String projectId; // required
+    public org.apache.airavata.model.workspace.Project updatedProject; // 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
{
-      PROJECT((short)1, "project");
+      PROJECT_ID((short)1, "projectId"),
+      UPDATED_PROJECT((short)2, "updatedProject");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -5807,8 +5815,10 @@ import org.slf4j.LoggerFactory;
        */
       public static _Fields findByThriftId(int fieldId) {
         switch(fieldId) {
-          case 1: // PROJECT
-            return PROJECT;
+          case 1: // PROJECT_ID
+            return PROJECT_ID;
+          case 2: // UPDATED_PROJECT
+            return UPDATED_PROJECT;
           default:
             return null;
         }
@@ -5852,7 +5862,9 @@ import org.slf4j.LoggerFactory;
     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.PROJECT, new org.apache.thrift.meta_data.FieldMetaData("project",
org.apache.thrift.TFieldRequirementType.REQUIRED, 
+      tmpMap.put(_Fields.PROJECT_ID, new org.apache.thrift.meta_data.FieldMetaData("projectId",
org.apache.thrift.TFieldRequirementType.REQUIRED, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+      tmpMap.put(_Fields.UPDATED_PROJECT, new org.apache.thrift.meta_data.FieldMetaData("updatedProject",
org.apache.thrift.TFieldRequirementType.REQUIRED, 
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT,
org.apache.airavata.model.workspace.Project.class)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(updateProject_args.class,
metaDataMap);
@@ -5862,18 +5874,23 @@ import org.slf4j.LoggerFactory;
     }
 
     public updateProject_args(
-      org.apache.airavata.model.workspace.Project project)
+      String projectId,
+      org.apache.airavata.model.workspace.Project updatedProject)
     {
       this();
-      this.project = project;
+      this.projectId = projectId;
+      this.updatedProject = updatedProject;
     }
 
     /**
      * Performs a deep copy on <i>other</i>.
      */
     public updateProject_args(updateProject_args other) {
-      if (other.isSetProject()) {
-        this.project = new org.apache.airavata.model.workspace.Project(other.project);
+      if (other.isSetProjectId()) {
+        this.projectId = other.projectId;
+      }
+      if (other.isSetUpdatedProject()) {
+        this.updatedProject = new org.apache.airavata.model.workspace.Project(other.updatedProject);
       }
     }
 
@@ -5883,40 +5900,73 @@ import org.slf4j.LoggerFactory;
 
     @Override
     public void clear() {
-      this.project = null;
+      this.projectId = null;
+      this.updatedProject = null;
     }
 
-    public org.apache.airavata.model.workspace.Project getProject() {
-      return this.project;
+    public String getProjectId() {
+      return this.projectId;
     }
 
-    public updateProject_args setProject(org.apache.airavata.model.workspace.Project project)
{
-      this.project = project;
+    public updateProject_args setProjectId(String projectId) {
+      this.projectId = projectId;
       return this;
     }
 
-    public void unsetProject() {
-      this.project = null;
+    public void unsetProjectId() {
+      this.projectId = null;
     }
 
-    /** Returns true if field project is set (has been assigned a value) and false otherwise
*/
-    public boolean isSetProject() {
-      return this.project != null;
+    /** Returns true if field projectId is set (has been assigned a value) and false otherwise
*/
+    public boolean isSetProjectId() {
+      return this.projectId != null;
     }
 
-    public void setProjectIsSet(boolean value) {
+    public void setProjectIdIsSet(boolean value) {
       if (!value) {
-        this.project = null;
+        this.projectId = null;
+      }
+    }
+
+    public org.apache.airavata.model.workspace.Project getUpdatedProject() {
+      return this.updatedProject;
+    }
+
+    public updateProject_args setUpdatedProject(org.apache.airavata.model.workspace.Project
updatedProject) {
+      this.updatedProject = updatedProject;
+      return this;
+    }
+
+    public void unsetUpdatedProject() {
+      this.updatedProject = null;
+    }
+
+    /** Returns true if field updatedProject is set (has been assigned a value) and false
otherwise */
+    public boolean isSetUpdatedProject() {
+      return this.updatedProject != null;
+    }
+
+    public void setUpdatedProjectIsSet(boolean value) {
+      if (!value) {
+        this.updatedProject = null;
       }
     }
 
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
-      case PROJECT:
+      case PROJECT_ID:
         if (value == null) {
-          unsetProject();
+          unsetProjectId();
         } else {
-          setProject((org.apache.airavata.model.workspace.Project)value);
+          setProjectId((String)value);
+        }
+        break;
+
+      case UPDATED_PROJECT:
+        if (value == null) {
+          unsetUpdatedProject();
+        } else {
+          setUpdatedProject((org.apache.airavata.model.workspace.Project)value);
         }
         break;
 
@@ -5925,8 +5975,11 @@ import org.slf4j.LoggerFactory;
 
     public Object getFieldValue(_Fields field) {
       switch (field) {
-      case PROJECT:
-        return getProject();
+      case PROJECT_ID:
+        return getProjectId();
+
+      case UPDATED_PROJECT:
+        return getUpdatedProject();
 
       }
       throw new IllegalStateException();
@@ -5939,8 +5992,10 @@ import org.slf4j.LoggerFactory;
       }
 
       switch (field) {
-      case PROJECT:
-        return isSetProject();
+      case PROJECT_ID:
+        return isSetProjectId();
+      case UPDATED_PROJECT:
+        return isSetUpdatedProject();
       }
       throw new IllegalStateException();
     }
@@ -5958,12 +6013,21 @@ import org.slf4j.LoggerFactory;
       if (that == null)
         return false;
 
-      boolean this_present_project = true && this.isSetProject();
-      boolean that_present_project = true && that.isSetProject();
-      if (this_present_project || that_present_project) {
-        if (!(this_present_project && that_present_project))
+      boolean this_present_projectId = true && this.isSetProjectId();
+      boolean that_present_projectId = true && that.isSetProjectId();
+      if (this_present_projectId || that_present_projectId) {
+        if (!(this_present_projectId && that_present_projectId))
           return false;
-        if (!this.project.equals(that.project))
+        if (!this.projectId.equals(that.projectId))
+          return false;
+      }
+
+      boolean this_present_updatedProject = true && this.isSetUpdatedProject();
+      boolean that_present_updatedProject = true && that.isSetUpdatedProject();
+      if (this_present_updatedProject || that_present_updatedProject) {
+        if (!(this_present_updatedProject && that_present_updatedProject))
+          return false;
+        if (!this.updatedProject.equals(that.updatedProject))
           return false;
       }
 
@@ -5983,12 +6047,22 @@ import org.slf4j.LoggerFactory;
 
       int lastComparison = 0;
 
-      lastComparison = Boolean.valueOf(isSetProject()).compareTo(other.isSetProject());
+      lastComparison = Boolean.valueOf(isSetProjectId()).compareTo(other.isSetProjectId());
       if (lastComparison != 0) {
         return lastComparison;
       }
-      if (isSetProject()) {
-        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.project, other.project);
+      if (isSetProjectId()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.projectId, other.projectId);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
+      lastComparison = Boolean.valueOf(isSetUpdatedProject()).compareTo(other.isSetUpdatedProject());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetUpdatedProject()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updatedProject, other.updatedProject);
         if (lastComparison != 0) {
           return lastComparison;
         }
@@ -6013,11 +6087,19 @@ import org.slf4j.LoggerFactory;
       StringBuilder sb = new StringBuilder("updateProject_args(");
       boolean first = true;
 
-      sb.append("project:");
-      if (this.project == null) {
+      sb.append("projectId:");
+      if (this.projectId == null) {
         sb.append("null");
       } else {
-        sb.append(this.project);
+        sb.append(this.projectId);
+      }
+      first = false;
+      if (!first) sb.append(", ");
+      sb.append("updatedProject:");
+      if (this.updatedProject == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.updatedProject);
       }
       first = false;
       sb.append(")");
@@ -6026,12 +6108,15 @@ import org.slf4j.LoggerFactory;
 
     public void validate() throws org.apache.thrift.TException {
       // check for required fields
-      if (project == null) {
-        throw new org.apache.thrift.protocol.TProtocolException("Required field 'project'
was not present! Struct: " + toString());
+      if (projectId == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'projectId'
was not present! Struct: " + toString());
+      }
+      if (updatedProject == null) {
+        throw new org.apache.thrift.protocol.TProtocolException("Required field 'updatedProject'
was not present! Struct: " + toString());
       }
       // check for sub-struct validity
-      if (project != null) {
-        project.validate();
+      if (updatedProject != null) {
+        updatedProject.validate();
       }
     }
 
@@ -6069,11 +6154,19 @@ import org.slf4j.LoggerFactory;
             break;
           }
           switch (schemeField.id) {
-            case 1: // PROJECT
+            case 1: // PROJECT_ID
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.projectId = iprot.readString();
+                struct.setProjectIdIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
+            case 2: // UPDATED_PROJECT
               if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
-                struct.project = new org.apache.airavata.model.workspace.Project();
-                struct.project.read(iprot);
-                struct.setProjectIsSet(true);
+                struct.updatedProject = new org.apache.airavata.model.workspace.Project();
+                struct.updatedProject.read(iprot);
+                struct.setUpdatedProjectIsSet(true);
               } else { 
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
@@ -6093,9 +6186,14 @@ import org.slf4j.LoggerFactory;
         struct.validate();
 
         oprot.writeStructBegin(STRUCT_DESC);
-        if (struct.project != null) {
-          oprot.writeFieldBegin(PROJECT_FIELD_DESC);
-          struct.project.write(oprot);
+        if (struct.projectId != null) {
+          oprot.writeFieldBegin(PROJECT_ID_FIELD_DESC);
+          oprot.writeString(struct.projectId);
+          oprot.writeFieldEnd();
+        }
+        if (struct.updatedProject != null) {
+          oprot.writeFieldBegin(UPDATED_PROJECT_FIELD_DESC);
+          struct.updatedProject.write(oprot);
           oprot.writeFieldEnd();
         }
         oprot.writeFieldStop();
@@ -6115,15 +6213,18 @@ import org.slf4j.LoggerFactory;
       @Override
       public void write(org.apache.thrift.protocol.TProtocol prot, updateProject_args struct)
throws org.apache.thrift.TException {
         TTupleProtocol oprot = (TTupleProtocol) prot;
-        struct.project.write(oprot);
+        oprot.writeString(struct.projectId);
+        struct.updatedProject.write(oprot);
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, updateProject_args struct)
throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        struct.project = new org.apache.airavata.model.workspace.Project();
-        struct.project.read(iprot);
-        struct.setProjectIsSet(true);
+        struct.projectId = iprot.readString();
+        struct.setProjectIdIsSet(true);
+        struct.updatedProject = new org.apache.airavata.model.workspace.Project();
+        struct.updatedProject.read(iprot);
+        struct.setUpdatedProjectIsSet(true);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.cpp
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.cpp
index 76e7b05..bfbbe0b 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.cpp
@@ -385,7 +385,8 @@ uint32_t Airavata_updateProject_args::read(::apache::thrift::protocol::TProtocol
 
   using ::apache::thrift::protocol::TProtocolException;
 
-  bool isset_project = false;
+  bool isset_projectId = false;
+  bool isset_updatedProject = false;
 
   while (true)
   {
@@ -396,9 +397,17 @@ uint32_t Airavata_updateProject_args::read(::apache::thrift::protocol::TProtocol
     switch (fid)
     {
       case 1:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->projectId);
+          isset_projectId = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 2:
         if (ftype == ::apache::thrift::protocol::T_STRUCT) {
-          xfer += this->project.read(iprot);
-          isset_project = true;
+          xfer += this->updatedProject.read(iprot);
+          isset_updatedProject = true;
         } else {
           xfer += iprot->skip(ftype);
         }
@@ -412,7 +421,9 @@ uint32_t Airavata_updateProject_args::read(::apache::thrift::protocol::TProtocol
 
   xfer += iprot->readStructEnd();
 
-  if (!isset_project)
+  if (!isset_projectId)
+    throw TProtocolException(TProtocolException::INVALID_DATA);
+  if (!isset_updatedProject)
     throw TProtocolException(TProtocolException::INVALID_DATA);
   return xfer;
 }
@@ -421,8 +432,12 @@ uint32_t Airavata_updateProject_args::write(::apache::thrift::protocol::TProtoco
   uint32_t xfer = 0;
   xfer += oprot->writeStructBegin("Airavata_updateProject_args");
 
-  xfer += oprot->writeFieldBegin("project", ::apache::thrift::protocol::T_STRUCT, 1);
-  xfer += this->project.write(oprot);
+  xfer += oprot->writeFieldBegin("projectId", ::apache::thrift::protocol::T_STRING, 1);
+  xfer += oprot->writeString(this->projectId);
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("updatedProject", ::apache::thrift::protocol::T_STRUCT,
2);
+  xfer += this->updatedProject.write(oprot);
   xfer += oprot->writeFieldEnd();
 
   xfer += oprot->writeFieldStop();
@@ -434,8 +449,12 @@ uint32_t Airavata_updateProject_pargs::write(::apache::thrift::protocol::TProtoc
   uint32_t xfer = 0;
   xfer += oprot->writeStructBegin("Airavata_updateProject_pargs");
 
-  xfer += oprot->writeFieldBegin("project", ::apache::thrift::protocol::T_STRUCT, 1);
-  xfer += (*(this->project)).write(oprot);
+  xfer += oprot->writeFieldBegin("projectId", ::apache::thrift::protocol::T_STRING, 1);
+  xfer += oprot->writeString((*(this->projectId)));
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("updatedProject", ::apache::thrift::protocol::T_STRUCT,
2);
+  xfer += (*(this->updatedProject)).write(oprot);
   xfer += oprot->writeFieldEnd();
 
   xfer += oprot->writeFieldStop();
@@ -5458,19 +5477,20 @@ void AiravataClient::recv_createProject(std::string& _return)
   throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT,
"createProject failed: unknown result");
 }
 
-void AiravataClient::updateProject(const  ::Project& project)
+void AiravataClient::updateProject(const std::string& projectId, const  ::Project&
updatedProject)
 {
-  send_updateProject(project);
+  send_updateProject(projectId, updatedProject);
   recv_updateProject();
 }
 
-void AiravataClient::send_updateProject(const  ::Project& project)
+void AiravataClient::send_updateProject(const std::string& projectId, const  ::Project&
updatedProject)
 {
   int32_t cseqid = 0;
   oprot_->writeMessageBegin("updateProject", ::apache::thrift::protocol::T_CALL, cseqid);
 
   Airavata_updateProject_pargs args;
-  args.project = &project;
+  args.projectId = &projectId;
+  args.updatedProject = &updatedProject;
   args.write(oprot_);
 
   oprot_->writeMessageEnd();
@@ -6991,7 +7011,7 @@ void AiravataProcessor::process_updateProject(int32_t seqid, ::apache::thrift::p
 
   Airavata_updateProject_result result;
   try {
-    iface_->updateProject(args.project);
+    iface_->updateProject(args.projectId, args.updatedProject);
   } catch ( ::airavata::api::error::InvalidRequestException &ire) {
     result.ire = ire;
     result.__isset.ire = true;

http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.h
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.h
index c20d484..ac16b6e 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata.h
@@ -17,7 +17,7 @@ class AiravataIf {
   virtual ~AiravataIf() {}
   virtual void GetAPIVersion(std::string& _return) = 0;
   virtual void createProject(std::string& _return, const  ::Project& project) = 0;
-  virtual void updateProject(const  ::Project& project) = 0;
+  virtual void updateProject(const std::string& projectId, const  ::Project& updatedProject)
= 0;
   virtual void getProject( ::Project& _return, const std::string& projectId) = 0;
   virtual void getAllUserProjects(std::vector< ::Project> & _return, const std::string&
userName) = 0;
   virtual void searchProjectsByProjectName(std::vector< ::Project> & _return, const
std::string& userName, const std::string& projectName) = 0;
@@ -73,7 +73,7 @@ class AiravataNull : virtual public AiravataIf {
   void createProject(std::string& /* _return */, const  ::Project& /* project */)
{
     return;
   }
-  void updateProject(const  ::Project& /* project */) {
+  void updateProject(const std::string& /* projectId */, const  ::Project& /* updatedProject
*/) {
     return;
   }
   void getProject( ::Project& /* _return */, const std::string& /* projectId */)
{
@@ -369,20 +369,27 @@ class Airavata_createProject_presult {
 class Airavata_updateProject_args {
  public:
 
-  Airavata_updateProject_args() {
+  Airavata_updateProject_args() : projectId() {
   }
 
   virtual ~Airavata_updateProject_args() throw() {}
 
-   ::Project project;
+  std::string projectId;
+   ::Project updatedProject;
 
-  void __set_project(const  ::Project& val) {
-    project = val;
+  void __set_projectId(const std::string& val) {
+    projectId = val;
+  }
+
+  void __set_updatedProject(const  ::Project& val) {
+    updatedProject = val;
   }
 
   bool operator == (const Airavata_updateProject_args & rhs) const
   {
-    if (!(project == rhs.project))
+    if (!(projectId == rhs.projectId))
+      return false;
+    if (!(updatedProject == rhs.updatedProject))
       return false;
     return true;
   }
@@ -404,7 +411,8 @@ class Airavata_updateProject_pargs {
 
   virtual ~Airavata_updateProject_pargs() throw() {}
 
-  const  ::Project* project;
+  const std::string* projectId;
+  const  ::Project* updatedProject;
 
   uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
 
@@ -3128,8 +3136,8 @@ class AiravataClient : virtual public AiravataIf {
   void createProject(std::string& _return, const  ::Project& project);
   void send_createProject(const  ::Project& project);
   void recv_createProject(std::string& _return);
-  void updateProject(const  ::Project& project);
-  void send_updateProject(const  ::Project& project);
+  void updateProject(const std::string& projectId, const  ::Project& updatedProject);
+  void send_updateProject(const std::string& projectId, const  ::Project& updatedProject);
   void recv_updateProject();
   void getProject( ::Project& _return, const std::string& projectId);
   void send_getProject(const std::string& projectId);
@@ -3303,13 +3311,13 @@ class AiravataMultiface : virtual public AiravataIf {
     return;
   }
 
-  void updateProject(const  ::Project& project) {
+  void updateProject(const std::string& projectId, const  ::Project& updatedProject)
{
     size_t sz = ifaces_.size();
     size_t i = 0;
     for (; i < (sz - 1); ++i) {
-      ifaces_[i]->updateProject(project);
+      ifaces_[i]->updateProject(projectId, updatedProject);
     }
-    ifaces_[i]->updateProject(project);
+    ifaces_[i]->updateProject(projectId, updatedProject);
   }
 
   void getProject( ::Project& _return, const std::string& projectId) {

http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata_server.skeleton.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata_server.skeleton.cpp
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata_server.skeleton.cpp
index 83e13ab..c19c034 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata_server.skeleton.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/Airavata_server.skeleton.cpp
@@ -32,7 +32,7 @@ class AiravataHandler : virtual public AiravataIf {
     printf("createProject\n");
   }
 
-  void updateProject(const  ::Project& project) {
+  void updateProject(const std::string& projectId, const  ::Project& updatedProject)
{
     // Your implementation goes here
     printf("updateProject\n");
   }

http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index a422c0d..fcb75a7 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -19,7 +19,7 @@ use Thrift\Exception\TApplicationException;
 interface AiravataIf {
   public function GetAPIVersion();
   public function createProject(\Airavata\Model\Workspace\Project $project);
-  public function updateProject(\Airavata\Model\Workspace\Project $project);
+  public function updateProject($projectId, \Airavata\Model\Workspace\Project $updatedProject);
   public function getProject($projectId);
   public function getAllUserProjects($userName);
   public function searchProjectsByProjectName($userName, $projectName);
@@ -163,16 +163,17 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("createProject failed: unknown result");
   }
 
-  public function updateProject(\Airavata\Model\Workspace\Project $project)
+  public function updateProject($projectId, \Airavata\Model\Workspace\Project $updatedProject)
   {
-    $this->send_updateProject($project);
+    $this->send_updateProject($projectId, $updatedProject);
     $this->recv_updateProject();
   }
 
-  public function send_updateProject(\Airavata\Model\Workspace\Project $project)
+  public function send_updateProject($projectId, \Airavata\Model\Workspace\Project $updatedProject)
   {
     $args = new \Airavata\API\Airavata_updateProject_args();
-    $args->project = $project;
+    $args->projectId = $projectId;
+    $args->updatedProject = $updatedProject;
     $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
     if ($bin_accel)
     {
@@ -1746,21 +1747,29 @@ class Airavata_createProject_result {
 class Airavata_updateProject_args {
   static $_TSPEC;
 
-  public $project = null;
+  public $projectId = null;
+  public $updatedProject = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
       self::$_TSPEC = array(
         1 => array(
-          'var' => 'project',
+          'var' => 'projectId',
+          'type' => TType::STRING,
+          ),
+        2 => array(
+          'var' => 'updatedProject',
           'type' => TType::STRUCT,
           'class' => '\Airavata\Model\Workspace\Project',
           ),
         );
     }
     if (is_array($vals)) {
-      if (isset($vals['project'])) {
-        $this->project = $vals['project'];
+      if (isset($vals['projectId'])) {
+        $this->projectId = $vals['projectId'];
+      }
+      if (isset($vals['updatedProject'])) {
+        $this->updatedProject = $vals['updatedProject'];
       }
     }
   }
@@ -1785,9 +1794,16 @@ class Airavata_updateProject_args {
       switch ($fid)
       {
         case 1:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->projectId);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
+        case 2:
           if ($ftype == TType::STRUCT) {
-            $this->project = new \Airavata\Model\Workspace\Project();
-            $xfer += $this->project->read($input);
+            $this->updatedProject = new \Airavata\Model\Workspace\Project();
+            $xfer += $this->updatedProject->read($input);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -1805,12 +1821,17 @@ class Airavata_updateProject_args {
   public function write($output) {
     $xfer = 0;
     $xfer += $output->writeStructBegin('Airavata_updateProject_args');
-    if ($this->project !== null) {
-      if (!is_object($this->project)) {
+    if ($this->projectId !== null) {
+      $xfer += $output->writeFieldBegin('projectId', TType::STRING, 1);
+      $xfer += $output->writeString($this->projectId);
+      $xfer += $output->writeFieldEnd();
+    }
+    if ($this->updatedProject !== null) {
+      if (!is_object($this->updatedProject)) {
         throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
       }
-      $xfer += $output->writeFieldBegin('project', TType::STRUCT, 1);
-      $xfer += $this->project->write($output);
+      $xfer += $output->writeFieldBegin('updatedProject', TType::STRUCT, 2);
+      $xfer += $this->updatedProject->write($output);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();

http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/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 57907f8..e39430a 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
@@ -78,13 +78,13 @@ public class CreateLaunchExperiment {
             List<Project> projects = getAllUserProject(airavata, "admin");
             List<Project> searchProjects1 = searchProjectsByProjectName(airavata, "admin",
"project");
             List<Project> searchProjects2 = searchProjectsByProjectDesc(airavata, "admin",
"test");
-//            for (Experiment exp : experiments){
-//                System.out.println(" exp id : " + exp.getExperimentID());
-//                System.out.println("experiment Description : " + exp.getDescription())
;
-//                if (exp.getExperimentStatus() != null) {
-//                    System.out.println(" exp status : " + exp.getExperimentStatus().getExperimentState().toString());
-//                }
-//            }
+            for (Experiment exp : experiments){
+                System.out.println(" exp id : " + exp.getExperimentID());
+                System.out.println("experiment Description : " + exp.getDescription()) ;
+                if (exp.getExperimentStatus() != null) {
+                    System.out.println(" exp status : " + exp.getExperimentStatus().getExperimentState().toString());
+                }
+            }
 
             for (ExperimentSummary exp : searchedExps1){
                 System.out.println("search results by experiment name");
@@ -103,14 +103,14 @@ public class CreateLaunchExperiment {
                 }
             }
 
-//            for (Project pr : searchProjects1){
-//                System.out.println(" project id : " + pr.getProjectID());
-//            }
-//
-//            for (Project pr : searchProjects2){
-//                System.out.println(" project id : " + pr.getProjectID());
-//                System.out.println(" project desc : " + pr.getDescription());
-//            }
+            for (Project pr : searchProjects1){
+                System.out.println(" project id : " + pr.getProjectID());
+            }
+
+            for (Project pr : searchProjects2){
+                System.out.println(" project id : " + pr.getProjectID());
+                System.out.println(" project desc : " + pr.getDescription());
+            }
 
             Thread monitor = (new Thread(){
                  public void run() {

http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
----------------------------------------------------------------------
diff --git a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
index 8fed521..5f1ffae 100644
--- a/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
+++ b/airavata-api/thrift-interface-descriptions/airavataAPI.thrift
@@ -74,7 +74,8 @@ service Airavata {
    * Update a Project
    *
   */
-  void updateProject (1: required workspaceModel.Project project)
+  void updateProject (1: required string projectId,
+                      2: required workspaceModel.Project updatedProject)
       throws (1: airavataErrors.InvalidRequestException ire,
               2: airavataErrors.AiravataClientException ace,
               3: airavataErrors.AiravataSystemException ase)
@@ -272,7 +273,7 @@ service Airavata {
    *
   */
   void updateExperiment(1: required string airavataExperimentId,
-                           2: required experimentModel.Experiment experiment)
+                        2: required experimentModel.Experiment experiment)
     throws (1: airavataErrors.InvalidRequestException ire,
             2: airavataErrors.ExperimentNotFoundException enf,
             3: airavataErrors.AiravataClientException ace,

http://git-wip-us.apache.org/repos/asf/airavata/blob/43a3761c/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
index 1184170..bae3287 100644
--- a/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
+++ b/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/utils/ThriftDataModelConversion.java
@@ -51,7 +51,7 @@ public class ThriftDataModelConversion {
                     sharedUsers.add(resource.getUserName());
                 }
             }
-            project.setSharedGroups(sharedUsers);
+            project.setSharedUsers(sharedUsers);
             return project;
         }
         return null;


Mime
View raw message