resource-registry-schema-cl.../src/main/java/org/gcube/informationsystem/resourceregistry/schema/ResourceRegistrySchemaClien...

38 lines
1.3 KiB
Java
Raw Normal View History

package org.gcube.informationsystem.resourceregistry.schema;
import org.gcube.informationsystem.resourceregistry.api.Constants;
import org.gcube.informationsystem.resourceregistry.api.rest.ServiceInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public class ResourceRegistrySchemaClientFactory {
private static final Logger logger = LoggerFactory.getLogger(ResourceRegistrySchemaClientFactory.class);
2023-02-10 15:36:58 +01:00
public static String getResourceRegistryURL() {
2022-07-25 11:18:52 +02:00
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);
2020-11-04 16:33:33 +01:00
return new ResourceRegistrySchemaClientImpl(address);
}
public static ResourceRegistrySchemaClient create(String context) {
String address = getResourceRegistryURL(context);
logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address);
return new ResourceRegistrySchemaClientImpl(address);
}
}