airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [1/2] airavata git commit: fixing ID match issue
Date Thu, 17 Dec 2015 17:52:29 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 75109b640 -> de9fe01c3


fixing ID match issue


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

Branch: refs/heads/master
Commit: 798bbf044e270c2a9cca4c09414200db1e1b821c
Parents: 3f0d74a
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Thu Dec 17 12:51:00 2015 -0500
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Thu Dec 17 12:51:00 2015 -0500

----------------------------------------------------------------------
 .../apache/airavata/client/samples/DataManagerSample.java    | 8 ++++++--
 .../apache/airavata/data/manager/core/DataManagerImpl.java   | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/798bbf04/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/DataManagerSample.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/DataManagerSample.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/DataManagerSample.java
index 445c401..655ccf6 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/DataManagerSample.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/DataManagerSample.java
@@ -22,6 +22,7 @@ package org.apache.airavata.client.samples;
 
 import org.apache.airavata.api.Airavata;
 import org.apache.airavata.api.client.AiravataClientFactory;
+import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
 import org.apache.airavata.model.data.resource.*;
 import org.apache.airavata.model.security.AuthzToken;
 import org.slf4j.Logger;
@@ -61,8 +62,11 @@ public class DataManagerSample {
             String resourceId = client.registerDataResource(authzToken, dataResourceModel);
             System.out.println(resourceId);
 
-            String replicaId = client.copyDataResource(authzToken, resourceId, STORAGE_RESOURCE_ID,
"/var/www/portals/gateway-user-data/test-dest");
-            System.out.println(replicaId);
+//            String replicaId = client.copyDataResource(authzToken, resourceId, STORAGE_RESOURCE_ID,
"/var/www/portals/gateway-user-data/test-dest");
+//            System.out.println(replicaId);
+
+            GatewayResourceProfile gatewayResourceProfile = client.getGatewayResourceProfile(authzToken,
DEFAULT_GATEWAY);
+            System.out.println(gatewayResourceProfile.getGatewayID());
         } catch (Exception e) {
             logger.error("Error while connecting with server", e.getMessage());
             e.printStackTrace();

http://git-wip-us.apache.org/repos/asf/airavata/blob/798bbf04/modules/data-manager/data-manager-core/src/main/java/org/apache/airavata/data/manager/core/DataManagerImpl.java
----------------------------------------------------------------------
diff --git a/modules/data-manager/data-manager-core/src/main/java/org/apache/airavata/data/manager/core/DataManagerImpl.java
b/modules/data-manager/data-manager-core/src/main/java/org/apache/airavata/data/manager/core/DataManagerImpl.java
index c2d9686..7c600d7 100644
--- a/modules/data-manager/data-manager-core/src/main/java/org/apache/airavata/data/manager/core/DataManagerImpl.java
+++ b/modules/data-manager/data-manager-core/src/main/java/org/apache/airavata/data/manager/core/DataManagerImpl.java
@@ -279,12 +279,12 @@ public class DataManagerImpl implements DataManager {
             GatewayResourceProfile gatewayProfile = appCatalog.getGatewayProfile().getGatewayProfile(dataResourceModel.getGatewayId());
             List<StoragePreference> storagePreferences = gatewayProfile.getStoragePreferences();
             Optional<StoragePreference> sourceResourcePreference = storagePreferences.stream()
-                    .filter(sp -> sp.getStorageResourceId() == sourceStorageResource.getStorageResourceId()).findFirst();
+                    .filter(sp -> sp.getStorageResourceId().equals(sourceStorageResource.getStorageResourceId())).findFirst();
             if(!sourceResourcePreference.isPresent())
                 throw new DataCatalogException("Could not find storage preference for storage
resource id:"
                         + sourceStorageResource.getStorageResourceId());
             Optional<StoragePreference> destResourcePreference = storagePreferences.stream()
-                    .filter(sp -> sp.getStorageResourceId() == destinationStorageResource.getStorageResourceId()).findFirst();
+                    .filter(sp -> sp.getStorageResourceId().equals(destinationStorageResource.getStorageResourceId())).findFirst();
             if(!destResourcePreference.isPresent())
                 throw new DataCatalogException("Could not find storage preference for storage
resource id:"
                         + destinationStorageResource.getStorageResourceId());


Mime
View raw message