Added facilities to use the client outside of container

This commit is contained in:
Luca Frosini 2023-03-02 14:52:37 +01:00
parent ac4b3ac056
commit c371748ca7
1 changed files with 12 additions and 2 deletions

View File

@ -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);
}