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/07/05 06:43:57 UTC
[3/3] git commit: AIRAVATA-1236
AIRAVATA-1236
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/ae1fe88a
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/ae1fe88a
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/ae1fe88a
Branch: refs/heads/master
Commit: ae1fe88ad5b13af4e7103ffeb968d5b59a7ebac9
Parents: 30388a1
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Sat Jul 5 00:43:31 2014 -0400
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Sat Jul 5 00:43:31 2014 -0400
----------------------------------------------------------------------
.../catalog/data/impl/ComputeResourceImpl.java | 26 +-
.../catalog/data/model/GridFTPDMEndPointPK.java | 64 ----
.../catalog/data/model/GridFTPDMEndpoint.java | 65 ----
.../catalog/data/model/GridFTPDataMovement.java | 61 ----
.../catalog/data/model/GridftpDataMovement.java | 60 ++++
.../catalog/data/model/GridftpEndpoint.java | 78 +++++
.../catalog/data/model/GridftpEndpoint_PK.java | 59 ++++
.../catalog/data/model/LocalDataMovement.java | 49 +++
.../catalog/data/model/LocalSubmission.java | 75 +++++
.../catalog/data/model/SCPDataMovement.java | 62 ----
.../catalog/data/model/SSHSubmission.java | 62 ----
.../catalog/data/model/ScpDataMovement.java | 93 ++++++
.../catalog/data/model/SshJobSubmission.java | 108 +++++++
.../data/resources/AbstractResource.java | 56 +++-
.../resources/GridFTPDMEndpointResource.java | 295 -------------------
.../resources/GridFTPDataMovementResource.java | 270 -----------------
.../resources/GridftpDataMovementResource.java | 228 ++++++++++++++
.../data/resources/GridftpEndpointResource.java | 266 +++++++++++++++++
.../resources/LocalDataMovementResource.java | 239 +++++++++++++++
.../data/resources/LocalSubmissionResource.java | 261 ++++++++++++++++
.../data/resources/SCPDataMovementResource.java | 264 -----------------
.../data/resources/SSHSubmissionResource.java | 241 ---------------
.../data/resources/ScpDataMovementResource.java | 258 ++++++++++++++++
.../resources/SshJobSubmissionResource.java | 269 +++++++++++++++++
.../catalog/data/util/AppCatalogJPAUtils.java | 166 +++++++----
.../data/util/AppCatalogResourceType.java | 12 +-
.../data/util/AppCatalogThriftConversion.java | 20 +-
.../src/main/resources/META-INF/persistence.xml | 10 +-
.../src/main/resources/appcatalog-derby.sql | 52 ++++
.../GridFTPDataMovementGenerator.java | 82 ++++++
.../appcatalog/GridFTPEndpointsGenerator.java | 83 ++++++
.../appcatalog/LocalDataMovementGenerator.java | 80 +++++
.../appcatalog/LocalSubmissionGenerator.java | 82 ++++++
.../appcatalog/SCPDataMovementGenerator.java | 83 ++++++
.../appcatalog/SSHJobSubmissionGenerator.java | 85 ++++++
35 files changed, 2774 insertions(+), 1490 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
index 7cdf362..82bfe2e 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/impl/ComputeResourceImpl.java
@@ -184,7 +184,7 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public String addSSHJobSubmission(SSHJobSubmission sshJobSubmission) throws AppCatalogException {
try {
- SSHSubmissionResource resource = new SSHSubmissionResource();
+ SshJobSubmissionResource resource = new SshJobSubmissionResource();
String hostName = "SSH";
resource.setSubmissionID(AppCatalogUtils.getID(hostName));
resource.setSshPort(resource.getSshPort());
@@ -329,7 +329,7 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public String addScpDataMovement(SCPDataMovement scpDataMovement) throws AppCatalogException {
try {
- SCPDataMovementResource resource = new SCPDataMovementResource();
+ ScpDataMovementResource resource = new ScpDataMovementResource();
String hostName = "SCP";
resource.setDataMoveID(AppCatalogUtils.getID(hostName));
resource.setSecurityProtocol(scpDataMovement.getSecurityProtocol().toString());
@@ -362,7 +362,7 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public String addGridFTPDataMovement(GridFTPDataMovement gridFTPDataMovement) throws AppCatalogException {
try {
- GridFTPDataMovementResource resource = new GridFTPDataMovementResource();
+ GridftpDataMovementResource resource = new GridftpDataMovementResource();
String hostName = "GRID_FTP";
resource.setDataMoveID(AppCatalogUtils.getID(hostName));
resource.setSecurityProtocol(gridFTPDataMovement.getSecurityProtocol().toString());
@@ -372,7 +372,7 @@ public class ComputeResourceImpl implements ComputeResource {
List<String> gridFTPEndPoint = gridFTPDataMovement.getGridFTPEndPoint();
if (gridFTPEndPoint != null && !gridFTPEndPoint.isEmpty()) {
for (String endpoint : gridFTPEndPoint) {
- GridFTPDMEndpointResource endpointResource = new GridFTPDMEndpointResource();
+ GridftpEndpointResource endpointResource = new GridftpEndpointResource();
endpointResource.setDataMoveId(resource.getDataMoveID());
endpointResource.setEndpoint(endpoint);
endpointResource.setGridFTPDataMovementResource(resource);
@@ -517,8 +517,8 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public SSHJobSubmission getSSHJobSubmission(String submissionId) throws AppCatalogException {
try {
- SSHSubmissionResource resource = new SSHSubmissionResource();
- SSHSubmissionResource submissionResource = (SSHSubmissionResource)resource.get(submissionId);
+ SshJobSubmissionResource resource = new SshJobSubmissionResource();
+ SshJobSubmissionResource submissionResource = (SshJobSubmissionResource)resource.get(submissionId);
return AppCatalogThriftConversion.getSSHJobSubmissionDescription(submissionResource);
}catch (Exception e){
logger.error("Error while retrieving SSH Job Submission...", e);
@@ -529,7 +529,7 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public List<SSHJobSubmission> getSSHJobSubmissionList(Map<String, String> filters) throws AppCatalogException {
try {
- SSHSubmissionResource resource = new SSHSubmissionResource();
+ SshJobSubmissionResource resource = new SshJobSubmissionResource();
for (String fieldName : filters.keySet() ){
if (fieldName.equals(AbstractResource.SSHSubmissionConstants.RESOURCE_JOB_MANAGER)){
List<Resource> resources = resource.get(AbstractResource.SSHSubmissionConstants.RESOURCE_JOB_MANAGER, filters.get(fieldName));
@@ -551,8 +551,8 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public SCPDataMovement getSCPDataMovement(String dataMoveId) throws AppCatalogException {
try {
- SCPDataMovementResource resource = new SCPDataMovementResource();
- SCPDataMovementResource dataMovementResource = (SCPDataMovementResource)resource.get(dataMoveId);
+ ScpDataMovementResource resource = new ScpDataMovementResource();
+ ScpDataMovementResource dataMovementResource = (ScpDataMovementResource)resource.get(dataMoveId);
return AppCatalogThriftConversion.getSCPDataMovementDescription(dataMovementResource);
}catch (Exception e){
logger.error("Error while retrieving SCP Data Movement...", e);
@@ -563,7 +563,7 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public List<SCPDataMovement> getSCPDataMovementList(Map<String, String> filters) throws AppCatalogException {
try {
- SCPDataMovementResource resource = new SCPDataMovementResource();
+ ScpDataMovementResource resource = new ScpDataMovementResource();
for (String fieldName : filters.keySet() ){
if (fieldName.equals(AbstractResource.SCPDataMovementConstants.SECURITY_PROTOCOL)){
List<Resource> resources = resource.get(AbstractResource.SCPDataMovementConstants.SECURITY_PROTOCOL, filters.get(fieldName));
@@ -585,8 +585,8 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public GridFTPDataMovement getGridFTPDataMovement(String dataMoveId) throws AppCatalogException {
try {
- GridFTPDataMovementResource resource = new GridFTPDataMovementResource();
- GridFTPDataMovementResource dataMovementResource = (GridFTPDataMovementResource)resource.get(dataMoveId);
+ GridftpDataMovementResource resource = new GridftpDataMovementResource();
+ GridftpDataMovementResource dataMovementResource = (GridftpDataMovementResource)resource.get(dataMoveId);
return AppCatalogThriftConversion.getGridFTPDataMovementDescription(dataMovementResource);
}catch (Exception e){
logger.error("Error while retrieving Grid FTP Data Movement...", e);
@@ -597,7 +597,7 @@ public class ComputeResourceImpl implements ComputeResource {
@Override
public List<GridFTPDataMovement> getGridFTPDataMovementList(Map<String, String> filters) throws AppCatalogException {
try {
- GridFTPDataMovementResource resource = new GridFTPDataMovementResource();
+ GridftpDataMovementResource resource = new GridftpDataMovementResource();
for (String fieldName : filters.keySet() ){
if (fieldName.equals(AbstractResource.GridFTPDataMovementConstants.SECURITY_PROTOCOL)){
List<Resource> resources = resource.get(AbstractResource.GridFTPDataMovementConstants.SECURITY_PROTOCOL, filters.get(fieldName));
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDMEndPointPK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDMEndPointPK.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDMEndPointPK.java
deleted file mode 100644
index 611a9c7..0000000
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDMEndPointPK.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.aiaravata.application.catalog.data.model;
-
-import java.io.Serializable;
-
-public class GridFTPDMEndPointPK implements Serializable {
- private String dataMoveId;
- private String endpoint;
-
- public GridFTPDMEndPointPK(String dataMoveId, String endpoint) {
- this.dataMoveId = dataMoveId;
- this.endpoint = endpoint;
- }
-
- public GridFTPDMEndPointPK() {
- ;
- }
-
- @Override
- public boolean equals(Object o) {
- return false;
- }
-
- @Override
- public int hashCode() {
- return 1;
- }
-
- public String getDataMoveId() {
- return dataMoveId;
- }
-
- public void setDataMoveId(String dataMoveId) {
- this.dataMoveId = dataMoveId;
- }
-
- public String getEndpoint() {
- return endpoint;
- }
-
- public void setEndpoint(String endpoint) {
- this.endpoint = endpoint;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDMEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDMEndpoint.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDMEndpoint.java
deleted file mode 100644
index 0d4768d..0000000
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDMEndpoint.java
+++ /dev/null
@@ -1,65 +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.aiaravata.application.catalog.data.model;
-
-import javax.persistence.*;
-import java.io.Serializable;
-
-@Entity
-@Table(name = "GRIDFTP_DM_ENDPOINT")
-@IdClass(GridFTPDMEndPointPK.class)
-public class GridFTPDMEndpoint implements Serializable {
- @Id
- @Column(name = "DATA_MOVE_ID")
- private String dataMoveId;
- @Id
- @Column(name = "ENDPOINT")
- private String endpoint;
-
- @ManyToOne(cascade= CascadeType.MERGE)
- @JoinColumn(name = "SUBMISSION_ID")
- private GridFTPDataMovement gridFTPDataMovement;
-
- public String getEndpoint() {
- return endpoint;
- }
-
- public void setEndpoint(String endpoint) {
- this.endpoint = endpoint;
- }
-
- public String getDataMoveId() {
- return dataMoveId;
- }
-
- public void setDataMoveId(String dataMoveId) {
- this.dataMoveId = dataMoveId;
- }
-
- public GridFTPDataMovement getGridFTPDataMovement() {
- return gridFTPDataMovement;
- }
-
- public void setGridFTPDataMovement(GridFTPDataMovement gridFTPDataMovement) {
- this.gridFTPDataMovement = gridFTPDataMovement;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDataMovement.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDataMovement.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDataMovement.java
deleted file mode 100644
index 3b9639b..0000000
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridFTPDataMovement.java
+++ /dev/null
@@ -1,61 +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.aiaravata.application.catalog.data.model;
-
-import javax.persistence.*;
-import java.io.Serializable;
-
-@Entity
-@Table(name = "GRID_FTP_DATAMOVEMENT")
-public class GridFTPDataMovement implements Serializable {
- @Id
- @Column(name = "DATA_MOVE_ID")
- private String dataMoveID;
- @Column(name = "SECURITY_PROTOCOL")
- private String securityProtocol;
- @Column(name = "GRID_FTP_EP")
- private String gridFTPEP;
-
- public String getDataMoveID() {
- return dataMoveID;
- }
-
- public void setDataMoveID(String dataMoveID) {
- this.dataMoveID = dataMoveID;
- }
-
- public String getSecurityProtocol() {
- return securityProtocol;
- }
-
- public void setSecurityProtocol(String securityProtocol) {
- this.securityProtocol = securityProtocol;
- }
-
- public String getGridFTPEP() {
- return gridFTPEP;
- }
-
- public void setGridFTPEP(String gridFTPEP) {
- this.gridFTPEP = gridFTPEP;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpDataMovement.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpDataMovement.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpDataMovement.java
new file mode 100644
index 0000000..fcae1d6
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpDataMovement.java
@@ -0,0 +1,60 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.aiaravata.application.catalog.data.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.apache.openjpa.persistence.DataCache;
+
+@DataCache
+@Entity
+@Table(name = "GRIDFTP_DATA_MOVEMENT")
+public class GridftpDataMovement implements Serializable {
+
+ @Id
+ @Column(name = "DATA_MOVEMENT_INTERFACE_ID")
+ private String dataMovementInterfaceId;
+
+ @Column(name = "SECURITY_PROTOCOL")
+ private String securityProtocol;
+
+ public String getDataMovementInterfaceId() {
+ return dataMovementInterfaceId;
+ }
+
+ public String getSecurityProtocol() {
+ return securityProtocol;
+ }
+
+ public void setDataMovementInterfaceId(String dataMovementInterfaceId) {
+ this.dataMovementInterfaceId=dataMovementInterfaceId;
+ }
+
+ public void setSecurityProtocol(String securityProtocol) {
+ this.securityProtocol=securityProtocol;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpEndpoint.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpEndpoint.java
new file mode 100644
index 0000000..b9cf40b
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpEndpoint.java
@@ -0,0 +1,78 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.aiaravata.application.catalog.data.model;
+
+import java.io.Serializable;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import org.apache.openjpa.persistence.DataCache;
+
+@DataCache
+@Entity
+@Table(name = "GRIDFTP_ENDPOINT")
+@IdClass(GridftpEndpoint_PK.class)
+public class GridftpEndpoint implements Serializable {
+
+ @Id
+ @Column(name = "ENDPOINT")
+ private String endpoint;
+
+ @Id
+ @Column(name = "DATA_MOVEMENT_INTERFACE_ID")
+ private String dataMovementInterfaceId;
+
+ @ManyToOne(cascade= CascadeType.MERGE)
+ @JoinColumn(name = "DATA_MOVEMENT_INTERFACE_ID")
+ private GridftpDataMovement gridftpDataMovement;
+
+ public String getEndpoint() {
+ return endpoint;
+ }
+
+ public String getDataMovementInterfaceId() {
+ return dataMovementInterfaceId;
+ }
+
+ public GridftpDataMovement getGridftpDataMovement() {
+ return gridftpDataMovement;
+ }
+
+ public void setEndpoint(String endpoint) {
+ this.endpoint=endpoint;
+ }
+
+ public void setDataMovementInterfaceId(String dataMovementInterfaceId) {
+ this.dataMovementInterfaceId=dataMovementInterfaceId;
+ }
+
+ public void setGridftpDataMovement(GridftpDataMovement gridftpDataMovement) {
+ this.gridftpDataMovement=gridftpDataMovement;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpEndpoint_PK.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpEndpoint_PK.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpEndpoint_PK.java
new file mode 100644
index 0000000..de2ad99
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/GridftpEndpoint_PK.java
@@ -0,0 +1,59 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.aiaravata.application.catalog.data.model;
+
+import java.io.Serializable;
+
+public class GridftpEndpoint_PK implements Serializable {
+ private String endpoint;
+ private String dataMovementInterfaceId;
+ public GridftpEndpoint_PK(String endpoint, String dataMovementInterfaceId){
+ this.endpoint = endpoint;
+ this.dataMovementInterfaceId = dataMovementInterfaceId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return 1;
+ }
+
+ public String getEndpoint() {
+ return endpoint;
+ }
+
+ public String getDataMovementInterfaceId() {
+ return dataMovementInterfaceId;
+ }
+
+ public void setEndpoint(String endpoint) {
+ this.endpoint=endpoint;
+ }
+
+ public void setDataMovementInterfaceId(String dataMovementInterfaceId) {
+ this.dataMovementInterfaceId=dataMovementInterfaceId;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/LocalDataMovement.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/LocalDataMovement.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/LocalDataMovement.java
new file mode 100644
index 0000000..de637ea
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/LocalDataMovement.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.aiaravata.application.catalog.data.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.apache.openjpa.persistence.DataCache;
+
+@DataCache
+@Entity
+@Table(name = "LOCAL_DATA_MOVEMENT")
+public class LocalDataMovement implements Serializable {
+
+ @Id
+ @Column(name = "DATA_MOVEMENT_INTERFACE_ID")
+ private String dataMovementInterfaceId;
+
+ public String getDataMovementInterfaceId() {
+ return dataMovementInterfaceId;
+ }
+
+ public void setDataMovementInterfaceId(String dataMovementInterfaceId) {
+ this.dataMovementInterfaceId=dataMovementInterfaceId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/LocalSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/LocalSubmission.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/LocalSubmission.java
new file mode 100644
index 0000000..0378343
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/LocalSubmission.java
@@ -0,0 +1,75 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.aiaravata.application.catalog.data.model;
+
+import java.io.Serializable;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import org.apache.openjpa.persistence.DataCache;
+
+@DataCache
+@Entity
+@Table(name = "LOCAL_SUBMISSION")
+public class LocalSubmission implements Serializable {
+
+ @Column(name = "RESOURCE_JOB_MANAGER_ID")
+ private String resourceJobManagerId;
+
+ @ManyToOne(cascade= CascadeType.MERGE)
+ @JoinColumn(name = "RESOURCE_JOB_MANAGER_ID")
+ private ResourceJobManager resourceJobManager;
+
+ @Id
+ @Column(name = "JOB_SUBMISSION_INTERFACE_ID")
+ private String jobSubmissionInterfaceId;
+
+ public String getResourceJobManagerId() {
+ return resourceJobManagerId;
+ }
+
+ public ResourceJobManager getResourceJobManager() {
+ return resourceJobManager;
+ }
+
+ public String getJobSubmissionInterfaceId() {
+ return jobSubmissionInterfaceId;
+ }
+
+ public void setResourceJobManagerId(String resourceJobManagerId) {
+ this.resourceJobManagerId=resourceJobManagerId;
+ }
+
+ public void setResourceJobManager(ResourceJobManager resourceJobManager) {
+ this.resourceJobManager=resourceJobManager;
+ }
+
+ public void setJobSubmissionInterfaceId(String jobSubmissionInterfaceId) {
+ this.jobSubmissionInterfaceId=jobSubmissionInterfaceId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SCPDataMovement.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SCPDataMovement.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SCPDataMovement.java
deleted file mode 100644
index fd0209f..0000000
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SCPDataMovement.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.aiaravata.application.catalog.data.model;
-
-import javax.persistence.*;
-import java.io.Serializable;
-
-@Entity
-@Table(name = "SCP_DATAMOVEMENT")
-public class SCPDataMovement implements Serializable {
- @Id
- @Column(name = "DATA_MOVE_ID")
- private String dataMoveID;
- @Column(name = "SECURITY_PROTOCOL")
- private String securityProtocol;
- @Column(name = "SSH_PORT")
- private int sshPort;
-
- public String getDataMoveID() {
- return dataMoveID;
- }
-
- public void setDataMoveID(String dataMoveID) {
- this.dataMoveID = dataMoveID;
- }
-
- public String getSecurityProtocol() {
- return securityProtocol;
- }
-
- public void setSecurityProtocol(String securityProtocol) {
- this.securityProtocol = securityProtocol;
- }
-
- public int getSshPort() {
- return sshPort;
- }
-
- public void setSshPort(int sshPort) {
- this.sshPort = sshPort;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SSHSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SSHSubmission.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SSHSubmission.java
deleted file mode 100644
index 507578a..0000000
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SSHSubmission.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.aiaravata.application.catalog.data.model;
-
-import javax.persistence.*;
-import java.io.Serializable;
-
-@Entity
-@Table(name = "SSH_SUBMISSION")
-public class SSHSubmission implements Serializable {
- @Id
- @Column(name = "SUBMISSION_ID")
- private String submissionID;
- @Column(name = "RESOURCE_JOB_MANAGER")
- private String resourceJobManager;
- @Column(name = "SSH_PORT")
- private int sshPort;
-
- 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;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/ScpDataMovement.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/ScpDataMovement.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/ScpDataMovement.java
new file mode 100644
index 0000000..35317d2
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/ScpDataMovement.java
@@ -0,0 +1,93 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.aiaravata.application.catalog.data.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.apache.openjpa.persistence.DataCache;
+
+@DataCache
+@Entity
+@Table(name = "SCP_DATA_MOVEMENT")
+public class ScpDataMovement implements Serializable {
+
+ @Column(name = "QUEUE_DESCRIPTION")
+ private String queueDescription;
+
+ @Id
+ @Column(name = "DATA_MOVEMENT_INTERFACE_ID")
+ private String dataMovementInterfaceId;
+
+ @Column(name = "SECURITY_PROTOCOL")
+ private String securityProtocol;
+
+ @Column(name = "ALTERNATIVE_SCP_HOSTNAME")
+ private String alternativeScpHostname;
+
+ @Column(name = "SSH_PORT")
+ private int sshPort;
+
+ public String getQueueDescription() {
+ return queueDescription;
+ }
+
+ public String getDataMovementInterfaceId() {
+ return dataMovementInterfaceId;
+ }
+
+ public String getSecurityProtocol() {
+ return securityProtocol;
+ }
+
+ public String getAlternativeScpHostname() {
+ return alternativeScpHostname;
+ }
+
+ public int getSshPort() {
+ return sshPort;
+ }
+
+ public void setQueueDescription(String queueDescription) {
+ this.queueDescription=queueDescription;
+ }
+
+ public void setDataMovementInterfaceId(String dataMovementInterfaceId) {
+ this.dataMovementInterfaceId=dataMovementInterfaceId;
+ }
+
+ public void setSecurityProtocol(String securityProtocol) {
+ this.securityProtocol=securityProtocol;
+ }
+
+ public void setAlternativeScpHostname(String alternativeScpHostname) {
+ this.alternativeScpHostname=alternativeScpHostname;
+ }
+
+ public void setSshPort(int sshPort) {
+ this.sshPort=sshPort;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java
new file mode 100644
index 0000000..bd29f7b
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/model/SshJobSubmission.java
@@ -0,0 +1,108 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.aiaravata.application.catalog.data.model;
+
+import java.io.Serializable;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import org.apache.openjpa.persistence.DataCache;
+
+@DataCache
+@Entity
+@Table(name = "SSH_JOB_SUBMISSION")
+public class SshJobSubmission implements Serializable {
+
+ @Column(name = "RESOURCE_JOB_MANAGER_ID")
+ private String resourceJobManagerId;
+
+ @ManyToOne(cascade= CascadeType.MERGE)
+ @JoinColumn(name = "RESOURCE_JOB_MANAGER_ID")
+ private ResourceJobManager resourceJobManager;
+
+ @Id
+ @Column(name = "JOB_SUBMISSION_INTERFACE_ID")
+ private String jobSubmissionInterfaceId;
+
+ @Column(name = "ALTERNATIVE_SSH_HOSTNAME")
+ private String alternativeSshHostname;
+
+ @Column(name = "SECURITY_PROTOCOL")
+ private String securityProtocol;
+
+ @Column(name = "SSH_PORT")
+ private int sshPort;
+
+ public String getResourceJobManagerId() {
+ return resourceJobManagerId;
+ }
+
+ public ResourceJobManager getResourceJobManager() {
+ return resourceJobManager;
+ }
+
+ public String getJobSubmissionInterfaceId() {
+ return jobSubmissionInterfaceId;
+ }
+
+ public String getAlternativeSshHostname() {
+ return alternativeSshHostname;
+ }
+
+ public String getSecurityProtocol() {
+ return securityProtocol;
+ }
+
+ public int getSshPort() {
+ return sshPort;
+ }
+
+ public void setResourceJobManagerId(String resourceJobManagerId) {
+ this.resourceJobManagerId=resourceJobManagerId;
+ }
+
+ public void setResourceJobManager(ResourceJobManager resourceJobManager) {
+ this.resourceJobManager=resourceJobManager;
+ }
+
+ public void setJobSubmissionInterfaceId(String jobSubmissionInterfaceId) {
+ this.jobSubmissionInterfaceId=jobSubmissionInterfaceId;
+ }
+
+ public void setAlternativeSshHostname(String alternativeSshHostname) {
+ this.alternativeSshHostname=alternativeSshHostname;
+ }
+
+ public void setSecurityProtocol(String securityProtocol) {
+ this.securityProtocol=securityProtocol;
+ }
+
+ public void setSshPort(int sshPort) {
+ this.sshPort=sshPort;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
index b718ad9..e6a1776 100644
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/AbstractResource.java
@@ -33,10 +33,10 @@ public abstract class AbstractResource implements Resource {
public static final String GLOBUS_SUBMISSION = "GlobusJobSubmission";
public static final String GLOBUS_GK_ENDPOINT = "GlobusGKEndpoint";
public static final String SSH_SUBMISSION = "SSHSubmission";
- public static final String SCP_DATAMOVEMENT = "SCPDataMovement";
- public static final String GRID_FTP_DATAMOVEMENT = "GridFTPDataMovement";
- public static final String GRIDFTP_DM_ENDPOINT = "GridFTPDMEndpoint";
- public static final String JOB_SUBMISSION_PROTOCOL = "JobSubmissionProtocol";
+ public static final String SCP_DATA_MOVEMENT = "ScpDataMovement";
+ public static final String GRIDFTP_DATA_MOVEMENT = "GridftpDataMovement";
+ public static final String GRIDFTP_ENDPOINT = "GridftpEndpoint";
+ public static final String JOB_SUBMISSION_PROTOCOL = "JobSubmissionProtocol";
public static final String DATA_MOVEMENT_PROTOCOL = "DataMovementProtocol";
public static final String APPLICATION_MODULE = "ApplicationModule";
public static final String APPLICATION_DEPLOYMENT = "ApplicationDeployment";
@@ -55,6 +55,9 @@ public abstract class AbstractResource implements Resource {
public static final String DATA_MOVEMENT_INTERFACE = "DataMovementInterface";
public static final String RESOURCE_JOB_MANAGER = "ResourceJobManager";
public static final String JOB_MANAGER_COMMAND = "JobManagerCommand";
+ public static final String LOCAL_SUBMISSION = "LocalSubmission";
+ public static final String LOCAL_DATA_MOVEMENT = "LocalDataMovement";
+ public static final String SSH_JOB_SUBMISSION = "SshJobSubmission";
// Compute Resource Table
public final class ComputeResourceConstants {
@@ -124,11 +127,14 @@ public abstract class AbstractResource implements Resource {
public static final String SSH_PORT = "sshPort";
}
- public final class SCPDataMovementConstants {
- public static final String DATA_MOVE_ID = "dataMoveID";
- public static final String SECURITY_PROTOCOL = "securityProtocol";
- public static final String SSH_PORT = "sshPort";
- }
+ // Scp Data Movement Table
+ public final class ScpDataMovementConstants {
+ public static final String QUEUE_DESCRIPTION = "queueDescription";
+ public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+ public static final String SECURITY_PROTOCOL = "securityProtocol";
+ public static final String ALTERNATIVE_SCP_HOSTNAME = "alternativeScpHostname";
+ public static final String SSH_PORT = "sshPort";
+ }
public final class GridFTPDataMovementConstants {
public static final String DATA_MOVE_ID = "dataMoveID";
@@ -280,4 +286,36 @@ public abstract class AbstractResource implements Resource {
public static final String COMMAND_TYPE = "commandType";
public static final String COMMAND = "command";
}
+
+ // Gridftp Data Movement Table
+ public final class GridftpDataMovementConstants {
+ public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+ public static final String SECURITY_PROTOCOL = "securityProtocol";
+ }
+
+ // Gridftp Endpoint Table
+ public final class GridftpEndpointConstants {
+ public static final String ENDPOINT = "endpoint";
+ public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+ }
+
+ // Local Submission Table
+ public final class LocalSubmissionConstants {
+ public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+ public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionInterfaceId";
+ }
+
+ // Local Data Movement Table
+ public final class LocalDataMovementConstants {
+ public static final String DATA_MOVEMENT_INTERFACE_ID = "dataMovementInterfaceId";
+ }
+
+ // Ssh Job Submission Table
+ public final class SshJobSubmissionConstants {
+ public static final String RESOURCE_JOB_MANAGER_ID = "resourceJobManagerId";
+ public static final String JOB_SUBMISSION_INTERFACE_ID = "jobSubmissionInterfaceId";
+ public static final String ALTERNATIVE_SSH_HOSTNAME = "alternativeSshHostname";
+ public static final String SECURITY_PROTOCOL = "securityProtocol";
+ public static final String SSH_PORT = "sshPort";
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridFTPDMEndpointResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridFTPDMEndpointResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridFTPDMEndpointResource.java
deleted file mode 100644
index 724e449..0000000
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridFTPDMEndpointResource.java
+++ /dev/null
@@ -1,295 +0,0 @@
-package org.apache.aiaravata.application.catalog.data.resources;
-
-import org.airavata.appcatalog.cpi.AppCatalogException;
-import org.apache.aiaravata.application.catalog.data.model.GridFTPDMEndPointPK;
-import org.apache.aiaravata.application.catalog.data.model.GridFTPDMEndpoint;
-import org.apache.aiaravata.application.catalog.data.model.GridFTPDataMovement;
-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 GridFTPDMEndpointResource extends AbstractResource {
- private final static Logger logger = LoggerFactory.getLogger(GridFTPDMEndpointResource.class);
-
- private String dataMoveId;
- private String endpoint;
-
- private GridFTPDataMovementResource gridFTPDataMovementResource;
-
-
- 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(GRIDFTP_DM_ENDPOINT);
- generator.setParameter(GridFTPDMEPConstants.ENDPOINT, ids.get(GridFTPDMEPConstants.ENDPOINT));
- generator.setParameter(GridFTPDMEPConstants.DATA_MOVE_ID, ids.get(GridFTPDMEPConstants.DATA_MOVE_ID));
- 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(GRIDFTP_DM_ENDPOINT);
- generator.setParameter(GridFTPDMEPConstants.DATA_MOVE_ID, ids.get(GridFTPDMEPConstants.DATA_MOVE_ID));
- generator.setParameter(GridFTPDMEPConstants.ENDPOINT, ids.get(GridFTPDMEPConstants.ENDPOINT));
- Query q = generator.selectQuery(em);
- GridFTPDMEndpoint result = (GridFTPDMEndpoint) q.getSingleResult();
- GridFTPDMEndpointResource gkEndpointResource =
- (GridFTPDMEndpointResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GRID_FTP_DM_ENDPOINT, result);
- em.getTransaction().commit();
- em.close();
- return gkEndpointResource;
- } 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> resources = new ArrayList<Resource>();
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- em.getTransaction().begin();
- Query q;
- AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRIDFTP_DM_ENDPOINT);
- List results;
- if (fieldName.equals(GridFTPDMEPConstants.ENDPOINT)) {
- generator.setParameter(GridFTPDMEPConstants.ENDPOINT, value);
- q = generator.selectQuery(em);
- results = q.getResultList();
- if (results.size() != 0) {
- for (Object result : results) {
- GridFTPDMEndpoint gridFTPDMEndpoint = (GridFTPDMEndpoint) result;
- GridFTPDMEndpointResource gkEndpointResource =
- (GridFTPDMEndpointResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GRID_FTP_DM_ENDPOINT, gridFTPDMEndpoint);
- resources.add(gkEndpointResource);
- }
- }
- } else if (fieldName.equals(GridFTPDMEPConstants.DATA_MOVE_ID)) {
- generator.setParameter(GridFTPDMEPConstants.DATA_MOVE_ID, value);
- q = generator.selectQuery(em);
- results = q.getResultList();
- if (results.size() != 0) {
- for (Object result : results) {
- GridFTPDMEndpoint gridFTPDMEndpoint = (GridFTPDMEndpoint) result;
- GridFTPDMEndpointResource gkEndpointResource =
- (GridFTPDMEndpointResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GRID_FTP_DM_ENDPOINT, gridFTPDMEndpoint);
- resources.add(gkEndpointResource);
- }
- }
- } else {
- em.getTransaction().commit();
- em.close();
- logger.error("Unsupported field name for GridFTPDMEndpoint Resource.", new IllegalArgumentException());
- throw new IllegalArgumentException("Unsupported field name for GridFTPDMEndpoint 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 resources;
- }
-
- public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
- List<String> list = new ArrayList<String>();
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- em.getTransaction().begin();
- Query q;
- AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRIDFTP_DM_ENDPOINT);
- List results;
- if (fieldName.equals(GridFTPDMEPConstants.DATA_MOVE_ID)) {
- generator.setParameter(GridFTPDMEPConstants.DATA_MOVE_ID, value);
- q = generator.selectQuery(em);
- results = q.getResultList();
- if (results.size() != 0) {
- for (Object result : results) {
- GridFTPDMEndpoint gridFTPDMEndpoint = (GridFTPDMEndpoint) result;
- list.add(gridFTPDMEndpoint.getDataMoveId());
- }
- }
- } else if (fieldName.equals(GridFTPDMEPConstants.ENDPOINT)) {
- generator.setParameter(GridFTPDMEPConstants.ENDPOINT, value);
- q = generator.selectQuery(em);
- results = q.getResultList();
- if (results.size() != 0) {
- for (Object result : results) {
- GridFTPDMEndpoint gridFTPDMEndpoint = (GridFTPDMEndpoint) result;
- list.add(gridFTPDMEndpoint.getDataMoveId());
- }
- }
- } else {
- em.getTransaction().commit();
- em.close();
- logger.error("Unsupported field name for GridFTPDMEndpoint resource.", new IllegalArgumentException());
- throw new IllegalArgumentException("Unsupported field name for GridFTPDMEndpoint 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 list;
- }
-
- public void save() throws AppCatalogException {
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- GridFTPDMEndpoint ftpdmEndpoint = em.find(GridFTPDMEndpoint.class, new GridFTPDMEndPointPK(dataMoveId, endpoint));
- em.close();
-
- em = AppCatalogJPAUtils.getEntityManager();
- em.getTransaction().begin();
- GridFTPDataMovement dataMovement = em.find(GridFTPDataMovement.class, dataMoveId);
- if (ftpdmEndpoint != null) {
- ftpdmEndpoint.setDataMoveId(dataMoveId);
- ftpdmEndpoint.setEndpoint(endpoint);
- ftpdmEndpoint.setGridFTPDataMovement(dataMovement);
- em.merge(ftpdmEndpoint);
- } else {
- GridFTPDMEndpoint gridFTPDMEndpoint = new GridFTPDMEndpoint();
- gridFTPDMEndpoint.setDataMoveId(dataMoveId);
- gridFTPDMEndpoint.setEndpoint(endpoint);
- gridFTPDMEndpoint.setGridFTPDataMovement(dataMovement);
- em.persist(gridFTPDMEndpoint);
- }
- 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();
- GridFTPDMEndpoint gridFTPDMEndpoint = em.find(GridFTPDMEndpoint.class, new GridFTPDMEndPointPK(ids.get(GridFTPDMEPConstants.DATA_MOVE_ID),
- ids.get(GridFTPDMEPConstants.ENDPOINT)));
-
- em.close();
- return gridFTPDMEndpoint != 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 getDataMoveId() {
- return dataMoveId;
- }
-
- public void setDataMoveId(String dataMoveId) {
- this.dataMoveId = dataMoveId;
- }
-
- public GridFTPDataMovementResource getGridFTPDataMovementResource() {
- return gridFTPDataMovementResource;
- }
-
- public void setGridFTPDataMovementResource(GridFTPDataMovementResource gridFTPDataMovementResource) {
- this.gridFTPDataMovementResource = gridFTPDataMovementResource;
- }
-
- public String getEndpoint() {
- return endpoint;
- }
-
- public void setEndpoint(String endpoint) {
- this.endpoint = endpoint;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridFTPDataMovementResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridFTPDataMovementResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridFTPDataMovementResource.java
deleted file mode 100644
index 16fc8de..0000000
--- a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridFTPDataMovementResource.java
+++ /dev/null
@@ -1,270 +0,0 @@
-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.GridFTPDataMovement;
-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;
-
-public class GridFTPDataMovementResource extends AbstractResource {
- private final static Logger logger = LoggerFactory.getLogger(GridFTPDataMovementResource.class);
-
- private String dataMoveID;
- private String resourceID;
- private String securityProtocol;
- private String gridFTPEP;
-
- private ComputeHostResource computeHostResource;
-
- public void remove(Object identifier) throws AppCatalogException {
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- em.getTransaction().begin();
- AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRID_FTP_DATAMOVEMENT);
- generator.setParameter(GridFTPDataMovementConstants.DATA_MOVE_ID, identifier);
- Query q = generator.deleteQuery(em);
- q.executeUpdate();
- em.getTransaction().commit();
- em.close();
- } catch (ApplicationSettingsException e) {
- logger.error(e.getMessage(), e);
- throw new AppCatalogException(e);
- } finally {
- if (em != null && em.isOpen()) {
- if (em.getTransaction().isActive()) {
- em.getTransaction().rollback();
- }
- em.close();
- }
- }
- }
-
- public Resource get(Object identifier) throws AppCatalogException {
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- em.getTransaction().begin();
- AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRID_FTP_DATAMOVEMENT);
- generator.setParameter(GridFTPDataMovementConstants.DATA_MOVE_ID, identifier);
- Query q = generator.selectQuery(em);
- GridFTPDataMovement gridFTPDataMovement = (GridFTPDataMovement) q.getSingleResult();
- GridFTPDataMovementResource gridFTPDataMovementResource =
- (GridFTPDataMovementResource) AppCatalogJPAUtils.getResource(
- AppCatalogResourceType.GRID_FTP_DATAMOVEMENT, gridFTPDataMovement);
- em.getTransaction().commit();
- em.close();
- return gridFTPDataMovementResource;
- } 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> gridFTPDataMoveResources = new ArrayList<Resource>();
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- em.getTransaction().begin();
- Query q;
- AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRID_FTP_DATAMOVEMENT);
- List results;
- if (fieldName.equals(GridFTPDataMovementConstants.SECURITY_PROTOCOL)) {
- generator.setParameter(GridFTPDataMovementConstants.SECURITY_PROTOCOL, value);
- q = generator.selectQuery(em);
- results = q.getResultList();
- if (results.size() != 0) {
- for (Object result : results) {
- GridFTPDataMovement gridFTPDataMovement = (GridFTPDataMovement) result;
- GridFTPDataMovementResource gridFTPDataMovementResource =
- (GridFTPDataMovementResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GRID_FTP_DATAMOVEMENT, gridFTPDataMovement);
- gridFTPDataMoveResources.add(gridFTPDataMovementResource);
- }
- }
- } else {
- em.getTransaction().commit();
- em.close();
- logger.error("Unsupported field name for Grid FTP Data Movement resource.", new IllegalArgumentException());
- throw new IllegalArgumentException("Unsupported field name for Grid FTP Data Movement 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 gridFTPDataMoveResources;
- }
-
- public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
- List<String> gridFTPDataMoveIDs = new ArrayList<String>();
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- em.getTransaction().begin();
- Query q;
- AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRID_FTP_DATAMOVEMENT);
- List results;
- if (fieldName.equals(GridFTPDataMovementConstants.DATA_MOVE_ID)) {
- generator.setParameter(GridFTPDataMovementConstants.DATA_MOVE_ID, value);
- q = generator.selectQuery(em);
- results = q.getResultList();
- if (results.size() != 0) {
- for (Object result : results) {
- GridFTPDataMovement gridFTPDataMovement = (GridFTPDataMovement) result;
- gridFTPDataMoveIDs.add(gridFTPDataMovement.getDataMoveID());
- }
- }
- } else if (fieldName.equals(GridFTPDataMovementConstants.GRID_FTP_EP)) {
- generator.setParameter(GridFTPDataMovementConstants.GRID_FTP_EP, value);
- q = generator.selectQuery(em);
- results = q.getResultList();
- if (results.size() != 0) {
- for (Object result : results) {
- GridFTPDataMovement gridFTPDataMovement = (GridFTPDataMovement) result;
- gridFTPDataMoveIDs.add(gridFTPDataMovement.getDataMoveID());
- }
- }
- } else {
- em.getTransaction().commit();
- em.close();
- logger.error("Unsupported field name for Grid FTP Data movement resource.", new IllegalArgumentException());
- throw new IllegalArgumentException("Unsupported field name for Grid FTP Data movement 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 gridFTPDataMoveIDs;
- }
-
- public void save() throws AppCatalogException {
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- GridFTPDataMovement existingGridFTPDataMovement = em.find(GridFTPDataMovement.class, dataMoveID);
- em.close();
-
- em = AppCatalogJPAUtils.getEntityManager();
- em.getTransaction().begin();
- if (existingGridFTPDataMovement != null) {
- existingGridFTPDataMovement.setDataMoveID(dataMoveID);
- existingGridFTPDataMovement.setGridFTPEP(gridFTPEP);
- existingGridFTPDataMovement.setSecurityProtocol(securityProtocol);
- em.merge(existingGridFTPDataMovement);
- } else {
- GridFTPDataMovement gridFTPDataMovement = new GridFTPDataMovement();
- gridFTPDataMovement.setDataMoveID(dataMoveID);
- gridFTPDataMovement.setGridFTPEP(gridFTPEP);
- gridFTPDataMovement.setSecurityProtocol(securityProtocol);
- em.persist(gridFTPDataMovement);
- }
- 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 {
- EntityManager em = null;
- try {
- em = AppCatalogJPAUtils.getEntityManager();
- GridFTPDataMovement gridFTPDataMovement = em.find(GridFTPDataMovement.class, identifier);
- em.close();
- return gridFTPDataMovement != 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 getDataMoveID() {
- return dataMoveID;
- }
-
- public void setDataMoveID(String dataMoveID) {
- this.dataMoveID = dataMoveID;
- }
-
- public String getResourceID() {
- return resourceID;
- }
-
- public void setResourceID(String resourceID) {
- this.resourceID = resourceID;
- }
-
- public String getSecurityProtocol() {
- return securityProtocol;
- }
-
- public void setSecurityProtocol(String securityProtocol) {
- this.securityProtocol = securityProtocol;
- }
-
- public String getGridFTPEP() {
- return gridFTPEP;
- }
-
- public void setGridFTPEP(String gridFTPEP) {
- this.gridFTPEP = gridFTPEP;
- }
-
- public ComputeHostResource getComputeHostResource() {
- return computeHostResource;
- }
-
- public void setComputeHostResource(ComputeHostResource computeHostResource) {
- this.computeHostResource = computeHostResource;
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/ae1fe88a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java
new file mode 100644
index 0000000..2244ea0
--- /dev/null
+++ b/modules/app-catalog/app-catalog-data/src/main/java/org/apache/aiaravata/application/catalog/data/resources/GridftpDataMovementResource.java
@@ -0,0 +1,228 @@
+package org.apache.aiaravata.application.catalog.data.resources;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+import org.airavata.appcatalog.cpi.AppCatalogException;
+import org.apache.aiaravata.application.catalog.data.model.GridftpDataMovement;
+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;
+
+public class GridftpDataMovementResource extends AbstractResource {
+ private final static Logger logger = LoggerFactory.getLogger(GridftpDataMovementResource.class);
+ private String dataMovementInterfaceId;
+ private String securityProtocol;
+
+ @Override
+ public void remove(Object identifier) throws AppCatalogException {
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRIDFTP_DATA_MOVEMENT);
+ generator.setParameter(GridftpDataMovementConstants.DATA_MOVEMENT_INTERFACE_ID, identifier);
+ Query q = generator.deleteQuery(em);
+ q.executeUpdate();
+ em.getTransaction().commit();
+ em.close();
+ } catch (ApplicationSettingsException e) {
+ logger.error(e.getMessage(), e);
+ throw new AppCatalogException(e);
+ } finally {
+ if (em != null && em.isOpen()) {
+ if (em.getTransaction().isActive()) {
+ em.getTransaction().rollback();
+ }
+ em.close();
+ }
+ }
+ }
+
+ @Override
+ public Resource get(Object identifier) throws AppCatalogException {
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRIDFTP_DATA_MOVEMENT);
+ generator.setParameter(GridftpDataMovementConstants.DATA_MOVEMENT_INTERFACE_ID, identifier);
+ Query q = generator.selectQuery(em);
+ GridftpDataMovement gridftpDataMovement = (GridftpDataMovement) q.getSingleResult();
+ GridftpDataMovementResource gridftpDataMovementResource = (GridftpDataMovementResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GRIDFTP_DATA_MOVEMENT, gridftpDataMovement);
+ em.getTransaction().commit();
+ em.close();
+ return gridftpDataMovementResource;
+ } catch (ApplicationSettingsException e) {
+ logger.error(e.getMessage(), e);
+ throw new AppCatalogException(e);
+ } finally {
+ if (em != null && em.isOpen()) {
+ if (em.getTransaction().isActive()) {
+ em.getTransaction().rollback();
+ }
+ em.close();
+ }
+ }
+ }
+
+ @Override
+ public List<Resource> get(String fieldName, Object value) throws AppCatalogException {
+ List<Resource> gridftpDataMovementResources = new ArrayList<Resource>();
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRIDFTP_DATA_MOVEMENT);
+ Query q;
+ if ((fieldName.equals(GridftpDataMovementConstants.DATA_MOVEMENT_INTERFACE_ID)) || (fieldName.equals(GridftpDataMovementConstants.SECURITY_PROTOCOL))) {
+ generator.setParameter(fieldName, value);
+ q = generator.selectQuery(em);
+ List<?> results = q.getResultList();
+ for (Object result : results) {
+ GridftpDataMovement gridftpDataMovement = (GridftpDataMovement) result;
+ GridftpDataMovementResource gridftpDataMovementResource = (GridftpDataMovementResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GRIDFTP_DATA_MOVEMENT, gridftpDataMovement);
+ gridftpDataMovementResources.add(gridftpDataMovementResource);
+ }
+ } else {
+ em.getTransaction().commit();
+ em.close();
+ logger.error("Unsupported field name for Gridftp Data Movement Resource.", new IllegalArgumentException());
+ throw new IllegalArgumentException("Unsupported field name for Gridftp Data Movement Resource.");
+ }
+ 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();
+ }
+ }
+ return gridftpDataMovementResources;
+ }
+
+ @Override
+ public List<String> getIds(String fieldName, Object value) throws AppCatalogException {
+ List<String> gridftpDataMovementResourceIDs = new ArrayList<String>();
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GRIDFTP_DATA_MOVEMENT);
+ Query q;
+ if ((fieldName.equals(GridftpDataMovementConstants.DATA_MOVEMENT_INTERFACE_ID)) || (fieldName.equals(GridftpDataMovementConstants.SECURITY_PROTOCOL))) {
+ generator.setParameter(fieldName, value);
+ q = generator.selectQuery(em);
+ List<?> results = q.getResultList();
+ for (Object result : results) {
+ GridftpDataMovement gridftpDataMovement = (GridftpDataMovement) result;
+ GridftpDataMovementResource gridftpDataMovementResource = (GridftpDataMovementResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.GRIDFTP_DATA_MOVEMENT, gridftpDataMovement);
+ gridftpDataMovementResourceIDs.add(gridftpDataMovementResource.getDataMovementInterfaceId());
+ }
+ } else {
+ em.getTransaction().commit();
+ em.close();
+ logger.error("Unsupported field name for Gridftp Data Movement Resource.", new IllegalArgumentException());
+ throw new IllegalArgumentException("Unsupported field name for Gridftp Data Movement Resource.");
+ }
+ 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();
+ }
+ }
+ return gridftpDataMovementResourceIDs;
+ }
+
+ @Override
+ public void save() throws AppCatalogException {
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ GridftpDataMovement existingGridftpDataMovement = em.find(GridftpDataMovement.class, dataMovementInterfaceId);
+ em.close();
+ GridftpDataMovement gridftpDataMovement;
+ em = AppCatalogJPAUtils.getEntityManager();
+ em.getTransaction().begin();
+ if (existingGridftpDataMovement == null) {
+ gridftpDataMovement = new GridftpDataMovement();
+ } else {
+ gridftpDataMovement = existingGridftpDataMovement;
+ }
+ gridftpDataMovement.setDataMovementInterfaceId(getDataMovementInterfaceId());
+ gridftpDataMovement.setSecurityProtocol(getSecurityProtocol());
+ if (existingGridftpDataMovement == null) {
+ em.persist(gridftpDataMovement);
+ } else {
+ em.merge(gridftpDataMovement);
+ }
+ em.getTransaction().commit();
+ em.close();
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ throw new AppCatalogException(e);
+ } finally {
+ if (em != null && em.isOpen()) {
+ if (em.getTransaction().isActive()) {
+ em.getTransaction().rollback();
+ }
+ em.close();
+ }
+ }
+ }
+
+ @Override
+ public boolean isExists(Object identifier) throws AppCatalogException {
+ EntityManager em = null;
+ try {
+ em = AppCatalogJPAUtils.getEntityManager();
+ GridftpDataMovement gridftpDataMovement = em.find(GridftpDataMovement.class, identifier);
+ em.close();
+ return gridftpDataMovement != 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 getDataMovementInterfaceId() {
+ return dataMovementInterfaceId;
+ }
+
+ public String getSecurityProtocol() {
+ return securityProtocol;
+ }
+
+ public void setDataMovementInterfaceId(String dataMovementInterfaceId) {
+ this.dataMovementInterfaceId=dataMovementInterfaceId;
+ }
+
+ public void setSecurityProtocol(String securityProtocol) {
+ this.securityProtocol=securityProtocol;
+ }
+}
\ No newline at end of file