airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject git commit: check for empty experiment names
Date Wed, 09 Jul 2014 19:39:55 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 40d6a8517 -> 533129f89


check for empty experiment names


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

Branch: refs/heads/master
Commit: 533129f898b419117bed6ad5f89c4ad08de5e671
Parents: 40d6a85
Author: Chathuri Wimalasena <kamalasini@gmail.com>
Authored: Wed Jul 9 15:39:50 2014 -0400
Committer: Chathuri Wimalasena <kamalasini@gmail.com>
Committed: Wed Jul 9 15:39:50 2014 -0400

----------------------------------------------------------------------
 .../airavata/api/server/handler/AiravataServerHandler.java    | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/533129f8/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 b961307..967294a 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
@@ -610,6 +610,13 @@ public class AiravataServerHandler implements Airavata.Iface, Watcher
{
     public String createExperiment(Experiment experiment) throws InvalidRequestException,
AiravataClientException, AiravataSystemException, TException {
         try {
             registry = RegistryFactory.getDefaultRegistry();
+            if (!validateString(experiment.getName())){
+                logger.error("Cannot create experiments with empty experiment name");
+                AiravataSystemException exception = new AiravataSystemException();
+                exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
+                exception.setMessage("Cannot create experiments with empty experiment name");
+                throw exception;
+            }
             return (String)registry.add(ParentDataType.EXPERIMENT, experiment);
         } catch (Exception e) {
             logger.error("Error while creating the experiment", e);


Mime
View raw message