You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2016/08/08 18:14:18 UTC

[1/7] airavata git commit: adding registry server module

Repository: airavata
Updated Branches:
  refs/heads/develop f88859bf3 -> 2d9fd253b


http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/thrift-interface-descriptions/component-cpis/registry_api_errors.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/registry_api_errors.thrift b/thrift-interface-descriptions/component-cpis/registry_api_errors.thrift
new file mode 100644
index 0000000..b1de09f
--- /dev/null
+++ b/thrift-interface-descriptions/component-cpis/registry_api_errors.thrift
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+/*
+* This file describes the definitions of the Error Messages that can occur
+*  when invoking Apache Airavata Services through the API. In addition Thrift provides
+*  built in funcationality to raise TApplicationException for all internal server errors.
+*/
+
+namespace java org.apache.airavata.registry.api.exception
+namespace php Airavata.Registry.API.Error
+
+exception RegistryServiceException {
+  1: required string message
+}


[3/7] airavata git commit: adding registry server module

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java
new file mode 100644
index 0000000..8a40fe3
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/exception/RegistryServiceException.java
@@ -0,0 +1,407 @@
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.registry.api.exception;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-08")
+public class RegistryServiceException extends TException implements org.apache.thrift.TBase<RegistryServiceException, RegistryServiceException._Fields>, java.io.Serializable, Cloneable, Comparable<RegistryServiceException> {
+  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RegistryServiceException");
+
+  private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+  static {
+    schemes.put(StandardScheme.class, new RegistryServiceExceptionStandardSchemeFactory());
+    schemes.put(TupleScheme.class, new RegistryServiceExceptionTupleSchemeFactory());
+  }
+
+  public String message; // required
+
+  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+    MESSAGE((short)1, "message");
+
+    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+    static {
+      for (_Fields field : EnumSet.allOf(_Fields.class)) {
+        byName.put(field.getFieldName(), field);
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, or null if its not found.
+     */
+    public static _Fields findByThriftId(int fieldId) {
+      switch(fieldId) {
+        case 1: // MESSAGE
+          return MESSAGE;
+        default:
+          return null;
+      }
+    }
+
+    /**
+     * Find the _Fields constant that matches fieldId, throwing an exception
+     * if it is not found.
+     */
+    public static _Fields findByThriftIdOrThrow(int fieldId) {
+      _Fields fields = findByThriftId(fieldId);
+      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+      return fields;
+    }
+
+    /**
+     * Find the _Fields constant that matches name, or null if its not found.
+     */
+    public static _Fields findByName(String name) {
+      return byName.get(name);
+    }
+
+    private final short _thriftId;
+    private final String _fieldName;
+
+    _Fields(short thriftId, String fieldName) {
+      _thriftId = thriftId;
+      _fieldName = fieldName;
+    }
+
+    public short getThriftFieldId() {
+      return _thriftId;
+    }
+
+    public String getFieldName() {
+      return _fieldName;
+    }
+  }
+
+  // isset id assignments
+  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+  static {
+    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+    tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", 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(RegistryServiceException.class, metaDataMap);
+  }
+
+  public RegistryServiceException() {
+  }
+
+  public RegistryServiceException(
+    String message)
+  {
+    this();
+    this.message = message;
+  }
+
+  /**
+   * Performs a deep copy on <i>other</i>.
+   */
+  public RegistryServiceException(RegistryServiceException other) {
+    if (other.isSetMessage()) {
+      this.message = other.message;
+    }
+  }
+
+  public RegistryServiceException deepCopy() {
+    return new RegistryServiceException(this);
+  }
+
+  @Override
+  public void clear() {
+    this.message = null;
+  }
+
+  public String getMessage() {
+    return this.message;
+  }
+
+  public RegistryServiceException setMessage(String message) {
+    this.message = message;
+    return this;
+  }
+
+  public void unsetMessage() {
+    this.message = null;
+  }
+
+  /** Returns true if field message is set (has been assigned a value) and false otherwise */
+  public boolean isSetMessage() {
+    return this.message != null;
+  }
+
+  public void setMessageIsSet(boolean value) {
+    if (!value) {
+      this.message = null;
+    }
+  }
+
+  public void setFieldValue(_Fields field, Object value) {
+    switch (field) {
+    case MESSAGE:
+      if (value == null) {
+        unsetMessage();
+      } else {
+        setMessage((String)value);
+      }
+      break;
+
+    }
+  }
+
+  public Object getFieldValue(_Fields field) {
+    switch (field) {
+    case MESSAGE:
+      return getMessage();
+
+    }
+    throw new IllegalStateException();
+  }
+
+  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+  public boolean isSet(_Fields field) {
+    if (field == null) {
+      throw new IllegalArgumentException();
+    }
+
+    switch (field) {
+    case MESSAGE:
+      return isSetMessage();
+    }
+    throw new IllegalStateException();
+  }
+
+  @Override
+  public boolean equals(Object that) {
+    if (that == null)
+      return false;
+    if (that instanceof RegistryServiceException)
+      return this.equals((RegistryServiceException)that);
+    return false;
+  }
+
+  public boolean equals(RegistryServiceException that) {
+    if (that == null)
+      return false;
+
+    boolean this_present_message = true && this.isSetMessage();
+    boolean that_present_message = true && that.isSetMessage();
+    if (this_present_message || that_present_message) {
+      if (!(this_present_message && that_present_message))
+        return false;
+      if (!this.message.equals(that.message))
+        return false;
+    }
+
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    List<Object> list = new ArrayList<Object>();
+
+    boolean present_message = true && (isSetMessage());
+    list.add(present_message);
+    if (present_message)
+      list.add(message);
+
+    return list.hashCode();
+  }
+
+  @Override
+  public int compareTo(RegistryServiceException other) {
+    if (!getClass().equals(other.getClass())) {
+      return getClass().getName().compareTo(other.getClass().getName());
+    }
+
+    int lastComparison = 0;
+
+    lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetMessage()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
+    return 0;
+  }
+
+  public _Fields fieldForId(int fieldId) {
+    return _Fields.findByThriftId(fieldId);
+  }
+
+  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+  }
+
+  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder sb = new StringBuilder("RegistryServiceException(");
+    boolean first = true;
+
+    sb.append("message:");
+    if (this.message == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.message);
+    }
+    first = false;
+    sb.append(")");
+    return sb.toString();
+  }
+
+  public void validate() throws org.apache.thrift.TException {
+    // check for required fields
+    if (message == null) {
+      throw new org.apache.thrift.protocol.TProtocolException("Required field 'message' was not present! Struct: " + toString());
+    }
+    // check for sub-struct validity
+  }
+
+  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+    try {
+      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+    try {
+      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+    } catch (org.apache.thrift.TException te) {
+      throw new java.io.IOException(te);
+    }
+  }
+
+  private static class RegistryServiceExceptionStandardSchemeFactory implements SchemeFactory {
+    public RegistryServiceExceptionStandardScheme getScheme() {
+      return new RegistryServiceExceptionStandardScheme();
+    }
+  }
+
+  private static class RegistryServiceExceptionStandardScheme extends StandardScheme<RegistryServiceException> {
+
+    public void read(org.apache.thrift.protocol.TProtocol iprot, RegistryServiceException struct) throws org.apache.thrift.TException {
+      org.apache.thrift.protocol.TField schemeField;
+      iprot.readStructBegin();
+      while (true)
+      {
+        schemeField = iprot.readFieldBegin();
+        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
+          break;
+        }
+        switch (schemeField.id) {
+          case 1: // MESSAGE
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.message = iprot.readString();
+              struct.setMessageIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
+          default:
+            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+        }
+        iprot.readFieldEnd();
+      }
+      iprot.readStructEnd();
+
+      // check for required fields of primitive type, which can't be checked in the validate method
+      struct.validate();
+    }
+
+    public void write(org.apache.thrift.protocol.TProtocol oprot, RegistryServiceException struct) throws org.apache.thrift.TException {
+      struct.validate();
+
+      oprot.writeStructBegin(STRUCT_DESC);
+      if (struct.message != null) {
+        oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
+        oprot.writeString(struct.message);
+        oprot.writeFieldEnd();
+      }
+      oprot.writeFieldStop();
+      oprot.writeStructEnd();
+    }
+
+  }
+
+  private static class RegistryServiceExceptionTupleSchemeFactory implements SchemeFactory {
+    public RegistryServiceExceptionTupleScheme getScheme() {
+      return new RegistryServiceExceptionTupleScheme();
+    }
+  }
+
+  private static class RegistryServiceExceptionTupleScheme extends TupleScheme<RegistryServiceException> {
+
+    @Override
+    public void write(org.apache.thrift.protocol.TProtocol prot, RegistryServiceException struct) throws org.apache.thrift.TException {
+      TTupleProtocol oprot = (TTupleProtocol) prot;
+      oprot.writeString(struct.message);
+    }
+
+    @Override
+    public void read(org.apache.thrift.protocol.TProtocol prot, RegistryServiceException struct) throws org.apache.thrift.TException {
+      TTupleProtocol iprot = (TTupleProtocol) prot;
+      struct.message = iprot.readString();
+      struct.setMessageIsSet(true);
+    }
+  }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/registry_apiConstants.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/registry_apiConstants.java b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/registry_apiConstants.java
new file mode 100644
index 0000000..cca3954
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/registry_apiConstants.java
@@ -0,0 +1,57 @@
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.registry.api;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+public class registry_apiConstants {
+
+  public static final String REGISTRY_API_VERSION = "0.17.0";
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh b/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh
index cdfa67b..ba95bee 100755
--- a/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh
+++ b/thrift-interface-descriptions/component-cpis/generate-cpi-stubs.sh
@@ -24,7 +24,8 @@ show_usage() {
 	echo -e "\tcs Generate/Update Credential Store Stubs"
 	echo -e "\torch Generate/Update Orchestrator Stubs"
 	echo -e "\tgfac Generate/Update GFac Stubs"
-	echo -e "\tall Generate/Update all stubs (Credential Store, Orchestrator, GFac)."
+	echo -e "\registry Generate/Update Registry Stubs"
+	echo -e "\tall Generate/Update all stubs (Credential Store, Orchestrator, GFac, Registry)."
 	echo -e "\t-h[elp] Print the usage options of this script"
 }
 
@@ -69,6 +70,9 @@ ORCHESTRATOR_SRC_DIR='../../modules/orchestrator/orchestrator-client/src/main/ja
 GFAC_THRIFT_FILE='gfac-cpi.thrift'
 GFAC_SRC_DIR='../../modules/gfac/gfac-client/src/main/java/'
 
+REGISTRY_THRIFT_FILE='registry-api.thrift'
+REGISTRY_SRC_DIR='../../modules/registry/registry-server/registry-api-stubs/src/main/java/'
+
 # Initialize the thrift arguments.
 #  Since most of the Airavata API and Data Models have includes, use recursive option by default.
 #  Generate all the files in target directory
@@ -171,6 +175,7 @@ do
             generate_thrift_stubs ${CS_THRIFT_FILE} ${CS_SRC_DIR}
             generate_thrift_stubs ${ORCHESTRATOR_THRIFT_FILE} ${ORCHESTRATOR_SRC_DIR}
             generate_thrift_stubs ${GFAC_THRIFT_FILE} ${GFAC_SRC_DIR}
+            generate_thrift_stubs ${REGISTRY_THRIFT_FILE} ${REGISTRY_SRC_DIR}
             ;;
     cs)   echo "Generating Credential Store Stubs"
             generate_thrift_stubs ${CS_THRIFT_FILE} ${CS_SRC_DIR}
@@ -181,6 +186,9 @@ do
     gfac)    echo "Generate GFac Stubs"
             generate_thrift_stubs ${GFAC_THRIFT_FILE} ${GFAC_SRC_DIR}
             ;;
+    registry)    echo "Generate Registry Stubs"
+            generate_thrift_stubs ${REGISTRY_THRIFT_FILE} ${REGISTRY_SRC_DIR}
+            ;;
     *)      echo "Invalid or unsupported option"
     	    show_usage
 	        exit 1


[4/7] airavata git commit: adding registry server module

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
new file mode 100644
index 0000000..22e29d1
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-stubs/src/main/java/org/apache/airavata/registry/api/RegistryService.java
@@ -0,0 +1,136899 @@
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+package org.apache.airavata.registry.api;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-08-08")
+public class RegistryService {
+
+  public interface Iface {
+
+    /**
+     * Fetch Apache Registry API version
+     * 
+     */
+    public String getAPIVersion() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Verify if User Exists within Airavata.
+     * 
+     * @param gatewayId
+     * 
+     *  @param userName
+     * 
+     * @return true/false
+     * 
+     * 
+     * 
+     * @param gatewayId
+     * @param userName
+     */
+    public boolean isUserExists(String gatewayId, String userName) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Register a Gateway with Airavata.
+     * 
+     * @param gateway
+     *    The gateway data model.
+     * 
+     * @return gatewayId
+     *   Th unique identifier of the  newly registered gateway.
+     * 
+     * 
+     * 
+     * @param gateway
+     */
+    public String addGateway(org.apache.airavata.model.workspace.Gateway gateway) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Get all users in the gateway
+     * 
+     * @param gatewayId
+     *    The gateway data model.
+     * 
+     * @return users
+     *   list of usernames of the users in the gateway
+     * 
+     * 
+     * 
+     * @param gatewayId
+     */
+    public List<String> getAllUsersInGateway(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Update previously registered Gateway metadata.
+     * 
+     * @param gatewayId
+     *    The gateway Id of the Gateway which require an update.
+     * 
+     * @return gateway
+     *    Modified gateway obejct.
+     * 
+     * @exception AiravataClientException
+     * 
+     * 
+     * 
+     * @param gatewayId
+     * @param updatedGateway
+     */
+    public boolean updateGateway(String gatewayId, org.apache.airavata.model.workspace.Gateway updatedGateway) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Get Gateway details by providing gatewayId
+     * 
+     * @param gatewayId
+     *    The gateway Id of the Gateway.
+     * 
+     * @return gateway
+     *    Gateway obejct.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     */
+    public org.apache.airavata.model.workspace.Gateway getGateway(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete a Gateway
+     * 
+     * @param gatewayId
+     *    The gateway Id of the Gateway to be deleted.
+     * 
+     * @return boolean
+     *    Boolean identifier for the success or failure of the deletion operation.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     */
+    public boolean deleteGateway(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Get All the Gateways Connected to Airavata.
+     * 
+     */
+    public List<org.apache.airavata.model.workspace.Gateway> getAllGateways() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Check for the Existance of a Gateway within Airavata
+     * 
+     * @param gatewayId
+     *   Provide the gatewayId of the gateway you want to check the existancy
+     * 
+     * @return boolean
+     *   Boolean idetifier for the existance or non-existane of the gatewayId
+     * 
+     * @return gatewayId
+     *   return the gatewayId of the existing gateway.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     */
+    public boolean isGatewayExist(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     *   * API methods to retrieve notifications
+     * *
+     * 
+     * @param notification
+     */
+    public String createNotification(org.apache.airavata.model.workspace.Notification notification) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public boolean updateNotification(org.apache.airavata.model.workspace.Notification notification) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public boolean deleteNotification(String gatewayId, String notificationId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public org.apache.airavata.model.workspace.Notification getNotification(String gatewayId, String notificationId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public List<org.apache.airavata.model.workspace.Notification> getAllNotifications(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Creates a Project with basic metadata.
+     *    A Project is a container of experiments.
+     * 
+     * @param gatewayId
+     *    The identifier for the requested gateway.
+     * 
+     * @param Project
+     *    The Project Object described in the workspace_model.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     * @param project
+     */
+    public String createProject(String gatewayId, org.apache.airavata.model.workspace.Project project) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update an Existing Project
+     * 
+     * @param projectId
+     *    The projectId of the project needed an update.
+     * 
+     * @return void
+     *    Currently this does not return any value.
+     * 
+     * 
+     * 
+     * @param projectId
+     * @param updatedProject
+     */
+    public void updateProject(String projectId, org.apache.airavata.model.workspace.Project updatedProject) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get a Project by ID
+     *    This method is to obtain a project by providing a projectId.
+     * 
+     * @param projectId
+     *    projectId of the project you require.
+     * 
+     * @return project
+     *    project data model will be returned.
+     * 
+     * 
+     * 
+     * @param projectId
+     */
+    public org.apache.airavata.model.workspace.Project getProject(String projectId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Delete a Project
+     *    This method is used to delete an existing Project.
+     * 
+     * @param projectId
+     *    projectId of the project you want to delete.
+     * 
+     * @return boolean
+     *    Boolean identifier for the success or failure of the deletion operation.
+     * 
+     *    NOTE: This method is not used within gateways connected with Airavata.
+     * 
+     * 
+     * 
+     * @param projectId
+     */
+    public boolean deleteProject(String projectId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get All User Projects
+     * Get all Project for the user with pagination. Results will be ordered based on creation time DESC.
+     * 
+     * @param gatewayId
+     *    The identifier for the requested gateway.
+     * 
+     * @param userName
+     *    The identifier of the user.
+     * 
+     * @param limit
+     *    The amount results to be fetched.
+     * 
+     * @param offset
+     *    The starting point of the results to be fetched.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     * @param userName
+     * @param limit
+     * @param offset
+     */
+    public List<org.apache.airavata.model.workspace.Project> getUserProjects(String gatewayId, String userName, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Search User Projects
+     * Search and get all Projects for user by project description or/and project name  with pagination.
+     * Results will be ordered based on creation time DESC.
+     * 
+     * @param gatewayId
+     *    The unique identifier of the gateway making the request.
+     * 
+     * @param userName
+     *    The identifier of the user.
+     * 
+     * @param filters
+     *    Map of multiple filter criteria. Currenlt search filters includes Project Name and Project Description
+     * 
+     * @param limit
+     *    The amount results to be fetched.
+     * 
+     * @param offset
+     *    The starting point of the results to be fetched.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     * @param userName
+     * @param filters
+     * @param limit
+     * @param offset
+     */
+    public List<org.apache.airavata.model.workspace.Project> searchProjects(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ProjectSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Search Experiments.
+     * Search Experiments by using multiple filter criteria with pagination. Results will be sorted based on creation time DESC.
+     * 
+     * @param gatewayId
+     *       Identifier of the requested gateway.
+     * 
+     * @param userName
+     *       Username of the user requesting the search function.
+     * 
+     * @param filters
+     *       Map of multiple filter criteria. Currenlt search filters includes Experiment Name, Description, Application, etc....
+     * 
+     * @param limit
+     *       Amount of results to be fetched.
+     * 
+     * @param offset
+     *       The starting point of the results to be fetched.
+     * 
+     * @return ExperimentSummaryModel
+     *    List of experiments for the given search filter. Here only the Experiment summary will be returned.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     * @param userName
+     * @param filters
+     * @param limit
+     * @param offset
+     */
+    public List<org.apache.airavata.model.experiment.ExperimentSummaryModel> searchExperiments(String gatewayId, String userName, Map<org.apache.airavata.model.experiment.ExperimentSearchFields,String> filters, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get Experiment Statistics
+     * Get Experiment Statisitics for a given gateway for a specific time period. This feature is available only for admins of a particular gateway. Gateway admin access is managed by the user roles.
+     * 
+     * @param gatewayId
+     *       Unique identifier of the gateway making the request to fetch statistics.
+     * 
+     * @param fromTime
+     *       Starting date time.
+     * 
+     * @param toTime
+     *       Ending data time.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     * @param fromTime
+     * @param toTime
+     */
+    public org.apache.airavata.model.experiment.ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get All Experiments of the Project
+     * Get Experiments within project with pagination. Results will be sorted based on creation time DESC.
+     * 
+     * @param projectId
+     *       Uniqie identifier of the project.
+     * 
+     * @param limit
+     *       Amount of results to be fetched.
+     * 
+     * @param offset
+     *       The starting point of the results to be fetched.
+     * 
+     * 
+     * 
+     * @param projectId
+     * @param limit
+     * @param offset
+     */
+    public List<org.apache.airavata.model.experiment.ExperimentModel> getExperimentsInProject(String projectId, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get All Experiments of the User
+     * Get experiments by user with pagination. Results will be sorted based on creation time DESC.
+     * 
+     * @param gatewayId
+     *       Identifier of the requesting gateway.
+     * 
+     * @param userName
+     *       Username of the requested end user.
+     * 
+     * @param limit
+     *       Amount of results to be fetched.
+     * 
+     * @param offset
+     *       The starting point of the results to be fetched.
+     * 
+     * 
+     * 
+     * @param gatewayId
+     * @param userName
+     * @param limit
+     * @param offset
+     */
+    public List<org.apache.airavata.model.experiment.ExperimentModel> getUserExperiments(String gatewayId, String userName, int limit, int offset) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     *   *
+     *   * Create New Experiment
+     *   * Create an experiment for the specified user belonging to the gateway. The gateway identity is not explicitly passed
+     *   *   but inferred from the sshKeyAuthentication header. This experiment is just a persistent place holder. The client
+     *   *   has to subsequently configure and launch the created experiment. No action is taken on Airavata Server except
+     *   *   registering the experiment in a persistent store.
+     *   *
+     *   * @param gatewayId
+     *   *    The unique ID of the gateway where the experiment is been created.
+     *   *
+     *   * @param ExperimentModel
+     *   *    The create experiment will require the basic experiment metadata like the name and description, intended user,
+     *   *      the gateway identifer and if the experiment should be shared public by defualt. During the creation of an experiment
+     *   *      the ExperimentMetadata is a required field.
+     *   *
+     *   * @return
+     *   *   The server-side generated.airavata.registry.core.experiment.globally unique identifier.
+     *   *
+     *   * @throws org.apache.airavata.model.error.InvalidRequestException
+     *   *    For any incorrect forming of the request itself.
+     *   *
+     *   * @throws org.apache.airavata.model.error.AiravataClientException
+     *   *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+     *   *
+     *   *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+     *   *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+     *   *         gateway registration steps and retry this request.
+     *   *
+     *   *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+     *   *         For now this is a place holder.
+     *   *
+     *   *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+     *   *         is implemented, the authorization will be more substantial.
+     *   *
+     *   * @throws org.apache.airavata.model.error.AiravataSystemException
+     *   *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+     *   *       rather an Airavata Administrator will be notified to take corrective action.
+     *   *
+     * *
+     * 
+     * @param gatewayId
+     * @param experiment
+     */
+    public String createExperiment(String gatewayId, org.apache.airavata.model.experiment.ExperimentModel experiment) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Delete an Experiment
+     * If the experiment is not already launched experiment can be deleted.
+     * 
+     * @param authzToken
+     * 
+     * @param experiementId
+     *     Experiment ID of the experimnet you want to delete.
+     * 
+     * @return boolean
+     *     Identifier for the success or failure of the deletion operation.
+     * 
+     * 
+     * 
+     * @param experimentId
+     */
+    public boolean deleteExperiment(String experimentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     *   *
+     *   * Get Experiment
+     *   * Fetch previously created experiment metadata.
+     *   *
+     *   * @param airavataExperimentId
+     *   *    The unique identifier of the requested experiment. This ID is returned during the create experiment step.
+     *   *
+     *   * @return ExperimentModel
+     *   *   This method will return the previously stored experiment metadata.
+     *   *
+     *   * @throws org.apache.airavata.model.error.InvalidRequestException
+     *   *    For any incorrect forming of the request itself.
+     *   *
+     *   * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+     *   *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+     *   *
+     *   * @throws org.apache.airavata.model.error.AiravataClientException
+     *   *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+     *   *
+     *   *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+     *   *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+     *   *         gateway registration steps and retry this request.
+     *   *
+     *   *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+     *   *         For now this is a place holder.
+     *   *
+     *   *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+     *   *         is implemented, the authorization will be more substantial.
+     *   *
+     *   * @throws org.apache.airavata.model.error.AiravataSystemException
+     *   *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+     *   *       rather an Airavata Administrator will be notified to take corrective action.
+     *   *
+     * *
+     * 
+     * @param airavataExperimentId
+     */
+    public org.apache.airavata.model.experiment.ExperimentModel getExperiment(String airavataExperimentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get Complete Experiment Details
+     * Fetch the completed nested tree structue of previously created experiment metadata which includes processes ->
+     * tasks -> jobs information.
+     * 
+     * @param airavataExperimentId
+     *    The identifier for the requested experiment. This is returned during the create experiment step.
+     * 
+     * @return ExperimentModel
+     *   This method will return the previously stored experiment metadata including application input parameters, computational resource scheduling
+     *   information, special input output handling and additional quality of service parameters.
+     * 
+     * @throws org.apache.airavata.model.error.InvalidRequestException
+     *    For any incorrect forming of the request itself.
+     * 
+     * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+     *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+     * 
+     * @throws org.apache.airavata.model.error.AiravataClientException
+     *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+     * 
+     *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+     *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+     *         gateway registration steps and retry this request.
+     * 
+     *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+     *         For now this is a place holder.
+     * 
+     *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+     *         is implemented, the authorization will be more substantial.
+     * 
+     * @throws org.apache.airavata.model.error.AiravataSystemException
+     *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+     *       rather an Airavata Administrator will be notified to take corrective action.
+     * 
+     * 
+     * @param airavataExperimentId
+     */
+    public org.apache.airavata.model.experiment.ExperimentModel getDetailedExperimentTree(String airavataExperimentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update a Previously Created Experiment
+     * Configure the CREATED experiment with required inputs, scheduling and other quality of service parameters. This method only updates the experiment object within the registry.
+     * The experiment has to be launched to make it actionable by the server.
+     * 
+     * @param airavataExperimentId
+     *    The identifier for the requested experiment. This is returned during the create experiment step.
+     * 
+     * @param ExperimentModel
+     *    The configuration information of the experiment with application input parameters, computational resource scheduling
+     *      information, special input output handling and additional quality of service parameters.
+     * 
+     * @return
+     *   This method call does not have a return value.
+     * 
+     * @throws org.apache.airavata.model.error.InvalidRequestException
+     *    For any incorrect forming of the request itself.
+     * 
+     * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+     *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+     * 
+     * @throws org.apache.airavata.model.error.AiravataClientException
+     *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+     * 
+     *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+     *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+     *         gateway registration steps and retry this request.
+     * 
+     *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+     *         For now this is a place holder.
+     * 
+     *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+     *         is implemented, the authorization will be more substantial.
+     * 
+     * @throws org.apache.airavata.model.error.AiravataSystemException
+     *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+     *       rather an Airavata Administrator will be notified to take corrective action.
+     * 
+     * 
+     * @param airavataExperimentId
+     * @param experiment
+     */
+    public void updateExperiment(String airavataExperimentId, org.apache.airavata.model.experiment.ExperimentModel experiment) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public void updateExperimentConfiguration(String airavataExperimentId, org.apache.airavata.model.experiment.UserConfigurationDataModel userConfiguration) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public void updateResourceScheduleing(String airavataExperimentId, org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel resourceScheduling) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get Experiment Status
+     * 
+     * Obtain the status of an experiment by providing the Experiment Id
+     * 
+     * @param authzToken
+     * 
+     * @param airavataExperimentId
+     *     Experiment ID of the experimnet you require the status.
+     * 
+     * @return ExperimentStatus
+     *     ExperimentStatus model with the current status will be returned.
+     * 
+     * 
+     * 
+     * @param airavataExperimentId
+     */
+    public org.apache.airavata.model.status.ExperimentStatus getExperimentStatus(String airavataExperimentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get Experiment Outputs
+     * This method to be used when need to obtain final outputs of a certain Experiment
+     * 
+     * @param authzToken
+     * 
+     * @param airavataExperimentId
+     *     Experiment ID of the experimnet you need the outputs.
+     * 
+     * @return list
+     *     List of experiment outputs will be returned. They will be returned as a list of OutputDataObjectType for the experiment.
+     * 
+     * 
+     * 
+     * @param airavataExperimentId
+     */
+    public List<org.apache.airavata.model.application.io.OutputDataObjectType> getExperimentOutputs(String airavataExperimentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get Intermediate Experiment Outputs
+     * This method to be used when need to obtain intermediate outputs of a certain Experiment
+     * 
+     * @param authzToken
+     * 
+     * @param airavataExperimentId
+     *     Experiment ID of the experimnet you need intermediate outputs.
+     * 
+     * @return list
+     *     List of intermediate experiment outputs will be returned. They will be returned as a list of OutputDataObjectType for the experiment.
+     * 
+     * 
+     * 
+     * @param airavataExperimentId
+     */
+    public List<org.apache.airavata.model.application.io.OutputDataObjectType> getIntermediateOutputs(String airavataExperimentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get Job Statuses for an Experiment
+     * This method to be used when need to get the job status of an Experiment. An experiment may have one or many jobs; there for one or many job statuses may turnup
+     * 
+     * @param authzToken
+     * 
+     * @param experiementId
+     *     Experiment ID of the experimnet you need the job statuses.
+     * 
+     * @return JobStatus
+     *     Job status (string) for all all the existing jobs for the experiment will be returned in the form of a map
+     * 
+     * 
+     * 
+     * @param airavataExperimentId
+     */
+    public Map<String,org.apache.airavata.model.status.JobStatus> getJobStatuses(String airavataExperimentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Get Job Details for all the jobs within an Experiment.
+     * This method to be used when need to get the job details for one or many jobs of an Experiment.
+     * 
+     * @param authzToken
+     * 
+     * @param experiementId
+     *     Experiment ID of the experimnet you need job details.
+     * 
+     * @return list of JobDetails
+     *     Job details.
+     * 
+     * 
+     * 
+     * @param airavataExperimentId
+     */
+    public List<org.apache.airavata.model.job.JobModel> getJobDetails(String airavataExperimentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Register a Application Module.
+     * 
+     * @gatewayId
+     *    ID of the gateway which is registering the new Application Module.
+     * 
+     * @param applicationModule
+     *    Application Module Object created from the datamodel.
+     * 
+     * @return appModuleId
+     *   Returns the server-side generated airavata appModule globally unique identifier.
+     * 
+     * 
+     * @param gatewayId
+     * @param applicationModule
+     */
+    public String registerApplicationModule(String gatewayId, org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule applicationModule) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch a Application Module.
+     * 
+     * @param appModuleId
+     *   The unique identifier of the application module required
+     * 
+     * @return applicationModule
+     *   Returns an Application Module Object.
+     * 
+     * 
+     * @param appModuleId
+     */
+    public org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule getApplicationModule(String appModuleId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update a Application Module.
+     * 
+     * @param appModuleId
+     *   The identifier for the requested application module to be updated.
+     * 
+     * @param applicationModule
+     *    Application Module Object created from the datamodel.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param appModuleId
+     * @param applicationModule
+     */
+    public boolean updateApplicationModule(String appModuleId, org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule applicationModule) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch all Application Module Descriptions.
+     * 
+     * @param gatewayId
+     *    ID of the gateway which need to list all available application deployment documentation.
+     * 
+     * @return list
+     *    Returns the list of all Application Module Objects.
+     * 
+     * 
+     * @param gatewayId
+     */
+    public List<org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule> getAllAppModules(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Delete an Application Module.
+     * 
+     * @param appModuleId
+     *   The identifier of the Application Module to be deleted.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param appModuleId
+     */
+    public boolean deleteApplicationModule(String appModuleId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Register an Application Deployment.
+     * 
+     * @param gatewayId
+     *    ID of the gateway which is registering the new Application Deployment.
+     * 
+     * @param applicationDeployment
+     *    Application Module Object created from the datamodel.
+     * 
+     * @return appDeploymentId
+     *   Returns a server-side generated airavata appDeployment globally unique identifier.
+     * 
+     * 
+     * @param gatewayId
+     * @param applicationDeployment
+     */
+    public String registerApplicationDeployment(String gatewayId, org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription applicationDeployment) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch a Application Deployment.
+     * 
+     * @param appDeploymentId
+     *   The identifier for the requested application module
+     * 
+     * @return applicationDeployment
+     *   Returns a application Deployment Object.
+     * 
+     * 
+     * @param appDeploymentId
+     */
+    public org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription getApplicationDeployment(String appDeploymentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update an Application Deployment.
+     * 
+     * @param appDeploymentId
+     *   The identifier of the requested application deployment to be updated.
+     * 
+     * @param appDeployment
+     *    Application Deployment Object created from the datamodel.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param appDeploymentId
+     * @param applicationDeployment
+     */
+    public boolean updateApplicationDeployment(String appDeploymentId, org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription applicationDeployment) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Delete an Application Deployment.
+     * 
+     * @param appDeploymentId
+     *   The unique identifier of application deployment to be deleted.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param appDeploymentId
+     */
+    public boolean deleteApplicationDeployment(String appDeploymentId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch all Application Deployment Descriptions.
+     * 
+     * @param gatewayId
+     *    ID of the gateway which need to list all available application deployment documentation.
+     * 
+     * @return list<applicationDeployment.
+     *    Returns the list of all application Deployment Objects.
+     * 
+     * 
+     * @param gatewayId
+     */
+    public List<org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription> getAllApplicationDeployments(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Fetch a list of Deployed Compute Hosts.
+     * 
+     * @param appModuleId
+     *   The identifier for the requested application module
+     * 
+     * @return list<string>
+     *   Returns a list of Deployed Resources.
+     * 
+     * 
+     * @param appModuleId
+     */
+    public List<String> getAppModuleDeployedResources(String appModuleId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Register a Application Interface.
+     * 
+     * @param applicationInterface
+     *    Application Module Object created from the datamodel.
+     * 
+     * @return appInterfaceId
+     *   Returns a server-side generated airavata application interface globally unique identifier.
+     * 
+     * 
+     * @param gatewayId
+     * @param applicationInterface
+     */
+    public String registerApplicationInterface(String gatewayId, org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription applicationInterface) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch an Application Interface.
+     * 
+     * @param appInterfaceId
+     *   The identifier for the requested application interface.
+     * 
+     * @return applicationInterface
+     *   Returns an application Interface Object.
+     * 
+     * 
+     * @param appInterfaceId
+     */
+    public org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription getApplicationInterface(String appInterfaceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update a Application Interface.
+     * 
+     * @param appInterfaceId
+     *   The identifier of the requested application deployment to be updated.
+     * 
+     * @param appInterface
+     *    Application Interface Object created from the datamodel.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param appInterfaceId
+     * @param applicationInterface
+     */
+    public boolean updateApplicationInterface(String appInterfaceId, org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription applicationInterface) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Delete an Application Interface.
+     * 
+     * @param appInterfaceId
+     *   The identifier for the requested application interface to be deleted.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param appInterfaceId
+     */
+    public boolean deleteApplicationInterface(String appInterfaceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch name and ID of  Application Interface documents.
+     * 
+     * 
+     * @return map<applicationId, applicationInterfaceNames>
+     *   Returns a list of application interfaces with corresponsing ID's
+     * 
+     * 
+     * @param gatewayId
+     */
+    public Map<String,String> getAllApplicationInterfaceNames(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch all Application Interface documents.
+     * 
+     * 
+     * @return map<applicationId, applicationInterfaceNames>
+     *   Returns a list of application interfaces documents (Application Interface ID, name, description, Inputs and Outputs objects).
+     * 
+     * 
+     * @param gatewayId
+     */
+    public List<org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription> getAllApplicationInterfaces(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch the list of Application Inputs.
+     * 
+     * @param appInterfaceId
+     *   The identifier of the application interface which need inputs to be fetched.
+     * 
+     * @return list<application_interface_model.InputDataObjectType>
+     *   Returns a list of application inputs.
+     * 
+     * 
+     * @param appInterfaceId
+     */
+    public List<org.apache.airavata.model.application.io.InputDataObjectType> getApplicationInputs(String appInterfaceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch list of Application Outputs.
+     * 
+     * @param appInterfaceId
+     *   The identifier of the application interface which need outputs to be fetched.
+     * 
+     * @return list<application_interface_model.OutputDataObjectType>
+     *   Returns a list of application outputs.
+     * 
+     * 
+     * @param appInterfaceId
+     */
+    public List<org.apache.airavata.model.application.io.OutputDataObjectType> getApplicationOutputs(String appInterfaceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch a list of all deployed Compute Hosts for a given application interfaces.
+     * 
+     * @param appInterfaceId
+     *   The identifier for the requested application interface.
+     * 
+     * @return map<computeResourceId, computeResourceName>
+     *   A map of registered compute resource id's and their corresponding hostnames.
+     *   Deployments of each modules listed within the interfaces will be listed.
+     * 
+     * 
+     * @param appInterfaceId
+     */
+    public Map<String,String> getAvailableAppInterfaceComputeResources(String appInterfaceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Register a Compute Resource.
+     * 
+     * @param computeResourceDescription
+     *    Compute Resource Object created from the datamodel.
+     * 
+     * @return computeResourceId
+     *   Returns a server-side generated airavata compute resource globally unique identifier.
+     * 
+     * 
+     * @param computeResourceDescription
+     */
+    public String registerComputeResource(org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription computeResourceDescription) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Fetch the given Compute Resource.
+     * 
+     * @param computeResourceId
+     *   The identifier for the requested compute resource
+     * 
+     * @return computeResourceDescription
+     *    Compute Resource Object created from the datamodel..
+     * 
+     * 
+     * @param computeResourceId
+     */
+    public org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription getComputeResource(String computeResourceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch all registered Compute Resources.
+     * 
+     * @return A map of registered compute resource id's and thier corresponding hostnames.
+     *    Compute Resource Object created from the datamodel..
+     * 
+     */
+    public Map<String,String> getAllComputeResourceNames() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Update a Compute Resource.
+     * 
+     * @param computeResourceId
+     *   The identifier for the requested compute resource to be updated.
+     * 
+     * @param computeResourceDescription
+     *    Compute Resource Object created from the datamodel.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param computeResourceId
+     * @param computeResourceDescription
+     */
+    public boolean updateComputeResource(String computeResourceId, org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription computeResourceDescription) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete a Compute Resource.
+     * 
+     * @param computeResourceId
+     *   The identifier for the requested compute resource to be deleted.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param computeResourceId
+     */
+    public boolean deleteComputeResource(String computeResourceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Register a Storage Resource.
+     * 
+     * @param storageResourceDescription
+     *    Storge Resource Object created from the datamodel.
+     * 
+     * @return storageResourceId
+     *   Returns a server-side generated airavata storage resource globally unique identifier.
+     * 
+     * 
+     * @param storageResourceDescription
+     */
+    public String registerStorageResource(org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription storageResourceDescription) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Fetch the given Storage Resource.
+     * 
+     * @param storageResourceId
+     *   The identifier for the requested storage resource
+     * 
+     * @return storageResourceDescription
+     *    Storage Resource Object created from the datamodel..
+     * 
+     * 
+     * @param storageResourceId
+     */
+    public org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription getStorageResource(String storageResourceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Fetch all registered Storage Resources.
+     * 
+     * @return A map of registered compute resource id's and thier corresponding hostnames.
+     *    Compute Resource Object created from the datamodel..
+     * 
+     */
+    public Map<String,String> getAllStorageResourceNames() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Update a Storage Resource.
+     * 
+     * @param storageResourceId
+     *   The identifier for the requested compute resource to be updated.
+     * 
+     * @param storageResourceDescription
+     *    Storage Resource Object created from the datamodel.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param storageResourceId
+     * @param storageResourceDescription
+     */
+    public boolean updateStorageResource(String storageResourceId, org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription storageResourceDescription) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete a Storage Resource.
+     * 
+     * @param storageResourceId
+     *   The identifier of the requested compute resource to be deleted.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param storageResourceId
+     */
+    public boolean deleteStorageResource(String storageResourceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Add a Local Job Submission details to a compute resource
+     *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     * 
+     * @param computeResourceId
+     *   The identifier of the compute resource to which JobSubmission protocol to be added
+     * 
+     * @param priorityOrder
+     *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * 
+     * @param localSubmission
+     *   The LOCALSubmission object to be added to the resource.
+     * 
+     * @return status
+     *   Returns the unique job submission id.
+     * 
+     * 
+     * @param computeResourceId
+     * @param priorityOrder
+     * @param localSubmission
+     */
+    public String addLocalSubmissionDetails(String computeResourceId, int priorityOrder, org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission localSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Update the given Local Job Submission details
+     * 
+     * @param jobSubmissionInterfaceId
+     *   The identifier of the JobSubmission Interface to be updated.
+     * 
+     * @param localSubmission
+     *   The LOCALSubmission object to be updated.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param jobSubmissionInterfaceId
+     * @param localSubmission
+     */
+    public boolean updateLocalSubmissionDetails(String jobSubmissionInterfaceId, org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission localSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * This method returns localJobSubmission object
+     * @param jobSubmissionInterfaceId
+     *   The identifier of the JobSubmission Interface to be retrieved.
+     *  @return LOCALSubmission instance
+     * 
+     * 
+     * @param jobSubmissionId
+     */
+    public org.apache.airavata.model.appcatalog.computeresource.LOCALSubmission getLocalJobSubmission(String jobSubmissionId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Add a SSH Job Submission details to a compute resource
+     *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     * 
+     * @param computeResourceId
+     *   The identifier of the compute resource to which JobSubmission protocol to be added
+     * 
+     * @param priorityOrder
+     *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * 
+     * @param sshJobSubmission
+     *   The SSHJobSubmission object to be added to the resource.
+     * 
+     * @return status
+     *   Returns the unique job submission id.
+     * 
+     * 
+     * @param computeResourceId
+     * @param priorityOrder
+     * @param sshJobSubmission
+     */
+    public String addSSHJobSubmissionDetails(String computeResourceId, int priorityOrder, org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission sshJobSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Add a SSH_FORK Job Submission details to a compute resource
+     *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     * 
+     * @param computeResourceId
+     *   The identifier of the compute resource to which JobSubmission protocol to be added
+     * 
+     * @param priorityOrder
+     *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * 
+     * @param sshJobSubmission
+     *   The SSHJobSubmission object to be added to the resource.
+     * 
+     * @return status
+     *   Returns the unique job submission id.
+     * 
+     * 
+     * @param computeResourceId
+     * @param priorityOrder
+     * @param sshJobSubmission
+     */
+    public String addSSHForkJobSubmissionDetails(String computeResourceId, int priorityOrder, org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission sshJobSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * This method returns SSHJobSubmission object
+     * @param jobSubmissionInterfaceId
+     *   The identifier of the JobSubmission Interface to be retrieved.
+     *  @return SSHJobSubmission instance
+     * 
+     * 
+     * @param jobSubmissionId
+     */
+    public org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission getSSHJobSubmission(String jobSubmissionId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Add a UNICORE Job Submission details to a compute resource
+     *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     * 
+     * @param computeResourceId
+     *   The identifier of the compute resource to which JobSubmission protocol to be added
+     * 
+     * @param priorityOrder
+     *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * 
+     * @param unicoreJobSubmission
+     *   The UnicoreJobSubmission object to be added to the resource.
+     * 
+     * @return status
+     *  Returns the unique job submission id.
+     * 
+     * 
+     * @param computeResourceId
+     * @param priorityOrder
+     * @param unicoreJobSubmission
+     */
+    public String addUNICOREJobSubmissionDetails(String computeResourceId, int priorityOrder, org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission unicoreJobSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     *   *
+     *   * This method returns UnicoreJobSubmission object
+     *   *
+     *   * @param jobSubmissionInterfaceId
+     *   *   The identifier of the JobSubmission Interface to be retrieved.
+     *   *  @return UnicoreJobSubmission instance
+     *   *
+     * *
+     * 
+     * @param jobSubmissionId
+     */
+    public org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission getUnicoreJobSubmission(String jobSubmissionId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     *    *
+     *    * Add a Cloud Job Submission details to a compute resource
+     *    *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     *    *
+     *    * @param computeResourceId
+     *    *   The identifier of the compute resource to which JobSubmission protocol to be added
+     *    *
+     *    * @param priorityOrder
+     *    *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     *    *
+     *    * @param sshJobSubmission
+     *    *   The SSHJobSubmission object to be added to the resource.
+     *    *
+     *    * @return status
+     *    *   Returns the unique job submission id.
+     *    *
+     * *
+     * 
+     * @param computeResourceId
+     * @param priorityOrder
+     * @param cloudSubmission
+     */
+    public String addCloudJobSubmissionDetails(String computeResourceId, int priorityOrder, org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission cloudSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     *    *
+     *    * This method returns cloudJobSubmission object
+     *    * @param jobSubmissionInterfaceI
+     *        *   The identifier of the JobSubmission Interface to be retrieved.
+     *    *  @return CloudJobSubmission instance
+     * *
+     * 
+     * @param jobSubmissionId
+     */
+    public org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission getCloudJobSubmission(String jobSubmissionId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update the given SSH Job Submission details
+     * 
+     * @param jobSubmissionInterfaceId
+     *   The identifier of the JobSubmission Interface to be updated.
+     * 
+     * @param sshJobSubmission
+     *   The SSHJobSubmission object to be updated.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param jobSubmissionInterfaceId
+     * @param sshJobSubmission
+     */
+    public boolean updateSSHJobSubmissionDetails(String jobSubmissionInterfaceId, org.apache.airavata.model.appcatalog.computeresource.SSHJobSubmission sshJobSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update the cloud Job Submission details
+     * 
+     * @param jobSubmissionInterfaceId
+     *   The identifier of the JobSubmission Interface to be updated.
+     * 
+     * @param cloudJobSubmission
+     *   The CloudJobSubmission object to be updated.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param jobSubmissionInterfaceId
+     * @param sshJobSubmission
+     */
+    public boolean updateCloudJobSubmissionDetails(String jobSubmissionInterfaceId, org.apache.airavata.model.appcatalog.computeresource.CloudJobSubmission sshJobSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update the UNIOCRE Job Submission details
+     * 
+     * @param jobSubmissionInterfaceId
+     *   The identifier of the JobSubmission Interface to be updated.
+     * 
+     * @param UnicoreJobSubmission
+     *   The UnicoreJobSubmission object to be updated.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * 
+     * @param jobSubmissionInterfaceId
+     * @param unicoreJobSubmission
+     */
+    public boolean updateUnicoreJobSubmissionDetails(String jobSubmissionInterfaceId, org.apache.airavata.model.appcatalog.computeresource.UnicoreJobSubmission unicoreJobSubmission) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Add a Local data movement details to a compute resource
+     *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     * 
+     * @param productUri
+     *   The identifier of the compute resource to which JobSubmission protocol to be added
+     * 
+     * @param DMType
+     *   DMType object to be added to the resource.
+     * 
+     * @param priorityOrder
+     *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * 
+     * @param localDataMovement
+     *   The LOCALDataMovement object to be added to the resource.
+     * 
+     * @return status
+     *   Returns the unique job submission id.
+     * 
+     * 
+     * 
+     * @param productUri
+     * @param dataMoveType
+     * @param priorityOrder
+     * @param localDataMovement
+     */
+    public String addLocalDataMovementDetails(String productUri, org.apache.airavata.model.data.movement.DMType dataMoveType, int priorityOrder, org.apache.airavata.model.data.movement.LOCALDataMovement localDataMovement) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update the given Local data movement details
+     * 
+     * @param dataMovementInterfaceId
+     *   The identifier of the data movement Interface to be updated.
+     * 
+     * @param localDataMovement
+     *   The LOCALDataMovement object to be updated.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * 
+     * @param dataMovementInterfaceId
+     * @param localDataMovement
+     */
+    public boolean updateLocalDataMovementDetails(String dataMovementInterfaceId, org.apache.airavata.model.data.movement.LOCALDataMovement localDataMovement) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * This method returns local datamovement object.
+     * 
+     * @param dataMovementId
+     *   The identifier of the datamovement Interface to be retrieved.
+     * 
+     *  @return LOCALDataMovement instance
+     * 
+     * 
+     * 
+     * @param dataMovementId
+     */
+    public org.apache.airavata.model.data.movement.LOCALDataMovement getLocalDataMovement(String dataMovementId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Add a SCP data movement details to a compute resource
+     *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     * 
+     * @param productUri
+     *   The identifier of the compute resource to which JobSubmission protocol to be added
+     * 
+     * @param priorityOrder
+     *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * 
+     * @param scpDataMovement
+     *   The SCPDataMovement object to be added to the resource.
+     * 
+     * @return status
+     *   Returns the unique job submission id.
+     * 
+     * 
+     * @param productUri
+     * @param dataMoveType
+     * @param priorityOrder
+     * @param scpDataMovement
+     */
+    public String addSCPDataMovementDetails(String productUri, org.apache.airavata.model.data.movement.DMType dataMoveType, int priorityOrder, org.apache.airavata.model.data.movement.SCPDataMovement scpDataMovement) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update the given scp data movement details
+     *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     * 
+     * @param dataMovementInterfaceId
+     *   The identifier of the data movement Interface to be updated.
+     * 
+     * @param scpDataMovement
+     *   The SCPDataMovement object to be updated.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param dataMovementInterfaceId
+     * @param scpDataMovement
+     */
+    public boolean updateSCPDataMovementDetails(String dataMovementInterfaceId, org.apache.airavata.model.data.movement.SCPDataMovement scpDataMovement) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * This method returns SCP datamovement object
+     * 
+     * @param dataMovementId
+     *   The identifier of the datamovement Interface to be retrieved.
+     * 
+     * @return SCPDataMovement instance
+     * 
+     * 
+     * 
+     * @param dataMovementId
+     */
+    public org.apache.airavata.model.data.movement.SCPDataMovement getSCPDataMovement(String dataMovementId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Add a UNICORE data movement details to a compute resource
+     *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     * 
+     * @param productUri
+     *   The identifier of the compute resource to which data movement protocol to be added
+     * 
+     * @param priorityOrder
+     *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * 
+     * @param UnicoreDataMovement
+     *   The UnicoreDataMovement object to be added to the resource.
+     * 
+     * @return status
+     *   Returns the unique data movement id.
+     * 
+     * 
+     * @param productUri
+     * @param dataMoveType
+     * @param priorityOrder
+     * @param unicoreDataMovement
+     */
+    public String addUnicoreDataMovementDetails(String productUri, org.apache.airavata.model.data.movement.DMType dataMoveType, int priorityOrder, org.apache.airavata.model.data.movement.UnicoreDataMovement unicoreDataMovement) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Update a selected UNICORE data movement details
+     *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     * 
+     * @param dataMovementInterfaceId
+     *   The identifier of the data movement Interface to be updated.
+     * 
+     * @param UnicoreDataMovement
+     *   The UnicoreDataMovement object to be updated.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * 
+     * @param dataMovementInterfaceId
+     * @param unicoreDataMovement
+     */
+    public boolean updateUnicoreDataMovementDetails(String dataMovementInterfaceId, org.apache.airavata.model.data.movement.UnicoreDataMovement unicoreDataMovement) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * This method returns UNICORE datamovement object
+     * 
+     * @param dataMovementId
+     *   The identifier of the datamovement Interface to be retrieved.
+     * 
+     * @return UnicoreDataMovement instance
+     * 
+     * 
+     * 
+     * @param dataMovementId
+     */
+    public org.apache.airavata.model.data.movement.UnicoreDataMovement getUnicoreDataMovement(String dataMovementId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Add a GridFTP data movement details to a compute resource
+     *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     * 
+     * @param productUri
+     *   The identifier of the compute resource to which dataMovement protocol to be added
+     * 
+     * @param DMType
+     *    The DMType object to be added to the resource.
+     * 
+     * @param priorityOrder
+     *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * 
+     * @param gridFTPDataMovement
+     *   The GridFTPDataMovement object to be added to the resource.
+     * 
+     * @return status
+     *   Returns the unique data movement id.
+     * 
+     * 
+     * 
+     * @param productUri
+     * @param dataMoveType
+     * @param priorityOrder
+     * @param gridFTPDataMovement
+     */
+    public String addGridFTPDataMovementDetails(String productUri, org.apache.airavata.model.data.movement.DMType dataMoveType, int priorityOrder, org.apache.airavata.model.data.movement.GridFTPDataMovement gridFTPDataMovement) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Update the given GridFTP data movement details to a compute resource
+     *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     * 
+     * @param dataMovementInterfaceId
+     *   The identifier of the data movement Interface to be updated.
+     * 
+     * @param gridFTPDataMovement
+     *   The GridFTPDataMovement object to be updated.
+     * 
+     * @return boolean
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * 
+     * @param dataMovementInterfaceId
+     * @param gridFTPDataMovement
+     */
+    public boolean updateGridFTPDataMovementDetails(String dataMovementInterfaceId, org.apache.airavata.model.data.movement.GridFTPDataMovement gridFTPDataMovement) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * This method returns GridFTP datamovement object
+     * 
+     * @param dataMovementId
+     *   The identifier of the datamovement Interface to be retrieved.
+     * 
+     *  @return GridFTPDataMovement instance
+     * 
+     * 
+     * 
+     * @param dataMovementId
+     */
+    public org.apache.airavata.model.data.movement.GridFTPDataMovement getGridFTPDataMovement(String dataMovementId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Change the priority of a given job submisison interface
+     * 
+     * @param jobSubmissionInterfaceId
+     *   The identifier of the JobSubmission Interface to be changed
+     * 
+     * @param priorityOrder
+     *   The new priority of the job manager interface.
+     * 
+     * @return status
+     *   Returns a success/failure of the change.
+     * 
+     * 
+     * 
+     * @param jobSubmissionInterfaceId
+     * @param newPriorityOrder
+     */
+    public boolean changeJobSubmissionPriority(String jobSubmissionInterfaceId, int newPriorityOrder) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Change the priority of a given data movement interface
+     * 
+     * @param dataMovementInterfaceId
+     *   The identifier of the DataMovement Interface to be changed
+     * 
+     * @param priorityOrder
+     *   The new priority of the data movement interface.
+     * 
+     * @return status
+     *   Returns a success/failure of the change.
+     * 
+     * 
+     * 
+     * @param dataMovementInterfaceId
+     * @param newPriorityOrder
+     */
+    public boolean changeDataMovementPriority(String dataMovementInterfaceId, int newPriorityOrder) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Change the priorities of a given set of job submission interfaces
+     * 
+     * @param jobSubmissionPriorityMap
+     *   A Map of identifiers of the JobSubmission Interfaces and thier associated priorities to be set.
+     * 
+     * @return status
+     *   Returns a success/failure of the changes.
+     * 
+     * 
+     * @param jobSubmissionPriorityMap
+     */
+    public boolean changeJobSubmissionPriorities(Map<String,Integer> jobSubmissionPriorityMap) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Change the priorities of a given set of data movement interfaces
+     * 
+     * @param dataMovementPriorityMap
+     *   A Map of identifiers of the DataMovement Interfaces and thier associated priorities to be set.
+     * 
+     * @return status
+     *   Returns a success/failure of the changes.
+     * 
+     * 
+     * 
+     * @param dataMovementPriorityMap
+     */
+    public boolean changeDataMovementPriorities(Map<String,Integer> dataMovementPriorityMap) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete a given job submisison interface
+     * 
+     * @param jobSubmissionInterfaceId
+     *   The identifier of the JobSubmission Interface to be changed
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * 
+     * @param computeResourceId
+     * @param jobSubmissionInterfaceId
+     */
+    public boolean deleteJobSubmissionInterface(String computeResourceId, String jobSubmissionInterfaceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete a given data movement interface
+     * 
+     * @param dataMovementInterfaceId
+     *   The identifier of the DataMovement Interface to be changed
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * 
+     * @param productUri
+     * @param dataMovementInterfaceId
+     * @param dataMoveType
+     */
+    public boolean deleteDataMovementInterface(String productUri, String dataMovementInterfaceId, org.apache.airavata.model.data.movement.DMType dataMoveType) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public String registerResourceJobManager(org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager resourceJobManager) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public boolean updateResourceJobManager(String resourceJobManagerId, org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager updatedResourceJobManager) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public org.apache.airavata.model.appcatalog.computeresource.ResourceJobManager getResourceJobManager(String resourceJobManagerId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public boolean deleteResourceJobManager(String resourceJobManagerId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete a Compute Resource Queue
+     * 
+     * @param computeResourceId
+     *   The identifier of the compute resource which has the queue to be deleted
+     * 
+     * @param queueName
+     *   Name of the queue need to be deleted. Name is the uniqueue identifier for the queue within a compute resource
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * 
+     * @param computeResourceId
+     * @param queueName
+     */
+    public boolean deleteBatchQueue(String computeResourceId, String queueName) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Register a Gateway Resource Profile.
+     * 
+     * @param gatewayResourceProfile
+     *    Gateway Resource Profile Object.
+     *    The GatewayID should be obtained from Airavata gateway registration and passed to register a corresponding
+     *      resource profile.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param gatewayResourceProfile
+     */
+    public String registerGatewayResourceProfile(org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile gatewayResourceProfile) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Fetch the given Gateway Resource Profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the requested gateway resource.
+     * 
+     * @return gatewayResourceProfile
+     *    Gateway Resource Profile Object.
+     * 
+     * 
+     * @param gatewayID
+     */
+    public org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile getGatewayResourceProfile(String gatewayID) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Update a Gateway Resource Profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the requested gateway resource to be updated.
+     * 
+     * @param gatewayResourceProfile
+     *    Gateway Resource Profile Object.
+     * 
+     * @return status
+     *   Returns a success/failure of the update.
+     * 
+     * 
+     * @param gatewayID
+     * @param gatewayResourceProfile
+     */
+    public boolean updateGatewayResourceProfile(String gatewayID, org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile gatewayResourceProfile) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete the given Gateway Resource Profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the requested gateway resource to be deleted.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param gatewayID
+     */
+    public boolean deleteGatewayResourceProfile(String gatewayID) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Add a Compute Resource Preference to a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the gateway profile to be added.
+     * 
+     * @param computeResourceId
+     *   Preferences related to a particular compute resource
+     * 
+     * @param computeResourcePreference
+     *   The ComputeResourcePreference object to be added to the resource profile.
+     * 
+     * @return status
+     *   Returns a success/failure of the addition. If a profile already exists, this operation will fail.
+     *    Instead an update should be used.
+     * 
+     * 
+     * @param gatewayID
+     * @param computeResourceId
+     * @param computeResourcePreference
+     */
+    public boolean addGatewayComputeResourcePreference(String gatewayID, String computeResourceId, org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference computeResourcePreference) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Add a Storage Resource Preference to a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier of the gateway profile to be added.
+     * 
+     * @param storageResourceId
+     *   Preferences related to a particular compute resource
+     * 
+     * @param computeResourcePreference
+     *   The ComputeResourcePreference object to be added to the resource profile.
+     * 
+     * @return status
+     *   Returns a success/failure of the addition. If a profile already exists, this operation will fail.
+     *    Instead an update should be used.
+     * 
+     * 
+     * @param gatewayID
+     * @param storageResourceId
+     * @param storagePreference
+     */
+    public boolean addGatewayStoragePreference(String gatewayID, String storageResourceId, org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference storagePreference) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch a Compute Resource Preference of a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the gateway profile to be requested
+     * 
+     * @param computeResourceId
+     *   Preferences related to a particular compute resource
+     * 
+     * @return computeResourcePreference
+     *   Returns the ComputeResourcePreference object.
+     * 
+     * 
+     * @param gatewayID
+     * @param computeResourceId
+     */
+    public org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference getGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch a Storage Resource Preference of a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier of the gateway profile to request to fetch the particular storage resource preference.
+     * 
+     * @param storageResourceId
+     *   Identifier of the Stprage Preference required to be fetched.
+     * 
+     * @return StoragePreference
+     *   Returns the StoragePreference object.
+     * 
+     * 
+     * @param gatewayID
+     * @param storageResourceId
+     */
+    public org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference getGatewayStoragePreference(String gatewayID, String storageResourceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch all Compute Resource Preferences of a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the gateway profile to be requested
+     * 
+     * @return computeResourcePreference
+     *   Returns the ComputeResourcePreference object.
+     * 
+     * 
+     * @param gatewayID
+     */
+    public List<org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference> getAllGatewayComputeResourcePreferences(String gatewayID) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Fetch all Storage Resource Preferences of a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the gateway profile to be requested
+     * 
+     * @return StoragePreference
+     *   Returns the StoragePreference object.
+     * 
+     * 
+     * @param gatewayID
+     */
+    public List<org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference> getAllGatewayStoragePreferences(String gatewayID) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * Fetch all Gateway Profiles registered
+     * 
+     * @return GatewayResourceProfile
+     *   Returns all the GatewayResourcePrifle list object.
+     * 
+     * 
+     */
+    public List<org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile> getAllGatewayResourceProfiles() throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Update a Compute Resource Preference to a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the gateway profile to be updated.
+     * 
+     * @param computeResourceId
+     *   Preferences related to a particular compute resource
+     * 
+     * @param computeResourcePreference
+     *   The ComputeResourcePreference object to be updated to the resource profile.
+     * 
+     * @return status
+     *   Returns a success/failure of the updation.
+     * 
+     * 
+     * @param gatewayID
+     * @param computeResourceId
+     * @param computeResourcePreference
+     */
+    public boolean updateGatewayComputeResourcePreference(String gatewayID, String computeResourceId, org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference computeResourcePreference) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Update a Storage Resource Preference of a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier of the gateway profile to be updated.
+     * 
+     * @param storageId
+     *   The Storage resource identifier of the one that you want to update
+     * 
+     * @param storagePreference
+     *   The storagePreference object to be updated to the resource profile.
+     * 
+     * @return status
+     *   Returns a success/failure of the updation.
+     * 
+     * 
+     * @param gatewayID
+     * @param storageId
+     * @param storagePreference
+     */
+    public boolean updateGatewayStoragePreference(String gatewayID, String storageId, org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference storagePreference) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete the Compute Resource Preference of a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier for the gateway profile to be deleted.
+     * 
+     * @param computeResourceId
+     *   Preferences related to a particular compute resource
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param gatewayID
+     * @param computeResourceId
+     */
+    public boolean deleteGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete the Storage Resource Preference of a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier of the gateway profile to be deleted.
+     * 
+     * @param storageId
+     *   ID of the storage preference you want to delete.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param gatewayID
+     * @param storageId
+     */
+    public boolean deleteGatewayStoragePreference(String gatewayID, String storageId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * Delete the Storage Resource Preference of a registered gateway profile.
+     * 
+     * @param gatewayID
+     *   The identifier of the gateway profile to be deleted.
+     * 
+     * @param storageId
+     *   ID of the storage preference you want to delete.
+     * 
+     * @return status
+     *   Returns a success/failure of the deletion.
+     * 
+     * 
+     * @param gatewayId
+     */
+    public List<String> getAllWorkflows(String gatewayId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * 
+     * API Methods Related for Work-Flow Submission Features.
+     * 
+     * 
+     * @param workflowTemplateId
+     */
+    public org.apache.airavata.model.WorkflowModel getWorkflow(String workflowTemplateId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public void deleteWorkflow(String workflowTemplateId) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public String registerWorkflow(String gatewayId, org.apache.airavata.model.WorkflowModel workflow) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public void updateWorkflow(String workflowTemplateId, org.apache.airavata.model.WorkflowModel workflow) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public String getWorkflowTemplateId(String workflowName) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public boolean isWorkflowExistWithName(String workflowName) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    /**
+     * API Methods related to replica catalog
+     * 
+     * 
+     * @param dataProductModel
+     */
+    public String registerDataProduct(org.apache.airavata.model.data.replica.DataProductModel dataProductModel) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public org.apache.airavata.model.data.replica.DataProductModel getDataProduct(String dataProductUri) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public String registerReplicaLocation(org.apache.airavata.model.data.replica.DataReplicaLocationModel replicaLocationModel) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public org.apache.airavata.model.data.replica.DataProductModel getParentDataProduct(String productUri) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+    public List<org.apache.airavata.model.data.replica.DataProductModel> getChildDataProducts(String productUri) throws org.apache.airavata.registry.api.exception.RegistryServiceException, org.apache.thrift.TException;
+
+  }
+
+  public interface AsyncIface {
+
+    public void getAPIVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
+    public void isUserExists(String gatewayId, String userName, org.apache.thrift.asy

<TRUNCATED>

[7/7] airavata git commit: adding registry server module

Posted by sc...@apache.org.
adding registry server module


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

Branch: refs/heads/develop
Commit: 2d9fd253b6e348a4cfb83e64b235f6adabfe4fa6
Parents: f88859b
Author: scnakandala <su...@gmail.com>
Authored: Mon Aug 8 14:14:09 2016 -0400
Committer: scnakandala <su...@gmail.com>
Committed: Mon Aug 8 14:14:09 2016 -0400

----------------------------------------------------------------------
 .../airavata/api/server/AiravataAPIServer.java  |      3 +
 .../api/server/util/ReplicaCatalogInitUtil.java |    160 +
 .../main/resources/airavata-server.properties   |      9 +
 modules/registry/pom.xml                        |      1 +
 modules/registry/registry-server/pom.xml        |     28 +
 .../registry-api-service/pom.xml                |     46 +
 .../registry/api/service/RegistryAPIServer.java |    163 +
 .../service/handler/RegistryServerHandler.java  |   1677 +
 .../api/service/util/AppCatalogInitUtil.java    |    168 +
 .../api/service/util/ConnectionPool.java        |    383 +
 .../registry/api/service/util/Constants.java    |     29 +
 .../api/service/util/DatabaseCreator.java       |    353 +
 .../service/util/ExperimentCatalogInitUtil.java |    203 +
 .../registry/api/service/util/JdbcStorage.java  |    176 +
 .../service/util/ReplicaCatalogInitUtil.java    |    160 +
 .../service/util/WorkflowCatalogInitUtil.java   |    160 +
 .../registry-server/registry-api-stubs/pom.xml  |     26 +
 .../airavata/registry/api/RegistryService.java  | 136899 ++++++++++++++++
 .../api/exception/RegistryServiceException.java |    407 +
 .../registry/api/registry_apiConstants.java     |     57 +
 .../component-cpis/generate-cpi-stubs.sh        |     10 +-
 .../component-cpis/registry-api.thrift          |   2072 +
 .../component-cpis/registry_api_errors.thrift   |     32 +
 23 files changed, 143221 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
index 01649ab..5290e83 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
@@ -72,6 +72,9 @@ public class AiravataAPIServer implements IServer{
             WorkflowCatalogInitUtil.initializeDB();
             // creating credential store db
             CredentialStoreInitUtil.initializeDB();
+			// creating replica catalog db
+			ReplicaCatalogInitUtil.initializeDB();
+
             final String serverHost = ServerSettings.getSetting(Constants.API_SERVER_HOST, null);
             if (!ServerSettings.isTLSEnabled()) {
                 final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.API_SERVER_PORT, "8930"));

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/ReplicaCatalogInitUtil.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/ReplicaCatalogInitUtil.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/ReplicaCatalogInitUtil.java
new file mode 100644
index 0000000..4093d7f
--- /dev/null
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/util/ReplicaCatalogInitUtil.java
@@ -0,0 +1,160 @@
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+package org.apache.airavata.api.server.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URI;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class ReplicaCatalogInitUtil {
+    private static final Logger logger = LoggerFactory.getLogger(ReplicaCatalogInitUtil.class);
+    public static final String REPLICA_CATALOG = "REPLICA_CATALOG";
+    public static final String REPLICA_CATALOG_JDBC_DRIVER = "replicacatalog.jdbc.driver";
+    public static final String REPLICA_CATALOG_JDBC_URL = "replicacatalog.jdbc.url";
+    public static final String REPLICA_CATALOG_JDBC_USER = "replicacatalog.jdbc.user";
+    public static final String REPLICA_CATALOG_JDBC_PASSWORD = "replicacatalog.jdbc.password";
+    public static final String START_DERBY_ENABLE = "start.derby.server.mode";
+    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+    private static NetworkServerControl server;
+    private static JdbcStorage db;
+    private static String jdbcURl;
+    private static String jdbcDriver;
+    private static String jdbcUser;
+    private static String jdbcPassword;
+
+
+    public static void initializeDB() {
+//        System.setProperty("appcatalog.initialize.state", "0");
+        try{
+            jdbcDriver = ServerSettings.getSetting(REPLICA_CATALOG_JDBC_DRIVER);
+            jdbcURl = ServerSettings.getSetting(REPLICA_CATALOG_JDBC_URL);
+            jdbcUser = ServerSettings.getSetting(REPLICA_CATALOG_JDBC_USER);
+            jdbcPassword = ServerSettings.getSetting(REPLICA_CATALOG_JDBC_PASSWORD);
+            jdbcURl = jdbcURl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage());
+        }
+
+        if (getDBType(jdbcURl).equals("derby") && isDerbyStartEnabled()) {
+            startDerbyInServerMode();
+        }
+        db = new JdbcStorage(10, 50, jdbcURl, jdbcDriver, true);
+
+        Connection conn = null;
+        try {
+            conn = db.connect();
+            if (!DatabaseCreator.isDatabaseStructureCreated(REPLICA_CATALOG, conn)) {
+                DatabaseCreator.createRegistryDatabase("database_scripts/replicacatalog", conn);
+                logger.info("New Database created for Replica Catalog !!! ");
+            } else {
+                logger.info("Database already created for Replica Catalog!!!");
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure", e);
+        } finally {
+            db.closeConnection(conn);
+            try {
+                if(conn != null){
+                    if (!conn.getAutoCommit()) {
+                        conn.commit();
+                    }
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                logger.error("Error while closing database connection...", e.getMessage(), e);
+            }
+        }
+//        System.setProperty("appcatalog.initialize.state", "1");
+    }
+
+    public static String getDBType(String jdbcUrl){
+        try{
+            String cleanURI = jdbcUrl.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getScheme();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    public static boolean isDerbyStartEnabled(){
+        try {
+            String s = ServerSettings.getSetting(START_DERBY_ENABLE);
+            if("true".equals(s)){
+                return true;
+            }
+        }  catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage(), e);
+            return false;
+        }
+        return false;
+    }
+
+    public static void startDerbyInServerMode() {
+        try {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
+                    getPort(jdbcURl),
+                    jdbcUser, jdbcPassword);
+            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+            server.start(consoleWriter);
+        } catch (IOException e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        } catch (Exception e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        }
+    }
+    
+    public static void stopDerbyInServerMode() {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "false");
+            if (server!=null){
+            	try {
+					server.shutdown();
+				} catch (Exception e) {
+		            logger.error("Error when stopping the derby server : "+e.getLocalizedMessage());
+				}
+            }
+    }
+
+    public static int getPort(String jdbcURL){
+        try{
+            String cleanURI = jdbcURL.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getPort();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return -1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/airavata-server.properties b/modules/configuration/server/src/main/resources/airavata-server.properties
index 526c312..a2cb584 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -134,6 +134,15 @@ start.submitter=true
 embedded.mode=true
 enable.validation=true
 
+###########################################################################
+#  Registry Server Configurations
+###########################################################################
+regserver=org.apache.airavata.registry.api.service.RegistryAPIServer
+regserver.server.name=regserver-node0
+regserver.server.host=localhost
+regserver.server.port=8960
+regserver.server.min.threads=50
+
 
 ###########################################################################
 #  GFac Server Configurations

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/pom.xml b/modules/registry/pom.xml
index d5623a0..f9fe9f5 100644
--- a/modules/registry/pom.xml
+++ b/modules/registry/pom.xml
@@ -33,6 +33,7 @@
                 <module>registry-cpi</module>
                 <module>registry-core</module>
                 <module>registry-tools</module>
+                <module>registry-server</module>
             </modules>
         </profile>
     </profiles>

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/pom.xml b/modules/registry/registry-server/pom.xml
new file mode 100644
index 0000000..f2e138b
--- /dev/null
+++ b/modules/registry/registry-server/pom.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>registry</artifactId>
+        <groupId>org.apache.airavata</groupId>
+        <version>0.17-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>registry-server</artifactId>
+    <packaging>pom</packaging>
+    <modules>
+        <module>registry-api-service</module>
+        <module>registry-api-stubs</module>
+    </modules>
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <version>${org.slf4j.version}</version>
+        </dependency>
+    </dependencies>
+
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/pom.xml b/modules/registry/registry-server/registry-api-service/pom.xml
new file mode 100644
index 0000000..7cd8b29
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>registry-server</artifactId>
+        <groupId>org.apache.airavata</groupId>
+        <version>0.17-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>registry-api-service</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-commons</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-data-models</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>registry-api-stubs</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-registry-cpi</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-registry-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+            <version>${thrift.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/RegistryAPIServer.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/RegistryAPIServer.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/RegistryAPIServer.java
new file mode 100644
index 0000000..7213f80
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/RegistryAPIServer.java
@@ -0,0 +1,163 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.api.service;
+
+import org.apache.airavata.common.utils.IServer;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.registry.api.service.handler.RegistryServerHandler;
+import org.apache.airavata.registry.api.service.util.*;
+import org.apache.thrift.server.TServer;
+import org.apache.thrift.server.TThreadPoolServer;
+import org.apache.thrift.transport.TServerSocket;
+import org.apache.thrift.transport.TServerTransport;
+import org.apache.thrift.transport.TTransportException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.InetSocketAddress;
+
+public class RegistryAPIServer implements IServer {
+    private final static Logger logger = LoggerFactory.getLogger(RegistryAPIServer.class);
+
+    private static final String SERVER_NAME = "Registry API Server";
+    private static final String SERVER_VERSION = "1.0";
+
+    private ServerStatus status;
+
+    private TServer server;
+
+    public RegistryAPIServer() {
+        setStatus(ServerStatus.STOPPED);
+    }
+
+    public void StartRegistryServer(RegistryService.Processor<RegistryServerHandler> orchestratorServerHandlerProcessor)
+            throws Exception {
+        // creating experiment catalog db
+        ExperimentCatalogInitUtil.initializeDB();
+        // creating app catalog db
+        AppCatalogInitUtil.initializeDB();
+        // creating workflow catalog db
+        WorkflowCatalogInitUtil.initializeDB();
+        // creating replica catalog db
+        ReplicaCatalogInitUtil.initializeDB();
+
+        final int serverPort = Integer.parseInt(ServerSettings.getSetting(Constants.REGISTRY_SERVER_PORT, "8960"));
+        try {
+            final String serverHost = ServerSettings.getSetting(Constants.REGISTRY_SERVER_HOST, null);
+            TServerTransport serverTransport;
+            if(serverHost == null){
+                serverTransport = new TServerSocket(serverPort);
+            }else{
+                InetSocketAddress inetSocketAddress = new InetSocketAddress(serverHost, serverPort);
+                serverTransport = new TServerSocket(inetSocketAddress);
+            }
+
+            TThreadPoolServer.Args options = new TThreadPoolServer.Args(serverTransport);
+            options.minWorkerThreads = Integer.parseInt(ServerSettings.getSetting(Constants.REGISTRY_SERVER_MIN_THREADS, "30"));
+            server = new TThreadPoolServer(options.processor(orchestratorServerHandlerProcessor));
+            new Thread() {
+                public void run() {
+                    server.serve();
+                    setStatus(ServerStatus.STARTING);
+                    logger.info("Starting Registry Server ... ");
+                }
+            }.start();
+            new Thread() {
+                public void run() {
+                    while(!server.isServing()){
+                        try {
+                            Thread.sleep(500);
+                        } catch (InterruptedException e) {
+                            break;
+                        }
+                    }
+                    if (server.isServing()){
+                        setStatus(ServerStatus.STARTED);
+                        logger.info("Started Registry Server on Port " + serverPort + " ...");
+                    }
+                }
+            }.start();
+        } catch (TTransportException e) {
+            logger.error(e.getMessage());
+            setStatus(ServerStatus.FAILED);
+            logger.error("Failed to start Registry server on port " + serverPort + " ...");
+        }
+    }
+
+    public static void main(String[] args) {
+        try {
+            new RegistryAPIServer().start();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public void start() throws Exception {
+        setStatus(ServerStatus.STARTING);
+        RegistryService.Processor<RegistryServerHandler> orchestratorService =
+                new RegistryService.Processor<RegistryServerHandler>(new RegistryServerHandler());
+        StartRegistryServer(orchestratorService);
+    }
+
+    @Override
+    public void stop() throws Exception {
+        if (server!=null && server.isServing()){
+            setStatus(ServerStatus.STOPING);
+            server.stop();
+        }
+
+    }
+
+    @Override
+    public void restart() throws Exception {
+        stop();
+        start();
+    }
+
+    @Override
+    public void configure() throws Exception {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public ServerStatus getStatus() throws Exception {
+        return status;
+    }
+
+    private void setStatus(ServerStatus stat){
+        status=stat;
+        status.updateTime();
+    }
+
+    @Override
+    public String getName() {
+        return SERVER_NAME;
+    }
+
+    @Override
+    public String getVersion() {
+        return SERVER_VERSION;
+    }
+
+}
\ No newline at end of file


[2/7] airavata git commit: adding registry server module

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/thrift-interface-descriptions/component-cpis/registry-api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/component-cpis/registry-api.thrift b/thrift-interface-descriptions/component-cpis/registry-api.thrift
new file mode 100644
index 0000000..825b30a
--- /dev/null
+++ b/thrift-interface-descriptions/component-cpis/registry-api.thrift
@@ -0,0 +1,2072 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+/*
+ * Component Programming Interface definition for Apache Airavata Registry Service.
+ *
+*/
+
+include "../data-models/airavata_data_models.thrift"
+include "../data-models/experiment-catalog-models/status_models.thrift"
+include "../data-models/experiment-catalog-models/job_model.thrift"
+include "../data-models/experiment-catalog-models/experiment_model.thrift"
+include "../data-models/experiment-catalog-models/workspace_model.thrift"
+include "../data-models/experiment-catalog-models/scheduling_model.thrift"
+include "../data-models/app-catalog-models/application_io_models.thrift"
+include "../data-models/app-catalog-models/application_deployment_model.thrift"
+include "../data-models/app-catalog-models/application_interface_model.thrift"
+include "../data-models/resource-catalog-models/compute_resource_model.thrift"
+include "../data-models/resource-catalog-models/storage_resource_model.thrift"
+include "../data-models/resource-catalog-models/gateway_resource_profile_model.thrift"
+include "../data-models/resource-catalog-models/data_movement_models.thrift"
+include "../data-models/workflow-models/workflow_data_model.thrift"
+include "../data-models/replica-catalog-models/replica_catalog_models.thrift"
+
+include "registry_api_errors.thrift"
+
+namespace java org.apache.airavata.registry.api
+
+const string REGISTRY_API_VERSION = "0.17.0"
+
+service RegistryService {
+    /**
+       * Fetch Apache Registry API version
+       **/
+      string getAPIVersion()
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+     /**
+     * Verify if User Exists within Airavata.
+     *
+     * @param gatewayId
+     *
+     *  @param userName
+     *
+     * @return true/false
+     *
+     **/
+      bool isUserExists (1: required string gatewayId,
+                         2: required string userName)
+              throws (1: registry_api_errors.RegistryServiceException rse)
+
+       /**
+       * Register a Gateway with Airavata.
+       *
+       * @param gateway
+       *    The gateway data model.
+       *
+       * @return gatewayId
+       *   Th unique identifier of the  newly registered gateway.
+       *
+       **/
+      string addGateway(1: required workspace_model.Gateway gateway)
+             throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+      /**
+         * Get all users in the gateway
+         *
+         * @param gatewayId
+         *    The gateway data model.
+         *
+         * @return users
+         *   list of usernames of the users in the gateway
+         *
+         **/
+      list<string> getAllUsersInGateway(1: required string gatewayId)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+       /**
+       * Update previously registered Gateway metadata.
+       *
+       * @param gatewayId
+       *    The gateway Id of the Gateway which require an update.
+       *
+       * @return gateway
+       *    Modified gateway obejct.
+       *
+       * @exception AiravataClientException
+       *
+       **/
+
+      bool updateGateway(1: required string gatewayId, 2: required workspace_model.Gateway updatedGateway)
+             throws (1: registry_api_errors.RegistryServiceException rse)
+
+        /**
+        * Get Gateway details by providing gatewayId
+        *
+        * @param gatewayId
+        *    The gateway Id of the Gateway.
+        *
+        * @return gateway
+        *    Gateway obejct.
+        *
+        **/
+
+      workspace_model.Gateway getGateway(1: required string gatewayId)
+               throws (1: registry_api_errors.RegistryServiceException rse)
+
+        /**
+        * Delete a Gateway
+        *
+        * @param gatewayId
+        *    The gateway Id of the Gateway to be deleted.
+        *
+        * @return boolean
+        *    Boolean identifier for the success or failure of the deletion operation.
+        *
+        **/
+
+      bool deleteGateway(1: required string gatewayId)
+                 throws (1: registry_api_errors.RegistryServiceException rse)
+
+        /**
+        * Get All the Gateways Connected to Airavata.
+        **/
+
+      list<workspace_model.Gateway> getAllGateways()
+                 throws (1: registry_api_errors.RegistryServiceException rse)
+
+        /**
+        * Check for the Existance of a Gateway within Airavata
+        *
+        * @param gatewayId
+        *   Provide the gatewayId of the gateway you want to check the existancy
+        *
+        * @return boolean
+        *   Boolean idetifier for the existance or non-existane of the gatewayId
+        *
+        * @return gatewayId
+        *   return the gatewayId of the existing gateway.
+        *
+        **/
+      bool isGatewayExist(1: required string gatewayId)
+               throws (1: registry_api_errors.RegistryServiceException rse)
+
+      /**
+        * API methods to retrieve notifications
+      **/
+       string createNotification(1: required workspace_model.Notification notification)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+       bool updateNotification(1: required workspace_model.Notification notification)
+               throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+      bool deleteNotification(1: required string gatewayId, 2: required string notificationId)
+                 throws (1: registry_api_errors.RegistryServiceException rse)
+
+      workspace_model.Notification getNotification(1: required string gatewayId, 2: required string notificationId)
+                 throws (1: registry_api_errors.RegistryServiceException rse)
+
+      list<workspace_model.Notification> getAllNotifications(1: required string gatewayId)
+                 throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+      /**
+         *
+         * Creates a Project with basic metadata.
+         *    A Project is a container of experiments.
+         *
+         * @param gatewayId
+         *    The identifier for the requested gateway.
+         *
+         * @param Project
+         *    The Project Object described in the workspace_model.
+         *
+         **/
+        string createProject (1: required string gatewayId,
+                              2: required workspace_model.Project project)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+         /**
+         *
+         * Update an Existing Project
+         *
+         * @param projectId
+         *    The projectId of the project needed an update.
+         *
+         * @return void
+         *    Currently this does not return any value.
+         *
+         **/
+        void updateProject (1: required string projectId,
+                            2: required workspace_model.Project updatedProject)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+         /**
+         *
+         * Get a Project by ID
+         *    This method is to obtain a project by providing a projectId.
+         *
+         * @param projectId
+         *    projectId of the project you require.
+         *
+         * @return project
+         *    project data model will be returned.
+         *
+         **/
+        workspace_model.Project getProject (1: required string projectId)
+              throws (1: registry_api_errors.RegistryServiceException rse)
+
+         /**
+         *
+         * Delete a Project
+         *    This method is used to delete an existing Project.
+         *
+         * @param projectId
+         *    projectId of the project you want to delete.
+         *
+         * @return boolean
+         *    Boolean identifier for the success or failure of the deletion operation.
+         *
+         *    NOTE: This method is not used within gateways connected with Airavata.
+         *
+         **/
+        bool deleteProject (1: required string projectId)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+         /**
+         *
+         * Get All User Projects
+         * Get all Project for the user with pagination. Results will be ordered based on creation time DESC.
+         *
+         * @param gatewayId
+         *    The identifier for the requested gateway.
+         *
+         * @param userName
+         *    The identifier of the user.
+         *
+         * @param limit
+         *    The amount results to be fetched.
+         *
+         * @param offset
+         *    The starting point of the results to be fetched.
+         *
+         **/
+        list<workspace_model.Project> getUserProjects(1: required string gatewayId,
+                                                         2: required string userName,
+                                                         3: required i32 limit,
+                                                         4: required i32 offset)
+              throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+          /**
+          *
+          * Search User Projects
+          * Search and get all Projects for user by project description or/and project name  with pagination.
+          * Results will be ordered based on creation time DESC.
+          *
+          * @param gatewayId
+          *    The unique identifier of the gateway making the request.
+          *
+          * @param userName
+          *    The identifier of the user.
+          *
+          * @param filters
+          *    Map of multiple filter criteria. Currenlt search filters includes Project Name and Project Description
+          *
+          * @param limit
+          *    The amount results to be fetched.
+          *
+          * @param offset
+          *    The starting point of the results to be fetched.
+          *
+          **/
+        list<workspace_model.Project> searchProjects(
+                                    1: required string gatewayId,
+                                    2: required string userName,
+                                    3: map<experiment_model.ProjectSearchFields, string> filters,
+                                    4: required i32 limit,
+                                    5: required i32 offset)
+                        throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+
+        /**
+           * Search Experiments.
+           * Search Experiments by using multiple filter criteria with pagination. Results will be sorted based on creation time DESC.
+           *
+           * @param gatewayId
+           *       Identifier of the requested gateway.
+           *
+           * @param userName
+           *       Username of the user requesting the search function.
+           *
+           * @param filters
+           *       Map of multiple filter criteria. Currenlt search filters includes Experiment Name, Description, Application, etc....
+           *
+           * @param limit
+           *       Amount of results to be fetched.
+           *
+           * @param offset
+           *       The starting point of the results to be fetched.
+           *
+           * @return ExperimentSummaryModel
+           *    List of experiments for the given search filter. Here only the Experiment summary will be returned.
+           *
+           **/
+
+            list<experiment_model.ExperimentSummaryModel> searchExperiments(1: required string gatewayId,
+                                    2: required string userName,
+                                    3: map<experiment_model.ExperimentSearchFields, string> filters,
+                                    4: required i32 limit,
+                                    5: required i32 offset)
+                        throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Get Experiment Statistics
+             * Get Experiment Statisitics for a given gateway for a specific time period. This feature is available only for admins of a particular gateway. Gateway admin access is managed by the user roles.
+             *
+             * @param gatewayId
+             *       Unique identifier of the gateway making the request to fetch statistics.
+             *
+             * @param fromTime
+             *       Starting date time.
+             *
+             * @param toTime
+             *       Ending data time.
+             *
+             **/
+            experiment_model.ExperimentStatistics getExperimentStatistics(1: required string gatewayId,
+                                    2: required i64 fromTime,
+                                    3: required i64 toTime)
+                        throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+          /**
+           *
+           * Get All Experiments of the Project
+           * Get Experiments within project with pagination. Results will be sorted based on creation time DESC.
+           *
+           * @param projectId
+           *       Uniqie identifier of the project.
+           *
+           * @param limit
+           *       Amount of results to be fetched.
+           *
+           * @param offset
+           *       The starting point of the results to be fetched.
+           *
+           **/
+          list<experiment_model.ExperimentModel> getExperimentsInProject(1: required string projectId,
+                          2: required i32 limit,
+                          3: required i32 offset)
+                  throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+           *
+           * Get All Experiments of the User
+           * Get experiments by user with pagination. Results will be sorted based on creation time DESC.
+           *
+           * @param gatewayId
+           *       Identifier of the requesting gateway.
+           *
+           * @param userName
+           *       Username of the requested end user.
+           *
+           * @param limit
+           *       Amount of results to be fetched.
+           *
+           * @param offset
+           *       The starting point of the results to be fetched.
+           *
+           **/
+          list<experiment_model.ExperimentModel> getUserExperiments(1: required string gatewayId,
+                                2: required string userName,
+                                3: required i32 limit,
+                                4: required i32 offset)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+             *
+             * Create New Experiment
+             * Create an experiment for the specified user belonging to the gateway. The gateway identity is not explicitly passed
+             *   but inferred from the sshKeyAuthentication header. This experiment is just a persistent place holder. The client
+             *   has to subsequently configure and launch the created experiment. No action is taken on Airavata Server except
+             *   registering the experiment in a persistent store.
+             *
+             * @param gatewayId
+             *    The unique ID of the gateway where the experiment is been created.
+             *
+             * @param ExperimentModel
+             *    The create experiment will require the basic experiment metadata like the name and description, intended user,
+             *      the gateway identifer and if the experiment should be shared public by defualt. During the creation of an experiment
+             *      the ExperimentMetadata is a required field.
+             *
+             * @return
+             *   The server-side generated.airavata.registry.core.experiment.globally unique identifier.
+             *
+             * @throws org.apache.airavata.model.error.InvalidRequestException
+             *    For any incorrect forming of the request itself.
+             *
+             * @throws org.apache.airavata.model.error.AiravataClientException
+             *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+             *
+             *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+             *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+             *         gateway registration steps and retry this request.
+             *
+             *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+             *         For now this is a place holder.
+             *
+             *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+             *         is implemented, the authorization will be more substantial.
+             *
+             * @throws org.apache.airavata.model.error.AiravataSystemException
+             *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+             *       rather an Airavata Administrator will be notified to take corrective action.
+             *
+           **/
+          string createExperiment(1: required string gatewayId,
+                                  2: required experiment_model.ExperimentModel experiment)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+          /**
+          *
+          * Delete an Experiment
+          * If the experiment is not already launched experiment can be deleted.
+          *
+          * @param authzToken
+          *
+          * @param experiementId
+          *     Experiment ID of the experimnet you want to delete.
+          *
+          * @return boolean
+          *     Identifier for the success or failure of the deletion operation.
+          *
+          **/
+          bool deleteExperiment(1: required string experimentId)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+          /**
+           *
+           * Get Experiment
+           * Fetch previously created experiment metadata.
+           *
+           * @param airavataExperimentId
+           *    The unique identifier of the requested experiment. This ID is returned during the create experiment step.
+           *
+           * @return ExperimentModel
+           *   This method will return the previously stored experiment metadata.
+           *
+           * @throws org.apache.airavata.model.error.InvalidRequestException
+           *    For any incorrect forming of the request itself.
+           *
+           * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+           *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+           *
+           * @throws org.apache.airavata.model.error.AiravataClientException
+           *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+           *
+           *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+           *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+           *         gateway registration steps and retry this request.
+           *
+           *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+           *         For now this is a place holder.
+           *
+           *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+           *         is implemented, the authorization will be more substantial.
+           *
+           * @throws org.apache.airavata.model.error.AiravataSystemException
+           *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+           *       rather an Airavata Administrator will be notified to take corrective action.
+           *
+         **/
+          experiment_model.ExperimentModel getExperiment(1: required string airavataExperimentId)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+          /**
+           *
+           * Get Complete Experiment Details
+           * Fetch the completed nested tree structue of previously created experiment metadata which includes processes ->
+           * tasks -> jobs information.
+           *
+           * @param airavataExperimentId
+           *    The identifier for the requested experiment. This is returned during the create experiment step.
+           *
+           * @return ExperimentModel
+           *   This method will return the previously stored experiment metadata including application input parameters, computational resource scheduling
+           *   information, special input output handling and additional quality of service parameters.
+           *
+           * @throws org.apache.airavata.model.error.InvalidRequestException
+           *    For any incorrect forming of the request itself.
+           *
+           * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+           *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+           *
+           * @throws org.apache.airavata.model.error.AiravataClientException
+           *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+           *
+           *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+           *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+           *         gateway registration steps and retry this request.
+           *
+           *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+           *         For now this is a place holder.
+           *
+           *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+           *         is implemented, the authorization will be more substantial.
+           *
+           * @throws org.apache.airavata.model.error.AiravataSystemException
+           *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+           *       rather an Airavata Administrator will be notified to take corrective action.
+           *
+          */
+          experiment_model.ExperimentModel getDetailedExperimentTree(1: required string airavataExperimentId)
+              throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+          /**
+           *
+           * Update a Previously Created Experiment
+           * Configure the CREATED experiment with required inputs, scheduling and other quality of service parameters. This method only updates the experiment object within the registry.
+           * The experiment has to be launched to make it actionable by the server.
+           *
+           * @param airavataExperimentId
+           *    The identifier for the requested experiment. This is returned during the create experiment step.
+           *
+           * @param ExperimentModel
+           *    The configuration information of the experiment with application input parameters, computational resource scheduling
+           *      information, special input output handling and additional quality of service parameters.
+           *
+           * @return
+           *   This method call does not have a return value.
+           *
+           * @throws org.apache.airavata.model.error.InvalidRequestException
+           *    For any incorrect forming of the request itself.
+           *
+           * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+           *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+           *
+           * @throws org.apache.airavata.model.error.AiravataClientException
+           *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+           *
+           *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+           *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+           *         gateway registration steps and retry this request.
+           *
+           *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+           *         For now this is a place holder.
+           *
+           *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+           *         is implemented, the authorization will be more substantial.
+           *
+           * @throws org.apache.airavata.model.error.AiravataSystemException
+           *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+           *       rather an Airavata Administrator will be notified to take corrective action.
+           *
+          */
+          void updateExperiment(1: required string airavataExperimentId,
+                                2: required experiment_model.ExperimentModel experiment)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+          void updateExperimentConfiguration(1: required string airavataExperimentId,
+                                             2: required experiment_model.UserConfigurationDataModel userConfiguration)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+          void updateResourceScheduleing(1: required string airavataExperimentId,
+                                         2: required scheduling_model.ComputationalResourceSchedulingModel resourceScheduling)
+            throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+         /**
+           *
+           * Get Experiment Status
+           *
+           * Obtain the status of an experiment by providing the Experiment Id
+           *
+           * @param authzToken
+           *
+           * @param airavataExperimentId
+           *     Experiment ID of the experimnet you require the status.
+           *
+           * @return ExperimentStatus
+           *     ExperimentStatus model with the current status will be returned.
+           *
+           **/
+            status_models.ExperimentStatus getExperimentStatus(1: required string airavataExperimentId)
+               throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+           *
+           * Get Experiment Outputs
+           * This method to be used when need to obtain final outputs of a certain Experiment
+           *
+           * @param authzToken
+           *
+           * @param airavataExperimentId
+           *     Experiment ID of the experimnet you need the outputs.
+           *
+           * @return list
+           *     List of experiment outputs will be returned. They will be returned as a list of OutputDataObjectType for the experiment.
+           *
+           **/
+           list<application_io_models.OutputDataObjectType> getExperimentOutputs (1: required string airavataExperimentId)
+               throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+           *
+           * Get Intermediate Experiment Outputs
+           * This method to be used when need to obtain intermediate outputs of a certain Experiment
+           *
+           * @param authzToken
+           *
+           * @param airavataExperimentId
+           *     Experiment ID of the experimnet you need intermediate outputs.
+           *
+           * @return list
+           *     List of intermediate experiment outputs will be returned. They will be returned as a list of OutputDataObjectType for the experiment.
+           *
+           **/
+            list<application_io_models.OutputDataObjectType> getIntermediateOutputs (1: required string airavataExperimentId)
+                 throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+           *
+           * Get Job Statuses for an Experiment
+           * This method to be used when need to get the job status of an Experiment. An experiment may have one or many jobs; there for one or many job statuses may turnup
+           *
+           * @param authzToken
+           *
+           * @param experiementId
+           *     Experiment ID of the experimnet you need the job statuses.
+           *
+           * @return JobStatus
+           *     Job status (string) for all all the existing jobs for the experiment will be returned in the form of a map
+           *
+           **/
+           map<string, status_models.JobStatus> getJobStatuses(1: required string airavataExperimentId)
+                       throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+           *
+           * Get Job Details for all the jobs within an Experiment.
+           * This method to be used when need to get the job details for one or many jobs of an Experiment.
+           *
+           * @param authzToken
+           *
+           * @param experiementId
+           *     Experiment ID of the experimnet you need job details.
+           *
+           * @return list of JobDetails
+           *     Job details.
+           *
+           **/
+           list<job_model.JobModel> getJobDetails(1: required string airavataExperimentId)
+                         throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+          /*
+           *
+           * API definitions for App Catalog related operations
+           *
+          */
+
+          /**
+             *
+             * Register a Application Module.
+             *
+             * @gatewayId
+             *    ID of the gateway which is registering the new Application Module.
+             *
+             * @param applicationModule
+             *    Application Module Object created from the datamodel.
+             *
+             * @return appModuleId
+             *   Returns the server-side generated airavata appModule globally unique identifier.
+             *
+            */
+            string registerApplicationModule(1: required string gatewayId,
+                                  2: required application_deployment_model.ApplicationModule applicationModule)
+              	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Fetch a Application Module.
+             *
+             * @param appModuleId
+             *   The unique identifier of the application module required
+             *
+             * @return applicationModule
+             *   Returns an Application Module Object.
+             *
+            */
+            application_deployment_model.ApplicationModule getApplicationModule(1: required string appModuleId)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Update a Application Module.
+             *
+             * @param appModuleId
+             *   The identifier for the requested application module to be updated.
+             *
+             * @param applicationModule
+             *    Application Module Object created from the datamodel.
+             *
+             * @return status
+             *   Returns a success/failure of the update.
+             *
+            */
+            bool updateApplicationModule(1: required string appModuleId,
+                      2: required application_deployment_model.ApplicationModule applicationModule)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Fetch all Application Module Descriptions.
+             *
+             * @param gatewayId
+             *    ID of the gateway which need to list all available application deployment documentation.
+             *
+             * @return list
+             *    Returns the list of all Application Module Objects.
+             *
+            */
+            list<application_deployment_model.ApplicationModule> getAllAppModules (1: required string gatewayId)
+                  throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Delete an Application Module.
+             *
+             * @param appModuleId
+             *   The identifier of the Application Module to be deleted.
+             *
+             * @return status
+             *   Returns a success/failure of the deletion.
+             *
+            */
+            bool deleteApplicationModule(1: required string appModuleId)
+                   	throws (1: registry_api_errors.RegistryServiceException rse)
+
+          /*
+           *
+           * Application Deployment
+           *  Registers a deployment of an Application Module on a Compute Resource.
+           *
+          */
+
+            /**
+             *
+             * Register an Application Deployment.
+             *
+             * @param gatewayId
+             *    ID of the gateway which is registering the new Application Deployment.
+             *
+             * @param applicationDeployment
+             *    Application Module Object created from the datamodel.
+             *
+             * @return appDeploymentId
+             *   Returns a server-side generated airavata appDeployment globally unique identifier.
+             *
+            */
+            string registerApplicationDeployment(1: required string gatewayId,
+                          2: required application_deployment_model.ApplicationDeploymentDescription applicationDeployment)
+              	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Fetch a Application Deployment.
+             *
+             * @param appDeploymentId
+             *   The identifier for the requested application module
+             *
+             * @return applicationDeployment
+             *   Returns a application Deployment Object.
+             *
+            */
+            application_deployment_model.ApplicationDeploymentDescription getApplicationDeployment(1: required string appDeploymentId)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Update an Application Deployment.
+             *
+             * @param appDeploymentId
+             *   The identifier of the requested application deployment to be updated.
+             *
+             * @param appDeployment
+             *    Application Deployment Object created from the datamodel.
+             *
+             * @return status
+             *   Returns a success/failure of the update.
+             *
+            */
+            bool updateApplicationDeployment(1: required string appDeploymentId,
+                      2: required application_deployment_model.ApplicationDeploymentDescription applicationDeployment)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Delete an Application Deployment.
+             *
+             * @param appDeploymentId
+             *   The unique identifier of application deployment to be deleted.
+             *
+             * @return status
+             *   Returns a success/failure of the deletion.
+             *
+            */
+            bool deleteApplicationDeployment(1: required string appDeploymentId)
+                   	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Fetch all Application Deployment Descriptions.
+             *
+             * @param gatewayId
+             *    ID of the gateway which need to list all available application deployment documentation.
+             *
+             * @return list<applicationDeployment.
+             *    Returns the list of all application Deployment Objects.
+             *
+            */
+            list<application_deployment_model.ApplicationDeploymentDescription> getAllApplicationDeployments(1: required string gatewayId)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Fetch a list of Deployed Compute Hosts.
+             *
+             * @param appModuleId
+             *   The identifier for the requested application module
+             *
+             * @return list<string>
+             *   Returns a list of Deployed Resources.
+             *
+            */
+            list<string> getAppModuleDeployedResources(1: required string appModuleId)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+          /*
+           *
+           * Application Interface
+           *
+          */
+
+            /**
+             *
+             * Register a Application Interface.
+             *
+             * @param applicationInterface
+             *    Application Module Object created from the datamodel.
+             *
+             * @return appInterfaceId
+             *   Returns a server-side generated airavata application interface globally unique identifier.
+             *
+            */
+            string registerApplicationInterface(1: required string gatewayId,
+                          2: required application_interface_model.ApplicationInterfaceDescription applicationInterface)
+              	throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+         /**
+            *
+            * Fetch an Application Interface.
+            *
+            * @param appInterfaceId
+            *   The identifier for the requested application interface.
+            *
+            * @return applicationInterface
+            *   Returns an application Interface Object.
+            *
+           */
+           application_interface_model.ApplicationInterfaceDescription getApplicationInterface(1: required string appInterfaceId)
+               	throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+            *
+            * Update a Application Interface.
+            *
+            * @param appInterfaceId
+            *   The identifier of the requested application deployment to be updated.
+            *
+            * @param appInterface
+            *    Application Interface Object created from the datamodel.
+            *
+            * @return status
+            *   Returns a success/failure of the update.
+            *
+           */
+           bool updateApplicationInterface(1: required string appInterfaceId,
+                     2: required application_interface_model.ApplicationInterfaceDescription applicationInterface)
+               	throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+            *
+            * Delete an Application Interface.
+            *
+            * @param appInterfaceId
+            *   The identifier for the requested application interface to be deleted.
+            *
+            * @return status
+            *   Returns a success/failure of the deletion.
+            *
+           */
+           bool deleteApplicationInterface(1: required string appInterfaceId)
+                  	throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+            *
+            * Fetch name and ID of  Application Interface documents.
+            *
+            *
+            * @return map<applicationId, applicationInterfaceNames>
+            *   Returns a list of application interfaces with corresponsing ID's
+            *
+           */
+           map<string, string> getAllApplicationInterfaceNames (1: required string gatewayId)
+               	throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+            *
+            * Fetch all Application Interface documents.
+            *
+            *
+            * @return map<applicationId, applicationInterfaceNames>
+            *   Returns a list of application interfaces documents (Application Interface ID, name, description, Inputs and Outputs objects).
+            *
+           */
+           list<application_interface_model.ApplicationInterfaceDescription> getAllApplicationInterfaces (1: required string gatewayId)
+               	throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+            *
+            * Fetch the list of Application Inputs.
+            *
+            * @param appInterfaceId
+            *   The identifier of the application interface which need inputs to be fetched.
+            *
+            * @return list<application_interface_model.InputDataObjectType>
+            *   Returns a list of application inputs.
+            *
+           */
+           list<application_io_models.InputDataObjectType> getApplicationInputs(1: required string appInterfaceId)
+               	throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+            *
+            * Fetch list of Application Outputs.
+            *
+            * @param appInterfaceId
+            *   The identifier of the application interface which need outputs to be fetched.
+            *
+            * @return list<application_interface_model.OutputDataObjectType>
+            *   Returns a list of application outputs.
+            *
+           */
+           list<application_io_models.OutputDataObjectType> getApplicationOutputs(1: required string appInterfaceId)
+               	throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+            *
+            * Fetch a list of all deployed Compute Hosts for a given application interfaces.
+            *
+            * @param appInterfaceId
+            *   The identifier for the requested application interface.
+            *
+            * @return map<computeResourceId, computeResourceName>
+            *   A map of registered compute resource id's and their corresponding hostnames.
+            *   Deployments of each modules listed within the interfaces will be listed.
+            *
+           */
+           map<string, string> getAvailableAppInterfaceComputeResources(1: required string appInterfaceId)
+               	throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+
+          /*
+           *
+           * Compute Resource
+           *
+          */
+          /**
+             * Register a Compute Resource.
+             *
+             * @param computeResourceDescription
+             *    Compute Resource Object created from the datamodel.
+             *
+             * @return computeResourceId
+             *   Returns a server-side generated airavata compute resource globally unique identifier.
+             *
+            */
+            string registerComputeResource(1: required compute_resource_model.ComputeResourceDescription computeResourceDescription)
+              	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Fetch the given Compute Resource.
+             *
+             * @param computeResourceId
+             *   The identifier for the requested compute resource
+             *
+             * @return computeResourceDescription
+             *    Compute Resource Object created from the datamodel..
+             *
+            */
+            compute_resource_model.ComputeResourceDescription getComputeResource(1: required string computeResourceId)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Fetch all registered Compute Resources.
+             *
+             * @return A map of registered compute resource id's and thier corresponding hostnames.
+             *    Compute Resource Object created from the datamodel..
+             *
+            */
+            map<string, string> getAllComputeResourceNames()
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Update a Compute Resource.
+             *
+             * @param computeResourceId
+             *   The identifier for the requested compute resource to be updated.
+             *
+             * @param computeResourceDescription
+             *    Compute Resource Object created from the datamodel.
+             *
+             * @return status
+             *   Returns a success/failure of the update.
+             *
+            */
+
+            bool updateComputeResource(1: required string computeResourceId,
+                      2: required compute_resource_model.ComputeResourceDescription computeResourceDescription)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Delete a Compute Resource.
+             *
+             * @param computeResourceId
+             *   The identifier for the requested compute resource to be deleted.
+             *
+             * @return status
+             *   Returns a success/failure of the deletion.
+             *
+            */
+            bool deleteComputeResource(1: required string computeResourceId)
+                   	throws (1: registry_api_errors.RegistryServiceException rse)
+
+          /*
+           *
+           * Storage Resource
+           *
+          */
+
+            /**
+             * Register a Storage Resource.
+             *
+             * @param storageResourceDescription
+             *    Storge Resource Object created from the datamodel.
+             *
+             * @return storageResourceId
+             *   Returns a server-side generated airavata storage resource globally unique identifier.
+             *
+            */
+
+            string registerStorageResource(1: required storage_resource_model.StorageResourceDescription storageResourceDescription)
+              	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Fetch the given Storage Resource.
+             *
+             * @param storageResourceId
+             *   The identifier for the requested storage resource
+             *
+             * @return storageResourceDescription
+             *    Storage Resource Object created from the datamodel..
+             *
+            */
+
+            storage_resource_model.StorageResourceDescription getStorageResource(1: required string storageResourceId)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Fetch all registered Storage Resources.
+             *
+             * @return A map of registered compute resource id's and thier corresponding hostnames.
+             *    Compute Resource Object created from the datamodel..
+             *
+            */
+
+            map<string, string> getAllStorageResourceNames()
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Update a Storage Resource.
+             *
+             * @param storageResourceId
+             *   The identifier for the requested compute resource to be updated.
+             *
+             * @param storageResourceDescription
+             *    Storage Resource Object created from the datamodel.
+             *
+             * @return status
+             *   Returns a success/failure of the update.
+             *
+            */
+
+            bool updateStorageResource(1: required string storageResourceId,
+                      2: required storage_resource_model.StorageResourceDescription storageResourceDescription)
+                	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Delete a Storage Resource.
+             *
+             * @param storageResourceId
+             *   The identifier of the requested compute resource to be deleted.
+             *
+             * @return status
+             *   Returns a success/failure of the deletion.
+             *
+            */
+
+            bool deleteStorageResource(1: required string storageResourceId)
+                   	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Add a Local Job Submission details to a compute resource
+             *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+             *
+             * @param computeResourceId
+             *   The identifier of the compute resource to which JobSubmission protocol to be added
+             *
+             * @param priorityOrder
+             *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+             *
+             * @param localSubmission
+             *   The LOCALSubmission object to be added to the resource.
+             *
+             * @return status
+             *   Returns the unique job submission id.
+             *
+            */
+
+            string addLocalSubmissionDetails(1: required string computeResourceId,
+                      2: required i32 priorityOrder,
+                      3: required compute_resource_model.LOCALSubmission localSubmission)
+
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Update the given Local Job Submission details
+             *
+             * @param jobSubmissionInterfaceId
+             *   The identifier of the JobSubmission Interface to be updated.
+             *
+             * @param localSubmission
+             *   The LOCALSubmission object to be updated.
+             *
+             * @return status
+             *   Returns a success/failure of the deletion.
+             *
+            */
+
+            bool updateLocalSubmissionDetails(1: required string jobSubmissionInterfaceId,
+                      2: required compute_resource_model.LOCALSubmission localSubmission)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+            * This method returns localJobSubmission object
+            * @param jobSubmissionInterfaceId
+            *   The identifier of the JobSubmission Interface to be retrieved.
+            *  @return LOCALSubmission instance
+            **/
+
+            compute_resource_model.LOCALSubmission getLocalJobSubmission(1: required string jobSubmissionId)
+                     throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+
+            /**
+             * Add a SSH Job Submission details to a compute resource
+             *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+             *
+             * @param computeResourceId
+             *   The identifier of the compute resource to which JobSubmission protocol to be added
+             *
+             * @param priorityOrder
+             *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+             *
+             * @param sshJobSubmission
+             *   The SSHJobSubmission object to be added to the resource.
+             *
+             * @return status
+             *   Returns the unique job submission id.
+             *
+            */
+
+            string addSSHJobSubmissionDetails(1: required string computeResourceId,
+                      2: required i32 priorityOrder,
+                      3: required compute_resource_model.SSHJobSubmission sshJobSubmission)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             * Add a SSH_FORK Job Submission details to a compute resource
+             *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+             *
+             * @param computeResourceId
+             *   The identifier of the compute resource to which JobSubmission protocol to be added
+             *
+             * @param priorityOrder
+             *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+             *
+             * @param sshJobSubmission
+             *   The SSHJobSubmission object to be added to the resource.
+             *
+             * @return status
+             *   Returns the unique job submission id.
+             *
+            */
+
+
+            string addSSHForkJobSubmissionDetails(1: required string computeResourceId,
+                      2: required i32 priorityOrder,
+                      3: required compute_resource_model.SSHJobSubmission sshJobSubmission)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+              * This method returns SSHJobSubmission object
+              * @param jobSubmissionInterfaceId
+              *   The identifier of the JobSubmission Interface to be retrieved.
+              *  @return SSHJobSubmission instance
+              **/
+
+              compute_resource_model.SSHJobSubmission getSSHJobSubmission(1: required string jobSubmissionId)
+                        throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+
+            /**
+             *
+             * Add a UNICORE Job Submission details to a compute resource
+             *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+             *
+             * @param computeResourceId
+             *   The identifier of the compute resource to which JobSubmission protocol to be added
+             *
+             * @param priorityOrder
+             *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+             *
+             * @param unicoreJobSubmission
+             *   The UnicoreJobSubmission object to be added to the resource.
+             *
+             * @return status
+             *  Returns the unique job submission id.
+             *
+            */
+            string addUNICOREJobSubmissionDetails(1: required string computeResourceId,
+                      2: required i32 priorityOrder,
+                      3: required compute_resource_model.UnicoreJobSubmission unicoreJobSubmission)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+            /**
+              *
+              * This method returns UnicoreJobSubmission object
+              *
+              * @param jobSubmissionInterfaceId
+              *   The identifier of the JobSubmission Interface to be retrieved.
+              *  @return UnicoreJobSubmission instance
+              *
+            **/
+            compute_resource_model.UnicoreJobSubmission getUnicoreJobSubmission(1: required string jobSubmissionId)
+                         throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+           /**
+             *
+             * Add a Cloud Job Submission details to a compute resource
+             *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+             *
+             * @param computeResourceId
+             *   The identifier of the compute resource to which JobSubmission protocol to be added
+             *
+             * @param priorityOrder
+             *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+             *
+             * @param sshJobSubmission
+             *   The SSHJobSubmission object to be added to the resource.
+             *
+             * @return status
+             *   Returns the unique job submission id.
+             *
+          **/
+           string addCloudJobSubmissionDetails(1: required string computeResourceId,
+                      2: required i32 priorityOrder,
+                      3: required compute_resource_model.CloudJobSubmission cloudSubmission)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+           /**
+              *
+              * This method returns cloudJobSubmission object
+              * @param jobSubmissionInterfaceI
+                  *   The identifier of the JobSubmission Interface to be retrieved.
+              *  @return CloudJobSubmission instance
+           **/
+           compute_resource_model.CloudJobSubmission getCloudJobSubmission(1: required string jobSubmissionId)
+                            throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Update the given SSH Job Submission details
+             *
+             * @param jobSubmissionInterfaceId
+             *   The identifier of the JobSubmission Interface to be updated.
+             *
+             * @param sshJobSubmission
+             *   The SSHJobSubmission object to be updated.
+             *
+             * @return status
+             *   Returns a success/failure of the update.
+             *
+            */
+            bool updateSSHJobSubmissionDetails(1: required string jobSubmissionInterfaceId,
+                      2: required compute_resource_model.SSHJobSubmission sshJobSubmission)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+          /**
+             *
+             * Update the cloud Job Submission details
+             *
+             * @param jobSubmissionInterfaceId
+             *   The identifier of the JobSubmission Interface to be updated.
+             *
+             * @param cloudJobSubmission
+             *   The CloudJobSubmission object to be updated.
+             *
+             * @return status
+             *   Returns a success/failure of the update.
+             *
+            */
+            bool updateCloudJobSubmissionDetails(1: required string jobSubmissionInterfaceId,
+                      2: required compute_resource_model.CloudJobSubmission sshJobSubmission)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+             /**
+             *
+             * Update the UNIOCRE Job Submission details
+             *
+             * @param jobSubmissionInterfaceId
+             *   The identifier of the JobSubmission Interface to be updated.
+             *
+             * @param UnicoreJobSubmission
+             *   The UnicoreJobSubmission object to be updated.
+             *
+             * @return status
+             *   Returns a success/failure of the update.
+             *
+             **/
+            bool updateUnicoreJobSubmissionDetails(1: required string jobSubmissionInterfaceId,
+                        2: required compute_resource_model.UnicoreJobSubmission unicoreJobSubmission)
+              	throws (1: registry_api_errors.RegistryServiceException rse)
+
+             /**
+             *
+             * Add a Local data movement details to a compute resource
+             *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+             *
+             * @param productUri
+             *   The identifier of the compute resource to which JobSubmission protocol to be added
+             *
+             * @param DMType
+             *   DMType object to be added to the resource.
+             *
+             * @param priorityOrder
+             *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+             *
+             * @param localDataMovement
+             *   The LOCALDataMovement object to be added to the resource.
+             *
+             * @return status
+             *   Returns the unique job submission id.
+             *
+             **/
+            string addLocalDataMovementDetails(1: required string productUri,
+                      2: required data_movement_models.DMType dataMoveType,
+                      3: required i32 priorityOrder,
+                      4: required data_movement_models.LOCALDataMovement localDataMovement)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+             /**
+             *
+             * Update the given Local data movement details
+             *
+             * @param dataMovementInterfaceId
+             *   The identifier of the data movement Interface to be updated.
+             *
+             * @param localDataMovement
+             *   The LOCALDataMovement object to be updated.
+             *
+             * @return status
+             *   Returns a success/failure of the update.
+             *
+             **/
+            bool updateLocalDataMovementDetails(1: required string dataMovementInterfaceId,
+                      2: required data_movement_models.LOCALDataMovement localDataMovement)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+            *
+            * This method returns local datamovement object.
+            *
+            * @param dataMovementId
+            *   The identifier of the datamovement Interface to be retrieved.
+            *
+            *  @return LOCALDataMovement instance
+            *
+            **/
+            data_movement_models.LOCALDataMovement getLocalDataMovement(1: required string dataMovementId)
+                              throws (1: registry_api_errors.RegistryServiceException rse)
+
+            /**
+             *
+             * Add a SCP data movement details to a compute resource
+             *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+             *
+             * @param productUri
+             *   The identifier of the compute resource to which JobSubmission protocol to be added
+             *
+             * @param priorityOrder
+             *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+             *
+             * @param scpDataMovement
+             *   The SCPDataMovement object to be added to the resource.
+             *
+             * @return status
+             *   Returns the unique job submission id.
+             *
+            */
+            string addSCPDataMovementDetails(1: required string productUri,
+                      2: required data_movement_models.DMType dataMoveType,
+                      3: required i32 priorityOrder,
+                      4: required data_movement_models.SCPDataMovement scpDataMovement)
+            	throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+            /**
+               *
+               * Update the given scp data movement details
+               *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+               *
+               * @param dataMovementInterfaceId
+               *   The identifier of the data movement Interface to be updated.
+               *
+               * @param scpDataMovement
+               *   The SCPDataMovement object to be updated.
+               *
+               * @return status
+               *   Returns a success/failure of the update.
+               *
+              */
+              bool updateSCPDataMovementDetails(1: required string dataMovementInterfaceId,
+                        2: required data_movement_models.SCPDataMovement scpDataMovement)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+                /**
+                * This method returns SCP datamovement object
+                *
+                * @param dataMovementId
+                *   The identifier of the datamovement Interface to be retrieved.
+                *
+                * @return SCPDataMovement instance
+                *
+                **/
+              data_movement_models.SCPDataMovement getSCPDataMovement(1: required string dataMovementId)
+                                throws (1: registry_api_errors.RegistryServiceException rse)
+
+             /**
+               *
+               * Add a UNICORE data movement details to a compute resource
+               *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+               *
+               * @param productUri
+               *   The identifier of the compute resource to which data movement protocol to be added
+               *
+               * @param priorityOrder
+               *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+               *
+               * @param UnicoreDataMovement
+               *   The UnicoreDataMovement object to be added to the resource.
+               *
+               * @return status
+               *   Returns the unique data movement id.
+               *
+              */
+             string addUnicoreDataMovementDetails(1: required string productUri,
+                          2: required data_movement_models.DMType dataMoveType,
+                          3: required i32 priorityOrder,
+                          4: required data_movement_models.UnicoreDataMovement unicoreDataMovement)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+               /**
+               *
+               * Update a selected UNICORE data movement details
+               *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+               *
+               * @param dataMovementInterfaceId
+               *   The identifier of the data movement Interface to be updated.
+               *
+               * @param UnicoreDataMovement
+               *   The UnicoreDataMovement object to be updated.
+               *
+               * @return status
+               *   Returns a success/failure of the update.
+               *
+               **/
+
+             bool updateUnicoreDataMovementDetails(1: required string dataMovementInterfaceId,
+                         2: required data_movement_models.UnicoreDataMovement unicoreDataMovement)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+                /**
+                *
+                * This method returns UNICORE datamovement object
+                *
+                * @param dataMovementId
+                *   The identifier of the datamovement Interface to be retrieved.
+                *
+                * @return UnicoreDataMovement instance
+                *
+                **/
+
+             data_movement_models.UnicoreDataMovement getUnicoreDataMovement(1: required string dataMovementId)
+                                throws (1: registry_api_errors.RegistryServiceException rse)
+
+               /**
+               *
+               * Add a GridFTP data movement details to a compute resource
+               *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+               *
+               * @param productUri
+               *   The identifier of the compute resource to which dataMovement protocol to be added
+               *
+               * @param DMType
+               *    The DMType object to be added to the resource.
+               *
+               * @param priorityOrder
+               *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+               *
+               * @param gridFTPDataMovement
+               *   The GridFTPDataMovement object to be added to the resource.
+               *
+               * @return status
+               *   Returns the unique data movement id.
+               *
+               **/
+
+              string addGridFTPDataMovementDetails(1: required string productUri,
+                        2: required data_movement_models.DMType dataMoveType,
+                        3: required i32 priorityOrder,
+                        4: required data_movement_models.GridFTPDataMovement gridFTPDataMovement)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+               /**
+               * Update the given GridFTP data movement details to a compute resource
+               *  App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+               *
+               * @param dataMovementInterfaceId
+               *   The identifier of the data movement Interface to be updated.
+               *
+               * @param gridFTPDataMovement
+               *   The GridFTPDataMovement object to be updated.
+               *
+               * @return boolean
+               *   Returns a success/failure of the update.
+               *
+               **/
+
+              bool updateGridFTPDataMovementDetails(1: required string dataMovementInterfaceId,
+                        2: required data_movement_models.GridFTPDataMovement gridFTPDataMovement)
+               throws (1: registry_api_errors.RegistryServiceException rse)
+
+                /**
+                * This method returns GridFTP datamovement object
+                *
+                * @param dataMovementId
+                *   The identifier of the datamovement Interface to be retrieved.
+                *
+                *  @return GridFTPDataMovement instance
+                *
+                **/
+
+              data_movement_models.GridFTPDataMovement getGridFTPDataMovement(1: required string dataMovementId)
+                                throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+               /**
+               * Change the priority of a given job submisison interface
+               *
+               * @param jobSubmissionInterfaceId
+               *   The identifier of the JobSubmission Interface to be changed
+               *
+               * @param priorityOrder
+               *   The new priority of the job manager interface.
+               *
+               * @return status
+               *   Returns a success/failure of the change.
+               *
+               **/
+
+              bool changeJobSubmissionPriority(1: required string jobSubmissionInterfaceId,
+                        2: required i32 newPriorityOrder)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+               /**
+               * Change the priority of a given data movement interface
+               *
+               * @param dataMovementInterfaceId
+               *   The identifier of the DataMovement Interface to be changed
+               *
+               * @param priorityOrder
+               *   The new priority of the data movement interface.
+               *
+               * @return status
+               *   Returns a success/failure of the change.
+               *
+               **/
+
+              bool changeDataMovementPriority(1: required string dataMovementInterfaceId,
+                        2: required i32 newPriorityOrder)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Change the priorities of a given set of job submission interfaces
+               *
+               * @param jobSubmissionPriorityMap
+               *   A Map of identifiers of the JobSubmission Interfaces and thier associated priorities to be set.
+               *
+               * @return status
+               *   Returns a success/failure of the changes.
+               *
+              */
+
+              bool changeJobSubmissionPriorities(1: required map<string, i32> jobSubmissionPriorityMap)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+               /**
+               * Change the priorities of a given set of data movement interfaces
+               *
+               * @param dataMovementPriorityMap
+               *   A Map of identifiers of the DataMovement Interfaces and thier associated priorities to be set.
+               *
+               * @return status
+               *   Returns a success/failure of the changes.
+               *
+               **/
+
+              bool changeDataMovementPriorities(1: required map<string, i32> dataMovementPriorityMap)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+               /**
+               * Delete a given job submisison interface
+               *
+               * @param jobSubmissionInterfaceId
+               *   The identifier of the JobSubmission Interface to be changed
+               *
+               * @return status
+               *   Returns a success/failure of the deletion.
+               *
+               **/
+
+              bool deleteJobSubmissionInterface(1: required string computeResourceId,
+                        2: required string jobSubmissionInterfaceId)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+               /**
+               * Delete a given data movement interface
+               *
+               * @param dataMovementInterfaceId
+               *   The identifier of the DataMovement Interface to be changed
+               *
+               * @return status
+               *   Returns a success/failure of the deletion.
+               *
+               **/
+
+              bool deleteDataMovementInterface(1: required string productUri,
+                        2: required string dataMovementInterfaceId,
+                        3: required data_movement_models.DMType dataMoveType,)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+             string registerResourceJobManager(1: required compute_resource_model.ResourceJobManager resourceJobManager)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+             bool updateResourceJobManager(1: required string resourceJobManagerId,
+                        2: required compute_resource_model.ResourceJobManager updatedResourceJobManager)
+                 throws (1: registry_api_errors.RegistryServiceException rse)
+
+             compute_resource_model.ResourceJobManager getResourceJobManager(1: required string resourceJobManagerId)
+                  throws (1: registry_api_errors.RegistryServiceException rse)
+
+             bool deleteResourceJobManager(1: required string resourceJobManagerId)
+                   throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Delete a Compute Resource Queue
+               *
+               * @param computeResourceId
+               *   The identifier of the compute resource which has the queue to be deleted
+               *
+               * @param queueName
+               *   Name of the queue need to be deleted. Name is the uniqueue identifier for the queue within a compute resource
+               *
+               * @return status
+               *   Returns a success/failure of the deletion.
+               *
+               **/
+
+              bool deleteBatchQueue(1: required string computeResourceId, 2: required string queueName)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+            /*
+             * Gateway Resource Profile
+             *
+            */
+
+              /**
+               * Register a Gateway Resource Profile.
+               *
+               * @param gatewayResourceProfile
+               *    Gateway Resource Profile Object.
+               *    The GatewayID should be obtained from Airavata gateway registration and passed to register a corresponding
+               *      resource profile.
+               *
+               * @return status
+               *   Returns a success/failure of the update.
+               *
+              */
+              string registerGatewayResourceProfile(1: required gateway_resource_profile_model.GatewayResourceProfile gatewayResourceProfile)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Fetch the given Gateway Resource Profile.
+               *
+               * @param gatewayID
+               *   The identifier for the requested gateway resource.
+               *
+               * @return gatewayResourceProfile
+               *    Gateway Resource Profile Object.
+               *
+              */
+
+              gateway_resource_profile_model.GatewayResourceProfile getGatewayResourceProfile(1: required string gatewayID)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Update a Gateway Resource Profile.
+               *
+               * @param gatewayID
+               *   The identifier for the requested gateway resource to be updated.
+               *
+               * @param gatewayResourceProfile
+               *    Gateway Resource Profile Object.
+               *
+               * @return status
+               *   Returns a success/failure of the update.
+               *
+              */
+
+              bool updateGatewayResourceProfile(1: required string gatewayID,
+                        2: required gateway_resource_profile_model.GatewayResourceProfile gatewayResourceProfile)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Delete the given Gateway Resource Profile.
+               *
+               * @param gatewayID
+               *   The identifier for the requested gateway resource to be deleted.
+               *
+               * @return status
+               *   Returns a success/failure of the deletion.
+               *
+              */
+
+              bool deleteGatewayResourceProfile(1: required string gatewayID)
+                        throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Add a Compute Resource Preference to a registered gateway profile.
+               *
+               * @param gatewayID
+               *   The identifier for the gateway profile to be added.
+               *
+               * @param computeResourceId
+               *   Preferences related to a particular compute resource
+               *
+               * @param computeResourcePreference
+               *   The ComputeResourcePreference object to be added to the resource profile.
+               *
+               * @return status
+               *   Returns a success/failure of the addition. If a profile already exists, this operation will fail.
+               *    Instead an update should be used.
+               *
+              */
+              bool addGatewayComputeResourcePreference(1: required string gatewayID,
+                        2: required string computeResourceId,
+                        3: required gateway_resource_profile_model.ComputeResourcePreference computeResourcePreference)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Add a Storage Resource Preference to a registered gateway profile.
+               *
+               * @param gatewayID
+               *   The identifier of the gateway profile to be added.
+               *
+               * @param storageResourceId
+               *   Preferences related to a particular compute resource
+               *
+               * @param computeResourcePreference
+               *   The ComputeResourcePreference object to be added to the resource profile.
+               *
+               * @return status
+               *   Returns a success/failure of the addition. If a profile already exists, this operation will fail.
+               *    Instead an update should be used.
+               *
+              */
+              bool addGatewayStoragePreference(1: required string gatewayID,
+                          2: required string storageResourceId,
+                          3: required gateway_resource_profile_model.StoragePreference storagePreference)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+              /**
+               *
+               * Fetch a Compute Resource Preference of a registered gateway profile.
+               *
+               * @param gatewayID
+               *   The identifier for the gateway profile to be requested
+               *
+               * @param computeResourceId
+               *   Preferences related to a particular compute resource
+               *
+               * @return computeResourcePreference
+               *   Returns the ComputeResourcePreference object.
+               *
+              */
+              gateway_resource_profile_model.ComputeResourcePreference getGatewayComputeResourcePreference(1: required string gatewayID,
+                        2: required string computeResourceId)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               *
+               * Fetch a Storage Resource Preference of a registered gateway profile.
+               *
+               * @param gatewayID
+               *   The identifier of the gateway profile to request to fetch the particular storage resource preference.
+               *
+               * @param storageResourceId
+               *   Identifier of the Stprage Preference required to be fetched.
+               *
+               * @return StoragePreference
+               *   Returns the StoragePreference object.
+               *
+              */
+              gateway_resource_profile_model.StoragePreference getGatewayStoragePreference(1: required string gatewayID,
+                          2: required string storageResourceId)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               *
+               * Fetch all Compute Resource Preferences of a registered gateway profile.
+               *
+               * @param gatewayID
+               *   The identifier for the gateway profile to be requested
+               *
+               * @return computeResourcePreference
+               *   Returns the ComputeResourcePreference object.
+               *
+              */
+              list<gateway_resource_profile_model.ComputeResourcePreference>
+                        getAllGatewayComputeResourcePreferences(1: required string gatewayID)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+              * Fetch all Storage Resource Preferences of a registered gateway profile.
+              *
+              * @param gatewayID
+              *   The identifier for the gateway profile to be requested
+              *
+              * @return StoragePreference
+              *   Returns the StoragePreference object.
+              *
+             */
+
+              list<gateway_resource_profile_model.StoragePreference>
+                          getAllGatewayStoragePreferences(1: required string gatewayID)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+              *
+              * Fetch all Gateway Profiles registered
+              *
+              * @return GatewayResourceProfile
+              *   Returns all the GatewayResourcePrifle list object.
+              *
+              **/
+              list<gateway_resource_profile_model.GatewayResourceProfile>
+                          getAllGatewayResourceProfiles()
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Update a Compute Resource Preference to a registered gateway profile.
+               *
+               * @param gatewayID
+               *   The identifier for the gateway profile to be updated.
+               *
+               * @param computeResourceId
+               *   Preferences related to a particular compute resource
+               *
+               * @param computeResourcePreference
+               *   The ComputeResourcePreference object to be updated to the resource profile.
+               *
+               * @return status
+               *   Returns a success/failure of the updation.
+               *
+              */
+              bool updateGatewayComputeResourcePreference(1: required string gatewayID,
+                        2: required string computeResourceId,
+                        3: required gateway_resource_profile_model.ComputeResourcePreference computeResourcePreference)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+                /**
+                 * Update a Storage Resource Preference of a registered gateway profile.
+                 *
+                 * @param gatewayID
+                 *   The identifier of the gateway profile to be updated.
+                 *
+                 * @param storageId
+                 *   The Storage resource identifier of the one that you want to update
+                 *
+                 * @param storagePreference
+                 *   The storagePreference object to be updated to the resource profile.
+                 *
+                 * @return status
+                 *   Returns a success/failure of the updation.
+                 *
+                */
+
+              bool updateGatewayStoragePreference(1: required string gatewayID,
+                          2: required string storageId,
+                          3: required gateway_resource_profile_model.StoragePreference storagePreference)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+              /**
+               * Delete the Compute Resource Preference of a registered gateway profile.
+               *
+               * @param gatewayID
+               *   The identifier for the gateway profile to be deleted.
+               *
+               * @param computeResourceId
+               *   Preferences related to a particular compute resource
+               *
+               * @return status
+               *   Returns a success/failure of the deletion.
+               *
+              */
+              bool deleteGatewayComputeResourcePreference(1: required string gatewayID,
+                        2: required string computeResourceId)
+                throws (1: registry_api_errors.RegistryServiceException rse)
+
+
+              /**
+               * Delete the Storage Resource Preference of a registered gateway profile.
+               *
+               * @param gatewayID
+               *   The identifier of the gateway profile to be deleted.
+               *
+               * @param storageId
+               *   ID of the storage preference you want to delete.
+               *
+               * @return status
+               *   Returns a success/failure of the deletion.
+               *
+              */
+
+              bool deleteGatewayStoragePreference(1: required string gatewayID,
+                          2: required string storageId)
+                    throws (1: registry_api_errors.RegistryServiceException rse)
+
+             /**
+                * Delete the Storage Resource Preference of a registered gateway profile.
+                *
+                * @

<TRUNCATED>

[5/7] airavata git commit: adding registry server module

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ConnectionPool.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ConnectionPool.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ConnectionPool.java
new file mode 100644
index 0000000..202a143
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ConnectionPool.java
@@ -0,0 +1,383 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.airavata.registry.api.service.util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Stack;
+import java.util.concurrent.Semaphore;
+
+
+/**
+ * A class for preallocating, recycling, and managing JDBC connections.
+ */
+public class ConnectionPool {
+    private static final Logger logger = LoggerFactory.getLogger(ConnectionPool.class);
+
+    private long MAX_IDLE_TIME = 5 * 60 * 1000; // 5 minutes
+
+    private String driver;
+    private String url;
+    private String username;
+    private String password;
+    private String jdbcUrl;
+
+    private int maxConnections;
+
+    private boolean autoCommit = true;
+    private boolean waitIfBusy;
+
+    private Semaphore needConnection = new Semaphore(0);
+    private boolean stop;
+
+    private Stack<Connection> availableConnections;
+    private Stack<Connection> busyConnections;
+
+    private HashMap<Connection, Long> lastAccessTimeRecord = new HashMap<Connection, Long>();
+
+    private String urlType = "";
+
+    private DataSource datasource;
+
+    private int transactionIsolation = Connection.TRANSACTION_NONE;
+
+    private Thread clenupThread;
+    private Thread producerThread;
+
+    public ConnectionPool(String driver, String url, String username, String password, int initialConnections,
+                          int maxConnections, boolean waitIfBusy) throws SQLException {
+        this.driver = driver;
+        this.url = url;
+        this.username = username;
+        this.password = password;
+        this.urlType = "speratedURL";
+        initialize(initialConnections, maxConnections, waitIfBusy);
+    }
+
+    public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections,
+                          boolean waitIfBusy, boolean autoCommit, int transactionIsolation) throws SQLException {
+        this.driver = driver;
+        this.jdbcUrl = jdbcUrl;
+        this.urlType = "simpleURL";
+        this.autoCommit = autoCommit;
+        this.transactionIsolation = transactionIsolation;
+        initialize(initialConnections, maxConnections, waitIfBusy);
+    }
+
+    public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections, boolean waitIfBusy)
+            throws SQLException {
+        this.driver = driver;
+        this.jdbcUrl = jdbcUrl;
+        this.urlType = "simpleURL";
+        initialize(initialConnections, maxConnections, waitIfBusy);
+    }
+
+    public ConnectionPool(DataSource dataSource, int initialConnections, int maxConnections, boolean waitIfBusy)
+            throws SQLException {
+        this.urlType = "dataSource";
+        this.datasource = dataSource;
+        initialize(initialConnections, maxConnections, waitIfBusy);
+    }
+
+    /**
+     * Check if this connection pool is auto commit or not
+     *
+     * @return
+     */
+    public boolean isAutoCommit() {
+        return this.autoCommit;
+    }
+
+    private void initialize(int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException {
+        this.maxConnections = maxConnections;
+        this.waitIfBusy = waitIfBusy;
+
+        int sizeOfConnections = (initialConnections > maxConnections) ? maxConnections : initialConnections;
+
+        availableConnections = new Stack<Connection>();
+        busyConnections = new Stack<Connection>();
+
+        for (int i = 0; i < sizeOfConnections; i++) {
+            Connection con = makeNewConnection();
+            setTimeStamp(con);
+            availableConnections.push(con);
+
+        }
+
+        producerThread = new Thread(new FillUpThread());
+        producerThread.start();
+
+        clenupThread = new Thread(new CleanUpThread());
+        clenupThread.start();
+    }
+
+    public synchronized Connection getConnection() throws SQLException {
+        if (!availableConnections.isEmpty()) {
+            Connection existingConnection = availableConnections.pop();
+
+            // If connection on available list is closed (e.g.,
+            // it timed out), then remove it from available list
+            // and race for a connection again.
+            if (existingConnection.isClosed()) {
+                lastAccessTimeRecord.remove(existingConnection);
+                // notifyAll for fairness
+                notifyAll();
+            } else {
+                busyConnections.push(existingConnection);
+                setTimeStamp(existingConnection);
+                return existingConnection;
+            }
+        } else if (!waitIfBusy && busyConnections.size() >= maxConnections) {
+            // You reached maxConnections limit and waitIfBusy flag is false.
+            // Throw SQLException in such a case.
+            throw new SQLException("Connection limit reached");
+        } else {
+
+            if (busyConnections.size() < maxConnections) {
+                // available connection is empty, but total number of connection
+                // doesn't reach maxConnection. Request for more connection
+                needConnection.release();
+            }
+
+            try {
+                // wait for free connection
+                wait();
+            } catch (InterruptedException ie) {
+            }
+        }
+        // always race for connection forever
+        return getConnection();
+    }
+
+    // This explicitly makes a new connection. Called in
+    // the foreground when initializing the ConnectionPool,
+    // and called in the background when running.
+    private Connection makeNewConnection() throws SQLException {
+        try {
+            // Load database driver if not already loaded
+            Class.forName(driver);
+            Connection connection;
+            // Establish network connection to database
+            if (urlType.equals("speratedURL")) {
+                connection = DriverManager.getConnection(url, username, password);
+            } else if (urlType.equals("simpleURL")) {
+                connection = DriverManager.getConnection(jdbcUrl);
+            } else { // if(urlType.equals("dataSource")){
+                connection = datasource.getConnection();
+            }
+            connection.setTransactionIsolation(this.transactionIsolation);
+            connection.setAutoCommit(this.autoCommit);
+            return connection;
+        } catch (ClassNotFoundException cnfe) {
+            // Simplify try/catch blocks of people using this by
+            // throwing only one exception type.
+            throw new SQLException("Can't find class for driver: " + driver);
+        }
+    }
+
+    private synchronized void fillUpConnection(Connection conn) {
+        setTimeStamp(conn);
+        availableConnections.push(conn);
+
+        // notify all since new connection is created
+        notifyAll();
+    }
+
+    private void setTimeStamp(Connection connection) {
+        lastAccessTimeRecord.put(connection, System.currentTimeMillis());
+    }
+
+    // The database connection cannot be left idle for too long, otherwise TCP
+    // connection will be broken.
+    /**
+     * From http://forums.mysql.com/read.php?39,28450,57460#msg-57460 Okay, then it looks like wait_timeout on the
+     * server is killing your connection (it is set to 8 hours of idle time by default). Either set that value higher on
+     * your server, or configure your connection pool to not hold connections idle that long (I prefer the latter). Most
+     * folks I know that run MySQL with a connection pool in high-load production environments only let connections sit
+     * idle for a matter of minutes, since it only takes a few milliseconds to open a connection, and the longer one
+     * sits idle the more chance it will go "bad" because of a network hiccup or the MySQL server being restarted.
+     *
+     * @throws SQLException
+     */
+    private boolean isConnectionStale(Connection connection) {
+        long currentTime = System.currentTimeMillis();
+        long lastAccess = lastAccessTimeRecord.get(connection);
+        if (currentTime - lastAccess > MAX_IDLE_TIME) {
+            return true;
+        } else
+            return false;
+    }
+
+    private synchronized void closeStaleConnections() {
+        // close idle connections
+        Iterator<Connection> iter = availableConnections.iterator();
+        while (iter.hasNext()) {
+            Connection existingConnection = iter.next();
+            if (isConnectionStale(existingConnection)) {
+                try {
+                    existingConnection.close();
+                    iter.remove();
+                } catch (SQLException sql) {
+                    logger.error(sql.getMessage(), sql);
+                }
+            }
+        }
+        // close busy connections that have been checked out for too long.
+        // This should not happen since this means program has bug for not
+        // releasing connections .
+        iter = busyConnections.iterator();
+        while (iter.hasNext()) {
+            Connection busyConnection = iter.next();
+            if (isConnectionStale(busyConnection)) {
+                try {
+                    busyConnection.close();
+                    iter.remove();
+                    logger.warn("****Connection has checked out too long. Forced release. Check the program for calling release connection [free(Connection) method]");
+                } catch (SQLException sql) {
+                    logger.error(sql.getMessage(), sql);
+                }
+            }
+        }
+    }
+
+    public synchronized void free(Connection connection) {
+        busyConnections.removeElement(connection);
+        availableConnections.addElement(connection);
+        // Wake up threads that are waiting for a connection
+        notifyAll();
+    }
+
+    /**
+     * Close all the connections. Use with caution: be sure no connections are in use before calling. Note that you are
+     * not <I>required</I> to call this when done with a ConnectionPool, since connections are guaranteed to be closed
+     * when garbage collected. But this method gives more control regarding when the connections are closed.
+     */
+    public synchronized void dispose() {
+        logger.info("Connection Pool Shutting down");
+
+        // stop clean up thread
+        this.stop = true;
+        this.clenupThread.interrupt();
+
+        // stop producer up thread
+        this.producerThread.interrupt();
+
+        // close all connection
+        closeConnections(availableConnections);
+        availableConnections = new Stack<Connection>();
+        closeConnections(busyConnections);
+        busyConnections = new Stack<Connection>();
+        lastAccessTimeRecord.clear();
+
+        logger.info("All connection is closed");
+
+        try {
+            this.clenupThread.join();
+            this.producerThread.join();
+        } catch (Exception e) {
+            logger.error("Cannot shutdown cleanup thread", e);
+        }
+
+        logger.info("Connection Pool Shutdown");
+    }
+
+    private void closeConnections(Stack<Connection> connections) {
+        while (!connections.isEmpty()) {
+            Connection connection = connections.pop();
+            try {
+                if (!connection.isClosed()) {
+                    connection.close();
+                }
+            } catch (SQLException sqle) {
+                // Ignore errors; garbage collect anyhow
+                logger.warn(sqle.getMessage());
+            }
+        }
+    }
+
+    public synchronized String toString() {
+        String info = "ConnectionPool(" + url + "," + username + ")" + ", available=" + availableConnections.size()
+                + ", busy=" + busyConnections.size() + ", max=" + maxConnections;
+        return (info);
+    }
+
+    class CleanUpThread implements Runnable {
+        public void run() {
+            while (!stop) {
+                try {
+                    Thread.sleep(MAX_IDLE_TIME);
+                    closeStaleConnections();
+                } catch (InterruptedException e) {
+                    logger.info("Clean up thread is interrupted to close");
+                }
+            }
+        }
+    }
+
+    class FillUpThread implements Runnable {
+        public void run() {
+            while (!stop) {
+                try {
+                    // block until get
+                    needConnection.acquire();
+
+                    Connection conn = makeNewConnection();
+                    fillUpConnection(conn);
+                } catch (SQLException e) {
+                    // cannot create connection (increase semaphore value back)
+                    needConnection.release();
+                    logger.error(e.getMessage(), e);
+                } catch (InterruptedException e) {
+                    logger.info("Fill up thread is interrupted to close");
+                    break;
+                }
+            }
+        }
+    }
+
+    public void shutdown() throws SQLException{
+        for (Connection c : availableConnections) {
+            try {
+                c.close();
+            } catch (SQLException e) {
+                logger.error("Error while closing the connection", e);
+                throw new SQLException("Error while closing the connection", e);
+            }
+        }
+
+        for (Connection c : busyConnections) {
+            try {
+                c.close();
+            } catch (SQLException e) {
+                logger.error("Error while closing the connection", e);
+                throw new SQLException("Error while closing the connection", e);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/Constants.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/Constants.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/Constants.java
new file mode 100644
index 0000000..90046c3
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/Constants.java
@@ -0,0 +1,29 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.registry.api.service.util;
+
+public class Constants {
+    public static final String REGISTRY_SERVER_PORT = "regserver.port";
+    public static final String REGISTRY_SERVER_HOST = "regserver.host";
+	public static final String REGISTRY_SERVER_NAME = "regserver.name";
+    public static final String REGISTRY_SERVER_MIN_THREADS = "regserver.server.min.threads";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/DatabaseCreator.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/DatabaseCreator.java
new file mode 100644
index 0000000..ba2316f
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/DatabaseCreator.java
@@ -0,0 +1,353 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.api.service.util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.sql.*;
+import java.util.StringTokenizer;
+
+/**
+ * This class creates the database tables required for airavata with default configuration this
+ * class creates derby database in server mode. User can specify required database in appropriate
+ * properties files.
+ */
+public class DatabaseCreator {
+    private final static Logger logger = LoggerFactory.getLogger(DatabaseCreator.class);
+
+    public enum DatabaseType {
+        derby("(?i).*derby.*"), mysql("(?i).*mysql.*"), other("");
+
+        private String pattern;
+
+        private DatabaseType(String matchingPattern) {
+            this.pattern = matchingPattern;
+        }
+
+        public String getMatchingPattern() {
+            return this.pattern;
+        }
+    }
+
+    private static DatabaseType[] supportedDatabase = new DatabaseType[] { DatabaseType.derby, DatabaseType.mysql };
+
+    private static Logger log = LoggerFactory.getLogger(DatabaseCreator.class);
+    private static final String delimiter = ";";
+
+    /**
+     * Creates database
+     *
+     * @throws Exception
+     */
+    public static void createRegistryDatabase(String prefix, Connection conn) throws Exception {
+        createDatabase(prefix, conn);
+    }
+
+
+
+    /**
+     * Checks whether database tables are created by using select * on given table name
+     *
+     * @param tableName
+     *            Table which should be existed
+     * @return <code>true</core> if checkSQL is success, else <code>false</code> .
+     */
+    public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
+        try {
+
+            log.debug("Running a query to test the database tables existence.");
+
+            // check whether the tables are already created with a query
+            Statement statement = null;
+            try {
+                statement = conn.createStatement();
+                ResultSet rs = statement.executeQuery("select * from " + tableName);
+                if (rs != null) {
+                    rs.close();
+                }
+            } finally {
+                try {
+                    if (statement != null) {
+                        statement.close();
+                    }
+                } catch (SQLException e) {
+                    return false;
+                }
+            }
+        } catch (SQLException e) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * executes given sql
+     *
+     * @param sql
+     * @throws Exception
+     */
+    private static void executeSQL(String sql, Connection conn) throws Exception {
+        // Check and ignore empty statements
+        if ("".equals(sql.trim())) {
+            return;
+        }
+
+        Statement statement = null;
+        try {
+            log.debug("SQL : " + sql);
+
+            boolean ret;
+            int updateCount = 0, updateCountTotal = 0;
+            statement = conn.createStatement();
+            ret = statement.execute(sql);
+            updateCount = statement.getUpdateCount();
+            do {
+                if (!ret) {
+                    if (updateCount != -1) {
+                        updateCountTotal += updateCount;
+                    }
+                }
+                ret = statement.getMoreResults();
+                if (ret) {
+                    updateCount = statement.getUpdateCount();
+                }
+            } while (ret);
+
+            log.debug(sql + " : " + updateCountTotal + " rows affected");
+
+            SQLWarning warning = conn.getWarnings();
+            while (warning != null) {
+                log.info(warning + " sql warning");
+                warning = warning.getNextWarning();
+            }
+            conn.clearWarnings();
+        } catch (SQLException e) {
+            if (e.getSQLState().equals("X0Y32")) {
+                // eliminating the table already exception for the derby
+                // database
+                log.info("Table Already Exists", e);
+            } else {
+                throw new Exception("Error occurred while executing : " + sql, e);
+            }
+        } finally {
+            if (statement != null) {
+                try {
+                    statement.close();
+                } catch (SQLException e) {
+                    log.error("Error occurred while closing result set.", e);
+                }
+            }
+        }
+    }
+
+    /**
+     * computes relatational database type using database name
+     *
+     * @return DatabaseType
+     * @throws Exception
+     *
+     */
+    public static DatabaseType getDatabaseType(Connection conn) throws Exception {
+        try {
+            if (conn != null && (!conn.isClosed())) {
+                DatabaseMetaData metaData = conn.getMetaData();
+                String databaseProductName = metaData.getDatabaseProductName();
+                return checkType(databaseProductName);
+            }
+        } catch (SQLException e) {
+            String msg = "Failed to create Airavata database." + e.getMessage();
+            log.error(msg, e);
+            throw new Exception(msg, e);
+        }
+        return DatabaseType.other;
+    }
+
+    /**
+     * Overloaded method with String input
+     *
+     * @return DatabaseType
+     * @throws Exception
+     *
+     */
+    public static DatabaseType getDatabaseType(String dbUrl) throws Exception {
+        return checkType(dbUrl);
+    }
+
+    private static DatabaseType checkType(String text) throws Exception {
+        try {
+            if (text != null) {
+                for (DatabaseType type : supportedDatabase) {
+                    if (text.matches(type.getMatchingPattern()))
+                        return type;
+                }
+            }
+            String msg = "Unsupported database: " + text
+                    + ". Database will not be created automatically by the Airavata. "
+                    + "Please create the database using appropriate database scripts for " + "the database.";
+            throw new Exception(msg);
+
+        } catch (SQLException e) {
+            String msg = "Failed to create Airavatadatabase." + e.getMessage();
+            log.error(msg, e);
+            throw new Exception(msg, e);
+        }
+    }
+
+    /**
+     * Get scripts location which is prefix + "-" + databaseType + ".sql"
+     *
+     * @param prefix
+     * @param databaseType
+     * @return script location
+     */
+    private static String getScriptLocation(String prefix, DatabaseType databaseType) {
+        String scriptName = prefix + "-" + databaseType + ".sql";
+        log.debug("Loading database script from :" + scriptName);
+        return  scriptName;
+    }
+
+    private static void createDatabase(String prefix, Connection conn) throws Exception {
+        Statement statement = null;
+        try {
+            conn.setAutoCommit(false);
+            statement = conn.createStatement();
+            executeSQLScript(getScriptLocation(prefix, DatabaseCreator.getDatabaseType(conn)), conn);
+            conn.commit();
+            log.debug("Tables are created successfully.");
+        } catch (SQLException e) {
+            String msg = "Failed to create database tables for Airavata resource store. " + e.getMessage();
+            log.error(msg, e);
+            conn.rollback();
+            throw new Exception(msg, e);
+        } finally {
+            conn.setAutoCommit(true);
+            try {
+                if (statement != null) {
+                    statement.close();
+                }
+            } catch (SQLException e) {
+                log.error("Failed to close statement.", e);
+            }
+        }
+    }
+
+    private static void executeSQLScript(String dbscriptName, Connection conn) throws Exception {
+        StringBuffer sql = new StringBuffer();
+        BufferedReader reader = null;
+
+        try {
+            InputStream is = DatabaseCreator.class.getClassLoader().getResourceAsStream(dbscriptName);
+            if(is == null) {
+                logger.info("Script file not found at " + dbscriptName + ". Uses default database script file");
+                DatabaseType databaseType = DatabaseCreator.getDatabaseType(conn);
+                if(databaseType.equals(DatabaseType.derby)){
+                    is = DatabaseCreator.class.getClassLoader().getResourceAsStream("experiment-derby.sql");
+                }else if(databaseType.equals(DatabaseType.mysql)){
+                    is = DatabaseCreator.class.getClassLoader().getResourceAsStream("experiment-mysql.sql");
+                }
+            }
+            reader = new BufferedReader(new InputStreamReader(is));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                line = line.trim();
+                if (line.startsWith("//")) {
+                    continue;
+                }
+                if (line.startsWith("--")) {
+                    continue;
+                }
+                StringTokenizer st = new StringTokenizer(line);
+                if (st.hasMoreTokens()) {
+                    String token = st.nextToken();
+                    if ("REM".equalsIgnoreCase(token)) {
+                        continue;
+                    }
+                }
+                sql.append(" ").append(line);
+
+                // SQL defines "--" as a comment to EOL
+                // and in Oracle it may contain a hint
+                // so we cannot just remove it, instead we must end it
+                if (line.indexOf("--") >= 0) {
+                    sql.append("\n");
+                }
+                if ((checkStringBufferEndsWith(sql, delimiter))) {
+                    executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
+                    sql.replace(0, sql.length(), "");
+                }
+            }
+            // Catch any statements not followed by ;
+            if (sql.length() > 0) {
+                executeSQL(sql.toString(), conn);
+            }
+        } catch (IOException e) {
+            log.error("Error occurred while executing SQL script for creating Airavata database", e);
+            throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
+
+        } finally {
+            if (reader != null) {
+                reader.close();
+            }
+        }
+    }
+
+    /**
+     * Checks that a string buffer ends up with a given string. It may sound trivial with the existing JDK API but the
+     * various implementation among JDKs can make those methods extremely resource intensive and perform poorly due to
+     * massive memory allocation and copying. See
+     *
+     * @param buffer
+     *            the buffer to perform the check on
+     * @param suffix
+     *            the suffix
+     * @return <code>true</code> if the character sequence represented by the argument is a suffix of the character
+     *         sequence represented by the StringBuffer object; <code>false</code> otherwise. Note that the result will
+     *         be <code>true</code> if the argument is the empty string.
+     */
+    public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
+        if (suffix.length() > buffer.length()) {
+            return false;
+        }
+        // this loop is done on purpose to avoid memory allocation performance
+        // problems on various JDKs
+        // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
+        // implementation is ok though does allocation/copying
+        // StringBuffer.toString().endsWith() does massive memory
+        // allocation/copying on JDK 1.5
+        // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
+        int endIndex = suffix.length() - 1;
+        int bufferIndex = buffer.length() - 1;
+        while (endIndex >= 0) {
+            if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
+                return false;
+            }
+            bufferIndex--;
+            endIndex--;
+        }
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ExperimentCatalogInitUtil.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ExperimentCatalogInitUtil.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ExperimentCatalogInitUtil.java
new file mode 100644
index 0000000..1ae5448
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ExperimentCatalogInitUtil.java
@@ -0,0 +1,203 @@
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+package org.apache.airavata.registry.api.service.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
+import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
+import org.apache.airavata.registry.core.experiment.catalog.resources.GatewayResource;
+import org.apache.airavata.registry.core.experiment.catalog.resources.ProjectResource;
+import org.apache.airavata.registry.core.experiment.catalog.resources.UserResource;
+import org.apache.airavata.registry.core.experiment.catalog.resources.WorkerResource;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URI;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class ExperimentCatalogInitUtil {
+    public static final String CONFIGURATION_TABLE = "CONFIGURATION";
+    private static final Logger logger = LoggerFactory.getLogger(ExperimentCatalogInitUtil.class);
+    public static final String REGISTRY_JDBC_DRIVER = "registry.jdbc.driver";
+    public static final String REGISTRY_JDBC_URL = "registry.jdbc.url";
+    public static final String REGISTRY_JDBC_USER = "registry.jdbc.user";
+    public static final String REGISTRY_JDBC_PASSWORD = "registry.jdbc.password";
+    public static final String START_DERBY_ENABLE = "start.derby.server.mode";
+    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+    public static final String DEFAULT_PROJECT_NAME = "default";
+    private static NetworkServerControl server;
+    private static JdbcStorage db;
+    private static String jdbcURl;
+    private static String jdbcDriver;
+    private static String jdbcUser;
+    private static String jdbcPassword;
+
+
+    public static void initializeDB() {
+        System.setProperty("registry.initialize.state", "0");
+        try{
+            jdbcDriver = ServerSettings.getSetting(REGISTRY_JDBC_DRIVER);
+            jdbcURl = ServerSettings.getSetting(REGISTRY_JDBC_URL);
+            jdbcUser = ServerSettings.getSetting(REGISTRY_JDBC_USER);
+            jdbcPassword = ServerSettings.getSetting(REGISTRY_JDBC_PASSWORD);
+            jdbcURl = jdbcURl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage());
+        }
+
+        if (getDBType(jdbcURl).equals("derby") && isDerbyStartEnabled()) {
+            startDerbyInServerMode();
+        }
+        db = new JdbcStorage(10, 50, jdbcURl, jdbcDriver, true);
+
+        Connection conn = null;
+        try {
+            conn = db.connect();
+            if (!DatabaseCreator.isDatabaseStructureCreated(CONFIGURATION_TABLE, conn)) {
+                DatabaseCreator.createRegistryDatabase("database_scripts/expcatalog", conn);
+                logger.info("New Database created for Experiment Catalog !!!");
+            } else {
+                logger.info("Database already created for Experiment Catalog !!!");
+            }
+            try{
+                GatewayResource gateway;
+                if (!ExpCatResourceUtils.isGatewayExist(ServerSettings.getDefaultUserGateway())){
+                    gateway = (GatewayResource)ExpCatResourceUtils.createGateway(ServerSettings.getDefaultUserGateway());
+                    gateway.save();
+                }else {
+                    gateway = (GatewayResource)ExpCatResourceUtils.getGateway(ServerSettings.getDefaultUserGateway());
+                }
+
+                UserResource user;
+                if (!ExpCatResourceUtils.isUserExist(ServerSettings.getDefaultUser(), ServerSettings.getDefaultUserGateway())){
+                    user = ExpCatResourceUtils.createUser(ServerSettings.getDefaultUser(), ServerSettings.getDefaultUserPassword(), ServerSettings.getDefaultUserGateway());
+                    user.save();
+                }else {
+                    user = (UserResource)ExpCatResourceUtils.getUser(ServerSettings.getDefaultUser(), ServerSettings.getDefaultUserGateway());
+                }
+
+                WorkerResource workerResource;
+                if (!gateway.isExists(ResourceType.GATEWAY_WORKER, ServerSettings.getDefaultUserGateway())){
+                    workerResource = (WorkerResource)gateway.create(ResourceType.GATEWAY_WORKER);
+                    workerResource.setUser(user.getUserName());
+                    workerResource.save();
+                }else {
+                    workerResource =  (WorkerResource)gateway.get(ResourceType.GATEWAY_WORKER, ServerSettings.getDefaultUser());
+                }
+                ProjectResource projectResource;
+                if (!workerResource.isExists(ResourceType.PROJECT, DEFAULT_PROJECT_NAME)){
+                    projectResource = workerResource.createProject(DEFAULT_PROJECT_NAME);
+                    projectResource.setName(DEFAULT_PROJECT_NAME);
+                    projectResource.setGatewayId(gateway.getGatewayId());
+                    projectResource.save();
+                }
+
+            } catch (ApplicationSettingsException e) {
+                logger.error("Unable to read airavata-server properties...", e.getMessage());
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure", e);
+        } finally {
+            db.closeConnection(conn);
+            try {
+                if(conn != null){
+                    if (!conn.getAutoCommit()) {
+                        conn.commit();
+                    }
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                logger.error("Error while closing database connection...", e.getMessage(), e);
+            }
+        }
+        System.setProperty("registry.initialize.state", "1");
+    }
+
+    public static String getDBType(String jdbcUrl){
+        try{
+            String cleanURI = jdbcUrl.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getScheme();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    public static boolean isDerbyStartEnabled(){
+        try {
+            String s = ServerSettings.getSetting(START_DERBY_ENABLE);
+            if("true".equals(s)){
+                return true;
+            }
+        }  catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage(), e);
+            return false;
+        }
+        return false;
+    }
+
+    public static void startDerbyInServerMode() {
+        try {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
+                    getPort(jdbcURl),
+                    jdbcUser, jdbcPassword);
+            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+            server.start(consoleWriter);
+        } catch (IOException e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        } catch (Exception e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        }
+    }
+    
+    public static void stopDerbyInServerMode() {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "false");
+            if (server!=null){
+            	try {
+					server.shutdown();
+				} catch (Exception e) {
+		            logger.error("Error when stopping the derby server : "+e.getLocalizedMessage());
+				}
+            }
+    }
+
+    public static int getPort(String jdbcURL){
+        try{
+            String cleanURI = jdbcURL.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getPort();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return -1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/JdbcStorage.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/JdbcStorage.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/JdbcStorage.java
new file mode 100644
index 0000000..7a33fef
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/JdbcStorage.java
@@ -0,0 +1,176 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.api.service.util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.*;
+
+public class JdbcStorage {
+    private static Logger log = LoggerFactory.getLogger(JdbcStorage.class);
+
+    private ConnectionPool connectionPool;
+
+    public JdbcStorage(String jdbcUrl, String jdbcDriver) {
+        // default init connection and max connection
+        this(3, 50, jdbcUrl, jdbcDriver, true);
+    }
+
+    public JdbcStorage(int initCon, int maxCon, String url, String driver, boolean enableTransactions) {
+        try {
+            if (enableTransactions) {
+                connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true, false,
+                        Connection.TRANSACTION_SERIALIZABLE);
+            } else {
+                connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to create database connection pool.", e);
+        }
+    }
+
+    /**
+     * Check if this connection pool is auto commit or not
+     *
+     * @return
+     */
+    public boolean isAutoCommit() {
+        return connectionPool.isAutoCommit();
+    }
+
+    public void commit(Connection conn) {
+        try {
+            if (conn != null && !conn.getAutoCommit()) {
+                conn.commit();
+            }
+        } catch (SQLException sqle) {
+            log.error("Cannot commit data", sqle);
+        }
+    }
+
+    public void commitAndFree(Connection conn) {
+        commit(conn);
+        closeConnection(conn);
+    }
+
+    public void rollback(Connection conn) {
+        try {
+            if (conn != null && !conn.getAutoCommit()) {
+                conn.rollback();
+            }
+        } catch (SQLException sqle) {
+            log.error("Cannot Rollback data", sqle);
+        }
+    }
+
+    public void rollbackAndFree(Connection conn) {
+        rollback(conn);
+        closeConnection(conn);
+    }
+
+    public Connection connect() {
+
+        Connection conn = null;
+        try {
+            conn = connectionPool.getConnection();
+        } catch (SQLException e) {
+            log.error(e.getMessage(), e);
+        }
+        return conn;
+    }
+
+    /**
+     * This method is provided so that you can have better control over the statement. For example: You can use
+     * stmt.setString to convert quotation mark automatically in an UPDATE statement
+     *
+     * NOTE: Statement is closed after execution
+     */
+    public int executeUpdateAndClose(PreparedStatement stmt) throws SQLException {
+        int rows = 0;
+        try {
+            rows = stmt.executeUpdate();
+            if (rows == 0) {
+                log.info("Problem: 0 rows affected by insert/update/delete statement.");
+            }
+        } finally {
+            stmt.close();
+        }
+        return rows;
+    }
+
+    public int countRow(String tableName, String columnName) throws SQLException {
+        String query = new String("SELECT COUNT(" + columnName + ") FROM " + tableName);
+        int count = -1;
+        Connection conn = null;
+        PreparedStatement stmt = null;
+        try {
+            conn = connectionPool.getConnection();
+            stmt = conn.prepareStatement(query);
+            ResultSet rs = stmt.executeQuery();
+            rs.next();
+            count = rs.getInt(1);
+            commit(conn);
+        } catch (SQLException sql) {
+            rollback(conn);
+            throw sql;
+        } finally {
+            try {
+                if (stmt != null && !stmt.isClosed()) {
+                    stmt.close();
+                }
+            } finally {
+                closeConnection(conn);
+            }
+        }
+        return count;
+    }
+
+    public void quietlyClose(Connection conn, Statement... stmts) {
+        if (stmts != null) {
+            for (Statement stmt : stmts) {
+                try {
+                    if (stmt != null && !stmt.isClosed()) {
+                        stmt.close();
+                    }
+                } catch (SQLException sql) {
+                    log.error(sql.getMessage(), sql);
+                }
+            }
+        }
+        closeConnection(conn);
+    }
+
+    public void closeConnection(Connection conn) {
+        if (conn != null) {
+            connectionPool.free(conn);
+        }
+    }
+
+    public void closeAllConnections() {
+        if (connectionPool != null)
+            connectionPool.dispose();
+    }
+
+    public void shutdown() throws SQLException {
+        connectionPool.shutdown();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ReplicaCatalogInitUtil.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ReplicaCatalogInitUtil.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ReplicaCatalogInitUtil.java
new file mode 100644
index 0000000..996afaf
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/ReplicaCatalogInitUtil.java
@@ -0,0 +1,160 @@
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+package org.apache.airavata.registry.api.service.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URI;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class ReplicaCatalogInitUtil {
+    private static final Logger logger = LoggerFactory.getLogger(ReplicaCatalogInitUtil.class);
+    public static final String REPLICA_CATALOG = "REPLICA_CATALOG";
+    public static final String REPLICA_CATALOG_JDBC_DRIVER = "replicacatalog.jdbc.driver";
+    public static final String REPLICA_CATALOG_JDBC_URL = "replicacatalog.jdbc.url";
+    public static final String REPLICA_CATALOG_JDBC_USER = "replicacatalog.jdbc.user";
+    public static final String REPLICA_CATALOG_JDBC_PASSWORD = "replicacatalog.jdbc.password";
+    public static final String START_DERBY_ENABLE = "start.derby.server.mode";
+    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+    private static NetworkServerControl server;
+    private static JdbcStorage db;
+    private static String jdbcURl;
+    private static String jdbcDriver;
+    private static String jdbcUser;
+    private static String jdbcPassword;
+
+
+    public static void initializeDB() {
+//        System.setProperty("appcatalog.initialize.state", "0");
+        try{
+            jdbcDriver = ServerSettings.getSetting(REPLICA_CATALOG_JDBC_DRIVER);
+            jdbcURl = ServerSettings.getSetting(REPLICA_CATALOG_JDBC_URL);
+            jdbcUser = ServerSettings.getSetting(REPLICA_CATALOG_JDBC_USER);
+            jdbcPassword = ServerSettings.getSetting(REPLICA_CATALOG_JDBC_PASSWORD);
+            jdbcURl = jdbcURl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage());
+        }
+
+        if (getDBType(jdbcURl).equals("derby") && isDerbyStartEnabled()) {
+            startDerbyInServerMode();
+        }
+        db = new JdbcStorage(10, 50, jdbcURl, jdbcDriver, true);
+
+        Connection conn = null;
+        try {
+            conn = db.connect();
+            if (!DatabaseCreator.isDatabaseStructureCreated(REPLICA_CATALOG, conn)) {
+                DatabaseCreator.createRegistryDatabase("database_scripts/replicacatalog", conn);
+                logger.info("New Database created for Replica Catalog !!! ");
+            } else {
+                logger.info("Database already created for Replica Catalog!!!");
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure", e);
+        } finally {
+            db.closeConnection(conn);
+            try {
+                if(conn != null){
+                    if (!conn.getAutoCommit()) {
+                        conn.commit();
+                    }
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                logger.error("Error while closing database connection...", e.getMessage(), e);
+            }
+        }
+//        System.setProperty("appcatalog.initialize.state", "1");
+    }
+
+    public static String getDBType(String jdbcUrl){
+        try{
+            String cleanURI = jdbcUrl.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getScheme();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    public static boolean isDerbyStartEnabled(){
+        try {
+            String s = ServerSettings.getSetting(START_DERBY_ENABLE);
+            if("true".equals(s)){
+                return true;
+            }
+        }  catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage(), e);
+            return false;
+        }
+        return false;
+    }
+
+    public static void startDerbyInServerMode() {
+        try {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
+                    getPort(jdbcURl),
+                    jdbcUser, jdbcPassword);
+            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+            server.start(consoleWriter);
+        } catch (IOException e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        } catch (Exception e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        }
+    }
+    
+    public static void stopDerbyInServerMode() {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "false");
+            if (server!=null){
+            	try {
+					server.shutdown();
+				} catch (Exception e) {
+		            logger.error("Error when stopping the derby server : "+e.getLocalizedMessage());
+				}
+            }
+    }
+
+    public static int getPort(String jdbcURL){
+        try{
+            String cleanURI = jdbcURL.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getPort();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return -1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/WorkflowCatalogInitUtil.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/WorkflowCatalogInitUtil.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/WorkflowCatalogInitUtil.java
new file mode 100644
index 0000000..a1ca429
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/WorkflowCatalogInitUtil.java
@@ -0,0 +1,160 @@
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+package org.apache.airavata.registry.api.service.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URI;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class WorkflowCatalogInitUtil {
+    private static final Logger logger = LoggerFactory.getLogger(WorkflowCatalogInitUtil.class);
+    public static final String WORKFLOW = "WORKFLOW";
+    public static final String WORKFLOWCATALOG_JDBC_DRIVER = "workflowcatalog.jdbc.driver";
+    public static final String WORKFLOWCATALOG_JDBC_URL = "workflowcatalog.jdbc.url";
+    public static final String WORKFLOWCATALOG_JDBC_USER = "workflowcatalog.jdbc.user";
+    public static final String WORKFLOWCATALOG_JDBC_PASSWORD = "workflowcatalog.jdbc.password";
+    public static final String START_DERBY_ENABLE = "start.derby.server.mode";
+    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+    private static NetworkServerControl server;
+    private static JdbcStorage db;
+    private static String jdbcURl;
+    private static String jdbcDriver;
+    private static String jdbcUser;
+    private static String jdbcPassword;
+
+
+    public static void initializeDB() {
+//        System.setProperty("appcatalog.initialize.state", "0");
+        try{
+            jdbcDriver = ServerSettings.getSetting(WORKFLOWCATALOG_JDBC_DRIVER);
+            jdbcURl = ServerSettings.getSetting(WORKFLOWCATALOG_JDBC_URL);
+            jdbcUser = ServerSettings.getSetting(WORKFLOWCATALOG_JDBC_USER);
+            jdbcPassword = ServerSettings.getSetting(WORKFLOWCATALOG_JDBC_PASSWORD);
+            jdbcURl = jdbcURl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage());
+        }
+
+        if (getDBType(jdbcURl).equals("derby") && isDerbyStartEnabled()) {
+            startDerbyInServerMode();
+        }
+        db = new JdbcStorage(10, 50, jdbcURl, jdbcDriver, true);
+
+        Connection conn = null;
+        try {
+            conn = db.connect();
+            if (!DatabaseCreator.isDatabaseStructureCreated(WORKFLOW, conn)) {
+                DatabaseCreator.createRegistryDatabase("database_scripts/workflowcatalog", conn);
+                logger.info("New Database created for Workflow Catalog !!! ");
+            } else {
+                logger.info("Database already created for Workflow Catalog!!!");
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure", e);
+        } finally {
+            db.closeConnection(conn);
+            try {
+                if(conn != null){
+                    if (!conn.getAutoCommit()) {
+                        conn.commit();
+                    }
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                logger.error("Error while closing database connection...", e.getMessage(), e);
+            }
+        }
+//        System.setProperty("appcatalog.initialize.state", "1");
+    }
+
+    public static String getDBType(String jdbcUrl){
+        try{
+            String cleanURI = jdbcUrl.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getScheme();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    public static boolean isDerbyStartEnabled(){
+        try {
+            String s = ServerSettings.getSetting(START_DERBY_ENABLE);
+            if("true".equals(s)){
+                return true;
+            }
+        }  catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage(), e);
+            return false;
+        }
+        return false;
+    }
+
+    public static void startDerbyInServerMode() {
+        try {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
+                    getPort(jdbcURl),
+                    jdbcUser, jdbcPassword);
+            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+            server.start(consoleWriter);
+        } catch (IOException e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        } catch (Exception e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        }
+    }
+    
+    public static void stopDerbyInServerMode() {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "false");
+            if (server!=null){
+            	try {
+					server.shutdown();
+				} catch (Exception e) {
+		            logger.error("Error when stopping the derby server : "+e.getLocalizedMessage());
+				}
+            }
+    }
+
+    public static int getPort(String jdbcURL){
+        try{
+            String cleanURI = jdbcURL.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getPort();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return -1;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-stubs/pom.xml b/modules/registry/registry-server/registry-api-stubs/pom.xml
new file mode 100644
index 0000000..818db67
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-stubs/pom.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>registry-server</artifactId>
+        <groupId>org.apache.airavata</groupId>
+        <version>0.17-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>registry-api-stubs</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+            <version>${thrift.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-data-models</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file


[6/7] airavata git commit: adding registry server module

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
new file mode 100644
index 0000000..7e2eb29
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -0,0 +1,1677 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.api.service.handler;
+
+import org.apache.airavata.model.WorkflowModel;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
+import org.apache.airavata.model.appcatalog.appdeployment.ApplicationModule;
+import org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
+import org.apache.airavata.model.appcatalog.computeresource.*;
+import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
+import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
+import org.apache.airavata.model.appcatalog.gatewayprofile.StoragePreference;
+import org.apache.airavata.model.appcatalog.storageresource.StorageResourceDescription;
+import org.apache.airavata.model.application.io.InputDataObjectType;
+import org.apache.airavata.model.application.io.OutputDataObjectType;
+import org.apache.airavata.model.data.movement.DMType;
+import org.apache.airavata.model.data.movement.*;
+import org.apache.airavata.model.data.replica.DataProductModel;
+import org.apache.airavata.model.data.replica.DataReplicaLocationModel;
+import org.apache.airavata.model.error.AiravataClientException;
+import org.apache.airavata.model.error.AiravataSystemException;
+import org.apache.airavata.model.error.ExperimentNotFoundException;
+import org.apache.airavata.model.error.InvalidRequestException;
+import org.apache.airavata.model.experiment.*;
+import org.apache.airavata.model.job.JobModel;
+import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
+import org.apache.airavata.model.status.ExperimentStatus;
+import org.apache.airavata.model.status.JobStatus;
+import org.apache.airavata.model.workspace.Gateway;
+import org.apache.airavata.model.workspace.Notification;
+import org.apache.airavata.model.workspace.Project;
+import org.apache.airavata.registry.api.RegistryService;
+import org.apache.airavata.registry.api.exception.RegistryServiceException;
+import org.apache.thrift.TException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.List;
+import java.util.Map;
+
+public class RegistryServerHandler implements RegistryService.Iface {
+    private final static Logger logger = LoggerFactory.getLogger(RegistryServerHandler.class);
+
+    /**
+     * Fetch Apache Registry API version
+     */
+    @Override
+    public String getAPIVersion() throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Verify if User Exists within Airavata.
+     *
+     * @param gatewayId
+     * @param userName
+     * @return true/false
+     */
+    @Override
+    public boolean isUserExists(String gatewayId, String userName) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Get all users in the gateway
+     *
+     * @param gatewayId The gateway data model.
+     * @return users
+     * list of usernames of the users in the gateway
+     */
+    @Override
+    public List<String> getAllUsersInGateway(String gatewayId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get Gateway details by providing gatewayId
+     *
+     * @param gatewayId The gateway Id of the Gateway.
+     * @return gateway
+     * Gateway obejct.
+     */
+    @Override
+    public Gateway getGateway(String gatewayId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete a Gateway
+     *
+     * @param gatewayId The gateway Id of the Gateway to be deleted.
+     * @return boolean
+     * Boolean identifier for the success or failure of the deletion operation.
+     */
+    @Override
+    public boolean deleteGateway(String gatewayId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Get All the Gateways Connected to Airavata.
+     */
+    @Override
+    public List<Gateway> getAllGateways() throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Check for the Existance of a Gateway within Airavata
+     *
+     * @param gatewayId Provide the gatewayId of the gateway you want to check the existancy
+     * @return gatewayId
+     * return the gatewayId of the existing gateway.
+     */
+    @Override
+    public boolean isGatewayExist(String gatewayId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    @Override
+    public boolean deleteNotification(String gatewayId, String notificationId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    @Override
+    public Notification getNotification(String gatewayId, String notificationId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public List<Notification> getAllNotifications(String gatewayId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get a Project by ID
+     * This method is to obtain a project by providing a projectId.
+     *
+     * @param projectId projectId of the project you require.
+     * @return project
+     * project data model will be returned.
+     */
+    @Override
+    public Project getProject(String projectId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete a Project
+     * This method is used to delete an existing Project.
+     *
+     * @param projectId projectId of the project you want to delete.
+     * @return boolean
+     * Boolean identifier for the success or failure of the deletion operation.
+     * <p>
+     * NOTE: This method is not used within gateways connected with Airavata.
+     */
+    @Override
+    public boolean deleteProject(String projectId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Get All User Projects
+     * Get all Project for the user with pagination. Results will be ordered based on creation time DESC.
+     *
+     * @param gatewayId The identifier for the requested gateway.
+     * @param userName  The identifier of the user.
+     * @param limit     The amount results to be fetched.
+     * @param offset    The starting point of the results to be fetched.
+     */
+    @Override
+    public List<Project> getUserProjects(String gatewayId, String userName, int limit, int offset) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get Experiment Statistics
+     * Get Experiment Statisitics for a given gateway for a specific time period. This feature is available only for admins of a particular gateway. Gateway admin access is managed by the user roles.
+     *
+     * @param gatewayId Unique identifier of the gateway making the request to fetch statistics.
+     * @param fromTime  Starting date time.
+     * @param toTime    Ending data time.
+     */
+    @Override
+    public ExperimentStatistics getExperimentStatistics(String gatewayId, long fromTime, long toTime) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get All Experiments of the Project
+     * Get Experiments within project with pagination. Results will be sorted based on creation time DESC.
+     *
+     * @param projectId Uniqie identifier of the project.
+     * @param limit     Amount of results to be fetched.
+     * @param offset    The starting point of the results to be fetched.
+     */
+    @Override
+    public List<ExperimentModel> getExperimentsInProject(String projectId, int limit, int offset) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get All Experiments of the User
+     * Get experiments by user with pagination. Results will be sorted based on creation time DESC.
+     *
+     * @param gatewayId Identifier of the requesting gateway.
+     * @param userName  Username of the requested end user.
+     * @param limit     Amount of results to be fetched.
+     * @param offset    The starting point of the results to be fetched.
+     */
+    @Override
+    public List<ExperimentModel> getUserExperiments(String gatewayId, String userName, int limit, int offset) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete an Experiment
+     * If the experiment is not already launched experiment can be deleted.
+     *
+     * @param experimentId@return boolean
+     *                            Identifier for the success or failure of the deletion operation.
+     */
+    @Override
+    public boolean deleteExperiment(String experimentId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * *
+     * * Get Experiment
+     * * Fetch previously created experiment metadata.
+     * *
+     * * @param airavataExperimentId
+     * *    The unique identifier of the requested experiment. This ID is returned during the create experiment step.
+     * *
+     * * @return ExperimentModel
+     * *   This method will return the previously stored experiment metadata.
+     * *
+     * * @throws org.apache.airavata.model.error.InvalidRequestException
+     * *    For any incorrect forming of the request itself.
+     * *
+     * * @throws org.apache.airavata.model.error.ExperimentNotFoundException
+     * *    If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+     * *
+     * * @throws org.apache.airavata.model.error.AiravataClientException
+     * *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+     * *
+     * *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+     * *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+     * *         gateway registration steps and retry this request.
+     * *
+     * *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+     * *         For now this is a place holder.
+     * *
+     * *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+     * *         is implemented, the authorization will be more substantial.
+     * *
+     * * @throws org.apache.airavata.model.error.AiravataSystemException
+     * *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+     * *       rather an Airavata Administrator will be notified to take corrective action.
+     * *
+     * *
+     *
+     * @param airavataExperimentId
+     */
+    @Override
+    public ExperimentModel getExperiment(String airavataExperimentId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get Complete Experiment Details
+     * Fetch the completed nested tree structue of previously created experiment metadata which includes processes ->
+     * tasks -> jobs information.
+     *
+     * @param airavataExperimentId The identifier for the requested experiment. This is returned during the create experiment step.
+     * @return ExperimentModel
+     * This method will return the previously stored experiment metadata including application input parameters, computational resource scheduling
+     * information, special input output handling and additional quality of service parameters.
+     * @throws InvalidRequestException     For any incorrect forming of the request itself.
+     * @throws ExperimentNotFoundException If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+     * @throws AiravataClientException     The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+     *                                     <p>
+     *                                     UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+     *                                     step, then Airavata Registry will not have a provenance area setup. The client has to follow
+     *                                     gateway registration steps and retry this request.
+     *                                     <p>
+     *                                     AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+     *                                     For now this is a place holder.
+     *                                     <p>
+     *                                     INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+     *                                     is implemented, the authorization will be more substantial.
+     * @throws AiravataSystemException     This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+     *                                     rather an Airavata Administrator will be notified to take corrective action.
+     */
+    @Override
+    public ExperimentModel getDetailedExperimentTree(String airavataExperimentId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get Experiment Status
+     * <p>
+     * Obtain the status of an experiment by providing the Experiment Id
+     *
+     * @param airavataExperimentId Experiment ID of the experimnet you require the status.
+     * @return ExperimentStatus
+     * ExperimentStatus model with the current status will be returned.
+     */
+    @Override
+    public ExperimentStatus getExperimentStatus(String airavataExperimentId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get Experiment Outputs
+     * This method to be used when need to obtain final outputs of a certain Experiment
+     *
+     * @param airavataExperimentId Experiment ID of the experimnet you need the outputs.
+     * @return list
+     * List of experiment outputs will be returned. They will be returned as a list of OutputDataObjectType for the experiment.
+     */
+    @Override
+    public List<OutputDataObjectType> getExperimentOutputs(String airavataExperimentId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get Intermediate Experiment Outputs
+     * This method to be used when need to obtain intermediate outputs of a certain Experiment
+     *
+     * @param airavataExperimentId Experiment ID of the experimnet you need intermediate outputs.
+     * @return list
+     * List of intermediate experiment outputs will be returned. They will be returned as a list of OutputDataObjectType for the experiment.
+     */
+    @Override
+    public List<OutputDataObjectType> getIntermediateOutputs(String airavataExperimentId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get Job Statuses for an Experiment
+     * This method to be used when need to get the job status of an Experiment. An experiment may have one or many jobs; there for one or many job statuses may turnup
+     *
+     * @param airavataExperimentId@return JobStatus
+     *                                    Job status (string) for all all the existing jobs for the experiment will be returned in the form of a map
+     */
+    @Override
+    public Map<String, JobStatus> getJobStatuses(String airavataExperimentId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Get Job Details for all the jobs within an Experiment.
+     * This method to be used when need to get the job details for one or many jobs of an Experiment.
+     *
+     * @param airavataExperimentId@return list of JobDetails
+     *                                    Job details.
+     */
+    @Override
+    public List<JobModel> getJobDetails(String airavataExperimentId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch a Application Module.
+     *
+     * @param appModuleId The unique identifier of the application module required
+     * @return applicationModule
+     * Returns an Application Module Object.
+     */
+    @Override
+    public ApplicationModule getApplicationModule(String appModuleId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch all Application Module Descriptions.
+     *
+     * @param gatewayId ID of the gateway which need to list all available application deployment documentation.
+     * @return list
+     * Returns the list of all Application Module Objects.
+     */
+    @Override
+    public List<ApplicationModule> getAllAppModules(String gatewayId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete an Application Module.
+     *
+     * @param appModuleId The identifier of the Application Module to be deleted.
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteApplicationModule(String appModuleId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Fetch a Application Deployment.
+     *
+     * @param appDeploymentId The identifier for the requested application module
+     * @return applicationDeployment
+     * Returns a application Deployment Object.
+     */
+    @Override
+    public ApplicationDeploymentDescription getApplicationDeployment(String appDeploymentId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete an Application Deployment.
+     *
+     * @param appDeploymentId The unique identifier of application deployment to be deleted.
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteApplicationDeployment(String appDeploymentId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Fetch all Application Deployment Descriptions.
+     *
+     * @param gatewayId ID of the gateway which need to list all available application deployment documentation.
+     * @param gatewayId
+     * @return list<applicationDeployment.
+     * Returns the list of all application Deployment Objects.
+     */
+    @Override
+    public List<ApplicationDeploymentDescription> getAllApplicationDeployments(String gatewayId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch a list of Deployed Compute Hosts.
+     *
+     * @param appModuleId The identifier for the requested application module
+     * @return list<string>
+     * Returns a list of Deployed Resources.
+     */
+    @Override
+    public List<String> getAppModuleDeployedResources(String appModuleId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch an Application Interface.
+     *
+     * @param appInterfaceId The identifier for the requested application interface.
+     * @return applicationInterface
+     * Returns an application Interface Object.
+     */
+    @Override
+    public ApplicationInterfaceDescription getApplicationInterface(String appInterfaceId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete an Application Interface.
+     *
+     * @param appInterfaceId The identifier for the requested application interface to be deleted.
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteApplicationInterface(String appInterfaceId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Fetch name and ID of  Application Interface documents.
+     *
+     * @param gatewayId
+     * @return map<applicationId, applicationInterfaceNames>
+     * Returns a list of application interfaces with corresponsing ID's
+     */
+    @Override
+    public Map<String, String> getAllApplicationInterfaceNames(String gatewayId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch all Application Interface documents.
+     *
+     * @param gatewayId
+     * @return map<applicationId, applicationInterfaceNames>
+     * Returns a list of application interfaces documents (Application Interface ID, name, description, Inputs and Outputs objects).
+     */
+    @Override
+    public List<ApplicationInterfaceDescription> getAllApplicationInterfaces(String gatewayId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch the list of Application Inputs.
+     *
+     * @param appInterfaceId The identifier of the application interface which need inputs to be fetched.
+     * @return list<application_interface_model.InputDataObjectType>
+     * Returns a list of application inputs.
+     */
+    @Override
+    public List<InputDataObjectType> getApplicationInputs(String appInterfaceId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch list of Application Outputs.
+     *
+     * @param appInterfaceId The identifier of the application interface which need outputs to be fetched.
+     * @return list<application_interface_model.OutputDataObjectType>
+     * Returns a list of application outputs.
+     */
+    @Override
+    public List<OutputDataObjectType> getApplicationOutputs(String appInterfaceId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch a list of all deployed Compute Hosts for a given application interfaces.
+     *
+     * @param appInterfaceId The identifier for the requested application interface.
+     * @return map<computeResourceId, computeResourceName>
+     * A map of registered compute resource id's and their corresponding hostnames.
+     * Deployments of each modules listed within the interfaces will be listed.
+     */
+    @Override
+    public Map<String, String> getAvailableAppInterfaceComputeResources(String appInterfaceId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch the given Compute Resource.
+     *
+     * @param computeResourceId The identifier for the requested compute resource
+     * @return computeResourceDescription
+     * Compute Resource Object created from the datamodel..
+     */
+    @Override
+    public ComputeResourceDescription getComputeResource(String computeResourceId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch all registered Compute Resources.
+     *
+     * @return A map of registered compute resource id's and thier corresponding hostnames.
+     * Compute Resource Object created from the datamodel..
+     */
+    @Override
+    public Map<String, String> getAllComputeResourceNames() throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete a Compute Resource.
+     *
+     * @param computeResourceId The identifier for the requested compute resource to be deleted.
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteComputeResource(String computeResourceId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Fetch the given Storage Resource.
+     *
+     * @param storageResourceId The identifier for the requested storage resource
+     * @return storageResourceDescription
+     * Storage Resource Object created from the datamodel..
+     */
+    @Override
+    public StorageResourceDescription getStorageResource(String storageResourceId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch all registered Storage Resources.
+     *
+     * @return A map of registered compute resource id's and thier corresponding hostnames.
+     * Compute Resource Object created from the datamodel..
+     */
+    @Override
+    public Map<String, String> getAllStorageResourceNames() throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete a Storage Resource.
+     *
+     * @param storageResourceId The identifier of the requested compute resource to be deleted.
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteStorageResource(String storageResourceId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * This method returns localJobSubmission object
+     *
+     * @param jobSubmissionId@return LOCALSubmission instance
+     */
+    @Override
+    public LOCALSubmission getLocalJobSubmission(String jobSubmissionId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * This method returns SSHJobSubmission object
+     *
+     * @param jobSubmissionId@return SSHJobSubmission instance
+     */
+    @Override
+    public SSHJobSubmission getSSHJobSubmission(String jobSubmissionId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * *
+     * * This method returns UnicoreJobSubmission object
+     * *
+     * * @param jobSubmissionInterfaceId
+     * *   The identifier of the JobSubmission Interface to be retrieved.
+     * *  @return UnicoreJobSubmission instance
+     * *
+     * *
+     *
+     * @param jobSubmissionId
+     */
+    @Override
+    public UnicoreJobSubmission getUnicoreJobSubmission(String jobSubmissionId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * *
+     * * This method returns cloudJobSubmission object
+     * * @param jobSubmissionInterfaceI
+     * *   The identifier of the JobSubmission Interface to be retrieved.
+     * *  @return CloudJobSubmission instance
+     * *
+     *
+     * @param jobSubmissionId
+     */
+    @Override
+    public CloudJobSubmission getCloudJobSubmission(String jobSubmissionId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * This method returns local datamovement object.
+     *
+     * @param dataMovementId The identifier of the datamovement Interface to be retrieved.
+     * @return LOCALDataMovement instance
+     */
+    @Override
+    public LOCALDataMovement getLocalDataMovement(String dataMovementId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * This method returns SCP datamovement object
+     *
+     * @param dataMovementId The identifier of the datamovement Interface to be retrieved.
+     * @return SCPDataMovement instance
+     */
+    @Override
+    public SCPDataMovement getSCPDataMovement(String dataMovementId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * This method returns UNICORE datamovement object
+     *
+     * @param dataMovementId The identifier of the datamovement Interface to be retrieved.
+     * @return UnicoreDataMovement instance
+     */
+    @Override
+    public UnicoreDataMovement getUnicoreDataMovement(String dataMovementId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * This method returns GridFTP datamovement object
+     *
+     * @param dataMovementId The identifier of the datamovement Interface to be retrieved.
+     * @return GridFTPDataMovement instance
+     */
+    @Override
+    public GridFTPDataMovement getGridFTPDataMovement(String dataMovementId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Change the priority of a given job submisison interface
+     *
+     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be changed
+     * @param newPriorityOrder
+     * @return status
+     * Returns a success/failure of the change.
+     */
+    @Override
+    public boolean changeJobSubmissionPriority(String jobSubmissionInterfaceId, int newPriorityOrder) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Change the priority of a given data movement interface
+     *
+     * @param dataMovementInterfaceId The identifier of the DataMovement Interface to be changed
+     * @param newPriorityOrder
+     * @return status
+     * Returns a success/failure of the change.
+     */
+    @Override
+    public boolean changeDataMovementPriority(String dataMovementInterfaceId, int newPriorityOrder) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Change the priorities of a given set of job submission interfaces
+     *
+     * @param jobSubmissionPriorityMap A Map of identifiers of the JobSubmission Interfaces and thier associated priorities to be set.
+     * @return status
+     * Returns a success/failure of the changes.
+     */
+    @Override
+    public boolean changeJobSubmissionPriorities(Map<String, Integer> jobSubmissionPriorityMap) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Change the priorities of a given set of data movement interfaces
+     *
+     * @param dataMovementPriorityMap A Map of identifiers of the DataMovement Interfaces and thier associated priorities to be set.
+     * @return status
+     * Returns a success/failure of the changes.
+     */
+    @Override
+    public boolean changeDataMovementPriorities(Map<String, Integer> dataMovementPriorityMap) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Delete a given job submisison interface
+     *
+     * @param computeResourceId
+     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be changed
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteJobSubmissionInterface(String computeResourceId, String jobSubmissionInterfaceId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    @Override
+    public ResourceJobManager getResourceJobManager(String resourceJobManagerId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public boolean deleteResourceJobManager(String resourceJobManagerId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Delete a Compute Resource Queue
+     *
+     * @param computeResourceId The identifier of the compute resource which has the queue to be deleted
+     * @param queueName         Name of the queue need to be deleted. Name is the uniqueue identifier for the queue within a compute resource
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteBatchQueue(String computeResourceId, String queueName) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Fetch the given Gateway Resource Profile.
+     *
+     * @param gatewayID The identifier for the requested gateway resource.
+     * @return gatewayResourceProfile
+     * Gateway Resource Profile Object.
+     */
+    @Override
+    public GatewayResourceProfile getGatewayResourceProfile(String gatewayID) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete the given Gateway Resource Profile.
+     *
+     * @param gatewayID The identifier for the requested gateway resource to be deleted.
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteGatewayResourceProfile(String gatewayID) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Fetch a Compute Resource Preference of a registered gateway profile.
+     *
+     * @param gatewayID         The identifier for the gateway profile to be requested
+     * @param computeResourceId Preferences related to a particular compute resource
+     * @return computeResourcePreference
+     * Returns the ComputeResourcePreference object.
+     */
+    @Override
+    public ComputeResourcePreference getGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch a Storage Resource Preference of a registered gateway profile.
+     *
+     * @param gatewayID         The identifier of the gateway profile to request to fetch the particular storage resource preference.
+     * @param storageResourceId Identifier of the Stprage Preference required to be fetched.
+     * @return StoragePreference
+     * Returns the StoragePreference object.
+     */
+    @Override
+    public StoragePreference getGatewayStoragePreference(String gatewayID, String storageResourceId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch all Compute Resource Preferences of a registered gateway profile.
+     *
+     * @param gatewayID The identifier for the gateway profile to be requested
+     * @return computeResourcePreference
+     * Returns the ComputeResourcePreference object.
+     */
+    @Override
+    public List<ComputeResourcePreference> getAllGatewayComputeResourcePreferences(String gatewayID) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch all Storage Resource Preferences of a registered gateway profile.
+     *
+     * @param gatewayID The identifier for the gateway profile to be requested
+     * @return StoragePreference
+     * Returns the StoragePreference object.
+     */
+    @Override
+    public List<StoragePreference> getAllGatewayStoragePreferences(String gatewayID) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Fetch all Gateway Profiles registered
+     *
+     * @return GatewayResourceProfile
+     * Returns all the GatewayResourcePrifle list object.
+     */
+    @Override
+    public List<GatewayResourceProfile> getAllGatewayResourceProfiles() throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete the Compute Resource Preference of a registered gateway profile.
+     *
+     * @param gatewayID         The identifier for the gateway profile to be deleted.
+     * @param computeResourceId Preferences related to a particular compute resource
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteGatewayComputeResourcePreference(String gatewayID, String computeResourceId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Delete the Storage Resource Preference of a registered gateway profile.
+     *
+     * @param gatewayID The identifier of the gateway profile to be deleted.
+     * @param storageId ID of the storage preference you want to delete.
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteGatewayStoragePreference(String gatewayID, String storageId) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Delete the Storage Resource Preference of a registered gateway profile.
+     *
+     * @param gatewayId@return status
+     *                         Returns a success/failure of the deletion.
+     */
+    @Override
+    public List<String> getAllWorkflows(String gatewayId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * API Methods Related for Work-Flow Submission Features.
+     *
+     * @param workflowTemplateId
+     */
+    @Override
+    public WorkflowModel getWorkflow(String workflowTemplateId) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public void deleteWorkflow(String workflowTemplateId) throws RegistryServiceException, TException {
+
+    }
+
+    @Override
+    public String getWorkflowTemplateId(String workflowName) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public boolean isWorkflowExistWithName(String workflowName) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    @Override
+    public DataProductModel getDataProduct(String dataProductUri) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public DataProductModel getParentDataProduct(String productUri) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public List<DataProductModel> getChildDataProducts(String productUri) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public String registerReplicaLocation(DataReplicaLocationModel replicaLocationModel) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * API Methods related to replica catalog
+     *
+     * @param dataProductModel
+     */
+    @Override
+    public String registerDataProduct(DataProductModel dataProductModel) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public void updateWorkflow(String workflowTemplateId, WorkflowModel workflow) throws RegistryServiceException, TException {
+
+    }
+
+    @Override
+    public String registerWorkflow(String gatewayId, WorkflowModel workflow) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update a Storage Resource Preference of a registered gateway profile.
+     *
+     * @param gatewayID         The identifier of the gateway profile to be updated.
+     * @param storageId         The Storage resource identifier of the one that you want to update
+     * @param storagePreference The storagePreference object to be updated to the resource profile.
+     * @return status
+     * Returns a success/failure of the updation.
+     */
+    @Override
+    public boolean updateGatewayStoragePreference(String gatewayID, String storageId, StoragePreference storagePreference) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Update a Compute Resource Preference to a registered gateway profile.
+     *
+     * @param gatewayID                 The identifier for the gateway profile to be updated.
+     * @param computeResourceId         Preferences related to a particular compute resource
+     * @param computeResourcePreference The ComputeResourcePreference object to be updated to the resource profile.
+     * @return status
+     * Returns a success/failure of the updation.
+     */
+    @Override
+    public boolean updateGatewayComputeResourcePreference(String gatewayID, String computeResourceId, ComputeResourcePreference computeResourcePreference) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Add a Storage Resource Preference to a registered gateway profile.
+     *
+     * @param gatewayID         The identifier of the gateway profile to be added.
+     * @param storageResourceId Preferences related to a particular compute resource
+     * @param storagePreference
+     * @return status
+     * Returns a success/failure of the addition. If a profile already exists, this operation will fail.
+     * Instead an update should be used.
+     */
+    @Override
+    public boolean addGatewayStoragePreference(String gatewayID, String storageResourceId, StoragePreference storagePreference) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Add a Compute Resource Preference to a registered gateway profile.
+     *
+     * @param gatewayID                 The identifier for the gateway profile to be added.
+     * @param computeResourceId         Preferences related to a particular compute resource
+     * @param computeResourcePreference The ComputeResourcePreference object to be added to the resource profile.
+     * @return status
+     * Returns a success/failure of the addition. If a profile already exists, this operation will fail.
+     * Instead an update should be used.
+     */
+    @Override
+    public boolean addGatewayComputeResourcePreference(String gatewayID, String computeResourceId, ComputeResourcePreference computeResourcePreference) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Update a Gateway Resource Profile.
+     *
+     * @param gatewayID              The identifier for the requested gateway resource to be updated.
+     * @param gatewayResourceProfile Gateway Resource Profile Object.
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateGatewayResourceProfile(String gatewayID, GatewayResourceProfile gatewayResourceProfile) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Register a Gateway Resource Profile.
+     *
+     * @param gatewayResourceProfile Gateway Resource Profile Object.
+     *                               The GatewayID should be obtained from Airavata gateway registration and passed to register a corresponding
+     *                               resource profile.
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public String registerGatewayResourceProfile(GatewayResourceProfile gatewayResourceProfile) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public boolean updateResourceJobManager(String resourceJobManagerId, ResourceJobManager updatedResourceJobManager) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    @Override
+    public String registerResourceJobManager(ResourceJobManager resourceJobManager) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Delete a given data movement interface
+     *
+     * @param productUri
+     * @param dataMovementInterfaceId The identifier of the DataMovement Interface to be changed
+     * @param dataMoveType
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean deleteDataMovementInterface(String productUri, String dataMovementInterfaceId, DMType dataMoveType) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Update the given GridFTP data movement details to a compute resource
+     * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     *
+     * @param dataMovementInterfaceId The identifier of the data movement Interface to be updated.
+     * @param gridFTPDataMovement     The GridFTPDataMovement object to be updated.
+     * @return boolean
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateGridFTPDataMovementDetails(String dataMovementInterfaceId, GridFTPDataMovement gridFTPDataMovement) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Add a GridFTP data movement details to a compute resource
+     * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     *
+     * @param productUri          The identifier of the compute resource to which dataMovement protocol to be added
+     * @param dataMoveType
+     * @param priorityOrder       Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * @param gridFTPDataMovement The GridFTPDataMovement object to be added to the resource.
+     * @return status
+     * Returns the unique data movement id.
+     */
+    @Override
+    public String addGridFTPDataMovementDetails(String productUri, DMType dataMoveType, int priorityOrder, GridFTPDataMovement gridFTPDataMovement) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update a selected UNICORE data movement details
+     * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     *
+     * @param dataMovementInterfaceId The identifier of the data movement Interface to be updated.
+     * @param unicoreDataMovement
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateUnicoreDataMovementDetails(String dataMovementInterfaceId, UnicoreDataMovement unicoreDataMovement) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Add a UNICORE data movement details to a compute resource
+     * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     *
+     * @param productUri          The identifier of the compute resource to which data movement protocol to be added
+     * @param dataMoveType
+     * @param priorityOrder       Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * @param unicoreDataMovement
+     * @return status
+     * Returns the unique data movement id.
+     */
+    @Override
+    public String addUnicoreDataMovementDetails(String productUri, DMType dataMoveType, int priorityOrder, UnicoreDataMovement unicoreDataMovement) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update the given scp data movement details
+     * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     *
+     * @param dataMovementInterfaceId The identifier of the data movement Interface to be updated.
+     * @param scpDataMovement         The SCPDataMovement object to be updated.
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateSCPDataMovementDetails(String dataMovementInterfaceId, SCPDataMovement scpDataMovement) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Add a SCP data movement details to a compute resource
+     * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     *
+     * @param productUri      The identifier of the compute resource to which JobSubmission protocol to be added
+     * @param dataMoveType
+     * @param priorityOrder   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * @param scpDataMovement The SCPDataMovement object to be added to the resource.
+     * @return status
+     * Returns the unique job submission id.
+     */
+    @Override
+    public String addSCPDataMovementDetails(String productUri, DMType dataMoveType, int priorityOrder, SCPDataMovement scpDataMovement) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update the given Local data movement details
+     *
+     * @param dataMovementInterfaceId The identifier of the data movement Interface to be updated.
+     * @param localDataMovement       The LOCALDataMovement object to be updated.
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateLocalDataMovementDetails(String dataMovementInterfaceId, LOCALDataMovement localDataMovement) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Add a Local data movement details to a compute resource
+     * App catalog will return a dataMovementInterfaceId which will be added to the dataMovementInterfaces.
+     *
+     * @param productUri        The identifier of the compute resource to which JobSubmission protocol to be added
+     * @param dataMoveType
+     * @param priorityOrder     Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * @param localDataMovement The LOCALDataMovement object to be added to the resource.
+     * @return status
+     * Returns the unique job submission id.
+     */
+    @Override
+    public String addLocalDataMovementDetails(String productUri, DMType dataMoveType, int priorityOrder, LOCALDataMovement localDataMovement) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update the UNIOCRE Job Submission details
+     *
+     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be updated.
+     * @param unicoreJobSubmission
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateUnicoreJobSubmissionDetails(String jobSubmissionInterfaceId, UnicoreJobSubmission unicoreJobSubmission) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Update the cloud Job Submission details
+     *
+     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be updated.
+     * @param sshJobSubmission
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateCloudJobSubmissionDetails(String jobSubmissionInterfaceId, CloudJobSubmission sshJobSubmission) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Update the given SSH Job Submission details
+     *
+     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be updated.
+     * @param sshJobSubmission         The SSHJobSubmission object to be updated.
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateSSHJobSubmissionDetails(String jobSubmissionInterfaceId, SSHJobSubmission sshJobSubmission) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * *
+     * * Add a Cloud Job Submission details to a compute resource
+     * *  App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     * *
+     * * @param computeResourceId
+     * *   The identifier of the compute resource to which JobSubmission protocol to be added
+     * *
+     * * @param priorityOrder
+     * *   Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * *
+     * * @param sshJobSubmission
+     * *   The SSHJobSubmission object to be added to the resource.
+     * *
+     * * @return status
+     * *   Returns the unique job submission id.
+     * *
+     * *
+     *
+     * @param computeResourceId
+     * @param priorityOrder
+     * @param cloudSubmission
+     */
+    @Override
+    public String addCloudJobSubmissionDetails(String computeResourceId, int priorityOrder, CloudJobSubmission cloudSubmission) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Add a UNICORE Job Submission details to a compute resource
+     * App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     *
+     * @param computeResourceId    The identifier of the compute resource to which JobSubmission protocol to be added
+     * @param priorityOrder        Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * @param unicoreJobSubmission The UnicoreJobSubmission object to be added to the resource.
+     * @return status
+     * Returns the unique job submission id.
+     */
+    @Override
+    public String addUNICOREJobSubmissionDetails(String computeResourceId, int priorityOrder, UnicoreJobSubmission unicoreJobSubmission) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Add a SSH_FORK Job Submission details to a compute resource
+     * App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     *
+     * @param computeResourceId The identifier of the compute resource to which JobSubmission protocol to be added
+     * @param priorityOrder     Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * @param sshJobSubmission  The SSHJobSubmission object to be added to the resource.
+     * @return status
+     * Returns the unique job submission id.
+     */
+    @Override
+    public String addSSHForkJobSubmissionDetails(String computeResourceId, int priorityOrder, SSHJobSubmission sshJobSubmission) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Add a SSH Job Submission details to a compute resource
+     * App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     *
+     * @param computeResourceId The identifier of the compute resource to which JobSubmission protocol to be added
+     * @param priorityOrder     Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * @param sshJobSubmission  The SSHJobSubmission object to be added to the resource.
+     * @return status
+     * Returns the unique job submission id.
+     */
+    @Override
+    public String addSSHJobSubmissionDetails(String computeResourceId, int priorityOrder, SSHJobSubmission sshJobSubmission) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update the given Local Job Submission details
+     *
+     * @param jobSubmissionInterfaceId The identifier of the JobSubmission Interface to be updated.
+     * @param localSubmission          The LOCALSubmission object to be updated.
+     * @return status
+     * Returns a success/failure of the deletion.
+     */
+    @Override
+    public boolean updateLocalSubmissionDetails(String jobSubmissionInterfaceId, LOCALSubmission localSubmission) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Add a Local Job Submission details to a compute resource
+     * App catalog will return a jobSubmissionInterfaceId which will be added to the jobSubmissionInterfaces.
+     *
+     * @param computeResourceId The identifier of the compute resource to which JobSubmission protocol to be added
+     * @param priorityOrder     Specify the priority of this job manager. If this is the only jobmanager, the priority can be zero.
+     * @param localSubmission   The LOCALSubmission object to be added to the resource.
+     * @return status
+     * Returns the unique job submission id.
+     */
+    @Override
+    public String addLocalSubmissionDetails(String computeResourceId, int priorityOrder, LOCALSubmission localSubmission) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update a Storage Resource.
+     *
+     * @param storageResourceId          The identifier for the requested compute resource to be updated.
+     * @param storageResourceDescription Storage Resource Object created from the datamodel.
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateStorageResource(String storageResourceId, StorageResourceDescription storageResourceDescription) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Register a Storage Resource.
+     *
+     * @param storageResourceDescription Storge Resource Object created from the datamodel.
+     * @return storageResourceId
+     * Returns a server-side generated airavata storage resource globally unique identifier.
+     */
+    @Override
+    public String registerStorageResource(StorageResourceDescription storageResourceDescription) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update a Compute Resource.
+     *
+     * @param computeResourceId          The identifier for the requested compute resource to be updated.
+     * @param computeResourceDescription Compute Resource Object created from the datamodel.
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateComputeResource(String computeResourceId, ComputeResourceDescription computeResourceDescription) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Register a Compute Resource.
+     *
+     * @param computeResourceDescription Compute Resource Object created from the datamodel.
+     * @return computeResourceId
+     * Returns a server-side generated airavata compute resource globally unique identifier.
+     */
+    @Override
+    public String registerComputeResource(ComputeResourceDescription computeResourceDescription) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update a Application Interface.
+     *
+     * @param appInterfaceId       The identifier of the requested application deployment to be updated.
+     * @param applicationInterface
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateApplicationInterface(String appInterfaceId, ApplicationInterfaceDescription applicationInterface) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Register a Application Interface.
+     *
+     * @param gatewayId
+     * @param applicationInterface Application Module Object created from the datamodel.
+     * @return appInterfaceId
+     * Returns a server-side generated airavata application interface globally unique identifier.
+     */
+    @Override
+    public String registerApplicationInterface(String gatewayId, ApplicationInterfaceDescription applicationInterface) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update an Application Deployment.
+     *
+     * @param appDeploymentId       The identifier of the requested application deployment to be updated.
+     * @param applicationDeployment
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateApplicationDeployment(String appDeploymentId, ApplicationDeploymentDescription applicationDeployment) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Register an Application Deployment.
+     *
+     * @param gatewayId             ID of the gateway which is registering the new Application Deployment.
+     * @param applicationDeployment Application Module Object created from the datamodel.
+     * @return appDeploymentId
+     * Returns a server-side generated airavata appDeployment globally unique identifier.
+     */
+    @Override
+    public String registerApplicationDeployment(String gatewayId, ApplicationDeploymentDescription applicationDeployment) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update a Application Module.
+     *
+     * @param appModuleId       The identifier for the requested application module to be updated.
+     * @param applicationModule Application Module Object created from the datamodel.
+     * @return status
+     * Returns a success/failure of the update.
+     */
+    @Override
+    public boolean updateApplicationModule(String appModuleId, ApplicationModule applicationModule) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Register a Application Module.
+     *
+     * @param gatewayId
+     * @param applicationModule Application Module Object created from the datamodel.
+     * @return appModuleId
+     * Returns the server-side generated airavata appModule globally unique identifier.
+     * @gatewayId ID of the gateway which is registering the new Application Module.
+     */
+    @Override
+    public String registerApplicationModule(String gatewayId, ApplicationModule applicationModule) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public void updateResourceScheduleing(String airavataExperimentId, ComputationalResourceSchedulingModel resourceScheduling) throws RegistryServiceException, TException {
+
+    }
+
+    @Override
+    public void updateExperimentConfiguration(String airavataExperimentId, UserConfigurationDataModel userConfiguration) throws RegistryServiceException, TException {
+
+    }
+
+    /**
+     * Update a Previously Created Experiment
+     * Configure the CREATED experiment with required inputs, scheduling and other quality of service parameters. This method only updates the experiment object within the registry.
+     * The experiment has to be launched to make it actionable by the server.
+     *
+     * @param airavataExperimentId The identifier for the requested experiment. This is returned during the create experiment step.
+     * @param experiment
+     * @return This method call does not have a return value.
+     * @throws InvalidRequestException     For any incorrect forming of the request itself.
+     * @throws ExperimentNotFoundException If the specified experiment is not previously created, then an Experiment Not Found Exception is thrown.
+     * @throws AiravataClientException     The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+     *                                     <p>
+     *                                     UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+     *                                     step, then Airavata Registry will not have a provenance area setup. The client has to follow
+     *                                     gateway registration steps and retry this request.
+     *                                     <p>
+     *                                     AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+     *                                     For now this is a place holder.
+     *                                     <p>
+     *                                     INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+     *                                     is implemented, the authorization will be more substantial.
+     * @throws AiravataSystemException     This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+     *                                     rather an Airavata Administrator will be notified to take corrective action.
+     */
+    @Override
+    public void updateExperiment(String airavataExperimentId, ExperimentModel experiment) throws RegistryServiceException, TException {
+
+    }
+
+    /**
+     * *
+     * * Create New Experiment
+     * * Create an experiment for the specified user belonging to the gateway. The gateway identity is not explicitly passed
+     * *   but inferred from the sshKeyAuthentication header. This experiment is just a persistent place holder. The client
+     * *   has to subsequently configure and launch the created experiment. No action is taken on Airavata Server except
+     * *   registering the experiment in a persistent store.
+     * *
+     * * @param gatewayId
+     * *    The unique ID of the gateway where the experiment is been created.
+     * *
+     * * @param ExperimentModel
+     * *    The create experiment will require the basic experiment metadata like the name and description, intended user,
+     * *      the gateway identifer and if the experiment should be shared public by defualt. During the creation of an experiment
+     * *      the ExperimentMetadata is a required field.
+     * *
+     * * @return
+     * *   The server-side generated.airavata.registry.core.experiment.globally unique identifier.
+     * *
+     * * @throws org.apache.airavata.model.error.InvalidRequestException
+     * *    For any incorrect forming of the request itself.
+     * *
+     * * @throws org.apache.airavata.model.error.AiravataClientException
+     * *    The following list of exceptions are thrown which Airavata Client can take corrective actions to resolve:
+     * *
+     * *      UNKNOWN_GATEWAY_ID - If a Gateway is not registered with Airavata as a one time administrative
+     * *         step, then Airavata Registry will not have a provenance area setup. The client has to follow
+     * *         gateway registration steps and retry this request.
+     * *
+     * *      AUTHENTICATION_FAILURE - How Authentication will be implemented is yet to be determined.
+     * *         For now this is a place holder.
+     * *
+     * *      INVALID_AUTHORIZATION - This will throw an authorization exception. When a more robust security hand-shake
+     * *         is implemented, the authorization will be more substantial.
+     * *
+     * * @throws org.apache.airavata.model.error.AiravataSystemException
+     * *    This exception will be thrown for any Airavata Server side issues and if the problem cannot be corrected by the client
+     * *       rather an Airavata Administrator will be notified to take corrective action.
+     * *
+     * *
+     *
+     * @param gatewayId
+     * @param experiment
+     */
+    @Override
+    public String createExperiment(String gatewayId, ExperimentModel experiment) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Search Experiments.
+     * Search Experiments by using multiple filter criteria with pagination. Results will be sorted based on creation time DESC.
+     *
+     * @param gatewayId Identifier of the requested gateway.
+     * @param userName  Username of the user requesting the search function.
+     * @param filters   Map of multiple filter criteria. Currenlt search filters includes Experiment Name, Description, Application, etc....
+     * @param limit     Amount of results to be fetched.
+     * @param offset    The starting point of the results to be fetched.
+     * @return ExperimentSummaryModel
+     * List of experiments for the given search filter. Here only the Experiment summary will be returned.
+     */
+    @Override
+    public List<ExperimentSummaryModel> searchExperiments(String gatewayId, String userName, Map<ExperimentSearchFields, String> filters, int limit, int offset) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Search User Projects
+     * Search and get all Projects for user by project description or/and project name  with pagination.
+     * Results will be ordered based on creation time DESC.
+     *
+     * @param gatewayId The unique identifier of the gateway making the request.
+     * @param userName  The identifier of the user.
+     * @param filters   Map of multiple filter criteria. Currenlt search filters includes Project Name and Project Description
+     * @param limit     The amount results to be fetched.
+     * @param offset    The starting point of the results to be fetched.
+     */
+    @Override
+    public List<Project> searchProjects(String gatewayId, String userName, Map<ProjectSearchFields, String> filters, int limit, int offset) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update an Existing Project
+     *
+     * @param projectId      The projectId of the project needed an update.
+     * @param updatedProject
+     * @return void
+     * Currently this does not return any value.
+     */
+    @Override
+    public void updateProject(String projectId, Project updatedProject) throws RegistryServiceException, TException {
+
+    }
+
+    /**
+     * Creates a Project with basic metadata.
+     * A Project is a container of experiments.
+     *
+     * @param gatewayId The identifier for the requested gateway.
+     * @param project
+     */
+    @Override
+    public String createProject(String gatewayId, Project project) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    @Override
+    public boolean updateNotification(Notification notification) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * * API methods to retrieve notifications
+     * *
+     *
+     * @param notification
+     */
+    @Override
+    public String createNotification(Notification notification) throws RegistryServiceException, TException {
+        return null;
+    }
+
+    /**
+     * Update previously registered Gateway metadata.
+     *
+     * @param gatewayId      The gateway Id of the Gateway which require an update.
+     * @param updatedGateway
+     * @return gateway
+     * Modified gateway obejct.
+     * @throws AiravataClientException
+     */
+    @Override
+    public boolean updateGateway(String gatewayId, Gateway updatedGateway) throws RegistryServiceException, TException {
+        return false;
+    }
+
+    /**
+     * Register a Gateway with Airavata.
+     *
+     * @param gateway The gateway data model.
+     * @return gatewayId
+     * Th unique identifier of the  newly registered gateway.
+     */
+    @Override
+    public String addGateway(Gateway gateway) throws RegistryServiceException, TException {
+        return null;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/2d9fd253/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/AppCatalogInitUtil.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/AppCatalogInitUtil.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/AppCatalogInitUtil.java
new file mode 100644
index 0000000..715ccbd
--- /dev/null
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/util/AppCatalogInitUtil.java
@@ -0,0 +1,168 @@
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+package org.apache.airavata.registry.api.service.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.registry.core.app.catalog.resources.GatewayProfileResource;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.URI;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public class AppCatalogInitUtil {
+    public static final String COMPUTE_RESOURCE = "GATEWAY_PROFILE";
+    private static final Logger logger = LoggerFactory.getLogger(AppCatalogInitUtil.class);
+    public static final String APPCATALOG_JDBC_DRIVER = "appcatalog.jdbc.driver";
+    public static final String APPCATALOG_JDBC_URL = "appcatalog.jdbc.url";
+    public static final String APPCATALOG_JDBC_USER = "appcatalog.jdbc.user";
+    public static final String APPCATALOG_JDBC_PASSWORD = "appcatalog.jdbc.password";
+    public static final String START_DERBY_ENABLE = "start.derby.server.mode";
+    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+    private static NetworkServerControl server;
+    private static JdbcStorage db;
+    private static String jdbcURl;
+    private static String jdbcDriver;
+    private static String jdbcUser;
+    private static String jdbcPassword;
+
+
+    public static void initializeDB() {
+//        System.setProperty("appcatalog.initialize.state", "0");
+        try{
+            jdbcDriver = ServerSettings.getSetting(APPCATALOG_JDBC_DRIVER);
+            jdbcURl = ServerSettings.getSetting(APPCATALOG_JDBC_URL);
+            jdbcUser = ServerSettings.getSetting(APPCATALOG_JDBC_USER);
+            jdbcPassword = ServerSettings.getSetting(APPCATALOG_JDBC_PASSWORD);
+            jdbcURl = jdbcURl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage());
+        }
+
+        if (getDBType(jdbcURl).equals("derby") && isDerbyStartEnabled()) {
+            startDerbyInServerMode();
+        }
+        db = new JdbcStorage(10, 50, jdbcURl, jdbcDriver, true);
+
+        Connection conn = null;
+        try {
+            conn = db.connect();
+            if (!DatabaseCreator.isDatabaseStructureCreated(COMPUTE_RESOURCE, conn)) {
+                DatabaseCreator.createRegistryDatabase("database_scripts/appcatalog", conn);
+                logger.info("New Database created for App Catalog !!!");
+            } else {
+                logger.info("Database already created for App Catalog !!!");
+            }
+            GatewayProfileResource gatewayProfileResource = new GatewayProfileResource();
+            if (!gatewayProfileResource.isExists(ServerSettings.getDefaultUserGateway())){
+                gatewayProfileResource.setGatewayID(ServerSettings.getDefaultUserGateway());
+                gatewayProfileResource.setCreatedTime(AiravataUtils.getCurrentTimestamp());
+                gatewayProfileResource.save();
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure", e);
+        } finally {
+            db.closeConnection(conn);
+            try {
+                if(conn != null){
+                    if (!conn.getAutoCommit()) {
+                        conn.commit();
+                    }
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                logger.error("Error while closing database connection...", e.getMessage(), e);
+            }
+        }
+//        System.setProperty("appcatalog.initialize.state", "1");
+    }
+
+    public static String getDBType(String jdbcUrl){
+        try{
+            String cleanURI = jdbcUrl.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getScheme();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    public static boolean isDerbyStartEnabled(){
+        try {
+            String s = ServerSettings.getSetting(START_DERBY_ENABLE);
+            if("true".equals(s)){
+                return true;
+            }
+        }  catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata server properties", e.getMessage(), e);
+            return false;
+        }
+        return false;
+    }
+
+    public static void startDerbyInServerMode() {
+        try {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
+                    getPort(jdbcURl),
+                    jdbcUser, jdbcPassword);
+            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+            server.start(consoleWriter);
+        } catch (IOException e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        } catch (Exception e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        }
+    }
+    
+    public static void stopDerbyInServerMode() {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "false");
+            if (server!=null){
+            	try {
+					server.shutdown();
+				} catch (Exception e) {
+		            logger.error("Error when stopping the derby server : "+e.getLocalizedMessage());
+				}
+            }
+    }
+
+    public static int getPort(String jdbcURL){
+        try{
+            String cleanURI = jdbcURL.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getPort();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return -1;
+        }
+    }
+}