airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [4/4] airavata git commit: adding delete experiment to Airavata API
Date Tue, 13 Oct 2015 16:07:57 GMT
adding delete experiment to Airavata API


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

Branch: refs/heads/master
Commit: 4db5d4f4b9168a3d512e7275c144c0a895c39a37
Parents: 07adb3b
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Tue Oct 13 12:07:29 2015 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Tue Oct 13 12:07:30 2015 -0400

----------------------------------------------------------------------
 .../server/handler/AiravataServerHandler.java   |    34 +
 .../java/org/apache/airavata/api/Airavata.java  | 10450 ++++++++++-------
 .../main/resources/lib/airavata/Airavata.cpp    |   425 +
 .../src/main/resources/lib/airavata/Airavata.h  |   184 +
 .../lib/airavata/Airavata_server.skeleton.cpp   |    17 +
 .../resources/lib/Airavata/API/Airavata.php     |   360 +
 .../lib/apache/airavata/api/Airavata-remote     |     7 +
 .../lib/apache/airavata/api/Airavata.py         |   289 +
 .../org/apache/airavata/model/Workflow.java     |     2 +-
 .../ApplicationDeploymentDescription.java       |     2 +-
 .../appdeployment/ApplicationModule.java        |     2 +-
 .../appcatalog/appdeployment/SetEnvPaths.java   |     2 +-
 .../ApplicationInterfaceDescription.java        |     2 +-
 .../appcatalog/computeresource/BatchQueue.java  |     2 +-
 .../computeresource/CloudJobSubmission.java     |     2 +-
 .../ComputeResourceDescription.java             |     2 +-
 .../computeresource/DataMovementInterface.java  |     2 +-
 .../computeresource/GlobusJobSubmission.java    |     2 +-
 .../computeresource/GridFTPDataMovement.java    |     2 +-
 .../computeresource/JobSubmissionInterface.java |     2 +-
 .../computeresource/LOCALDataMovement.java      |     2 +-
 .../computeresource/LOCALSubmission.java        |     2 +-
 .../computeresource/ResourceJobManager.java     |     2 +-
 .../computeresource/SCPDataMovement.java        |     2 +-
 .../computeresource/SSHJobSubmission.java       |     2 +-
 .../computeresource/UnicoreDataMovement.java    |     2 +-
 .../computeresource/UnicoreJobSubmission.java   |     2 +-
 .../ComputeResourcePreference.java              |     2 +-
 .../gatewayprofile/DataStoragePreference.java   |     2 +-
 .../gatewayprofile/GatewayResourceProfile.java  |     2 +-
 .../application/io/InputDataObjectType.java     |     2 +-
 .../application/io/OutputDataObjectType.java    |     2 +-
 .../airavata/model/commons/ErrorModel.java      |     2 +-
 .../model/commons/ValidationResults.java        |     2 +-
 .../airavata/model/commons/ValidatorResult.java |     2 +-
 .../model/error/AiravataClientException.java    |     2 +-
 .../model/error/AiravataSystemException.java    |     2 +-
 .../model/error/AuthenticationException.java    |     2 +-
 .../model/error/AuthorizationException.java     |     2 +-
 .../error/ExperimentNotFoundException.java      |     2 +-
 .../model/error/InvalidRequestException.java    |     2 +-
 .../model/error/LaunchValidationException.java  |     2 +-
 .../model/error/ProjectNotFoundException.java   |     2 +-
 .../airavata/model/error/TimedOutException.java |     2 +-
 .../airavata/model/error/ValidationResults.java |     2 +-
 .../airavata/model/error/ValidatorResult.java   |     2 +-
 .../model/experiment/ExperimentModel.java       |     2 +-
 .../model/experiment/ExperimentStatistics.java  |     2 +-
 .../experiment/ExperimentSummaryModel.java      |     2 +-
 .../experiment/UserConfigurationDataModel.java  |     2 +-
 .../org/apache/airavata/model/job/JobModel.java |     2 +-
 .../event/ExperimentStatusChangeEvent.java      |     2 +-
 .../model/messaging/event/JobIdentifier.java    |     2 +-
 .../messaging/event/JobStatusChangeEvent.java   |     2 +-
 .../event/JobStatusChangeRequestEvent.java      |     2 +-
 .../airavata/model/messaging/event/Message.java |     2 +-
 .../messaging/event/ProcessIdentifier.java      |     2 +-
 .../event/ProcessStatusChangeEvent.java         |     2 +-
 .../event/ProcessStatusChangeRequestEvent.java  |     2 +-
 .../messaging/event/ProcessSubmitEvent.java     |     2 +-
 .../messaging/event/ProcessTerminateEvent.java  |     2 +-
 .../model/messaging/event/TaskIdentifier.java   |     2 +-
 .../messaging/event/TaskOutputChangeEvent.java  |     2 +-
 .../messaging/event/TaskStatusChangeEvent.java  |     2 +-
 .../event/TaskStatusChangeRequestEvent.java     |     2 +-
 .../airavata/model/process/ProcessModel.java    |     2 +-
 .../ComputationalResourceSchedulingModel.java   |     2 +-
 .../airavata/model/security/AuthzToken.java     |     2 +-
 .../airavata/model/status/ExperimentStatus.java |     2 +-
 .../apache/airavata/model/status/JobStatus.java |     2 +-
 .../airavata/model/status/ProcessStatus.java    |     2 +-
 .../airavata/model/status/TaskStatus.java       |     2 +-
 .../model/task/DataStagingTaskModel.java        |     2 +-
 .../apache/airavata/model/task/TaskModel.java   |     2 +-
 .../airavata/model/workspace/Gateway.java       |     2 +-
 .../apache/airavata/model/workspace/Group.java  |     2 +-
 .../airavata/model/workspace/Project.java       |     2 +-
 .../apache/airavata/model/workspace/User.java   |     2 +-
 .../airavata-api/airavata_api.thrift            |    19 +
 79 files changed, 7351 insertions(+), 4574 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/4db5d4f4/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 3307121..15f930b 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
@@ -1190,6 +1190,40 @@ public class AiravataServerHandler implements Airavata.Iface {
     }
 
     /**
+     * If the experiment is not already launched experiment can be deleted.
+     * @param authzToken
+     * @param experimentId
+     * @return
+     * @throws InvalidRequestException
+     * @throws AiravataClientException
+     * @throws AiravataSystemException
+     * @throws AuthorizationException
+     * @throws TException
+     */
+    @Override
+    public boolean deleteExperiment(AuthzToken authzToken, String experimentId) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, AuthorizationException, TException {
+        try {
+            experimentCatalog = RegistryFactory.getDefaultExpCatalog();
+            if (!experimentCatalog.isExist(ExperimentCatalogModelType.EXPERIMENT, experimentId)){
+                throw new ExperimentNotFoundException("Requested experiment id " + experimentId
+ " does not exist in the system..");
+            }
+            ExperimentModel experimentModel = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT,
experimentId);
+            if(!(experimentModel.getExperimentStatus().getState() == ExperimentState.CREATED)){
+                logger.error("Error while deleting the experiment");
+                throw new ExperimentCatalogException("Experiment is not in CREATED state.
Hence cannot deleted. ID:"+ experimentId);
+            }
+            experimentCatalog.remove(ExperimentCatalogModelType.EXPERIMENT, experimentId);
+            return true;
+        } catch (Exception e) {
+            logger.error("Error while deleting the experiment", e);
+            AiravataSystemException exception = new AiravataSystemException();
+            exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+            exception.setMessage("Error while deleting the experiment. More info : " + e.getMessage());
+            throw exception;
+        }
+    }
+
+    /**
      * Fetch previously created experiment metadata.
      *
      * @param airavataExperimentId The identifier for the requested experiment. This is returned
during the create experiment step.


Mime
View raw message