From 83fce2b7e2d652d4ae4bb08e1b9795f831aaffaa Mon Sep 17 00:00:00 2001 From: roberto cirillo Date: Thu, 4 Feb 2021 15:51:13 +0100 Subject: [PATCH] Added ServiceEndpoint coordinates as costants. Now the serviceEndpoint coordinates are DataStorage - StorageManager-S3 as reported in #20505 --- .../storageclient/wrapper/ISClientConnector.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/ISClientConnector.java b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/ISClientConnector.java index b656c4d..28140d5 100644 --- a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/ISClientConnector.java +++ b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/ISClientConnector.java @@ -39,6 +39,14 @@ public class ISClientConnector { protected ServiceEndpoint storageResource; public String region; private static HashMap isCache; + /** + * identify the ServiceEndpoint Category of the storage-manager backend + */ + public final String CATEGORY="DataStorage"; + /** + * identify the ServiceEndpoint name of the storage-manager backend + */ + public final String NAME="StorageManager-S3"; public ISClientConnector(String backendType){ setBackendType(backendType); @@ -71,7 +79,7 @@ public class ISClientConnector { ScopeProvider.instance.set(scope); } SimpleQuery query = queryFor(ServiceEndpoint.class); - query.addCondition("$resource/Profile/Category/text() eq 'DataStorage' and $resource/Profile/Name eq 'StorageManager' "); + query.addCondition("$resource/Profile/Category/text() eq '"+CATEGORY+"' and $resource/Profile/Name eq '"+NAME+"' "); DiscoveryClient client = clientFor(ServiceEndpoint.class); List resources = client.submit(query); if(scope!=null){