You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2014/06/28 06:57:59 UTC
[1/2] removing the app-catalog jpa module and adding resources
Repository: airavata
Updated Branches:
refs/heads/master 2e36ba4af -> 69be6c770
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHSubmission.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHSubmission.java
deleted file mode 100644
index aa68daa..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHSubmission.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GSISSH_SUBMISSION")
-public class GSISSHSubmission {
- @Column(name = "RESOURCE_ID")
- private String resourceID;
- @Id
- @Column(name = "SUBMISSION_ID")
- private String submissionID;
- @Column(name = "RESOURCE_JOB_MANAGER")
- private String resourceJobManager;
- @Column(name = "SSH_PORT")
- private int sshPort;
- @Column(name = "INSTALLED_PATH")
- private String installedPath;
- @Column(name = "MONITOR_MODE")
- private String monitorMode;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "RESOURCE_ID")
- private ComputeResource computeResource;
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getResourceJobManager() {
- return resourceJobManager;
- }
-
- public void setResourceJobManager(String resourceJobManager) {
- this.resourceJobManager = resourceJobManager;
- }
-
- public int getSshPort() {
- return sshPort;
- }
-
- public void setSshPort(int sshPort) {
- this.sshPort = sshPort;
- }
-
- public String getInstalledPath() {
- return installedPath;
- }
-
- public void setInstalledPath(String installedPath) {
- this.installedPath = installedPath;
- }
-
- public String getMonitorMode() {
- return monitorMode;
- }
-
- public void setMonitorMode(String monitorMode) {
- this.monitorMode = monitorMode;
- }
-
- public ComputeResource getComputeResource() {
- return computeResource;
- }
-
- public void setComputeResource(ComputeResource computeResource) {
- this.computeResource = computeResource;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayApplications.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayApplications.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayApplications.java
deleted file mode 100644
index 64538b7..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayApplications.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GATEWAY_PROFILE")
-@IdClass(GatewayApplicationsPK.class)
-public class GatewayApplications {
-
- @Id
- @Column(name = "GATEWAY_ID")
- private String gatewayID;
-
- @Id
- @Column(name = "APPLICATION_ID")
- private String applicationID;
-
- @Column(name = "IS_TURNED_ON")
- private boolean turnedOn;
-
- @ManyToOne(cascade = CascadeType.REMOVE)
- @JoinColumn(name = "GATEWAY_ID")
- private GatewayProfile gatewayProfile;
-
- @ManyToOne(cascade = CascadeType.REMOVE)
- @JoinColumn(name = "APPLICATION_ID")
- private Application application;
-
- public GatewayProfile getGatewayProfile() {
- return gatewayProfile;
- }
-
- public void setGatewayProfile(GatewayProfile gatewayProfile) {
- this.gatewayProfile = gatewayProfile;
- }
-
- public Application getApplication() {
- return application;
- }
-
- public void setApplication(Application application) {
- this.application = application;
- }
-
- public String getGatewayID() {
- return gatewayID;
- }
-
- public void setGatewayID(String gatewayID) {
- this.gatewayID = gatewayID;
- }
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-
- public boolean isTurnedOn() {
- return turnedOn;
- }
-
- public void setTurnedOn(boolean turnedOn) {
- this.turnedOn = turnedOn;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayApplicationsPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayApplicationsPK.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayApplicationsPK.java
deleted file mode 100644
index 2ce6eb2..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayApplicationsPK.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-public class GatewayApplicationsPK {
-
- private String gatewayID;
- private String applicationID;
-
- public GatewayApplicationsPK(String gatewayID, String applicationID) {
- this.gatewayID = gatewayID;
- this.applicationID = applicationID;
- }
-
- public GatewayApplicationsPK() {
- }
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getGatewayID() {
- return gatewayID;
- }
-
- public void setGatewayID(String gatewayID) {
- this.gatewayID = gatewayID;
- }
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayProfile.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayProfile.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayProfile.java
deleted file mode 100644
index eaad518..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GatewayProfile.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "GATEWAY_PROFILE")
-public class GatewayProfile {
-
- @Id
- @Column(name = "GATEWAY_ID")
- private String gatewayID;
- @Column(name = "GATEWAY_NAME")
- private String gatewayName;
- @Column(name = "GATEWAY_DESCRIPTION")
- private String gatewayDescription;
-
- public String getGatewayID() {
- return gatewayID;
- }
-
- public void setGatewayID(String gatewayID) {
- this.gatewayID = gatewayID;
- }
-
- public String getGatewayName() {
- return gatewayName;
- }
-
- public void setGatewayName(String gatewayName) {
- this.gatewayName = gatewayName;
- }
-
- public String getGatewayDescription() {
- return gatewayDescription;
- }
-
- public void setGatewayDescription(String gatewayDescription) {
- this.gatewayDescription = gatewayDescription;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GlobusJobSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GlobusJobSubmission.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GlobusJobSubmission.java
deleted file mode 100644
index 890d19f..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GlobusJobSubmission.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GLOBUS_SUBMISSION")
-public class GlobusJobSubmission {
- @Column(name = "RESOURCE_ID")
- private String resourceID;
- @Id
- @Column(name = "SUBMISSION_ID")
- private String submissionID;
- @Column(name = "RESOURCE_JOB_MANAGER")
- private String resourceJobManager;
- @Column(name = "SECURITY_PROTOCAL")
- private String securityProtocol;
- @Column(name = "GLOBUS_GATEKEEPER_EP")
- private String globusEP;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "RESOURCE_ID")
- private ComputeResource computeResource;
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getResourceJobManager() {
- return resourceJobManager;
- }
-
- public void setResourceJobManager(String resourceJobManager) {
- this.resourceJobManager = resourceJobManager;
- }
-
- public String getSecurityProtocol() {
- return securityProtocol;
- }
-
- public void setSecurityProtocol(String securityProtocol) {
- this.securityProtocol = securityProtocol;
- }
-
- public String getGlobusEP() {
- return globusEP;
- }
-
- public void setGlobusEP(String globusEP) {
- this.globusEP = globusEP;
- }
-
- public ComputeResource getComputeResource() {
- return computeResource;
- }
-
- public void setComputeResource(ComputeResource computeResource) {
- this.computeResource = computeResource;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/InputOutputs.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/InputOutputs.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/InputOutputs.java
deleted file mode 100644
index 8ca5450..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/InputOutputs.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "GATEWAY_PROFILE")
-public class InputOutputs {
-
- @Id
- @Column(name = "INPUT_OUTPUT_ID")
- private String inputOutputID;
-
- @Column(name = "INPUT_OUTPUT_NAME")
- private String inputOutputName;
-
- @Column(name = "INPUT_OUTPUT_TYPE")
- private String inputOutputType;
-
- @Column(name = "MAXSIZE")
- private int maxSize;
-
- @Column(name = "MINSIZE")
- private int minSize;
-
- public String getInputOutputID() {
- return inputOutputID;
- }
-
- public void setInputOutputID(String inputOutputID) {
- this.inputOutputID = inputOutputID;
- }
-
- public String getInputOutputName() {
- return inputOutputName;
- }
-
- public void setInputOutputName(String inputOutputName) {
- this.inputOutputName = inputOutputName;
- }
-
- public String getInputOutputType() {
- return inputOutputType;
- }
-
- public void setInputOutputType(String inputOutputType) {
- this.inputOutputType = inputOutputType;
- }
-
- public int getMaxSize() {
- return maxSize;
- }
-
- public void setMaxSize(int maxSize) {
- this.maxSize = maxSize;
- }
-
- public int getMinSize() {
- return minSize;
- }
-
- public void setMinSize(int minSize) {
- this.minSize = minSize;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/JobSubmissionProtocol.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/JobSubmissionProtocol.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/JobSubmissionProtocol.java
deleted file mode 100644
index 6a46f40..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/JobSubmissionProtocol.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "JOB_SUBMISSION_PROTOCOL")
-@IdClass(JobSubmissionProtocolPK.class)
-public class JobSubmissionProtocol {
- @Id
- @Column(name = "RESOURCE_ID")
- private String resourceID;
- @Id
- @Column(name = "SUBMISSION_ID")
- private String submissionID;
-
- @Id
- @Column(name = "JOB_TYPE")
- private String jobType;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "RESOURCE_ID")
- private ComputeResource computeResource;
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getJobType() {
- return jobType;
- }
-
- public void setJobType(String jobType) {
- this.jobType = jobType;
- }
-
- public ComputeResource getComputeResource() {
- return computeResource;
- }
-
- public void setComputeResource(ComputeResource computeResource) {
- this.computeResource = computeResource;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/JobSubmissionProtocolPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/JobSubmissionProtocolPK.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/JobSubmissionProtocolPK.java
deleted file mode 100644
index 5482d63..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/JobSubmissionProtocolPK.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-public class JobSubmissionProtocolPK {
- private String resourceID;
- private String submissionID;
- private String jobType;
-
- public JobSubmissionProtocolPK(String resourceID, String submissionID, String jobType) {
- this.resourceID = resourceID;
- this.submissionID = submissionID;
- this.jobType = jobType;
- }
-
- public JobSubmissionProtocolPK() {
- ;
- }
-
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getJobType() {
- return jobType;
- }
-
- public void setJobType(String jobType) {
- this.jobType = jobType;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/SCPDataMovement.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/SCPDataMovement.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/SCPDataMovement.java
deleted file mode 100644
index 42c3e03..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/SCPDataMovement.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "SCP_DATAMOVEMENT")
-public class SCPDataMovement {
- @Column(name = "RESOURCE_ID")
- private String resourceID;
- @Id
- @Column(name = "DATA_MOVE_ID")
- private String dataMoveID;
- @Column(name = "RESOURCE_JOB_MANAGER")
- private String resourceJobManager;
- @Column(name = "SSH_PORT")
- private int sshPort;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "RESOURCE_ID")
- private ComputeResource computeResource;
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getDataMoveID() {
- return dataMoveID;
- }
-
- public void setDataMoveID(String dataMoveID) {
- this.dataMoveID = dataMoveID;
- }
-
- public String getResourceJobManager() {
- return resourceJobManager;
- }
-
- public void setResourceJobManager(String resourceJobManager) {
- this.resourceJobManager = resourceJobManager;
- }
-
- public int getSshPort() {
- return sshPort;
- }
-
- public void setSshPort(int sshPort) {
- this.sshPort = sshPort;
- }
-
- public ComputeResource getComputeResource() {
- return computeResource;
- }
-
- public void setComputeResource(ComputeResource computeResource) {
- this.computeResource = computeResource;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/SSHSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/SSHSubmission.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/SSHSubmission.java
deleted file mode 100644
index 1ef2c1e..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/SSHSubmission.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "SSH_SUBMISSION")
-public class SSHSubmission {
- @Column(name = "RESOURCE_ID")
- private String resourceID;
- @Id
- @Column(name = "SUBMISSION_ID")
- private String submissionID;
- @Column(name = "RESOURCE_JOB_MANAGER")
- private String resourceJobManager;
- @Column(name = "SSH_PORT")
- private int sshPort;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "RESOURCE_ID")
- private ComputeResource computeResource;
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getResourceJobManager() {
- return resourceJobManager;
- }
-
- public void setResourceJobManager(String resourceJobManager) {
- this.resourceJobManager = resourceJobManager;
- }
-
- public int getSshPort() {
- return sshPort;
- }
-
- public void setSshPort(int sshPort) {
- this.sshPort = sshPort;
- }
-
- public ComputeResource getComputeResource() {
- return computeResource;
- }
-
- public void setComputeResource(ComputeResource computeResource) {
- this.computeResource = computeResource;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/resources/META-INF/persistence.xml b/modules/app-catalog/app-catalog-jpa/src/main/resources/META-INF/persistence.xml
deleted file mode 100644
index 7335d90..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<!--*
- *
- * 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.
- *
-* -->
-<persistence xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
- <persistence-unit name="appcatalog_data">
- <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
- <exclude-unlisted-classes>true</exclude-unlisted-classes>
- </persistence-unit>
-</persistence>
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/resources/appcatalog-mysql_new.sql
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/resources/appcatalog-mysql_new.sql b/modules/app-catalog/app-catalog-jpa/src/main/resources/appcatalog-mysql_new.sql
deleted file mode 100644
index a375bf9..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/resources/appcatalog-mysql_new.sql
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- *
- * 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.
- *
- */
-
-
-CREATE TABLE GATEWAY_PROFILE
-(
- GATEWAY_ID VARCHAR(255),
- GATEWAY_NAME VARCHAR (255),
- GATEWAY_DESCRIPTION VARCHAR (255),
- PRIMARY KEY(GATEWAY_ID)
-
-);
-
-CREATE TABLE APPLICATION
-(
- APPLICATION_ID VARCHAR(255),
- APPLICATION_NAME VARCHAR(255),
- GATEWAY_ID VARCHAR(255),
- IS_PUBLIC BOOLEAN,
- APPLICATION_DESCRIPTION VARCHAR (255),
- PRIMARY KEY(APPLICATION_ID),
- FOREIGN KEY(GATEWAY_ID) REFERENCES GATEWAY_PROFILE(GATEWAY_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE GATEWAY_APPLICATIONS
-(
- GATEWAY_ID VARCHAR (255),
- APPLICATION_ID VARCHAR (255),
- IS_TURNED_ON BOOLEAN,
- PRIMARY KEY(GATEWAY_ID,APPLICATION_ID),
- FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY_PROFILE(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (APPLICATION_ID) REFERENCES APPLICATION(APPLICATION_ID) ON DELETE CASCADE
-
-);
-
-CREATE TABLE INPUT_OUTPUTS
-(
- INPUT_OUTPUT_ID VARCHAR (255),
- INPUT_OUTPUT_NAME VARCHAR (255),
- INPUT_OUTPUT_TYPE VARCHAR (255),
- MAXSIZE INTEGER ,
- MINSIZE INTEGER ,
- PRIMARY KEY (INPUT_OUTPUT_ID)
-
-);
-
-CREATE TABLE APPLICATION_INPUT_OUTPUTS
-(
- APPLICATION_ID VARCHAR (255),
- INPUT_OUTPUT_ID VARCHAR (255),
- IS_INPUT BOOLEAN,
- PRIMARY KEY (APPLICATION_ID,INPUT_OUTPUT_ID),
- FOREIGN KEY (APPLICATION_ID) REFERENCES APPLICATION(APPLICATION_ID) ON DELETE CASCADE,
- FOREIGN KEY (INPUT_OUTPUT_ID) REFERENCES INPUT_OUTPUTS(INPUT_OUTPUT_ID) ON DELETE CASCADE
-
-);
-
-CREATE TABLE COMPUTE_RESOURCE
-(
- RESOURCE_ID VARCHAR(255),
- HOST_NAME VARCHAR(255),
- IP_ADDRESS VARCHAR(255),
- DESCRIPTION VARCHAR(255),
- PREFERRED_JOB_SUBMISSION_PROTOCOL VARCHAR(255),
- PRIMARY KEY(RESOURCE_ID)
-);
-
-
-CREATE TABLE DEPLOYMENT
-(
- DEPLOYMENT_ID VARCHAR (255),
- COMPUTE_RESOURCE_ID VARCHAR (255),
- DEPLOYMENT_HOST_NAME VARCHAR (255),
- INPUT_DIR VARCHAR (255),
- ERROR_DIR VARCHAR (255),
- OUTPUT_DIR VARCHAR (255),
- SCRATCH_DIR VARCHAR (255),
- EXECUTION_PATH VARCHAR (255),
- QUEUE_NAME VARCHAR (255),
- CPU_COUNT SMALLINT ,
- NODE_COUNT SMALLINT ,
- WALLTIME_LIMIT SMALLINT ,
- NO_OF_THREADS SMALLINT ,
- PRIMARY KEY (DEPLOYMENT_ID),
- FOREIGN KEY (COMPUTE_RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE
-
-
-);
-
-CREATE TABLE APPLICATION_DEPLOYMENT
-(
- APPLICATION_ID VARCHAR (255),
- DEPLOYMENT_ID VARCHAR (255),
- DEPLOYMENT_HOST_NAME VARCHAR (255),
- PRIMARY KEY (APPLICATION_ID,DEPLOYMENT_ID),
- FOREIGN KEY (APPLICATION_ID) REFERENCES APPLICATION(APPLICATION_ID) ON DELETE CASCADE,
- FOREIGN KEY (DEPLOYMENT_ID) REFERENCES DEPLOYMENT(DEPLOYMENT_ID) ON DELETE CASCADE
-
-);
-
-CREATE TABLE JOB_SUBMISSION_PROTOCOL
-(
- RESOURCE_ID VARCHAR(255),
- SUBMISSION_ID VARCHAR(255),
- JOB_TYPE VARCHAR(255),
- PRIMARY KEY(RESOURCE_ID,SUBMISSION_ID,JOB_TYPE),
- FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE DATA_MOVEMENT_PROTOCOL
-(
- RESOURCE_ID VARCHAR(255),
- DATA_MOVE_ID VARCHAR(255),
- JOB_TYPE VARCHAR(255),
- PRIMARY KEY(RESOURCE_ID,DATA_MOVE_ID,JOB_TYPE),
- FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE GSISSH_SUBMISSION
-(
- SUBMISSION_ID VARCHAR(255),
- RESOURCE_ID VARCHAR(255),
- RESOURCE_JOB_MANAGER VARCHAR(255),
- SSH_PORT INTEGER,
- INSTALLED_PATH VARCHAR(255),
- MONITOR_MODE VARCHAR(255),
- PRIMARY KEY(SUBMISSION_ID),
- FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE GSISSH_EXPORT
-(
- SUBMISSION_ID VARCHAR(255),
- EXPORT VARCHAR(255),
- PRIMARY KEY(SUBMISSION_ID, EXPORT),
- FOREIGN KEY (SUBMISSION_ID) REFERENCES GSISSH_SUBMISSION(SUBMISSION_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE GSISSH_PREJOBCOMMAND
-(
- SUBMISSION_ID VARCHAR(255),
- COMMAND VARCHAR(255),
- PRIMARY KEY(SUBMISSION_ID, COMMAND),
- FOREIGN KEY (SUBMISSION_ID) REFERENCES GSISSH_SUBMISSION(SUBMISSION_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE GSISSH_POSTJOBCOMMAND
-(
- SUBMISSION_ID VARCHAR(255),
- COMMAND VARCHAR(255),
- PRIMARY KEY(SUBMISSION_ID, COMMAND),
- FOREIGN KEY (SUBMISSION_ID) REFERENCES GSISSH_SUBMISSION(SUBMISSION_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE GLOBUS_SUBMISSION
-(
- SUBMISSION_ID VARCHAR(255),
- RESOURCE_ID VARCHAR(255),
- RESOURCE_JOB_MANAGER VARCHAR(255),
- SECURITY_PROTOCAL VARCHAR(255),
- GLOBUS_GATEKEEPER_EP VARCHAR(255),
- PRIMARY KEY(SUBMISSION_ID),
- FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE SSH_SUBMISSION
-(
- SUBMISSION_ID VARCHAR(255),
- RESOURCE_ID VARCHAR(255),
- RESOURCE_JOB_MANAGER VARCHAR(255),
- SSH_PORT INTEGER,
- PRIMARY KEY(SUBMISSION_ID),
- FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE SCP_DATAMOVEMENT
-(
- DATA_MOVE_ID VARCHAR(255),
- RESOURCE_ID VARCHAR(255),
- RESOURCE_JOB_MANAGER VARCHAR(255),
- SSH_PORT INTEGER,
- PRIMARY KEY(DATA_MOVE_ID),
- FOREIGN KEY (RESOURCE_ID) REFERENCES COMPUTE_RESOURCE(RESOURCE_ID) ON DELETE CASCADE
-);
-
[2/2] git commit: removing the app-catalog jpa module and adding
resources
Posted by sa...@apache.org.
removing the app-catalog jpa module and adding resources
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/69be6c77
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/69be6c77
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/69be6c77
Branch: refs/heads/master
Commit: 69be6c770cc49f7612ccb5b635eaf6f268d8c8a9
Parents: 2e36ba4
Author: Sachith Withana <sa...@apache.org>
Authored: Sat Jun 28 10:29:56 2014 +0530
Committer: Sachith Withana <sa...@apache.org>
Committed: Sat Jun 28 10:29:56 2014 +0530
----------------------------------------------------------------------
.../resources/DataMovementProtocolResource.java | 4 +
.../data/resources/HostAliasResource.java | 104 +++++-
.../data/resources/HostIPAddressResource.java | 301 +++++++++++++++++
.../JobSubmissionProtocolResource.java | 332 +++++++++++++++++++
modules/app-catalog/app-catalog-jpa/pom.xml | 131 --------
.../appcatalog/jpa/model/Application.java | 77 -----
.../jpa/model/ApplicationDeployment.java | 69 ----
.../jpa/model/ApplicationDeploymentPK.java | 40 ---
.../jpa/model/ApplicationInputOutputs.java | 68 ----
.../jpa/model/ApplicationInputOutputsPK.java | 39 ---
.../appcatalog/jpa/model/ComputeResource.java | 68 ----
.../jpa/model/DataMovementProtocol.java | 75 -----
.../jpa/model/DataMovementProtocolPK.java | 72 ----
.../appcatalog/jpa/model/Deployment.java | 152 ---------
.../appcatalog/jpa/model/GSISSHExport.java | 64 ----
.../appcatalog/jpa/model/GSISSHExportPK.java | 62 ----
.../jpa/model/GSISSHPostJobCommand.java | 66 ----
.../jpa/model/GSISSHPostJobCommandPK.java | 62 ----
.../jpa/model/GSISSHPreJobCommand.java | 64 ----
.../jpa/model/GSISSHPreJobCommandPK.java | 62 ----
.../appcatalog/jpa/model/GSISSHSubmission.java | 102 ------
.../jpa/model/GatewayApplications.java | 68 ----
.../jpa/model/GatewayApplicationsPK.java | 40 ---
.../appcatalog/jpa/model/GatewayProfile.java | 43 ---
.../jpa/model/GlobusJobSubmission.java | 92 -----
.../appcatalog/jpa/model/InputOutputs.java | 67 ----
.../jpa/model/JobSubmissionProtocol.java | 76 -----
.../jpa/model/JobSubmissionProtocolPK.java | 72 ----
.../appcatalog/jpa/model/SCPDataMovement.java | 82 -----
.../appcatalog/jpa/model/SSHSubmission.java | 82 -----
.../src/main/resources/META-INF/persistence.xml | 28 --
.../src/main/resources/appcatalog-mysql_new.sql | 203 ------------
32 files changed, 736 insertions(+), 2131 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java
new file mode 100644
index 0000000..6c42d49
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/DataMovementProtocolResource.java
@@ -0,0 +1,4 @@
+package org.apache.aiaravata.application.catalog.data.resources;
+
+public class DataMovementProtocolResource {
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostAliasResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostAliasResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostAliasResource.java
index 083c6b1..54cd61a 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostAliasResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostAliasResource.java
@@ -7,29 +7,93 @@ import org.apache.aiaravata.application.catalog.data.model.HostAliasPK;
import org.apache.aiaravata.application.catalog.data.util.AppCatalogJPAUtils;
import org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator;
import org.apache.aiaravata.application.catalog.data.util.AppCatalogResourceType;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.persistence.EntityManager;
import javax.persistence.Query;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
public class HostAliasResource extends AbstractResource {
+
private final static Logger logger = LoggerFactory.getLogger(HostAliasResource.class);
+
private String resourceID;
private String alias;
private ComputeHostResource computeHostResource;
public void remove(Object identifier) throws AppCatalogException {
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(HOST_ALIAS);
+ generator.setParameter(HostAliasConstants.RESOURCE_ID, ids.get(HostAliasConstants.RESOURCE_ID));
+ generator.setParameter(HostAliasConstants.ALIAS, ids.get(HostAliasConstants.ALIAS));
+ 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();
+ }
+ }
}
public Resource get(Object identifier) throws AppCatalogException {
- return null;
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(HOST_ALIAS);
+ generator.setParameter(HostAliasConstants.RESOURCE_ID, ids.get(HostAliasConstants.RESOURCE_ID));
+ generator.setParameter(HostAliasConstants.ALIAS, ids.get(HostAliasConstants.ALIAS));
+ Query q = generator.selectQuery(em);
+ HostAlias hostAlias = (HostAlias) q.getSingleResult();
+ HostAliasResource hostAliasResource =
+ (HostAliasResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.HOST_ALIAS, hostAlias);
+ em.getTransaction().commit();
+ em.close();
+ return hostAliasResource;
+ } 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 List<Resource> get(String fieldName, Object value) throws AppCatalogException {
+
List<Resource> hostAliasResources = new ArrayList<Resource>();
EntityManager em = null;
try {
@@ -150,6 +214,7 @@ public class HostAliasResource extends AbstractResource {
ComputeResource computeResource = em.find(ComputeResource.class, computeHostResource.getResoureId());
existingHostAlias.setComputeResource(computeResource);
existingHostAlias.setResourceID(resourceID);
+
em.merge(existingHostAlias);
}else {
HostAlias hostAlias = new HostAlias();
@@ -157,7 +222,8 @@ public class HostAliasResource extends AbstractResource {
hostAlias.setResourceID(resourceID);
ComputeResource computeResource = em.find(ComputeResource.class, computeHostResource.getResoureId());
hostAlias.setComputeResource(computeResource);
- em.persist(computeResource);
+
+ em.persist(hostAlias);
}
em.getTransaction().commit();
em.close();
@@ -175,7 +241,35 @@ public class HostAliasResource extends AbstractResource {
}
public boolean isExists(Object identifier) throws AppCatalogException {
- return false;
+
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ HostAlias hostAlias = em.find(HostAlias.class, new HostAliasPK(ids.get(HostAliasConstants.RESOURCE_ID),
+ ids.get(HostAliasConstants.ALIAS)));
+
+ em.close();
+ return hostAlias != 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 getResourceID() {
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostIPAddressResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostIPAddressResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostIPAddressResource.java
new file mode 100644
index 0000000..5ad6562
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/HostIPAddressResource.java
@@ -0,0 +1,301 @@
+package org.apache.aiaravata.application.catalog.data.resources;
+
+import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.apache.aiaravata.application.catalog.data.model.ComputeResource;
+import org.apache.aiaravata.application.catalog.data.model.HostIPAddress;
+import org.apache.aiaravata.application.catalog.data.model.HostIPAddressPK;
+import org.apache.aiaravata.application.catalog.data.util.AppCatalogJPAUtils;
+import org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator;
+import org.apache.aiaravata.application.catalog.data.util.AppCatalogResourceType;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class HostIPAddressResource extends AbstractResource{
+
+ private final static Logger logger = LoggerFactory.getLogger(HostIPAddressResource.class);
+
+ private String resourceID;
+ private String ipaddress;
+ private ComputeHostResource computeHostResource;
+
+ public void remove(Object identifier) throws AppCatalogException {
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(HOST_IPADDRESS);
+ generator.setParameter(HostIPAddressConstants.RESOURCE_ID, ids.get(HostIPAddressConstants.RESOURCE_ID));
+ generator.setParameter(HostIPAddressConstants.IP_ADDRESS, ids.get(HostIPAddressConstants.IP_ADDRESS));
+ 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();
+ }
+ }
+
+ }
+
+ public Resource get(Object identifier) throws AppCatalogException {
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(HOST_IPADDRESS);
+ generator.setParameter(HostIPAddressConstants.RESOURCE_ID, ids.get(HostIPAddressConstants.RESOURCE_ID));
+ generator.setParameter(HostIPAddressConstants.IP_ADDRESS, ids.get(HostIPAddressConstants.IP_ADDRESS));
+ Query q = generator.selectQuery(em);
+ HostIPAddress hostIPAddress = (HostIPAddress) q.getSingleResult();
+ HostIPAddressResource hostIPAddressResource =
+ (HostIPAddressResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.HOST_IPADDRESS, hostIPAddress);
+ em.getTransaction().commit();
+ em.close();
+ return hostIPAddressResource;
+ } 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 List<Resource> get(String fieldName, Object value) throws AppCatalogException {
+
+ List<Resource> hostIPAddressResources = new ArrayList<Resource>();
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ Query q;
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(HOST_IPADDRESS);
+ List results;
+ if (fieldName.equals(HostIPAddressConstants.IP_ADDRESS)) {
+ generator.setParameter(HostIPAddressConstants.IP_ADDRESS, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ HostIPAddress hostIPAddress = (HostIPAddress) result;
+ HostIPAddressResource hostIPAddressResource =
+ (HostIPAddressResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.HOST_IPADDRESS, hostIPAddress);
+ hostIPAddressResources.add(hostIPAddressResource);
+ }
+ }
+ } else if (fieldName.equals(HostIPAddressConstants.RESOURCE_ID)) {
+ generator.setParameter(HostIPAddressConstants.RESOURCE_ID, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ HostIPAddress hostIPAddress = (HostIPAddress) result;
+ HostIPAddressResource hostIPAddressResource =
+ (HostIPAddressResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.HOST_IPADDRESS, hostIPAddress);
+ hostIPAddressResources.add(hostIPAddressResource);
+ }
+ }
+ } else {
+ em.getTransaction().commit();
+ em.close();
+ logger.error("Unsupported field name for Host IPAddress Resource.", new IllegalArgumentException());
+ throw new IllegalArgumentException("Unsupported field name for Host IPAddress 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 hostIPAddressResources;
+ }
+
+ public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
+
+ List<String> hostIPAddressResourceIDs = new ArrayList<String>();
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ Query q;
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(HOST_IPADDRESS);
+ List results;
+ if (fieldName.equals(HostIPAddressConstants.IP_ADDRESS)) {
+ generator.setParameter(HostIPAddressConstants.IP_ADDRESS, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ HostIPAddress hostIPAddress = (HostIPAddress) result;
+ hostIPAddressResourceIDs.add(hostIPAddress.getResourceID());
+ }
+ }
+ } else if (fieldName.equals(HostIPAddressConstants.RESOURCE_ID)) {
+ generator.setParameter(HostIPAddressConstants.RESOURCE_ID, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ HostIPAddress hostIPAddress = (HostIPAddress) result;
+ hostIPAddressResourceIDs.add(hostIPAddress.getResourceID());
+ }
+ }
+ } else {
+ em.getTransaction().commit();
+ em.close();
+ logger.error("Unsupported field name for Host IP Address resource.", new IllegalArgumentException());
+ throw new IllegalArgumentException("Unsupported field name for Host IPAddress 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 hostIPAddressResourceIDs;
+ }
+
+ public void save() throws AppCatalogException {
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ HostIPAddress existingHostIP = em.find(HostIPAddress.class, new HostIPAddressPK(resourceID,ipaddress));
+ em.close();
+
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ if (existingHostIP != null){
+ existingHostIP.setIpaddress(ipaddress);
+ ComputeResource computeResource = em.find(ComputeResource.class, computeHostResource.getResoureId());
+ existingHostIP.setComputeResource(computeResource);
+ existingHostIP.setResourceID(resourceID);
+
+ em.merge(existingHostIP);
+ }else {
+ HostIPAddress hostIPAddress = new HostIPAddress();
+ hostIPAddress.setIpaddress(ipaddress);
+ hostIPAddress.setResourceID(resourceID);
+ ComputeResource computeResource = em.find(ComputeResource.class, computeHostResource.getResoureId());
+ hostIPAddress.setComputeResource(computeResource);
+
+ em.persist(hostIPAddress);
+ }
+ 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();
+ }
+ }
+
+ }
+
+ public boolean isExists(Object identifier) throws AppCatalogException {
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ HostIPAddress hostIPAddress = em.find(HostIPAddress.class, new HostIPAddressPK(ids.get(HostIPAddressConstants.RESOURCE_ID),
+ ids.get(HostIPAddressConstants.IP_ADDRESS)));
+
+ em.close();
+ return hostIPAddress != 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 getResourceID() {
+ return resourceID;
+ }
+
+ public void setResourceID(String resourceID) {
+ this.resourceID = resourceID;
+ }
+
+ public String getIpaddress() {
+ return ipaddress;
+ }
+
+ public void setIpaddress(String ipaddress) {
+ this.ipaddress = ipaddress;
+ }
+
+ public ComputeHostResource getComputeHostResource() {
+ return computeHostResource;
+ }
+
+ public void setComputeHostResource(ComputeHostResource computeHostResource) {
+ this.computeHostResource = computeHostResource;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java
new file mode 100644
index 0000000..a9e2517
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/JobSubmissionProtocolResource.java
@@ -0,0 +1,332 @@
+package org.apache.aiaravata.application.catalog.data.resources;
+
+import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.apache.aiaravata.application.catalog.data.model.ComputeResource;
+import org.apache.aiaravata.application.catalog.data.model.JobSubmissionProtocol;
+import org.apache.aiaravata.application.catalog.data.model.JobSubmissionProtocolPK;
+import org.apache.aiaravata.application.catalog.data.util.AppCatalogJPAUtils;
+import org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator;
+import org.apache.aiaravata.application.catalog.data.util.AppCatalogResourceType;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class JobSubmissionProtocolResource extends AbstractResource {
+
+ private final static Logger logger = LoggerFactory.getLogger(JobSubmissionProtocolResource.class);
+
+ private String resourceID;
+ private String submissionID;
+ private String jobType;
+ private ComputeHostResource computeHostResource;
+
+ public void remove(Object identifier) throws AppCatalogException {
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
+ generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, ids.get(JobSubmissionProtocolConstants.RESOURCE_ID));
+ generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID));
+ generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, ids.get(JobSubmissionProtocolConstants.JOB_TYPE));
+ 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();
+ }
+ }
+ }
+
+ public Resource get(Object identifier) throws AppCatalogException {
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
+ generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, ids.get(JobSubmissionProtocolConstants.RESOURCE_ID));
+ generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID));
+ generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, ids.get(JobSubmissionProtocolConstants.JOB_TYPE));
+ Query q = generator.selectQuery(em);
+ JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) q.getSingleResult();
+ JobSubmissionProtocolResource jobSubmissionProtocolResource =
+ (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
+ em.getTransaction().commit();
+ em.close();
+ return jobSubmissionProtocolResource;
+ } 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 List<Resource> get(String fieldName, Object value) throws AppCatalogException {
+ List<Resource> jobSubmissionProtocolResourceList = new ArrayList<Resource>();
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ Query q;
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
+ List results;
+ if (fieldName.equals(JobSubmissionProtocolConstants.SUBMISSION_ID)) {
+ generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+ JobSubmissionProtocolResource jobSubmissionProtocolResource =
+ (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
+ jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
+ }
+ }
+ }else if (fieldName.equals(JobSubmissionProtocolConstants.JOB_TYPE)) {
+ generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+ JobSubmissionProtocolResource jobSubmissionProtocolResource =
+ (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
+ jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
+ }
+ }
+ }else if (fieldName.equals(HostIPAddressConstants.RESOURCE_ID)) {
+ generator.setParameter(HostIPAddressConstants.RESOURCE_ID, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+ JobSubmissionProtocolResource jobSubmissionProtocolResource =
+ (JobSubmissionProtocolResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_PROTOCOL, jobSubmissionProtocol);
+ jobSubmissionProtocolResourceList.add(jobSubmissionProtocolResource);
+ }
+ }
+ } else {
+ em.getTransaction().commit();
+ em.close();
+ logger.error("Unsupported field name for Job Submission Protocol Resource.", new IllegalArgumentException());
+ throw new IllegalArgumentException("Unsupported field name for Job Submission Protocol 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 jobSubmissionProtocolResourceList;
+ }
+
+ public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
+ List<String> jobSubmissionProtocolIDs = new ArrayList<String>();
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ Query q;
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_PROTOCOL);
+ List results;
+ if (fieldName.equals(JobSubmissionProtocolConstants.SUBMISSION_ID)) {
+ generator.setParameter(JobSubmissionProtocolConstants.SUBMISSION_ID, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+ jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getResourceID());
+ }
+ }
+ } else if (fieldName.equals(JobSubmissionProtocolConstants.RESOURCE_ID)) {
+ generator.setParameter(JobSubmissionProtocolConstants.RESOURCE_ID, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+ jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getResourceID());
+ }
+ }
+ }else if (fieldName.equals(JobSubmissionProtocolConstants.JOB_TYPE)) {
+ generator.setParameter(JobSubmissionProtocolConstants.JOB_TYPE, value);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ JobSubmissionProtocol jobSubmissionProtocol = (JobSubmissionProtocol) result;
+ jobSubmissionProtocolIDs.add(jobSubmissionProtocol.getResourceID());
+ }
+ }
+ } else {
+ em.getTransaction().commit();
+ em.close();
+ logger.error("Unsupported field name for Job Submission Protocol resource.", new IllegalArgumentException());
+ throw new IllegalArgumentException("Unsupported field name for Job Submission Protocol 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 jobSubmissionProtocolIDs; }
+
+ public void save() throws AppCatalogException {
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ JobSubmissionProtocol existingJobSubProtocol = em.find(JobSubmissionProtocol.class, new JobSubmissionProtocolPK(resourceID,submissionID,jobType));
+ em.close();
+
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ if (existingJobSubProtocol != null){
+ existingJobSubProtocol.setJobType(jobType);
+ existingJobSubProtocol.setSubmissionID(submissionID);
+ ComputeResource computeResource = em.find(ComputeResource.class, computeHostResource.getResoureId());
+ existingJobSubProtocol.setComputeResource(computeResource);
+ existingJobSubProtocol.setResourceID(resourceID);
+
+ em.merge(existingJobSubProtocol);
+ }else {
+ JobSubmissionProtocol jobSubmissionProtocol = new JobSubmissionProtocol();
+ jobSubmissionProtocol.setJobType(jobType);
+ jobSubmissionProtocol.setSubmissionID(submissionID);
+ jobSubmissionProtocol.setResourceID(resourceID);
+ ComputeResource computeResource = em.find(ComputeResource.class, computeHostResource.getResoureId());
+ jobSubmissionProtocol.setComputeResource(computeResource);
+
+ em.persist(jobSubmissionProtocol);
+ }
+ 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();
+ }
+ }
+
+ }
+
+ public boolean isExists(Object identifier) throws AppCatalogException {
+ HashMap<String, String> ids;
+ if (identifier instanceof Map){
+ ids = (HashMap)identifier;
+ }else {
+ logger.error("Identifier should be a map with the field name and it's value");
+ throw new AppCatalogException("Identifier should be a map with the field name and it's value");
+ }
+
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ JobSubmissionProtocol jobSubmissionProtocol = em.find(JobSubmissionProtocol.class, new JobSubmissionProtocolPK(ids.get(JobSubmissionProtocolConstants.RESOURCE_ID),
+ ids.get(JobSubmissionProtocolConstants.SUBMISSION_ID),ids.get(JobSubmissionProtocolConstants.JOB_TYPE)));
+
+ em.close();
+ return jobSubmissionProtocol != 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 getResourceID() {
+ return resourceID;
+ }
+
+ public void setResourceID(String resourceID) {
+ this.resourceID = resourceID;
+ }
+
+ public String getSubmissionID() {
+ return submissionID;
+ }
+
+ public void setSubmissionID(String submissionID) {
+ this.submissionID = submissionID;
+ }
+
+ public String getJobType() {
+ return jobType;
+ }
+
+ public void setJobType(String jobType) {
+ this.jobType = jobType;
+ }
+
+ public ComputeHostResource getComputeHostResource() {
+ return computeHostResource;
+ }
+
+ public void setComputeHostResource(ComputeHostResource computeHostResource) {
+ this.computeHostResource = computeHostResource;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/pom.xml
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/pom.xml b/modules/app-catalog/app-catalog-jpa/pom.xml
deleted file mode 100644
index 439030e..0000000
--- a/modules/app-catalog/app-catalog-jpa/pom.xml
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--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. -->
-
-<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/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.apache.airavata</groupId>
- <artifactId>app-catalog</artifactId>
- <version>0.13-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>app-catalog-jpa</artifactId>
- <packaging>jar</packaging>
- <name>Airavata Application Catalog JPA</name>
- <url>http://airavata.apache.org/</url>
-
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-data-models</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.airavata</groupId>
- <artifactId>airavata-common-utils</artifactId>
- <version>${project.version}</version>
- </dependency>
- <!-- Test -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.openjpa</groupId>
- <artifactId>openjpa-all</artifactId>
- <version>2.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derby</artifactId>
- <version>${derby.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derbyclient</artifactId>
- <version>${derby.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derbynet</artifactId>
- <version>${derby.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.derby</groupId>
- <artifactId>derbytools</artifactId>
- <version>${derby.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${antrun.version}</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
- <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="maven.compile.classpath" />
- <openjpac>
- <classpath refid="maven.compile.classpath" />
- </openjpac>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <inherited>true</inherited>
- <configuration>
- <failIfNoTests>false</failIfNoTests>
- <skipTests>${skipTests}</skipTests>
- <workingDirectory>${project.build.testOutputDirectory}</workingDirectory>
- <!-- making sure that the sure-fire plugin doesn't run the integration tests-->
- <!-- Integration tests are run using the fail-safe plugin in the module pom-->
- <excludes>
- <exclude>**/TaskDetailResourceTest.java</exclude>
- <exclude>**/WorkflowNodeDetailResourceTest.java</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/Application.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/Application.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/Application.java
deleted file mode 100644
index 8c64d0c..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/Application.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GATEWAY_PROFILE")
-public class Application {
-
- @Id
- @Column(name = "APPLICATION_ID")
- private String applicationID;
- @Column(name = "APPLICATION_NAME")
- private String applicationName;
-
- // the gateway that owns the application
- @Column(name = "GATEWAY_ID")
- private String gatewayID;
-
- //whether the appliation is publicly available or not
- @Column(name = "IS_PUBLIC")
- private boolean published;
- @Column(name = "APPLICATION_DESCRIPTION")
- private String applicationDescription;
-
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "GATEWAY_ID")
- private GatewayProfile gatewayProfile;
-
- public GatewayProfile getGatewayProfile() {
- return gatewayProfile;
- }
-
- public void setGatewayProfile(GatewayProfile gatewayProfile) {
- this.gatewayProfile = gatewayProfile;
- }
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-
- public String getApplicationName() {
- return applicationName;
- }
-
- public void setApplicationName(String applicationName) {
- this.applicationName = applicationName;
- }
-
- public String getGatewayID() {
- return gatewayID;
- }
-
- public void setGatewayID(String gatewayID) {
- this.gatewayID = gatewayID;
- }
-
- public boolean isPublished() {
- return published;
- }
-
- public void setPublished(boolean published) {
- this.published = published;
- }
-
- public String getApplicationDescription() {
- return applicationDescription;
- }
-
- public void setApplicationDescription(String applicationDescription) {
- this.applicationDescription = applicationDescription;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationDeployment.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationDeployment.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationDeployment.java
deleted file mode 100644
index bf60615..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationDeployment.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GATEWAY_PROFILE")
-@IdClass(ApplicationDeploymentPK.class)
-public class ApplicationDeployment {
-
- @Id
- @Column(name = "DEPLOYMENT_ID")
- private String deploymentID;
-
- @Id
- @Column(name = "APPLICATION_ID")
- private String applicationID;
-
- @Column(name = "DEPLOYMENT_HOST_NAME")
- private String deploymentHostName;
-
-
- @ManyToOne(cascade = CascadeType.REMOVE)
- @JoinColumn(name = "DEPLOYMENT_ID")
- private Deployment deployment;
-
- @ManyToOne(cascade = CascadeType.REMOVE)
- @JoinColumn(name = "APPLICATION_ID")
- private Application application;
-
- public String getDeploymentID() {
- return deploymentID;
- }
-
- public void setDeploymentID(String deploymentID) {
- this.deploymentID = deploymentID;
- }
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-
- public String getDeploymentHostName() {
- return deploymentHostName;
- }
-
- public void setDeploymentHostName(String deploymentHostName) {
- this.deploymentHostName = deploymentHostName;
- }
-
- public Deployment getDeployment() {
- return deployment;
- }
-
- public void setDeployment(Deployment deployment) {
- this.deployment = deployment;
- }
-
- public Application getApplication() {
- return application;
- }
-
- public void setApplication(Application application) {
- this.application = application;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationDeploymentPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationDeploymentPK.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationDeploymentPK.java
deleted file mode 100644
index a5695aa..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationDeploymentPK.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-public class ApplicationDeploymentPK {
- private String deploymentID;
- private String applicationID;
-
- public ApplicationDeploymentPK(String deploymentID, String applicationID) {
- this.deploymentID = deploymentID;
- this.applicationID = applicationID;
- }
-
- public ApplicationDeploymentPK() {
- }
-
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getDeploymentID() {
- return deploymentID;
- }
-
- public void setDeploymentID(String deploymentID) {
- this.deploymentID = deploymentID;
- }
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationInputOutputs.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationInputOutputs.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationInputOutputs.java
deleted file mode 100644
index 2d3fed1..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationInputOutputs.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "APPLICATION_INPUT_OUTPUTS")
-@IdClass(ApplicationInputOutputsPK.class)
-public class ApplicationInputOutputs {
-
- @Id
- @Column(name = "APPLICATION_ID")
- private String applicationID;
-
- @Id
- @Column(name = "INPUT_OUTPUT_ID")
- private String inputOutputID;
-
- @Column(name = "IS_INPUT")
- private boolean input;
-
- @OneToOne(cascade = CascadeType.REMOVE)
- @JoinColumn(name = "INPUT_OUTPUT_ID")
- private InputOutputs inputOutputs;
-
- @ManyToOne(cascade = CascadeType.REMOVE)
- @JoinColumn(name = "APPLICATION_ID")
- private Application application;
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-
- public String getInputOutputID() {
- return inputOutputID;
- }
-
- public void setInputOutputID(String inputOutputID) {
- this.inputOutputID = inputOutputID;
- }
-
- public boolean isInput() {
- return input;
- }
-
- public void setInput(boolean input) {
- this.input = input;
- }
-
- public InputOutputs getInputOutputs() {
- return inputOutputs;
- }
-
- public void setInputOutputs(InputOutputs inputOutputs) {
- this.inputOutputs = inputOutputs;
- }
-
- public Application getApplication() {
- return application;
- }
-
- public void setApplication(Application application) {
- this.application = application;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationInputOutputsPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationInputOutputsPK.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationInputOutputsPK.java
deleted file mode 100644
index 715b5be..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ApplicationInputOutputsPK.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-public class ApplicationInputOutputsPK {
- private String applicationID;
- private String inputOutputID;
-
- public ApplicationInputOutputsPK(String applicationID, String inputOutputID) {
- this.applicationID = applicationID;
- this.inputOutputID = inputOutputID;
- }
-
- public ApplicationInputOutputsPK() {
- }
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-
- public String getInputOutputID() {
- return inputOutputID;
- }
-
- public void setInputOutputID(String inputOutputID) {
- this.inputOutputID = inputOutputID;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ComputeResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ComputeResource.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ComputeResource.java
deleted file mode 100644
index b9cc227..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/ComputeResource.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name = "COMPUTE_RESOURCE")
-public class ComputeResource {
-
-
- @Id
- @Column(name = "RESOURCE_ID")
- private String applicationID;
-
- @Column(name = "HOST_NAME")
- private String hostname;
-
- @Column(name = "IP_ADDRESS")
- private String ipAddress;
-
- @Column(name = "DESCRIPTION")
- private String description;
-
- @Column(name = "PREFERRED_JOB_SUBMISSION_PROTOCOL ")
- private String preferredJobSubmissionProtocol;
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-
- public String getHostname() {
- return hostname;
- }
-
- public void setHostname(String hostname) {
- this.hostname = hostname;
- }
-
- public String getIpAddress() {
- return ipAddress;
- }
-
- public void setIpAddress(String ipAddress) {
- this.ipAddress = ipAddress;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getPreferredJobSubmissionProtocol() {
- return preferredJobSubmissionProtocol;
- }
-
- public void setPreferredJobSubmissionProtocol(String preferredJobSubmissionProtocol) {
- this.preferredJobSubmissionProtocol = preferredJobSubmissionProtocol;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/DataMovementProtocol.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/DataMovementProtocol.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/DataMovementProtocol.java
deleted file mode 100644
index 4b7d64e..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/DataMovementProtocol.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "DATA_MOVEMENT_PROTOCOL")
-@IdClass(DataMovementProtocolPK.class)
-public class DataMovementProtocol {
- @Id
- @Column(name = "RESOURCE_ID")
- private String resourceID;
- @Id
- @Column(name = "DATA_MOVE_ID")
- private String dataMoveID;
- @Id
- @Column(name = "JOB_TYPE")
- private String jobType;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "RESOURCE_ID")
- private ComputeResource computeResource;
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getDataMoveID() {
- return dataMoveID;
- }
-
- public void setDataMoveID(String dataMoveID) {
- this.dataMoveID = dataMoveID;
- }
-
- public String getJobType() {
- return jobType;
- }
-
- public void setJobType(String jobType) {
- this.jobType = jobType;
- }
-
- public ComputeResource getComputeResource() {
- return computeResource;
- }
-
- public void setComputeResource(ComputeResource computeResource) {
- this.computeResource = computeResource;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/DataMovementProtocolPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/DataMovementProtocolPK.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/DataMovementProtocolPK.java
deleted file mode 100644
index 6367132..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/DataMovementProtocolPK.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-public class DataMovementProtocolPK {
- private String resourceID;
- private String dataMoveID;
- private String jobType;
-
- public DataMovementProtocolPK(String resourceID, String dataMoveID, String jobType) {
- this.resourceID = resourceID;
- this.dataMoveID = dataMoveID;
- this.jobType = jobType;
- }
-
- public DataMovementProtocolPK() {
- ;
- }
-
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getDataMoveID() {
- return dataMoveID;
- }
-
- public void setDataMoveID(String dataMoveID) {
- this.dataMoveID = dataMoveID;
- }
-
- public String getJobType() {
- return jobType;
- }
-
- public void setJobType(String jobType) {
- this.jobType = jobType;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/Deployment.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/Deployment.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/Deployment.java
deleted file mode 100644
index afc1280..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/Deployment.java
+++ /dev/null
@@ -1,152 +0,0 @@
-package org.apache.airavata.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "DEPLOYMENT")
-public class Deployment {
- @Id
- @Column(name = "DEPLOYMENT_ID")
- private String applicationID;
-
- @Column(name = "COMPUTE_RESOURCE_ID")
- private String computeResourceID;
-
- @Column(name = "DEPLOYMENT_HOST_NAME")
- private String deploymentHostName;
-
- @Column(name = "INPUT_DIR")
- private String inputDir;
-
- @Column(name = "OUTPUT_DIR")
- private String outputDir;
-
- @Column(name = "SCRATCH_DIR")
- private String scratchDir;
-
- @Column(name = "EXECUTION_PATH")
- private String executionPath;
-
- @Column(name = "QUEUE_NAME")
- private String queueName;
-
- @Column(name = "CPU_COUNT")
- private int cpuCount;
-
- @Column(name = "NODE_COUNT")
- private int nodeCount;
-
- @Column(name = "WALLTIME_LIMIT")
- private int walltime;
-
- @Column(name = "NO_OF_THREADS")
- private int numberOfThreads;
-
- @ManyToOne(cascade = CascadeType.REMOVE)
- @JoinColumn(name = "COMPUTE_RESOURCE_ID")
- private ComputeResource computeResource;
-
- public String getQueueName() {
- return queueName;
- }
-
- public void setQueueName(String queueName) {
- this.queueName = queueName;
- }
-
- public void setCpuCount(int cpuCount) {
- this.cpuCount = cpuCount;
- }
-
- public void setNodeCount(int nodeCount) {
- this.nodeCount = nodeCount;
- }
-
- public void setWalltime(int walltime) {
- this.walltime = walltime;
- }
-
- public int getNumberOfThreads() {
- return numberOfThreads;
- }
-
- public void setNumberOfThreads(int numberOfThreads) {
- this.numberOfThreads = numberOfThreads;
- }
-
- public ComputeResource getComputeResource() {
- return computeResource;
- }
-
- public void setComputeResource(ComputeResource computeResource) {
- this.computeResource = computeResource;
- }
-
- public String getApplicationID() {
- return applicationID;
- }
-
- public void setApplicationID(String applicationID) {
- this.applicationID = applicationID;
- }
-
- public String getComputeResourceID() {
- return computeResourceID;
- }
-
- public void setComputeResourceID(String computeResourceID) {
- this.computeResourceID = computeResourceID;
- }
-
- public String getDeploymentHostName() {
- return deploymentHostName;
- }
-
- public void setDeploymentHostName(String deploymentHostName) {
- this.deploymentHostName = deploymentHostName;
- }
-
- public String getInputDir() {
- return inputDir;
- }
-
- public void setInputDir(String inputDir) {
- this.inputDir = inputDir;
- }
-
- public String getOutputDir() {
- return outputDir;
- }
-
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-
- public String getScratchDir() {
- return scratchDir;
- }
-
- public void setScratchDir(String scratchDir) {
- this.scratchDir = scratchDir;
- }
-
- public String getExecutionPath() {
- return executionPath;
- }
-
- public void setExecutionPath(String executionPath) {
- this.executionPath = executionPath;
- }
-
- public int getCpuCount() {
- return cpuCount;
- }
-
- public int getNodeCount() {
- return nodeCount;
- }
-
- public int getWalltime() {
- return walltime;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHExport.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHExport.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHExport.java
deleted file mode 100644
index 2123340..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHExport.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GSISSH_EXPORT")
-@IdClass(GSISSHExportPK.class)
-public class GSISSHExport {
- @Id
- @Column(name = "SUBMISSION_ID")
- private String submissionID;
- @Id
- @Column(name = "EXPORT")
- private String export;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "SUBMISSION_ID")
- private GSISSHSubmission gsisshJobSubmission;
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getExport() {
- return export;
- }
-
- public void setExport(String export) {
- this.export = export;
- }
-
- public GSISSHSubmission getGsisshJobSubmission() {
- return gsisshJobSubmission;
- }
-
- public void setGsisshJobSubmission(GSISSHSubmission gsisshJobSubmission) {
- this.gsisshJobSubmission = gsisshJobSubmission;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHExportPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHExportPK.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHExportPK.java
deleted file mode 100644
index 8ec8315..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHExportPK.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-public class GSISSHExportPK {
- private String submissionID;
- private String export;
-
- public GSISSHExportPK(String submissionID, String export) {
- this.submissionID = submissionID;
- this.export = export;
- }
-
- public GSISSHExportPK() {
- ;
- }
-
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getExport() {
- return export;
- }
-
- public void setExport(String export) {
- this.export = export;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPostJobCommand.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPostJobCommand.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPostJobCommand.java
deleted file mode 100644
index 0e1ee4f..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPostJobCommand.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import org.apache.airavata.model.appcatalog.GSISSHJobSubmission;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GSISSH_POSTJOBCOMMAND")
-@IdClass(GSISSHPostJobCommandPK.class)
-public class GSISSHPostJobCommand {
- @Id
- @Column(name = "SUBMISSION_ID")
- private String submissionID;
- @Id
- @Column(name = "COMMAND")
- private String command;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "SUBMISSION_ID")
- private GSISSHJobSubmission gsisshJobSubmission;
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getCommand() {
- return command;
- }
-
- public void setCommand(String command) {
- this.command = command;
- }
-
- public GSISSHJobSubmission getGsisshJobSubmission() {
- return gsisshJobSubmission;
- }
-
- public void setGsisshJobSubmission(GSISSHJobSubmission gsisshJobSubmission) {
- this.gsisshJobSubmission = gsisshJobSubmission;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPostJobCommandPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPostJobCommandPK.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPostJobCommandPK.java
deleted file mode 100644
index ca7ae6a..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPostJobCommandPK.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-public class GSISSHPostJobCommandPK {
- private String submissionID;
- private String command;
-
- public GSISSHPostJobCommandPK(String submissionID, String command) {
- this.submissionID = submissionID;
- this.command = command;
- }
-
- public GSISSHPostJobCommandPK() {
- ;
- }
-
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getCommand() {
- return command;
- }
-
- public void setCommand(String command) {
- this.command = command;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPreJobCommand.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPreJobCommand.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPreJobCommand.java
deleted file mode 100644
index 92a4e5d..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPreJobCommand.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-import javax.persistence.*;
-
-@Entity
-@Table(name = "GSISSH_PREJOBCOMMAND")
-@IdClass(GSISSHPreJobCommandPK.class)
-public class GSISSHPreJobCommand {
- @Id
- @Column(name = "SUBMISSION_ID")
- private String submissionID;
- @Id
- @Column(name = "COMMAND")
- private String command;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "SUBMISSION_ID")
- private GSISSHSubmission gsisshJobSubmission;
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getCommand() {
- return command;
- }
-
- public void setCommand(String command) {
- this.command = command;
- }
-
- public GSISSHSubmission getGsisshJobSubmission() {
- return gsisshJobSubmission;
- }
-
- public void setGsisshJobSubmission(GSISSHSubmission gsisshJobSubmission) {
- this.gsisshJobSubmission = gsisshJobSubmission;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/69be6c77/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPreJobCommandPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPreJobCommandPK.java b/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPreJobCommandPK.java
deleted file mode 100644
index 7aba7c8..0000000
--- a/modules/app-catalog/app-catalog-jpa/src/main/java/org/apache/airavata/persistence/appcatalog/jpa/model/GSISSHPreJobCommandPK.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *
- * 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.persistence.appcatalog.jpa.model;
-
-public class GSISSHPreJobCommandPK {
- private String submissionID;
- private String command;
-
- public GSISSHPreJobCommandPK(String submissionID, String command) {
- this.submissionID = submissionID;
- this.command = command;
- }
-
- public GSISSHPreJobCommandPK() {
- ;
- }
-
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getSubmissionID() {
- return submissionID;
- }
-
- public void setSubmissionID(String submissionID) {
- this.submissionID = submissionID;
- }
-
- public String getCommand() {
- return command;
- }
-
- public void setCommand(String command) {
- this.command = command;
- }
-}