Added facilities to use the client outside of container

This commit is contained in:
Luca Frosini 2023-03-02 14:52:43 +01:00
parent 9be6bfa8ec
commit 1a55e93ebe
1 changed files with 12 additions and 2 deletions

View File

@ -12,14 +12,24 @@ public class ResourceRegistrySchemaClientFactory {
private static final Logger logger = LoggerFactory.getLogger(ResourceRegistrySchemaClientFactory.class);
public static ResourceRegistrySchemaClient 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 ResourceRegistrySchemaClient create() {
String address = getResourceRegistryURL();
logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address);
return new ResourceRegistrySchemaClientImpl(address);
}
public static ResourceRegistrySchemaClient 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 ResourceRegistrySchemaClientImpl(address);
}