From c371748ca7f97221b148309c4e4a2bbf5ccf821a Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Thu, 2 Mar 2023 14:52:37 +0100 Subject: [PATCH] Added facilities to use the client outside of container --- ...ResourceRegistryQueryTemplateClientFactory.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/templates/ResourceRegistryQueryTemplateClientFactory.java b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/templates/ResourceRegistryQueryTemplateClientFactory.java index 43eb557..280f5fd 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/queries/templates/ResourceRegistryQueryTemplateClientFactory.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/queries/templates/ResourceRegistryQueryTemplateClientFactory.java @@ -12,14 +12,24 @@ public class ResourceRegistryQueryTemplateClientFactory { private static final Logger logger = LoggerFactory.getLogger(ResourceRegistryQueryTemplateClientFactory.class); - public static ResourceRegistryQueryTemplateClient create() { + public static String getResourceRegistryURL() { String address = String.format("%s/%s", ServiceInstance.getServiceURL(),Constants.SERVICE_NAME); + return address; + } + + public static String getResourceRegistryURL(String context) { + String address = String.format("%s/%s", ServiceInstance.getServiceURL(context),Constants.SERVICE_NAME); + return address; + } + + public static ResourceRegistryQueryTemplateClient create() { + String address = getResourceRegistryURL(); logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address); return new ResourceRegistryQueryTemplateClientImpl(address); } public static ResourceRegistryQueryTemplateClient create(String context) { - String address = String.format("%s/%s", ServiceInstance.getServiceURL(context),Constants.SERVICE_NAME); + String address = getResourceRegistryURL(context); logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address); return new ResourceRegistryQueryTemplateClientImpl(address); }