2017-04-03 18:44:47 +02:00
|
|
|
package org.gcube.informationsystem.resourceregistry.client;
|
|
|
|
|
|
|
|
import org.gcube.informationsystem.resourceregistry.api.Constants;
|
2022-07-21 16:55:22 +02:00
|
|
|
import org.gcube.informationsystem.resourceregistry.api.rest.ServiceInstance;
|
2017-06-22 17:25:14 +02:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
2017-04-03 18:44:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
|
|
*/
|
|
|
|
public class ResourceRegistryClientFactory {
|
|
|
|
|
2017-06-22 17:25:14 +02:00
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ResourceRegistryClientFactory.class);
|
|
|
|
|
2020-11-04 16:23:06 +01:00
|
|
|
public static ResourceRegistryClient create() {
|
2022-07-25 11:07:32 +02:00
|
|
|
String address = String.format("%s/%s", ServiceInstance.getServiceURL(),Constants.SERVICE_NAME);
|
2022-07-21 16:55:22 +02:00
|
|
|
logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address);
|
2020-11-04 16:23:06 +01:00
|
|
|
return new ResourceRegistryClientImpl(address);
|
2017-04-03 18:44:47 +02:00
|
|
|
}
|
|
|
|
|
2023-02-27 18:52:23 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2017-04-03 18:44:47 +02:00
|
|
|
}
|