airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject svn commit: r1434886 - in /airavata/trunk/modules: registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/ rest/client/src/main/java/org/apache/airavata/rest/client/
Date Thu, 17 Jan 2013 20:11:45 GMT
Author: chathuri
Date: Thu Jan 17 20:11:45 2013
New Revision: 1434886

URL: http://svn.apache.org/viewvc?rev=1434886&view=rev
Log:
fixing custom registry check missed in AiravataJPARegistry

Modified:
    airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
    airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java

Modified: airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java?rev=1434886&r1=1434885&r2=1434886&view=diff
==============================================================================
--- airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
(original)
+++ airavata/trunk/modules/registry/airavata-jpa-registry/src/main/java/org/apache/airavata/persistance/registry/jpa/impl/AiravataJPARegistry.java
Thu Jan 17 20:11:45 2013
@@ -780,12 +780,16 @@ public class AiravataJPARegistry extends
 	}
 
     public void addWorkspaceProject(WorkspaceProject project) throws RegistryException {
-    	WorkerResource worker = jpa.getWorker();
-		if (isWorkspaceProjectExists(project.getProjectName())){
-        	throw new WorkspaceProjectAlreadyExistsException(createProjName(project.getProjectName()));
+        if (projectsRegistry != null){
+            projectsRegistry.addWorkspaceProject(project);
+        } else {
+            WorkerResource worker = jpa.getWorker();
+            if (isWorkspaceProjectExists(project.getProjectName())){
+                throw new WorkspaceProjectAlreadyExistsException(createProjName(project.getProjectName()));
+            }
+            ProjectResource projectResource = worker.createProject(createProjName(project.getProjectName()));
+            projectResource.save();
         }
-		ProjectResource projectResource = worker.createProject(createProjName(project.getProjectName()));
-		projectResource.save();
     }
 
     public void updateWorkspaceProject(WorkspaceProject project) throws RegistryException
{

Modified: airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java?rev=1434886&r1=1434885&r2=1434886&view=diff
==============================================================================
--- airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
(original)
+++ airavata/trunk/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
Thu Jan 17 20:11:45 2013
@@ -564,7 +564,12 @@ public class ProvenanceResourceClient {
                 cookie = response.getCookies().get(0).toCookie();
                 CookieManager.setCookie(cookie);
             }
-            return true;
+            String exists = response.getEntity(String.class);
+            if (exists.equals("True")) {
+                return true;
+            } else {
+                return false;
+            }
         } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
             builder = BasicAuthHeaderUtil.getBuilder(
                     webResource, queryParams, userName, callback.getPassword(userName), null,
gateway);
@@ -607,7 +612,12 @@ public class ProvenanceResourceClient {
                 cookie = response.getCookies().get(0).toCookie();
                 CookieManager.setCookie(cookie);
             }
-            return true;
+            String exists = response.getEntity(String.class);
+            if (exists.equals("True")) {
+                return true;
+            } else {
+                return false;
+            }
         } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
             builder = BasicAuthHeaderUtil.getBuilder(
                     webResource, null, userName, callback.getPassword(userName), null, gateway);
@@ -1546,7 +1556,12 @@ public class ProvenanceResourceClient {
                 cookie = response.getCookies().get(0).toCookie();
                 CookieManager.setCookie(cookie);
             }
-            return true;
+            String exists = response.getEntity(String.class);
+            if (exists.equals("True")) {
+                return true;
+            } else {
+                return false;
+            }
         } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
             builder = BasicAuthHeaderUtil.getBuilder(
                     webResource, queryParams, userName, callback.getPassword(userName), null,
gateway);
@@ -1592,7 +1607,12 @@ public class ProvenanceResourceClient {
                 cookie = response.getCookies().get(0).toCookie();
                 CookieManager.setCookie(cookie);
             }
-            return true;
+            String exists = response.getEntity(String.class);
+            if (exists.equals("True")) {
+                return true;
+            } else {
+                return false;
+            }
         } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
             builder = BasicAuthHeaderUtil.getBuilder(
                     webResource, null, userName, callback.getPassword(userName), null, gateway);



Mime
View raw message