28 lines
1.0 KiB
Java
28 lines
1.0 KiB
Java
package org.gcube.informationsystem.resourceregistry.publisher;
|
|
|
|
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 ResourceRegistryPublisherFactory {
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ResourceRegistryPublisherFactory.class);
|
|
|
|
public static ResourceRegistryPublisher create() {
|
|
String address = String.format("%s/%s", ServiceInstance.getServiceURL(),Constants.SERVICE_NAME);
|
|
logger.trace("The {} will be contacted at {}", Constants.SERVICE_NAME, address);
|
|
return new ResourceRegistryPublisherImpl(address);
|
|
}
|
|
|
|
public static ResourceRegistryPublisher 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 ResourceRegistryPublisherImpl(address);
|
|
}
|
|
|
|
}
|