airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject [18/51] [abbrv] [partial] airavata git commit: registry refactoring
Date Thu, 04 Jun 2015 20:34:06 GMT
http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UnicoreJobSubmission.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UnicoreJobSubmission.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UnicoreJobSubmission.java
new file mode 100644
index 0000000..8395e40
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/UnicoreJobSubmission.java
@@ -0,0 +1,66 @@
+/*
+ *
+ * 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.core.app.catalog.model;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "UNICORE_SUBMISSION")
+public class UnicoreJobSubmission {
+	@Id
+    @Column(name = "SUBMISSION_ID")
+    private String submissionID;
+    @Column(name = "SECURITY_PROTOCAL")
+    private String securityProtocol;
+
+    @Column(name = "UNICORE_ENDPOINT_URL")
+    private String unicoreEndpointUrl;
+    
+    public String getUnicoreEndpointUrl() {
+		return unicoreEndpointUrl;
+	}
+
+    public void setUnicoreEndpointUrl(String unicoreEndpointUrl) {
+		this.unicoreEndpointUrl = unicoreEndpointUrl;
+	}
+    
+    
+	public String getSubmissionID() {
+        return submissionID;
+    }
+
+    public void setSubmissionID(String submissionID) {
+        this.submissionID = submissionID;
+    }
+
+    public String getSecurityProtocol() {
+        return securityProtocol;
+    }
+
+    public void setSecurityProtocol(String securityProtocol) {
+        this.securityProtocol = securityProtocol;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/Workflow.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/Workflow.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/Workflow.java
new file mode 100644
index 0000000..6520fd2
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/Workflow.java
@@ -0,0 +1,126 @@
+/*
+ *
+ * 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.core.app.catalog.model;
+
+import org.apache.openjpa.persistence.DataCache;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.sql.Timestamp;
+
+@DataCache
+@Entity
+@Table(name = "WORKFLOW")
+public class Workflow implements Serializable {
+
+    @Column(name = "WF_NAME")
+    private String wfName;
+
+    @Column(name = "CREATED_USER")
+    private String createdUser;
+
+    @Lob
+    @Column(name = "GRAPH")
+    private char[] graph;
+
+    @Id
+    @Column(name = "WF_TEMPLATE_ID")
+    private String wfTemplateId;
+
+    @Column(name = "CREATION_TIME")
+    private Timestamp creationTime;
+
+    @Column(name = "UPDATE_TIME")
+    private Timestamp updateTime;
+
+    @Lob
+    @Column(name = "IMAGE")
+    private byte[] image;
+
+    @Column(name = "GATEWAY_ID")
+    private String gatewayId;
+
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId = gatewayId;
+    }
+
+    public Timestamp getCreationTime() {
+        return creationTime;
+    }
+
+    public void setCreationTime(Timestamp creationTime) {
+        this.creationTime = creationTime;
+    }
+
+    public Timestamp getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Timestamp updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getWfName() {
+        return wfName;
+    }
+
+    public String getCreatedUser() {
+        return createdUser;
+    }
+
+    public char[] getGraph() {
+        return graph;
+    }
+
+    public String getWfTemplateId() {
+        return wfTemplateId;
+    }
+
+    public void setWfName(String wfName) {
+        this.wfName=wfName;
+    }
+
+    public void setCreatedUser(String createdUser) {
+        this.createdUser=createdUser;
+    }
+
+    public void setGraph(char[] graph) {
+        this.graph=graph;
+    }
+
+    public void setWfTemplateId(String wfTemplateId) {
+        this.wfTemplateId=wfTemplateId;
+    }
+
+    public byte[] getImage() {
+        return image;
+    }
+
+    public void setImage(byte[] image) {
+        this.image = image;
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowInput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowInput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowInput.java
new file mode 100644
index 0000000..c559906
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowInput.java
@@ -0,0 +1,167 @@
+/*
+ *
+ * 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.core.app.catalog.model;
+
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+@Entity
+@Table(name = "WORKFLOW_INPUT")
+@IdClass(WorkflowInput_PK.class)
+public class WorkflowInput implements Serializable {
+    @Id
+    @Column(name = "WF_TEMPLATE_ID")
+    private String wfTemplateId;
+    @Id
+    @Column(name = "INPUT_KEY")
+    private String inputKey;
+    @Lob
+    @Column(name = "INPUT_VALUE")
+    private char[] inputVal;
+    @Column(name = "DATA_TYPE")
+    private String dataType;
+    @Column(name = "METADATA")
+    private String metadata;
+    @Column(name = "APP_ARGUMENT")
+    private String appArgument;
+    @Column(name = "USER_FRIENDLY_DESC")
+    private String userFriendlyDesc;
+    @Column(name = "STANDARD_INPUT")
+    private boolean standardInput;
+    @Column(name = "INPUT_ORDER")
+    private int inputOrder;
+    @Column(name="IS_REQUIRED")
+    private boolean isRequired;
+    @Column(name="REQUIRED_TO_COMMANDLINE")
+    private boolean requiredToCMD;
+    @Column(name = "DATA_STAGED")
+    private boolean dataStaged;
+
+    @ManyToOne(cascade = CascadeType.MERGE)
+    @JoinColumn(name = "WF_TEMPLATE_ID")
+    private Workflow workflow;
+
+    public String getWfTemplateId() {
+        return wfTemplateId;
+    }
+
+    public void setWfTemplateId(String wfTemplateId) {
+        this.wfTemplateId = wfTemplateId;
+    }
+
+    public String getInputKey() {
+        return inputKey;
+    }
+
+    public void setInputKey(String inputKey) {
+        this.inputKey = inputKey;
+    }
+
+    public char[] getInputVal() {
+        return inputVal;
+    }
+
+    public void setInputVal(char[] inputVal) {
+        this.inputVal = inputVal;
+    }
+
+    public String getDataType() {
+        return dataType;
+    }
+
+    public void setDataType(String dataType) {
+        this.dataType = dataType;
+    }
+
+    public String getMetadata() {
+        return metadata;
+    }
+
+    public void setMetadata(String metadata) {
+        this.metadata = metadata;
+    }
+
+    public String getAppArgument() {
+        return appArgument;
+    }
+
+    public void setAppArgument(String appArgument) {
+        this.appArgument = appArgument;
+    }
+
+    public String getUserFriendlyDesc() {
+        return userFriendlyDesc;
+    }
+
+    public void setUserFriendlyDesc(String userFriendlyDesc) {
+        this.userFriendlyDesc = userFriendlyDesc;
+    }
+
+    public Workflow getWorkflow() {
+        return workflow;
+    }
+
+    public void setWorkflow(Workflow workflow) {
+        this.workflow = workflow;
+    }
+
+    public boolean isStandardInput() {
+        return standardInput;
+    }
+
+    public void setStandardInput(boolean standardInput) {
+        this.standardInput = standardInput;
+    }
+
+    public int getInputOrder() {
+        return inputOrder;
+    }
+
+    public void setInputOrder(int inputOrder) {
+        this.inputOrder = inputOrder;
+    }
+
+    public boolean isRequired() {
+        return isRequired;
+    }
+
+    public void setRequired(boolean isRequired) {
+        this.isRequired = isRequired;
+    }
+
+    public boolean isRequiredToCMD() {
+        return requiredToCMD;
+    }
+
+    public void setRequiredToCMD(boolean requiredToCMD) {
+        this.requiredToCMD = requiredToCMD;
+    }
+
+    public boolean isDataStaged() {
+        return dataStaged;
+    }
+
+    public void setDataStaged(boolean dataStaged) {
+        this.dataStaged = dataStaged;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowInput_PK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowInput_PK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowInput_PK.java
new file mode 100644
index 0000000..d72799c
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowInput_PK.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.core.app.catalog.model;
+
+import java.io.Serializable;
+
+public class WorkflowInput_PK implements Serializable {
+    private String wfTemplateId;
+    private String inputKey;
+
+    public WorkflowInput_PK(String wfTemplateId, String inputKey) {
+        this.wfTemplateId = wfTemplateId;
+        this.inputKey = inputKey;
+    }
+
+    public WorkflowInput_PK() {
+        ;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return 1;
+    }
+
+    public String getWfTemplateId() {
+        return wfTemplateId;
+    }
+
+    public void setWfTemplateId(String wfTemplateId) {
+        this.wfTemplateId = wfTemplateId;
+    }
+
+    public String getInputKey() {
+        return inputKey;
+    }
+
+    public void setInputKey(String inputKey) {
+        this.inputKey = inputKey;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowOutput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowOutput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowOutput.java
new file mode 100644
index 0000000..3080b0f
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowOutput.java
@@ -0,0 +1,117 @@
+/*
+ *
+ * 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.core.app.catalog.model;
+
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+@Entity
+@Table(name = "WORKFLOW_OUTPUT")
+@IdClass(WorkflowOutput_PK.class)
+public class WorkflowOutput implements Serializable {
+    @Id
+    @Column(name = "WF_TEMPLATE_ID")
+    private String wfTemplateId;
+    @Id
+    @Column(name = "OUTPUT_KEY")
+    private String outputKey;
+    @Lob
+    @Column(name = "OUTPUT_VALUE")
+    private char[] outputVal;
+    @Column(name = "DATA_TYPE")
+    private String dataType;
+    @Column(name = "VALIDITY_TYPE")
+    private String validityType;
+    @Column(name = "DATA_MOVEMENT")
+    private boolean dataMovement;
+    @Column(name = "DATA_NAME_LOCATION")
+    private String dataNameLocation;
+
+    @ManyToOne(cascade= CascadeType.MERGE)
+    @JoinColumn(name = "WF_TEMPLATE_ID")
+    private Workflow workflow;
+
+    public String getWfTemplateId() {
+        return wfTemplateId;
+    }
+
+    public void setWfTemplateId(String wfTemplateId) {
+        this.wfTemplateId = wfTemplateId;
+    }
+
+    public String getDataType() {
+        return dataType;
+    }
+
+    public void setDataType(String dataType) {
+        this.dataType = dataType;
+    }
+
+    public Workflow getWorkflow() {
+        return workflow;
+    }
+
+    public void setWorkflow(Workflow workflow) {
+        this.workflow = workflow;
+    }
+
+    public String getOutputKey() {
+        return outputKey;
+    }
+
+    public void setOutputKey(String outputKey) {
+        this.outputKey = outputKey;
+    }
+
+    public char[] getOutputVal() {
+        return outputVal;
+    }
+
+    public void setOutputVal(char[] outputVal) {
+        this.outputVal = outputVal;
+    }
+
+    public String getValidityType() {
+        return validityType;
+    }
+
+    public void setValidityType(String validityType) {
+        this.validityType = validityType;
+    }
+
+    public boolean isDataMovement() {
+        return dataMovement;
+    }
+
+    public void setDataMovement(boolean dataMovement) {
+        this.dataMovement = dataMovement;
+    }
+
+    public String getDataNameLocation() {
+        return dataNameLocation;
+    }
+
+    public void setDataNameLocation(String dataNameLocation) {
+        this.dataNameLocation = dataNameLocation;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowOutput_PK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowOutput_PK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowOutput_PK.java
new file mode 100644
index 0000000..183afe8
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/model/WorkflowOutput_PK.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.core.app.catalog.model;
+
+import java.io.Serializable;
+
+public class WorkflowOutput_PK implements Serializable {
+    private String wfTemplateId;
+    private String outputKey;
+
+    public WorkflowOutput_PK(String wfTemplateId, String outputKey) {
+        this.wfTemplateId = wfTemplateId;
+        this.outputKey = outputKey;
+    }
+
+    public WorkflowOutput_PK() {
+        ;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        return false;
+    }
+
+    @Override
+    public int hashCode() {
+        return 1;
+    }
+
+    public String getWfTemplateId() {
+        return wfTemplateId;
+    }
+
+    public void setWfTemplateId(String wfTemplateId) {
+        this.wfTemplateId = wfTemplateId;
+    }
+
+    public String getOutputKey() {
+        return outputKey;
+    }
+
+    public void setOutputKey(String outputKey) {
+        this.outputKey = outputKey;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AbstractResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AbstractResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AbstractResource.java
new file mode 100644
index 0000000..e1b042d
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AbstractResource.java
@@ -0,0 +1,382 @@
+/*
+ *
+ * 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.aiaravata.application.catalog.data.resources;
+
+public abstract class AbstractResource implements Resource {
+    // table names
+	public static final String COMPUTE_RESOURCE = "ComputeResource";
+	public static final String HOST_ALIAS = "HostAlias";
+    public static final String HOST_IPADDRESS = "HostIPAddress";
+    public static final String GSISSH_SUBMISSION = "GSISSHSubmission";
+    public static final String GSISSH_EXPORT = "GSISSHExport";
+    public static final String PRE_JOBCOMMAND = "PreJobCommand";
+    public static final String POST_JOBCOMMAND = "PostJobCommand";
+    public static final String GLOBUS_SUBMISSION = "GlobusJobSubmission";
+    public static final String UNICORE_JOB_SUBMISSION = "UnicoreJobSubmission";
+    public static final String UNICORE_DATA_MOVEMENT = "UnicoreDataMovement";
+    public static final String GLOBUS_GK_ENDPOINT = "GlobusGKEndpoint";
+    public static final String SSH_SUBMISSION = "SSHSubmission";
+	public static final String SCP_DATA_MOVEMENT = "ScpDataMovement";
+	public static final String GRIDFTP_DATA_MOVEMENT = "GridftpDataMovement";
+	public static final String GRIDFTP_ENDPOINT = "GridftpEndpoint";
+	public static final String JOB_SUBMISSION_PROTOCOL = "JobSubmissionProtocol";
+    public static final String DATA_MOVEMENT_PROTOCOL = "DataMovementProtocol";
+    public static final String APPLICATION_MODULE = "ApplicationModule";
+    public static final String APPLICATION_DEPLOYMENT = "ApplicationDeployment";
+    public static final String LIBRARY_PREPAND_PATH = "LibraryPrepandPath";
+    public static final String LIBRARY_APEND_PATH = "LibraryApendPath";
+    public static final String APP_ENVIRONMENT = "AppEnvironment";
+    public static final String APPLICATION_INTERFACE = "ApplicationInterface";
+    public static final String APP_MODULE_MAPPING = "AppModuleMapping";
+    public static final String APPLICATION_INPUT = "ApplicationInput";
+    public static final String WORKFLOW_INPUT = "WorkflowInput";
+    public static final String APPLICATION_OUTPUT = "ApplicationOutput";
+    public static final String WORKFLOW_OUTPUT = "WorkflowOutput";
+    public static final String GATEWAY_PROFILE = "GatewayProfile";
+    public static final String COMPUTE_RESOURCE_PREFERENCE = "ComputeResourcePreference";
+	public static final String BATCH_QUEUE = "BatchQueue";
+	public static final String COMPUTE_RESOURCE_FILE_SYSTEM = "ComputeResourceFileSystem";
+	public static final String JOB_SUBMISSION_INTERFACE = "JobSubmissionInterface";
+	public static final String DATA_MOVEMENT_INTERFACE = "DataMovementInterface";
+	public static final String RESOURCE_JOB_MANAGER = "ResourceJobManager";
+	public static final String JOB_MANAGER_COMMAND = "JobManagerCommand";
+	public static final String LOCAL_SUBMISSION = "LocalSubmission";
+	public static final String LOCAL_DATA_MOVEMENT = "LocalDataMovement";
+	public static final String SSH_JOB_SUBMISSION = "SshJobSubmission";
+	public static final String EMAIL_PROPERTY = "EmailMonitorProperty";
+    public static final String CLOUD_JOB_SUBMISSION = "CloudJobSubmission";
+    public static final String MODULE_LOAD_CMD = "ModuleLoadCmd";
+    public static final String WORKFLOW = "Workflow";
+
+    public final class EmailMonitorPropertyConstants {
+        public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionId";
+    }
+
+	// Compute Resource Table
+	public final class ComputeResourceConstants {
+		public static final String RESOURCE_DESCRIPTION = "resourceDescription";
+		public static final String RESOURCE_ID = "resourceId";
+		public static final String HOST_NAME = "hostName";
+	}
+
+    // Host Alias Table
+    public final class HostAliasConstants {
+        public static final String RESOURCE_ID = "resourceID";
+        public static final String ALIAS = "alias";
+    }
+
+    // Host IPAddress Table
+    public final class HostIPAddressConstants {
+        public static final String RESOURCE_ID = "resourceID";
+        public static final String IP_ADDRESS = "ipaddress";
+    }
+
+    // GSSISSH Submission Table
+    public final class GSISSHSubmissionConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String RESOURCE_JOB_MANAGER = "resourceJobManager";
+        public static final String SSH_PORT = "sshPort";
+        public static final String INSTALLED_PATH = "installedPath";
+        public static final String MONITOR_MODE = "monitorMode";
+    }
+
+    // GSSISSH Export Table
+    public final class GSISSHExportConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String EXPORT = "export";
+    }
+
+    // GSSISSH Pre Job Command Table
+    public final class PreJobCommandConstants {
+        public static final String DEPLOYMENT_ID = "deploymentId";
+        public static final String COMMAND = "command";
+    }
+
+    // GSSISSH Post Job Command Table
+    public final class PostJobCommandConstants {
+        public static final String DEPLOYMENT_ID = "deploymentId";
+        public static final String COMMAND = "command";
+    }
+
+    // GSSISSH Post Job Command Table
+    public final class GlobusJobSubmissionConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String RESOURCE_JOB_MANAGER = "resourceJobManager";
+        public static final String SECURITY_PROTOCAL = "securityProtocol";
+        public static final String GLOBUS_GATEKEEPER_EP = "globusEP";
+    }
+
+    // Unicore Post Job Command Table
+    public final class UnicoreJobSubmissionConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String SECURITY_PROTOCAL = "securityProtocol";
+        public static final String UNICORE_ENDPOINT_URL = "unicoreEndpointUrl";
+        
+    }
+
+    public final class UnicoreDataMovementConstants {
+        public static final String DATAMOVEMENT_ID = "dataMovementId";
+        public static final String SECURITY_PROTOCAL = "securityProtocol";
+        public static final String UNICORE_ENDPOINT_URL = "unicoreEndpointUrl";
+    }
+
+    
+    public final class GlobusEPConstants{
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String ENDPOINT = "endpoint";
+    }
+
+    // GSSISSH Post Job Command Table
+    public final class SSHSubmissionConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String RESOURCE_JOB_MANAGER = "resourceJobManager";
+        public static final String SSH_PORT = "sshPort";
+    }
+
+	// Scp Data Movement Table
+	public final class ScpDataMovementConstants {
+		public static final String QUEUE_DESCRIPTION = "queueDescription";
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+		public static final String SECURITY_PROTOCOL = "securityProtocol";
+		public static final String ALTERNATIVE_SCP_HOSTNAME = "alternativeScpHostname";
+		public static final String SSH_PORT = "sshPort";
+	}
+
+    public final class GridFTPDataMovementConstants {
+        public static final String DATA_MOVE_ID = "dataMoveID";
+        public static final String SECURITY_PROTOCOL = "securityProtocol";
+        public static final String GRID_FTP_EP = "gridFTPEP";
+    }
+
+    public final class GridFTPDMEPConstants{
+        public static final String DATA_MOVE_ID = "dataMoveId";
+        public static final String ENDPOINT = "endpoint";
+    }
+
+    public final class JobSubmissionProtocolConstants {
+        public static final String RESOURCE_ID = "resourceID";
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String JOB_TYPE = "jobType";
+    }
+
+    public final class DataMoveProtocolConstants {
+        public static final String RESOURCE_ID = "resourceID";
+        public static final String DATA_MOVE_ID = "dataMoveID";
+        public static final String DATA_MOVE_TYPE = "dataMoveType";
+    }
+
+    public final class ApplicationModuleConstants {
+        public static final String MODULE_ID = "moduleID";
+        public static final String GATEWAY_ID = "gatewayId";
+        public static final String MODULE_NAME = "moduleName";
+        public static final String MODULE_VERSION = "moduleVersion";
+        public static final String MODULE_DESC = "moduleDesc";
+    }
+
+    public final class ApplicationDeploymentConstants {
+        public static final String APP_MODULE_ID = "appModuleID";
+        public static final String DEPLOYMENT_ID = "deploymentID";
+        public static final String COMPUTE_HOST_ID = "hostID";
+        public static final String GATEWAY_ID = "gatewayId";
+        public static final String EXECUTABLE_PATH = "executablePath";
+        public static final String APPLICATION_DESC = "applicationDesc";
+        public static final String ENV_MODULE_LOAD_CMD = "envModuleLoaString";
+        public static final String PARALLELISM = "parallelism";
+    }
+
+    public final class LibraryPrepandPathConstants {
+        public static final String DEPLOYMENT_ID = "deploymentID";
+        public static final String NAME = "name";
+        public static final String VALUE = "value";
+    }
+
+    public final class LibraryApendPathConstants {
+        public static final String DEPLOYMENT_ID = "deploymentID";
+        public static final String NAME = "name";
+        public static final String VALUE = "value";
+    }
+
+    public final class AppEnvironmentConstants {
+        public static final String DEPLOYMENT_ID = "deploymentID";
+        public static final String NAME = "name";
+        public static final String VALUE = "value";
+    }
+
+    public final class ApplicationInterfaceConstants {
+        public static final String INTERFACE_ID = "interfaceID";
+        public static final String APPLICATION_NAME = "appName";
+        public static final String GATEWAY_ID = "gatewayId";
+    }
+
+    public final class AppModuleMappingConstants {
+        public static final String INTERFACE_ID = "interfaceID";
+        public static final String MODULE_ID = "moduleID";
+    }
+
+    public final class AppInputConstants {
+        public static final String INTERFACE_ID = "interfaceID";
+        public static final String INPUT_KEY = "inputKey";
+        public static final String INPUT_VALUE = "inputVal";
+        public static final String DATA_TYPE = "dataType";
+        public static final String METADATA = "metadata";
+        public static final String APP_ARGUMENT = "appArgument";
+        public static final String USER_FRIENDLY_DESC = "userFriendlyDesc";
+        public static final String STANDARD_INPUT = "standardInput";
+    }
+
+    public final class AppOutputConstants {
+        public static final String INTERFACE_ID = "interfaceID";
+        public static final String OUTPUT_KEY = "outputKey";
+        public static final String OUTPUT_VALUE = "outputVal";
+        public static final String DATA_TYPE = "dataType";
+    }
+
+    public final class WFInputConstants {
+        public static final String WF_TEMPLATE_ID = "wfTemplateId";
+        public static final String INPUT_KEY = "inputKey";
+        public static final String INPUT_VALUE = "inputVal";
+        public static final String DATA_TYPE = "dataType";
+        public static final String METADATA = "metadata";
+        public static final String APP_ARGUMENT = "appArgument";
+        public static final String USER_FRIENDLY_DESC = "userFriendlyDesc";
+        public static final String STANDARD_INPUT = "standardInput";
+    }
+
+    public final class WFOutputConstants {
+        public static final String WF_TEMPLATE_ID = "wfTemplateId";
+        public static final String OUTPUT_KEY = "outputKey";
+        public static final String OUTPUT_VALUE = "outputVal";
+        public static final String DATA_TYPE = "dataType";
+    }
+
+    public final class GatewayProfileConstants {
+        public static final String GATEWAY_ID = "gatewayID";
+        public static final String GATEWAY_DESC = "gatewayDesc";
+    }
+
+    public final class ComputeResourcePreferenceConstants {
+        public static final String GATEWAY_ID = "gatewayId";
+        public static final String RESOURCE_ID = "resourceId";
+        public static final String OVERRIDE_BY_AIRAVATA = "overrideByAiravata";
+        public static final String PREFERED_JOB_SUB_PROTOCOL = "preferedJobSubmissionProtocol";
+        public static final String PREFERED_DATA_MOVE_PROTOCOL = "preferedDataMoveProtocol";
+        public static final String PREFERED_BATCH_QUEUE = "batchQueue";
+        public static final String SCRATCH_LOCATION = "scratchLocation";
+        public static final String ALLOCATION_PROJECT_NUMBER = "projectNumber";
+    }
+
+    // Batch Queue Table
+ 	public final class BatchQueueConstants {
+ 		public static final String COMPUTE_RESOURCE_ID = "computeResourceId";
+ 		public static final String MAX_RUNTIME = "maxRuntime";
+ 		public static final String MAX_JOB_IN_QUEUE = "maxJobInQueue";
+ 		public static final String QUEUE_DESCRIPTION = "queueDescription";
+ 		public static final String QUEUE_NAME = "queueName";
+ 		public static final String MAX_PROCESSORS = "maxProcessors";
+ 		public static final String MAX_NODES = "maxNodes";
+ 	}
+ 	
+	// Compute Resource File System Table
+	public final class ComputeResourceFileSystemConstants {
+		public static final String COMPUTE_RESOURCE_ID = "computeResourceId";
+		public static final String PATH = "path";
+		public static final String FILE_SYSTEM = "fileSystem";
+	}
+	
+	// Job Submission Interface Table
+	public final class JobSubmissionInterfaceConstants {
+		public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionInterfaceId";
+		public static final String COMPUTE_RESOURCE_ID = "computeResourceId";
+		public static final String JOB_SUBMISSION_PROTOCOL = "jobSubmissionProtocol";
+		public static final String PRIORITY_ORDER = "priorityOrder";
+	}
+	
+	// Data Movement Interface Table
+	public final class DataMovementInterfaceConstants {
+		public static final String COMPUTE_RESOURCE_ID = "computeResourceId";
+		public static final String DATA_MOVEMENT_PROTOCOL = "dataMovementProtocol";
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+		public static final String PRIORITY_ORDER = "priorityOrder";
+	}
+	
+	// Resource Job Manager Table
+	public final class ResourceJobManagerConstants {
+		public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+		public static final String PUSH_MONITORING_ENDPOINT = "pushMonitoringEndpoint";
+		public static final String JOB_MANAGER_BIN_PATH = "jobManagerBinPath";
+		public static final String RESOURCE_JOB_MANAGER_TYPE = "resourceJobManagerType";
+	}
+	
+	// Job Manager Command Table
+	public final class JobManagerCommandConstants {
+		public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+		public static final String COMMAND_TYPE = "commandType";
+		public static final String COMMAND = "command";
+	}
+	
+	// Gridftp Data Movement Table
+	public final class GridftpDataMovementConstants {
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+		public static final String SECURITY_PROTOCOL = "securityProtocol";
+	}
+	
+	// Gridftp Endpoint Table
+	public final class GridftpEndpointConstants {
+		public static final String ENDPOINT = "endpoint";
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+	}
+	
+	// Local Submission Table
+	public final class LocalSubmissionConstants {
+		public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+		public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionInterfaceId";
+	}
+	
+	// Local Data Movement Table
+	public final class LocalDataMovementConstants {
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+	}
+	
+	// Ssh Job Submission Table
+	public final class SshJobSubmissionConstants {
+		public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+		public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionInterfaceId";
+		public static final String ALTERNATIVE_SSH_HOSTNAME = "alternativeSshHostname";
+		public static final String SECURITY_PROTOCOL = "securityProtocol";
+		public static final String SSH_PORT = "sshPort";
+	}
+
+    // Module Load Cmd Table
+    public final class ModuleLoadCmdConstants {
+        public static final String CMD = "cmd";
+        public static final String APP_DEPLOYMENT_ID = "appDeploymentId";
+    }
+
+    // Workflow Table
+    public final class WorkflowConstants {
+        public static final String WF_NAME = "wfName";
+        public static final String CREATED_USER = "createdUser";
+        public static final String GRAPH = "graph";
+        public static final String WF_TEMPLATE_ID = "wfTemplateId";
+        public static final String GATEWAY_ID = "gatewayId";
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatAbstractResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatAbstractResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatAbstractResource.java
new file mode 100644
index 0000000..7db1eb7
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatAbstractResource.java
@@ -0,0 +1,382 @@
+/*
+ *
+ * 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.core.app.catalog.resources;
+
+public abstract class AppCatAbstractResource implements AppCatalogResource {
+    // table names
+	public static final String COMPUTE_RESOURCE = "ComputeResource";
+	public static final String HOST_ALIAS = "HostAlias";
+    public static final String HOST_IPADDRESS = "HostIPAddress";
+    public static final String GSISSH_SUBMISSION = "GSISSHSubmission";
+    public static final String GSISSH_EXPORT = "GSISSHExport";
+    public static final String PRE_JOBCOMMAND = "PreJobCommand";
+    public static final String POST_JOBCOMMAND = "PostJobCommand";
+    public static final String GLOBUS_SUBMISSION = "GlobusJobSubmission";
+    public static final String UNICORE_JOB_SUBMISSION = "UnicoreJobSubmission";
+    public static final String UNICORE_DATA_MOVEMENT = "UnicoreDataMovement";
+    public static final String GLOBUS_GK_ENDPOINT = "GlobusGKEndpoint";
+    public static final String SSH_SUBMISSION = "SSHSubmission";
+	public static final String SCP_DATA_MOVEMENT = "ScpDataMovement";
+	public static final String GRIDFTP_DATA_MOVEMENT = "GridftpDataMovement";
+	public static final String GRIDFTP_ENDPOINT = "GridftpEndpoint";
+	public static final String JOB_SUBMISSION_PROTOCOL = "JobSubmissionProtocol";
+    public static final String DATA_MOVEMENT_PROTOCOL = "DataMovementProtocol";
+    public static final String APPLICATION_MODULE = "ApplicationModule";
+    public static final String APPLICATION_DEPLOYMENT = "ApplicationDeployment";
+    public static final String LIBRARY_PREPAND_PATH = "LibraryPrepandPath";
+    public static final String LIBRARY_APEND_PATH = "LibraryApendPath";
+    public static final String APP_ENVIRONMENT = "AppEnvironment";
+    public static final String APPLICATION_INTERFACE = "ApplicationInterface";
+    public static final String APP_MODULE_MAPPING = "AppModuleMapping";
+    public static final String APPLICATION_INPUT = "ApplicationInput";
+    public static final String WORKFLOW_INPUT = "WorkflowInput";
+    public static final String APPLICATION_OUTPUT = "ApplicationOutput";
+    public static final String WORKFLOW_OUTPUT = "WorkflowOutput";
+    public static final String GATEWAY_PROFILE = "GatewayProfile";
+    public static final String COMPUTE_RESOURCE_PREFERENCE = "ComputeResourcePreference";
+	public static final String BATCH_QUEUE = "BatchQueue";
+	public static final String COMPUTE_RESOURCE_FILE_SYSTEM = "ComputeResourceFileSystem";
+	public static final String JOB_SUBMISSION_INTERFACE = "JobSubmissionInterface";
+	public static final String DATA_MOVEMENT_INTERFACE = "DataMovementInterface";
+	public static final String RESOURCE_JOB_MANAGER = "ResourceJobManager";
+	public static final String JOB_MANAGER_COMMAND = "JobManagerCommand";
+	public static final String LOCAL_SUBMISSION = "LocalSubmission";
+	public static final String LOCAL_DATA_MOVEMENT = "LocalDataMovement";
+	public static final String SSH_JOB_SUBMISSION = "SshJobSubmission";
+	public static final String EMAIL_PROPERTY = "EmailMonitorProperty";
+    public static final String CLOUD_JOB_SUBMISSION = "CloudJobSubmission";
+    public static final String MODULE_LOAD_CMD = "ModuleLoadCmd";
+    public static final String WORKFLOW = "Workflow";
+
+    public final class EmailMonitorPropertyConstants {
+        public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionId";
+    }
+
+	// Compute Resource Table
+	public final class ComputeResourceConstants {
+		public static final String RESOURCE_DESCRIPTION = "resourceDescription";
+		public static final String RESOURCE_ID = "resourceId";
+		public static final String HOST_NAME = "hostName";
+	}
+
+    // Host Alias Table
+    public final class HostAliasConstants {
+        public static final String RESOURCE_ID = "resourceID";
+        public static final String ALIAS = "alias";
+    }
+
+    // Host IPAddress Table
+    public final class HostIPAddressConstants {
+        public static final String RESOURCE_ID = "resourceID";
+        public static final String IP_ADDRESS = "ipaddress";
+    }
+
+    // GSSISSH Submission Table
+    public final class GSISSHSubmissionConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String RESOURCE_JOB_MANAGER = "resourceJobManager";
+        public static final String SSH_PORT = "sshPort";
+        public static final String INSTALLED_PATH = "installedPath";
+        public static final String MONITOR_MODE = "monitorMode";
+    }
+
+    // GSSISSH Export Table
+    public final class GSISSHExportConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String EXPORT = "export";
+    }
+
+    // GSSISSH Pre Job Command Table
+    public final class PreJobCommandConstants {
+        public static final String DEPLOYMENT_ID = "deploymentId";
+        public static final String COMMAND = "command";
+    }
+
+    // GSSISSH Post Job Command Table
+    public final class PostJobCommandConstants {
+        public static final String DEPLOYMENT_ID = "deploymentId";
+        public static final String COMMAND = "command";
+    }
+
+    // GSSISSH Post Job Command Table
+    public final class GlobusJobSubmissionConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String RESOURCE_JOB_MANAGER = "resourceJobManager";
+        public static final String SECURITY_PROTOCAL = "securityProtocol";
+        public static final String GLOBUS_GATEKEEPER_EP = "globusEP";
+    }
+
+    // Unicore Post Job Command Table
+    public final class UnicoreJobSubmissionConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String SECURITY_PROTOCAL = "securityProtocol";
+        public static final String UNICORE_ENDPOINT_URL = "unicoreEndpointUrl";
+        
+    }
+
+    public final class UnicoreDataMovementConstants {
+        public static final String DATAMOVEMENT_ID = "dataMovementId";
+        public static final String SECURITY_PROTOCAL = "securityProtocol";
+        public static final String UNICORE_ENDPOINT_URL = "unicoreEndpointUrl";
+    }
+
+    
+    public final class GlobusEPConstants{
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String ENDPOINT = "endpoint";
+    }
+
+    // GSSISSH Post Job Command Table
+    public final class SSHSubmissionConstants {
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String RESOURCE_JOB_MANAGER = "resourceJobManager";
+        public static final String SSH_PORT = "sshPort";
+    }
+
+	// Scp Data Movement Table
+	public final class ScpDataMovementConstants {
+		public static final String QUEUE_DESCRIPTION = "queueDescription";
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+		public static final String SECURITY_PROTOCOL = "securityProtocol";
+		public static final String ALTERNATIVE_SCP_HOSTNAME = "alternativeScpHostname";
+		public static final String SSH_PORT = "sshPort";
+	}
+
+    public final class GridFTPDataMovementConstants {
+        public static final String DATA_MOVE_ID = "dataMoveID";
+        public static final String SECURITY_PROTOCOL = "securityProtocol";
+        public static final String GRID_FTP_EP = "gridFTPEP";
+    }
+
+    public final class GridFTPDMEPConstants{
+        public static final String DATA_MOVE_ID = "dataMoveId";
+        public static final String ENDPOINT = "endpoint";
+    }
+
+    public final class JobSubmissionProtocolConstants {
+        public static final String RESOURCE_ID = "resourceID";
+        public static final String SUBMISSION_ID = "submissionID";
+        public static final String JOB_TYPE = "jobType";
+    }
+
+    public final class DataMoveProtocolConstants {
+        public static final String RESOURCE_ID = "resourceID";
+        public static final String DATA_MOVE_ID = "dataMoveID";
+        public static final String DATA_MOVE_TYPE = "dataMoveType";
+    }
+
+    public final class ApplicationModuleConstants {
+        public static final String MODULE_ID = "moduleID";
+        public static final String GATEWAY_ID = "gatewayId";
+        public static final String MODULE_NAME = "moduleName";
+        public static final String MODULE_VERSION = "moduleVersion";
+        public static final String MODULE_DESC = "moduleDesc";
+    }
+
+    public final class ApplicationDeploymentConstants {
+        public static final String APP_MODULE_ID = "appModuleID";
+        public static final String DEPLOYMENT_ID = "deploymentID";
+        public static final String COMPUTE_HOST_ID = "hostID";
+        public static final String GATEWAY_ID = "gatewayId";
+        public static final String EXECUTABLE_PATH = "executablePath";
+        public static final String APPLICATION_DESC = "applicationDesc";
+        public static final String ENV_MODULE_LOAD_CMD = "envModuleLoaString";
+        public static final String PARALLELISM = "parallelism";
+    }
+
+    public final class LibraryPrepandPathConstants {
+        public static final String DEPLOYMENT_ID = "deploymentID";
+        public static final String NAME = "name";
+        public static final String VALUE = "value";
+    }
+
+    public final class LibraryApendPathConstants {
+        public static final String DEPLOYMENT_ID = "deploymentID";
+        public static final String NAME = "name";
+        public static final String VALUE = "value";
+    }
+
+    public final class AppEnvironmentConstants {
+        public static final String DEPLOYMENT_ID = "deploymentID";
+        public static final String NAME = "name";
+        public static final String VALUE = "value";
+    }
+
+    public final class ApplicationInterfaceConstants {
+        public static final String INTERFACE_ID = "interfaceID";
+        public static final String APPLICATION_NAME = "appName";
+        public static final String GATEWAY_ID = "gatewayId";
+    }
+
+    public final class AppModuleMappingConstants {
+        public static final String INTERFACE_ID = "interfaceID";
+        public static final String MODULE_ID = "moduleID";
+    }
+
+    public final class AppInputConstants {
+        public static final String INTERFACE_ID = "interfaceID";
+        public static final String INPUT_KEY = "inputKey";
+        public static final String INPUT_VALUE = "inputVal";
+        public static final String DATA_TYPE = "dataType";
+        public static final String METADATA = "metadata";
+        public static final String APP_ARGUMENT = "appArgument";
+        public static final String USER_FRIENDLY_DESC = "userFriendlyDesc";
+        public static final String STANDARD_INPUT = "standardInput";
+    }
+
+    public final class AppOutputConstants {
+        public static final String INTERFACE_ID = "interfaceID";
+        public static final String OUTPUT_KEY = "outputKey";
+        public static final String OUTPUT_VALUE = "outputVal";
+        public static final String DATA_TYPE = "dataType";
+    }
+
+    public final class WFInputConstants {
+        public static final String WF_TEMPLATE_ID = "wfTemplateId";
+        public static final String INPUT_KEY = "inputKey";
+        public static final String INPUT_VALUE = "inputVal";
+        public static final String DATA_TYPE = "dataType";
+        public static final String METADATA = "metadata";
+        public static final String APP_ARGUMENT = "appArgument";
+        public static final String USER_FRIENDLY_DESC = "userFriendlyDesc";
+        public static final String STANDARD_INPUT = "standardInput";
+    }
+
+    public final class WFOutputConstants {
+        public static final String WF_TEMPLATE_ID = "wfTemplateId";
+        public static final String OUTPUT_KEY = "outputKey";
+        public static final String OUTPUT_VALUE = "outputVal";
+        public static final String DATA_TYPE = "dataType";
+    }
+
+    public final class GatewayProfileConstants {
+        public static final String GATEWAY_ID = "gatewayID";
+        public static final String GATEWAY_DESC = "gatewayDesc";
+    }
+
+    public final class ComputeResourcePreferenceConstants {
+        public static final String GATEWAY_ID = "gatewayId";
+        public static final String RESOURCE_ID = "resourceId";
+        public static final String OVERRIDE_BY_AIRAVATA = "overrideByAiravata";
+        public static final String PREFERED_JOB_SUB_PROTOCOL = "preferedJobSubmissionProtocol";
+        public static final String PREFERED_DATA_MOVE_PROTOCOL = "preferedDataMoveProtocol";
+        public static final String PREFERED_BATCH_QUEUE = "batchQueue";
+        public static final String SCRATCH_LOCATION = "scratchLocation";
+        public static final String ALLOCATION_PROJECT_NUMBER = "projectNumber";
+    }
+
+    // Batch Queue Table
+ 	public final class BatchQueueConstants {
+ 		public static final String COMPUTE_RESOURCE_ID = "computeResourceId";
+ 		public static final String MAX_RUNTIME = "maxRuntime";
+ 		public static final String MAX_JOB_IN_QUEUE = "maxJobInQueue";
+ 		public static final String QUEUE_DESCRIPTION = "queueDescription";
+ 		public static final String QUEUE_NAME = "queueName";
+ 		public static final String MAX_PROCESSORS = "maxProcessors";
+ 		public static final String MAX_NODES = "maxNodes";
+ 	}
+ 	
+	// Compute Resource File System Table
+	public final class ComputeResourceFileSystemConstants {
+		public static final String COMPUTE_RESOURCE_ID = "computeResourceId";
+		public static final String PATH = "path";
+		public static final String FILE_SYSTEM = "fileSystem";
+	}
+	
+	// Job Submission Interface Table
+	public final class JobSubmissionInterfaceConstants {
+		public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionInterfaceId";
+		public static final String COMPUTE_RESOURCE_ID = "computeResourceId";
+		public static final String JOB_SUBMISSION_PROTOCOL = "jobSubmissionProtocol";
+		public static final String PRIORITY_ORDER = "priorityOrder";
+	}
+	
+	// Data Movement Interface Table
+	public final class DataMovementInterfaceConstants {
+		public static final String COMPUTE_RESOURCE_ID = "computeResourceId";
+		public static final String DATA_MOVEMENT_PROTOCOL = "dataMovementProtocol";
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+		public static final String PRIORITY_ORDER = "priorityOrder";
+	}
+	
+	// Resource Job Manager Table
+	public final class ResourceJobManagerConstants {
+		public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+		public static final String PUSH_MONITORING_ENDPOINT = "pushMonitoringEndpoint";
+		public static final String JOB_MANAGER_BIN_PATH = "jobManagerBinPath";
+		public static final String RESOURCE_JOB_MANAGER_TYPE = "resourceJobManagerType";
+	}
+	
+	// Job Manager Command Table
+	public final class JobManagerCommandConstants {
+		public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+		public static final String COMMAND_TYPE = "commandType";
+		public static final String COMMAND = "command";
+	}
+	
+	// Gridftp Data Movement Table
+	public final class GridftpDataMovementConstants {
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+		public static final String SECURITY_PROTOCOL = "securityProtocol";
+	}
+	
+	// Gridftp Endpoint Table
+	public final class GridftpEndpointConstants {
+		public static final String ENDPOINT = "endpoint";
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+	}
+	
+	// Local Submission Table
+	public final class LocalSubmissionConstants {
+		public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+		public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionInterfaceId";
+	}
+	
+	// Local Data Movement Table
+	public final class LocalDataMovementConstants {
+		public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+	}
+	
+	// Ssh Job Submission Table
+	public final class SshJobSubmissionConstants {
+		public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+		public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionInterfaceId";
+		public static final String ALTERNATIVE_SSH_HOSTNAME = "alternativeSshHostname";
+		public static final String SECURITY_PROTOCOL = "securityProtocol";
+		public static final String SSH_PORT = "sshPort";
+	}
+
+    // Module Load Cmd Table
+    public final class ModuleLoadCmdConstants {
+        public static final String CMD = "cmd";
+        public static final String APP_DEPLOYMENT_ID = "appDeploymentId";
+    }
+
+    // Workflow Table
+    public final class WorkflowConstants {
+        public static final String WF_NAME = "wfName";
+        public static final String CREATED_USER = "createdUser";
+        public static final String GRAPH = "graph";
+        public static final String WF_TEMPLATE_ID = "wfTemplateId";
+        public static final String GATEWAY_ID = "gatewayId";
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatalogResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatalogResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatalogResource.java
new file mode 100644
index 0000000..7492d9a
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppCatalogResource.java
@@ -0,0 +1,90 @@
+/*
+*
+* 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.core.app.catalog.resources;
+
+
+import org.apache.airavata.registry.cpi.AppCatalogException;
+
+import java.util.List;
+
+public interface AppCatalogResource {
+
+    /**
+     * This method will remove the given resource from the database
+     *
+     * @param identifier identifier that can uniquely identify a single instance of the resource
+     */
+    void remove(Object identifier) throws AppCatalogException;
+
+    /**
+     * This method will return the given resource from the database
+     *
+     * @param identifier identifier that can uniquely identify a single instance of the resource
+     * @return associate resource
+     */
+    AppCatalogResource get(Object identifier) throws AppCatalogException;
+
+    /**
+     * This method will list all the resources according to the filtering criteria
+     * @param fieldName field name
+     * @param value value of the field
+     * @return list of resources
+     */
+    List<AppCatalogResource> get(String fieldName, Object value) throws AppCatalogException;
+
+    /**
+     *
+     * @return
+     * @throws AppCatalogException
+     */
+    List<AppCatalogResource> getAll() throws AppCatalogException;
+
+    /**
+     *
+     * @return
+     * @throws AppCatalogException
+     */
+    List<String> getAllIds() throws AppCatalogException;
+
+    /** This method will return list of resource ids according to given criteria
+     * @param fieldName field name
+     * @param value value of the field
+     * @return list of resource Ids
+     * @throws AppCatalogException
+     */
+    List<String> getIds(String fieldName, Object value) throws AppCatalogException;
+
+    /**
+     * This method will save the resource to the database.
+     */
+    void save() throws AppCatalogException;
+
+    /**
+     * This method will check whether an entry from the given resource and resource name
+     * exists in the database
+     *
+     * @param identifier identifier that can uniquely identify a single instance of the resource
+     * @return whether the entry exists in the database or not
+     */
+    boolean isExists(Object identifier) throws AppCatalogException;
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/ec8c6202/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppDeploymentAppCatalogResourceAppCat.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppDeploymentAppCatalogResourceAppCat.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppDeploymentAppCatalogResourceAppCat.java
new file mode 100644
index 0000000..50136de
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/app/catalog/resources/AppDeploymentAppCatalogResourceAppCat.java
@@ -0,0 +1,446 @@
+/*
+ *
+ * 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.core.app.catalog.resources;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.registry.core.app.catalog.model.ApplicationDeployment;
+import org.apache.airavata.registry.core.app.catalog.model.ApplicationModule;
+import org.apache.airavata.registry.core.app.catalog.model.ComputeResource;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogJPAUtils;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogQueryGenerator;
+import org.apache.airavata.registry.core.app.catalog.util.AppCatalogResourceType;
+import org.apache.airavata.registry.cpi.AppCatalogException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.List;
+
+public class AppDeploymentAppCatalogResourceAppCat extends AppCatAbstractResource {
+    private final static Logger logger = LoggerFactory.getLogger(AppDeploymentAppCatalogResourceAppCat.class);
+    private String deploymentId;
+    private String appModuleId;
+    private String hostId;
+    private String executablePath;
+    private String parallelism;
+    private String appDes;
+    private String gatewayId;
+    private ComputeResourceAppCatalogResourceAppCat hostResource;
+    private AppModuleAppCatalogResourceAppCat moduleResource;
+    private Timestamp createdTime;
+    private Timestamp updatedTime;
+
+    public String getGatewayId() {
+        return gatewayId;
+    }
+
+    public void setGatewayId(String gatewayId) {
+        this.gatewayId = gatewayId;
+    }
+
+    public Timestamp getCreatedTime() {
+        return createdTime;
+    }
+
+    public void setCreatedTime(Timestamp createdTime) {
+        this.createdTime = createdTime;
+    }
+
+    public Timestamp getUpdatedTime() {
+        return updatedTime;
+    }
+
+    public void setUpdatedTime(Timestamp updatedTime) {
+        this.updatedTime = updatedTime;
+    }
+
+    public String getDeploymentId() {
+        return deploymentId;
+    }
+
+    public void setDeploymentId(String deploymentId) {
+        this.deploymentId = deploymentId;
+    }
+
+    public String getAppModuleId() {
+        return appModuleId;
+    }
+
+    public void setAppModuleId(String appModuleId) {
+        this.appModuleId = appModuleId;
+    }
+
+    public String getHostId() {
+        return hostId;
+    }
+
+    public void setHostId(String hostId) {
+        this.hostId = hostId;
+    }
+
+    public String getExecutablePath() {
+        return executablePath;
+    }
+
+    public void setExecutablePath(String executablePath) {
+        this.executablePath = executablePath;
+    }
+
+    public String getAppDes() {
+        return appDes;
+    }
+
+    public void setAppDes(String appDes) {
+        this.appDes = appDes;
+    }
+
+    public ComputeResourceAppCatalogResourceAppCat getHostResource() {
+        return hostResource;
+    }
+
+    public void setHostResource(ComputeResourceAppCatalogResourceAppCat hostResource) {
+        this.hostResource = hostResource;
+    }
+
+    public AppModuleAppCatalogResourceAppCat getModuleResource() {
+        return moduleResource;
+    }
+
+    public void setModuleResource(AppModuleAppCatalogResourceAppCat moduleResource) {
+        this.moduleResource = moduleResource;
+    }
+
+    @Override
+    public void remove(Object identifier) throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
+            generator.setParameter(ApplicationDeploymentConstants.DEPLOYMENT_ID, identifier);
+            Query q = generator.deleteQuery(em);
+            q.executeUpdate();
+            em.getTransaction().commit();
+            em.close();
+        } catch (ApplicationSettingsException e) {
+            logger.error(e.getMessage(), e);
+            throw new AppCatalogException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()){
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+    }
+
+    @Override
+    public AppCatalogResource get(Object identifier) throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
+            generator.setParameter(ApplicationDeploymentConstants.DEPLOYMENT_ID, identifier);
+            Query q = generator.selectQuery(em);
+            ApplicationDeployment deployment = (ApplicationDeployment) q.getSingleResult();
+            AppDeploymentAppCatalogResourceAppCat deploymentResource =
+                    (AppDeploymentAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_DEPLOYMENT, deployment);
+            em.getTransaction().commit();
+            em.close();
+            return deploymentResource;
+        } catch (ApplicationSettingsException e) {
+            logger.error(e.getMessage(), e);
+            throw new AppCatalogException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()) {
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+    }
+
+    @Override
+    public List<AppCatalogResource> get(String fieldName, Object value) throws AppCatalogException {
+        List<AppCatalogResource> appDeployments = new ArrayList<AppCatalogResource>();
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            Query q;
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
+            List results;
+            if (fieldName.equals(ApplicationDeploymentConstants.APP_MODULE_ID)) {
+                generator.setParameter(ApplicationDeploymentConstants.APP_MODULE_ID, value);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ApplicationDeployment deployment = (ApplicationDeployment) result;
+                        AppDeploymentAppCatalogResourceAppCat deploymentResource =
+                                (AppDeploymentAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_DEPLOYMENT, deployment);
+                        appDeployments.add(deploymentResource);
+                    }
+                }
+            } else if (fieldName.equals(ApplicationDeploymentConstants.COMPUTE_HOST_ID)) {
+                generator.setParameter(ApplicationDeploymentConstants.COMPUTE_HOST_ID, value);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ApplicationDeployment deployment = (ApplicationDeployment) result;
+                        AppDeploymentAppCatalogResourceAppCat deploymentResource =
+                                (AppDeploymentAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_DEPLOYMENT, deployment);
+                        appDeployments.add(deploymentResource);
+                    }
+                }
+            }else {
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported field name for app deployment resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported field name for app deployment resource.");
+            }
+            em.getTransaction().commit();
+            em.close();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new AppCatalogException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()) {
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+        return appDeployments;
+    }
+
+    @Override
+    public List<AppCatalogResource> getAll() throws AppCatalogException {
+        List<AppCatalogResource> appDeployments = new ArrayList<AppCatalogResource>();
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
+            generator.setParameter(ApplicationDeploymentConstants.GATEWAY_ID, gatewayId);
+            Query q = generator.selectQuery(em);
+            List results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ApplicationDeployment deployment = (ApplicationDeployment) result;
+                        AppDeploymentAppCatalogResourceAppCat deploymentResource =
+                                (AppDeploymentAppCatalogResourceAppCat) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_DEPLOYMENT, deployment);
+                        appDeployments.add(deploymentResource);
+                    }
+                }
+            em.getTransaction().commit();
+            em.close();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new AppCatalogException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()) {
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+        return appDeployments;
+    }
+
+    @Override
+    public List<String> getAllIds() throws AppCatalogException {
+        List<String> appDeployments = new ArrayList<String>();
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
+            Query q = generator.selectQuery(em);
+            List results = q.getResultList();
+            if (results.size() != 0) {
+                for (Object result : results) {
+                    ApplicationDeployment deployment = (ApplicationDeployment) result;
+                    appDeployments.add(deployment.getDeploymentID());
+                }
+            }
+            em.getTransaction().commit();
+            em.close();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new AppCatalogException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()) {
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+        return appDeployments;
+    }
+
+    @Override
+    public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
+        List<String> appDeployments = new ArrayList<String>();
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            Query q;
+            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_DEPLOYMENT);
+            List results;
+            if (fieldName.equals(ApplicationDeploymentConstants.APP_MODULE_ID)) {
+                generator.setParameter(ApplicationDeploymentConstants.APP_MODULE_ID, value);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ApplicationDeployment deployment = (ApplicationDeployment) result;
+                        appDeployments.add(deployment.getDeploymentID());
+                    }
+                }
+            } else if (fieldName.equals(ApplicationDeploymentConstants.COMPUTE_HOST_ID)) {
+                generator.setParameter(ApplicationDeploymentConstants.COMPUTE_HOST_ID, value);
+                q = generator.selectQuery(em);
+                results = q.getResultList();
+                if (results.size() != 0) {
+                    for (Object result : results) {
+                        ApplicationDeployment deployment = (ApplicationDeployment) result;
+                        appDeployments.add(deployment.getDeploymentID());
+                    }
+                }
+            }else {
+                em.getTransaction().commit();
+                em.close();
+                logger.error("Unsupported field name for app deployment resource.", new IllegalArgumentException());
+                throw new IllegalArgumentException("Unsupported field name for app deployment resource.");
+            }
+            em.getTransaction().commit();
+            em.close();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new AppCatalogException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()) {
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+        return appDeployments;
+    }
+
+    @Override
+    public void save() throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            ApplicationDeployment existingDeployment = em.find(ApplicationDeployment.class, deploymentId);
+            em.close();
+
+            em = AppCatalogJPAUtils.getEntityManager();
+            em.getTransaction().begin();
+            ApplicationModule applicationModule = em.find(ApplicationModule.class, appModuleId);
+            ComputeResource computeHost = em.find(ComputeResource.class, hostId);
+            if (existingDeployment !=  null){
+                existingDeployment.setDeploymentID(deploymentId);
+                existingDeployment.setApplicationDesc(appDes);
+                existingDeployment.setAppModuleID(appModuleId);
+                existingDeployment.setApplicationModule(applicationModule);
+                existingDeployment.setComputeResource(computeHost);
+                existingDeployment.setHostID(hostId);
+                existingDeployment.setExecutablePath(executablePath);
+                existingDeployment.setParallelism(parallelism);
+                existingDeployment.setGatewayId(gatewayId);
+                existingDeployment.setUpdateTime(AiravataUtils.getCurrentTimestamp());
+                em.merge(existingDeployment);
+            }else {
+                ApplicationDeployment deployment  = new ApplicationDeployment();
+                deployment.setApplicationDesc(appDes);
+                deployment.setDeploymentID(deploymentId);
+                deployment.setAppModuleID(appModuleId);
+                deployment.setHostID(hostId);
+                deployment.setApplicationModule(applicationModule);
+                deployment.setComputeResource(computeHost);
+                deployment.setExecutablePath(executablePath);
+                deployment.setParallelism(parallelism);
+                deployment.setGatewayId(gatewayId);
+                deployment.setCreationTime(AiravataUtils.getCurrentTimestamp());
+                em.persist(deployment);
+            }
+            em.getTransaction().commit();
+            em.close();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new AppCatalogException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()){
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+
+    }
+
+    @Override
+    public boolean isExists(Object identifier) throws AppCatalogException {
+        EntityManager em = null;
+        try {
+            em = AppCatalogJPAUtils.getEntityManager();
+            ApplicationDeployment deployment = em.find(ApplicationDeployment.class, identifier);
+            em.close();
+            return deployment != null;
+        } catch (ApplicationSettingsException e) {
+            logger.error(e.getMessage(), e);
+            throw new AppCatalogException(e);
+        } finally {
+            if (em != null && em.isOpen()) {
+                if (em.getTransaction().isActive()){
+                    em.getTransaction().rollback();
+                }
+                em.close();
+            }
+        }
+    }
+
+	public String getParallelism() {
+		return parallelism;
+	}
+
+	public void setParallelism(String parallelism) {
+		this.parallelism = parallelism;
+	}
+}


Mime
View raw message