airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: adding methods to remove datamovement interface and jobsubmission interface
Date Mon, 07 Jul 2014 20:19:48 GMT
Repository: airavata
Updated Branches:
  refs/heads/master d76cf9e34 -> 4d2805f86


adding methods to remove datamovement interface and jobsubmission interface


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

Branch: refs/heads/master
Commit: 4d2805f86ef433421d5dc3f8c3fefc1e41924037
Parents: d76cf9e
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Mon Jul 7 16:19:43 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Mon Jul 7 16:19:43 2014 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   | 24 ++++++++++++++++--
 .../appcatalog/cpi/ComputeResource.java         | 26 ++++++++++++++++++++
 .../catalog/data/impl/ComputeResourceImpl.java  | 24 +++++++++++++++++-
 .../app/catalog/test/AppDeploymentTest.java     |  6 ++---
 4 files changed, 74 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/4d2805f8/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index d520190..fe59ca2 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -2032,7 +2032,17 @@ public class AiravataServerHandler implements Airavata.Iface, Watcher
{
      */
     @Override
     public boolean deleteJobSubmissionInterface(String jobSubmissionInterfaceId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
-        return false;
+        try {
+            appCatalog = AppCatalogFactory.getAppCatalog();
+            appCatalog.getComputeResource().removeJobSubmissionInterface(jobSubmissionInterfaceId);
+            return true;
+        } catch (AppCatalogException e) {
+            logger.error("Error while deleting job submission interface...", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while deleting job submission interface. More info
: " + e.getMessage());
+            throw exception;
+        }
     }
 
     /**
@@ -2044,7 +2054,17 @@ public class AiravataServerHandler implements Airavata.Iface, Watcher
{
      */
     @Override
     public boolean deleteDataMovementInterface(String dataMovementInterfaceId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
-        return false;
+        try {
+            appCatalog = AppCatalogFactory.getAppCatalog();
+            appCatalog.getComputeResource().removeDataMovementInterface(dataMovementInterfaceId);
+            return true;
+        } catch (AppCatalogException e) {
+            logger.error("Error while deleting data movement interface...", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while deleting data movement interface. More info
: " + e.getMessage());
+            throw exception;
+        }
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/airavata/blob/4d2805f8/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java
b/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java
index d9668ea..9840d50 100644
--- a/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java
+++ b/modules/app-catalog/app-catalog-cpi/src/main/java/org/airavata/appcatalog/cpi/ComputeResource.java
@@ -89,8 +89,18 @@ public interface ComputeResource {
      */
     List<ComputeResourceDescription> getComputeResourceList (Map<String, String>
filters) throws AppCatalogException;
 
+    /**
+     * This method will retrieve all the compute resources
+     * @return list of compute resources
+     * @throws AppCatalogException
+     */
     List<ComputeResourceDescription> getAllComputeResourceList () throws AppCatalogException;
 
+    /**
+     * This method will retrieve all the compute resource ids
+     * @return list of compute resource ids
+     * @throws AppCatalogException
+     */
     List<String> getAllComputeResourceIdList () throws AppCatalogException;
 
 
@@ -163,6 +173,22 @@ public interface ComputeResource {
      */
     void removeComputeResource (String resourceId) throws AppCatalogException;
 
+    /**
+     * This method will remove job submission interface
+     * @param jobSubmissionInterfaceId unique job submission interface id
+     * @throws AppCatalogException
+     */
+    void removeJobSubmissionInterface(String jobSubmissionInterfaceId) throws AppCatalogException;
+
+    /**
+     * This method will remove data movement interface
+     * @param dataMovementInterfaceId unique data movement id
+     * @throws AppCatalogException
+     */
+    void removeDataMovementInterface(String dataMovementInterfaceId)  throws AppCatalogException;
+
+
+
     LOCALSubmission getLocalJobSubmission(String submissionId) throws AppCatalogException;
     
     LOCALDataMovement getLocalDataMovement(String datamovementId) throws AppCatalogException;

http://git-wip-us.apache.org/repos/asf/airavata/blob/4d2805f8/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 e23caae..f0c57dc 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
@@ -638,7 +638,29 @@ public class ComputeResourceImpl implements ComputeResource {
         }
     }
 
-	@Override
+    @Override
+    public void removeJobSubmissionInterface(String jobSubmissionInterfaceId) throws AppCatalogException
{
+        try {
+            JobSubmissionInterfaceResource resource = new JobSubmissionInterfaceResource();
+            resource.remove(jobSubmissionInterfaceId);
+        }catch (Exception e){
+            logger.error("Error while removing job submission interface..", e);
+            throw new AppCatalogException(e);
+        }
+    }
+
+    @Override
+    public void removeDataMovementInterface(String dataMovementInterfaceId) throws AppCatalogException
{
+        try {
+            DataMovementInterfaceResource resource = new DataMovementInterfaceResource();
+            resource.remove(dataMovementInterfaceId);
+        }catch (Exception e){
+            logger.error("Error while removing data movement interface..", e);
+            throw new AppCatalogException(e);
+        }
+    }
+
+    @Override
 	public String addResourceJobManager(ResourceJobManager resourceJobManager)
 			throws AppCatalogException {
 		resourceJobManager.setResourceJobManagerId(AppCatalogUtils.getID("RJM"));

http://git-wip-us.apache.org/repos/asf/airavata/blob/4d2805f8/modules/app-catalog/app-catalog-data/src/test/java/org/apache/airavata/app/catalog/test/AppDeploymentTest.java
----------------------------------------------------------------------
diff --git a/modules/app-catalog/app-catalog-data/src/test/java/org/apache/airavata/app/catalog/test/AppDeploymentTest.java
b/modules/app-catalog/app-catalog-data/src/test/java/org/apache/airavata/app/catalog/test/AppDeploymentTest.java
index 1f1d29e..11e87f9 100644
--- a/modules/app-catalog/app-catalog-data/src/test/java/org/apache/airavata/app/catalog/test/AppDeploymentTest.java
+++ b/modules/app-catalog/app-catalog-data/src/test/java/org/apache/airavata/app/catalog/test/AppDeploymentTest.java
@@ -87,9 +87,9 @@ public class AppDeploymentTest {
         description.setComputeHostId(hostId);
         description.setExecutablePath("/home/a/b/c");
         description.setAppDeploymentDescription("test app deployment");
-        description.addToModuleLoadCmds("");
-        //TODO
-//        description.setModuleLoadCmd("module load");?
+        description.addToModuleLoadCmds("cmd1");
+        description.addToModuleLoadCmds("cmd2");
+
         List<SetEnvPaths> libPrepandPaths = new ArrayList<SetEnvPaths>();
         libPrepandPaths.add(createSetEnvPath("name1", "val1"));
         libPrepandPaths.add(createSetEnvPath("name2", "val2"));


Mime
View raw message