airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata git commit: setting username in process model
Date Fri, 25 Mar 2016 18:19:29 GMT
Repository: airavata
Updated Branches:
  refs/heads/develop 253dee8cd -> 6f39725a1


setting username in process model


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

Branch: refs/heads/develop
Commit: 5d36493a8855635f9045cfa6c18b58755b6c640e
Parents: fd9b64f
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Fri Mar 25 14:19:07 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Fri Mar 25 14:19:07 2016 -0400

----------------------------------------------------------------------
 .../lib/airavata/process_model_types.cpp        |  22 ++++
 .../lib/airavata/process_model_types.h          |  12 +-
 .../lib/Airavata/Model/Process/Types.php        |  23 ++++
 .../lib/apache/airavata/model/process/ttypes.py |  15 ++-
 .../airavata/model/process/ProcessModel.java    | 114 ++++++++++++++++++-
 .../model/util/ExperimentModelUtil.java         |   1 +
 .../apache/airavata/gfac/core/GFacUtils.java    |   2 +-
 .../catalog/impl/ExperimentRegistry.java        |   2 +
 .../core/experiment/catalog/model/Process.java  |  10 ++
 .../catalog/resources/ProcessResource.java      |  10 ++
 .../utils/ThriftDataModelConversion.java        |   1 +
 .../src/main/resources/expcatalog-derby.sql     |   1 +
 .../src/main/resources/expcatalog-mysql.sql     |   1 +
 .../process_model.thrift                        |   3 +-
 14 files changed, 208 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.cpp
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.cpp
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.cpp
index 629b78f..cdd437a 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.cpp
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.cpp
@@ -143,6 +143,11 @@ void ProcessModel::__set_experimentDataDir(const std::string& val)
{
 __isset.experimentDataDir = true;
 }
 
+void ProcessModel::__set_userName(const std::string& val) {
+  this->userName = val;
+__isset.userName = true;
+}
+
 uint32_t ProcessModel::read(::apache::thrift::protocol::TProtocol* iprot) {
 
   apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
@@ -390,6 +395,14 @@ uint32_t ProcessModel::read(::apache::thrift::protocol::TProtocol* iprot)
{
           xfer += iprot->skip(ftype);
         }
         break;
+      case 23:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->userName);
+          this->__isset.userName = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
       default:
         xfer += iprot->skip(ftype);
         break;
@@ -551,6 +564,11 @@ uint32_t ProcessModel::write(::apache::thrift::protocol::TProtocol* oprot)
const
     xfer += oprot->writeString(this->experimentDataDir);
     xfer += oprot->writeFieldEnd();
   }
+  if (this->__isset.userName) {
+    xfer += oprot->writeFieldBegin("userName", ::apache::thrift::protocol::T_STRING, 23);
+    xfer += oprot->writeString(this->userName);
+    xfer += oprot->writeFieldEnd();
+  }
   xfer += oprot->writeFieldStop();
   xfer += oprot->writeStructEnd();
   return xfer;
@@ -580,6 +598,7 @@ void swap(ProcessModel &a, ProcessModel &b) {
   swap(a.userDn, b.userDn);
   swap(a.generateCert, b.generateCert);
   swap(a.experimentDataDir, b.experimentDataDir);
+  swap(a.userName, b.userName);
   swap(a.__isset, b.__isset);
 }
 
@@ -606,6 +625,7 @@ ProcessModel::ProcessModel(const ProcessModel& other24) {
   userDn = other24.userDn;
   generateCert = other24.generateCert;
   experimentDataDir = other24.experimentDataDir;
+  userName = other24.userName;
   __isset = other24.__isset;
 }
 ProcessModel& ProcessModel::operator=(const ProcessModel& other25) {
@@ -631,6 +651,7 @@ ProcessModel& ProcessModel::operator=(const ProcessModel& other25)
{
   userDn = other25.userDn;
   generateCert = other25.generateCert;
   experimentDataDir = other25.experimentDataDir;
+  userName = other25.userName;
   __isset = other25.__isset;
   return *this;
 }
@@ -659,6 +680,7 @@ void ProcessModel::printTo(std::ostream& out) const {
   out << ", " << "userDn="; (__isset.userDn ? (out << to_string(userDn))
: (out << "<null>"));
   out << ", " << "generateCert="; (__isset.generateCert ? (out << to_string(generateCert))
: (out << "<null>"));
   out << ", " << "experimentDataDir="; (__isset.experimentDataDir ? (out <<
to_string(experimentDataDir)) : (out << "<null>"));
+  out << ", " << "userName="; (__isset.userName ? (out << to_string(userName))
: (out << "<null>"));
   out << ")";
 }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.h
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.h
b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.h
index efa30d1..bf5b5d0 100644
--- a/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.h
+++ b/airavata-api/airavata-client-sdks/airavata-cpp-sdk/src/main/resources/lib/airavata/process_model_types.h
@@ -44,7 +44,7 @@ namespace apache { namespace airavata { namespace model { namespace process
{
 class ProcessModel;
 
 typedef struct _ProcessModel__isset {
-  _ProcessModel__isset() : creationTime(false), lastUpdateTime(false), processStatus(false),
processDetail(false), applicationInterfaceId(false), applicationDeploymentId(false), computeResourceId(false),
processInputs(false), processOutputs(false), resourceSchedule(false), tasks(false), taskDag(false),
processError(false), gatewayExecutionId(false), enableEmailNotification(false), emailAddresses(false),
storageResourceId(false), userDn(false), generateCert(true), experimentDataDir(false) {}
+  _ProcessModel__isset() : creationTime(false), lastUpdateTime(false), processStatus(false),
processDetail(false), applicationInterfaceId(false), applicationDeploymentId(false), computeResourceId(false),
processInputs(false), processOutputs(false), resourceSchedule(false), tasks(false), taskDag(false),
processError(false), gatewayExecutionId(false), enableEmailNotification(false), emailAddresses(false),
storageResourceId(false), userDn(false), generateCert(true), experimentDataDir(false), userName(false)
{}
   bool creationTime :1;
   bool lastUpdateTime :1;
   bool processStatus :1;
@@ -65,6 +65,7 @@ typedef struct _ProcessModel__isset {
   bool userDn :1;
   bool generateCert :1;
   bool experimentDataDir :1;
+  bool userName :1;
 } _ProcessModel__isset;
 
 class ProcessModel {
@@ -72,7 +73,7 @@ class ProcessModel {
 
   ProcessModel(const ProcessModel&);
   ProcessModel& operator=(const ProcessModel&);
-  ProcessModel() : processId("DO_NOT_SET_AT_CLIENTS"), experimentId(), creationTime(0), lastUpdateTime(0),
processDetail(), applicationInterfaceId(), applicationDeploymentId(), computeResourceId(),
taskDag(), gatewayExecutionId(), enableEmailNotification(0), storageResourceId(), userDn(),
generateCert(false), experimentDataDir() {
+  ProcessModel() : processId("DO_NOT_SET_AT_CLIENTS"), experimentId(), creationTime(0), lastUpdateTime(0),
processDetail(), applicationInterfaceId(), applicationDeploymentId(), computeResourceId(),
taskDag(), gatewayExecutionId(), enableEmailNotification(0), storageResourceId(), userDn(),
generateCert(false), experimentDataDir(), userName() {
   }
 
   virtual ~ProcessModel() throw();
@@ -98,6 +99,7 @@ class ProcessModel {
   std::string userDn;
   bool generateCert;
   std::string experimentDataDir;
+  std::string userName;
 
   _ProcessModel__isset __isset;
 
@@ -145,6 +147,8 @@ class ProcessModel {
 
   void __set_experimentDataDir(const std::string& val);
 
+  void __set_userName(const std::string& val);
+
   bool operator == (const ProcessModel & rhs) const
   {
     if (!(processId == rhs.processId))
@@ -231,6 +235,10 @@ class ProcessModel {
       return false;
     else if (__isset.experimentDataDir && !(experimentDataDir == rhs.experimentDataDir))
       return false;
+    if (__isset.userName != rhs.__isset.userName)
+      return false;
+    else if (__isset.userName && !(userName == rhs.userName))
+      return false;
     return true;
   }
   bool operator != (const ProcessModel &rhs) const {

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Process/Types.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Process/Types.php
b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Process/Types.php
index c0000d0..179be2b 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Process/Types.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/Model/Process/Types.php
@@ -117,6 +117,10 @@ class ProcessModel {
    * @var string
    */
   public $experimentDataDir = null;
+  /**
+   * @var string
+   */
+  public $userName = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -231,6 +235,10 @@ class ProcessModel {
           'var' => 'experimentDataDir',
           'type' => TType::STRING,
           ),
+        23 => array(
+          'var' => 'userName',
+          'type' => TType::STRING,
+          ),
         );
     }
     if (is_array($vals)) {
@@ -300,6 +308,9 @@ class ProcessModel {
       if (isset($vals['experimentDataDir'])) {
         $this->experimentDataDir = $vals['experimentDataDir'];
       }
+      if (isset($vals['userName'])) {
+        $this->userName = $vals['userName'];
+      }
     }
   }
 
@@ -522,6 +533,13 @@ class ProcessModel {
             $xfer += $input->skip($ftype);
           }
           break;
+        case 23:
+          if ($ftype == TType::STRING) {
+            $xfer += $input->readString($this->userName);
+          } else {
+            $xfer += $input->skip($ftype);
+          }
+          break;
         default:
           $xfer += $input->skip($ftype);
           break;
@@ -702,6 +720,11 @@ class ProcessModel {
       $xfer += $output->writeString($this->experimentDataDir);
       $xfer += $output->writeFieldEnd();
     }
+    if ($this->userName !== null) {
+      $xfer += $output->writeFieldBegin('userName', TType::STRING, 23);
+      $xfer += $output->writeString($this->userName);
+      $xfer += $output->writeFieldEnd();
+    }
     $xfer += $output->writeFieldStop();
     $xfer += $output->writeStructEnd();
     return $xfer;

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/process/ttypes.py
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/process/ttypes.py
b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/process/ttypes.py
index 7355759..7da3b53 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/process/ttypes.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/process/ttypes.py
@@ -56,6 +56,7 @@ class ProcessModel:
    - userDn
    - generateCert
    - experimentDataDir
+   - userName
   """
 
   thrift_spec = (
@@ -82,9 +83,10 @@ class ProcessModel:
     (20, TType.STRING, 'userDn', None, None, ), # 20
     (21, TType.BOOL, 'generateCert', None, False, ), # 21
     (22, TType.STRING, 'experimentDataDir', None, None, ), # 22
+    (23, TType.STRING, 'userName', None, None, ), # 23
   )
 
-  def __init__(self, processId=thrift_spec[1][4], experimentId=None, creationTime=None, lastUpdateTime=None,
processStatus=None, processDetail=None, applicationInterfaceId=None, applicationDeploymentId=None,
computeResourceId=None, processInputs=None, processOutputs=None, resourceSchedule=None, tasks=None,
taskDag=None, processError=None, gatewayExecutionId=None, enableEmailNotification=None, emailAddresses=None,
storageResourceId=None, userDn=None, generateCert=thrift_spec[21][4], experimentDataDir=None,):
+  def __init__(self, processId=thrift_spec[1][4], experimentId=None, creationTime=None, lastUpdateTime=None,
processStatus=None, processDetail=None, applicationInterfaceId=None, applicationDeploymentId=None,
computeResourceId=None, processInputs=None, processOutputs=None, resourceSchedule=None, tasks=None,
taskDag=None, processError=None, gatewayExecutionId=None, enableEmailNotification=None, emailAddresses=None,
storageResourceId=None, userDn=None, generateCert=thrift_spec[21][4], experimentDataDir=None,
userName=None,):
     self.processId = processId
     self.experimentId = experimentId
     self.creationTime = creationTime
@@ -107,6 +109,7 @@ class ProcessModel:
     self.userDn = userDn
     self.generateCert = generateCert
     self.experimentDataDir = experimentDataDir
+    self.userName = userName
 
   def read(self, iprot):
     if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans,
TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -253,6 +256,11 @@ class ProcessModel:
           self.experimentDataDir = iprot.readString()
         else:
           iprot.skip(ftype)
+      elif fid == 23:
+        if ftype == TType.STRING:
+          self.userName = iprot.readString()
+        else:
+          iprot.skip(ftype)
       else:
         iprot.skip(ftype)
       iprot.readFieldEnd()
@@ -363,6 +371,10 @@ class ProcessModel:
       oprot.writeFieldBegin('experimentDataDir', TType.STRING, 22)
       oprot.writeString(self.experimentDataDir)
       oprot.writeFieldEnd()
+    if self.userName is not None:
+      oprot.writeFieldBegin('userName', TType.STRING, 23)
+      oprot.writeString(self.userName)
+      oprot.writeFieldEnd()
     oprot.writeFieldStop()
     oprot.writeStructEnd()
 
@@ -398,6 +410,7 @@ class ProcessModel:
     value = (value * 31) ^ hash(self.userDn)
     value = (value * 31) ^ hash(self.generateCert)
     value = (value * 31) ^ hash(self.experimentDataDir)
+    value = (value * 31) ^ hash(self.userName)
     return value
 
   def __repr__(self):

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java
b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java
index 607d5bc..170a30a 100644
--- a/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java
+++ b/airavata-api/airavata-data-models/src/main/java/org/apache/airavata/model/process/ProcessModel.java
@@ -86,6 +86,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
   private static final org.apache.thrift.protocol.TField USER_DN_FIELD_DESC = new org.apache.thrift.protocol.TField("userDn",
org.apache.thrift.protocol.TType.STRING, (short)20);
   private static final org.apache.thrift.protocol.TField GENERATE_CERT_FIELD_DESC = new org.apache.thrift.protocol.TField("generateCert",
org.apache.thrift.protocol.TType.BOOL, (short)21);
   private static final org.apache.thrift.protocol.TField EXPERIMENT_DATA_DIR_FIELD_DESC =
new org.apache.thrift.protocol.TField("experimentDataDir", org.apache.thrift.protocol.TType.STRING,
(short)22);
+  private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName",
org.apache.thrift.protocol.TType.STRING, (short)23);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -115,6 +116,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
   private String userDn; // optional
   private boolean generateCert; // optional
   private String experimentDataDir; // optional
+  private String userName; // optional
 
   /** The set of fields this struct contains, along with convenience methods for finding
and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -139,7 +141,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
     STORAGE_RESOURCE_ID((short)19, "storageResourceId"),
     USER_DN((short)20, "userDn"),
     GENERATE_CERT((short)21, "generateCert"),
-    EXPERIMENT_DATA_DIR((short)22, "experimentDataDir");
+    EXPERIMENT_DATA_DIR((short)22, "experimentDataDir"),
+    USER_NAME((short)23, "userName");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -198,6 +201,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
           return GENERATE_CERT;
         case 22: // EXPERIMENT_DATA_DIR
           return EXPERIMENT_DATA_DIR;
+        case 23: // USER_NAME
+          return USER_NAME;
         default:
           return null;
       }
@@ -243,7 +248,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
   private static final int __ENABLEEMAILNOTIFICATION_ISSET_ID = 2;
   private static final int __GENERATECERT_ISSET_ID = 3;
   private byte __isset_bitfield = 0;
-  private static final _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.LAST_UPDATE_TIME,_Fields.PROCESS_STATUS,_Fields.PROCESS_DETAIL,_Fields.APPLICATION_INTERFACE_ID,_Fields.APPLICATION_DEPLOYMENT_ID,_Fields.COMPUTE_RESOURCE_ID,_Fields.PROCESS_INPUTS,_Fields.PROCESS_OUTPUTS,_Fields.RESOURCE_SCHEDULE,_Fields.TASKS,_Fields.TASK_DAG,_Fields.PROCESS_ERROR,_Fields.GATEWAY_EXECUTION_ID,_Fields.ENABLE_EMAIL_NOTIFICATION,_Fields.EMAIL_ADDRESSES,_Fields.STORAGE_RESOURCE_ID,_Fields.USER_DN,_Fields.GENERATE_CERT,_Fields.EXPERIMENT_DATA_DIR};
+  private static final _Fields optionals[] = {_Fields.CREATION_TIME,_Fields.LAST_UPDATE_TIME,_Fields.PROCESS_STATUS,_Fields.PROCESS_DETAIL,_Fields.APPLICATION_INTERFACE_ID,_Fields.APPLICATION_DEPLOYMENT_ID,_Fields.COMPUTE_RESOURCE_ID,_Fields.PROCESS_INPUTS,_Fields.PROCESS_OUTPUTS,_Fields.RESOURCE_SCHEDULE,_Fields.TASKS,_Fields.TASK_DAG,_Fields.PROCESS_ERROR,_Fields.GATEWAY_EXECUTION_ID,_Fields.ENABLE_EMAIL_NOTIFICATION,_Fields.EMAIL_ADDRESSES,_Fields.STORAGE_RESOURCE_ID,_Fields.USER_DN,_Fields.GENERATE_CERT,_Fields.EXPERIMENT_DATA_DIR,_Fields.USER_NAME};
   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);
@@ -295,6 +300,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
     tmpMap.put(_Fields.EXPERIMENT_DATA_DIR, new org.apache.thrift.meta_data.FieldMetaData("experimentDataDir",
org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+    tmpMap.put(_Fields.USER_NAME, 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)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ProcessModel.class, metaDataMap);
   }
@@ -391,6 +398,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
     if (other.isSetExperimentDataDir()) {
       this.experimentDataDir = other.experimentDataDir;
     }
+    if (other.isSetUserName()) {
+      this.userName = other.userName;
+    }
   }
 
   public ProcessModel deepCopy() {
@@ -426,6 +436,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
     this.generateCert = false;
 
     this.experimentDataDir = null;
+    this.userName = null;
   }
 
   public String getProcessId() {
@@ -990,6 +1001,29 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
     }
   }
 
+  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 void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case PROCESS_ID:
@@ -1168,6 +1202,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
       }
       break;
 
+    case USER_NAME:
+      if (value == null) {
+        unsetUserName();
+      } else {
+        setUserName((String)value);
+      }
+      break;
+
     }
   }
 
@@ -1239,6 +1281,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
     case EXPERIMENT_DATA_DIR:
       return getExperimentDataDir();
 
+    case USER_NAME:
+      return getUserName();
+
     }
     throw new IllegalStateException();
   }
@@ -1294,6 +1339,8 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
       return isSetGenerateCert();
     case EXPERIMENT_DATA_DIR:
       return isSetExperimentDataDir();
+    case USER_NAME:
+      return isSetUserName();
     }
     throw new IllegalStateException();
   }
@@ -1509,6 +1556,15 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
         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;
+    }
+
     return true;
   }
 
@@ -1626,6 +1682,11 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
     if (present_experimentDataDir)
       list.add(experimentDataDir);
 
+    boolean present_userName = true && (isSetUserName());
+    list.add(present_userName);
+    if (present_userName)
+      list.add(userName);
+
     return list.hashCode();
   }
 
@@ -1857,6 +1918,16 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
         return lastComparison;
       }
     }
+    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;
+      }
+    }
     return 0;
   }
 
@@ -2076,6 +2147,16 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
       }
       first = false;
     }
+    if (isSetUserName()) {
+      if (!first) sb.append(", ");
+      sb.append("userName:");
+      if (this.userName == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.userName);
+      }
+      first = false;
+    }
     sb.append(")");
     return sb.toString();
   }
@@ -2360,6 +2441,14 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 23: // USER_NAME
+            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;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -2543,6 +2632,13 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
           oprot.writeFieldEnd();
         }
       }
+      if (struct.userName != null) {
+        if (struct.isSetUserName()) {
+          oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
+          oprot.writeString(struct.userName);
+          oprot.writeFieldEnd();
+        }
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -2623,7 +2719,10 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
       if (struct.isSetExperimentDataDir()) {
         optionals.set(19);
       }
-      oprot.writeBitSet(optionals, 20);
+      if (struct.isSetUserName()) {
+        optionals.set(20);
+      }
+      oprot.writeBitSet(optionals, 21);
       if (struct.isSetCreationTime()) {
         oprot.writeI64(struct.creationTime);
       }
@@ -2708,6 +2807,9 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
       if (struct.isSetExperimentDataDir()) {
         oprot.writeString(struct.experimentDataDir);
       }
+      if (struct.isSetUserName()) {
+        oprot.writeString(struct.userName);
+      }
     }
 
     @Override
@@ -2717,7 +2819,7 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
       struct.setProcessIdIsSet(true);
       struct.experimentId = iprot.readString();
       struct.setExperimentIdIsSet(true);
-      BitSet incoming = iprot.readBitSet(20);
+      BitSet incoming = iprot.readBitSet(21);
       if (incoming.get(0)) {
         struct.creationTime = iprot.readI64();
         struct.setCreationTimeIsSet(true);
@@ -2840,6 +2942,10 @@ public class ProcessModel implements org.apache.thrift.TBase<ProcessModel,
Proce
         struct.experimentDataDir = iprot.readString();
         struct.setExperimentDataDirIsSet(true);
       }
+      if (incoming.get(20)) {
+        struct.userName = iprot.readString();
+        struct.setUserNameIsSet(true);
+      }
     }
   }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
index 502c8ce..d1b25b0 100644
--- a/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
+++ b/airavata-api/airavata-model-utils/src/main/java/org/apache/airavata/model/util/ExperimentModelUtil.java
@@ -107,6 +107,7 @@ public class ExperimentModelUtil {
                 processModel.setComputeResourceId(scheduling.getResourceHostId());
             }
         }
+        processModel.setUserName(experiment.getUserName());
         return processModel;
     }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index 65085db..799ea28 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -864,8 +864,8 @@ public class GFacUtils {
                 for (OutputDataObjectType expOutput : experimentOutputs){
                     if (expOutput.getName().equals(outputName)){
                         DataProductModel dataProductModel = new DataProductModel();
-                        //FIXME We need to set the username here
                         dataProductModel.setGatewayId(processContext.getGatewayId());
+                        dataProductModel.setOwnerName(processContext.getProcessModel().getUserName());
                         dataProductModel.setProductName(outputName);
                         dataProductModel.setDataProductType(DataProductType.FILE);
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
index e890905..3db46f1 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
@@ -281,6 +281,7 @@ public class ExperimentRegistry {
             processResource.setUserDn(process.getUserDn());
             processResource.setGenerateCert(process.isGenerateCert());
             processResource.setExperimentDataDir(process.getExperimentDataDir());
+            processResource.setUserName(process.getUserName());
             if(process.isEnableEmailNotification()){
                 processResource.setEnableEmailNotification(true);
                 if(process.getEmailAddresses() != null){
@@ -739,6 +740,7 @@ public class ExperimentRegistry {
             processResource.setUserDn(process.getUserDn());
             processResource.setGenerateCert(process.isGenerateCert());
             processResource.setExperimentDataDir(process.getExperimentDataDir());
+            processResource.setUserName(process.getUserName());
             if(process.isEnableEmailNotification()){
                 processResource.setEnableEmailNotification(true);
                 if(process.getEmailAddresses() != null){

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
index cc777a1..0722647 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
@@ -45,6 +45,7 @@ public class Process {
     private String emailAddresses;
     private String storageId;
     private String experimentDataDir;
+    private String userName;
     private Experiment experiment;
     private Collection<ProcessError> processErrors;
     private Collection<ProcessInput> processInputs;
@@ -111,6 +112,15 @@ public class Process {
         this.applicationInterfaceId = applicationInterfaceId;
     }
 
+    @Column(name = "USERNAME")
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userDn = userName;
+    }
+
     @Column(name = "STORAGE_RESOURCE_ID")
     public String getStorageId() {
         return storageId;

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
index e1720de..c0c974d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
@@ -54,6 +54,7 @@ public class ProcessResource extends AbstractExpCatResource {
     private String emailAddresses;
     private String storageResourceId;
     private String userDn;
+    private String userName;
     private boolean generateCert;
     private String experimentDataDir;
 
@@ -185,6 +186,14 @@ public class ProcessResource extends AbstractExpCatResource {
         this.experimentDataDir = experimentDataDir;
     }
 
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
     public ExperimentCatResource create(ResourceType type) throws RegistryException{
        switch (type){
            case PROCESS_ERROR:
@@ -590,6 +599,7 @@ public class ProcessResource extends AbstractExpCatResource {
             process.setUserDn(userDn);
             process.setGenerateCert(generateCert);
             process.setExperimentDataDir(experimentDataDir);
+            process.setUserName(userName);
             if (existingProcess == null){
                 em.persist(process);
             }else {

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
index 1e6dda1..e39adc2 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
@@ -380,6 +380,7 @@ public class ThriftDataModelConversion {
             processModel.setStorageResourceId(processResource.getStorageResourceId());
             processModel.setUserDn(processResource.getUserDn());
             processModel.setGenerateCert(processResource.isGenerateCert());
+            processModel.setUserName(processResource.getUserName());
             return processModel;
         }
         return null;

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
index dd2c9ee..ded83b0 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
@@ -196,6 +196,7 @@ CREATE TABLE PROCESS (
   USER_DN varchar(255),
   GENERATE_CERT SMALLINT,
   EXPERIMENT_DATA_DIR VARCHAR (512),
+  USERNAME VARCHAR (255),
   PRIMARY KEY (PROCESS_ID),
   FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 );

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
index aef0b89..04c7cee 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
@@ -200,6 +200,7 @@ CREATE TABLE PROCESS (
   USER_DN varchar(255),
   GENERATE_CERT SMALLINT,
   EXPERIMENT_DATA_DIR VARCHAR (512),
+  USERNAME VARCHAR (255),
   PRIMARY KEY (PROCESS_ID),
   FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
 );

http://git-wip-us.apache.org/repos/asf/airavata/blob/5d36493a/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift
b/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift
index d46a7f4..b780203 100644
--- a/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift
+++ b/thrift-interface-descriptions/data-models/experiment-catalog-models/process_model.thrift
@@ -61,5 +61,6 @@ struct ProcessModel {
     19: optional string storageResourceId,
     20: optional string userDn,
     21: optional bool generateCert = 0,
-    22: optional string experimentDataDir
+    22: optional string experimentDataDir,
+    23: optional string userName;
 }
\ No newline at end of file


Mime
View raw message