From a0dd4422b0b950c7c2313986a30b6fbb7889a08f Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 27 Feb 2023 18:52:23 +0100 Subject: [PATCH] Added the possibility to create a client instance by context --- .../client/ResourceRegistryClientFactory.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientFactory.java b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientFactory.java index 9379741..3d43f69 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientFactory.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/client/ResourceRegistryClientFactory.java @@ -18,4 +18,10 @@ public class ResourceRegistryClientFactory { return new ResourceRegistryClientImpl(address); } + public static ResourceRegistryClient create(String context) { + String address = String.format("%s/%s", ServiceInstance.getServiceURL(context),Constants.SERVICE_NAME); + logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address); + return new ResourceRegistryClientImpl(address); + } + }