New social client
This commit is contained in:
parent
5088ed448e
commit
dadf817c3a
|
@ -1,6 +1,6 @@
|
|||
# Changelog
|
||||
|
||||
## [v1.2.1] - 2023-11-20
|
||||
## [v1.3.1] - 2023-11-20
|
||||
|
||||
- Corresponding API calls for all the public functions in Social Networking Library
|
||||
|
||||
|
|
|
@ -10,20 +10,28 @@ import org.slf4j.LoggerFactory;
|
|||
*/
|
||||
public abstract class BaseClient {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(BaseClient.class);
|
||||
private String serviceEndpoint;
|
||||
|
||||
public BaseClient(String subPath) throws Exception {
|
||||
ServiceDiscoverer discoverer = new ServiceDiscoverer();
|
||||
logger.debug("Discovering service...");
|
||||
serviceEndpoint = discoverer.getEntryPoint();
|
||||
serviceEndpoint = serviceEndpoint.endsWith("/") ? serviceEndpoint + subPath :
|
||||
serviceEndpoint + "/" + subPath;
|
||||
logger.debug("Discovered service " + serviceEndpoint);
|
||||
}
|
||||
private static Logger logger = LoggerFactory.getLogger(BaseClient.class);
|
||||
private String serviceEndpoint;
|
||||
|
||||
public String getServiceEndpoint() {
|
||||
return serviceEndpoint;
|
||||
}
|
||||
|
||||
public BaseClient(String subPath) throws Exception {
|
||||
//ServiceDiscoverer discoverer = new ServiceDiscoverer();
|
||||
//serviceEndpoint = discoverer.getEntryPoint();
|
||||
logger.debug("Discovering service...");
|
||||
|
||||
|
||||
logger.debug(" \n\n\n *** I found " + serviceEndpoint);
|
||||
|
||||
serviceEndpoint = "https://api.dev.d4science.org/rest";
|
||||
|
||||
logger.debug("\n replacing it with "+ serviceEndpoint);
|
||||
|
||||
serviceEndpoint = serviceEndpoint.endsWith("/") ? serviceEndpoint + subPath :
|
||||
serviceEndpoint + "/" + subPath;
|
||||
logger.info("\n\n ABZ Discovered service " + serviceEndpoint);
|
||||
}
|
||||
|
||||
public String getServiceEndpoint() {
|
||||
logger.info("\n\n RETURNING Discovered service " + serviceEndpoint);
|
||||
return serviceEndpoint;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ import java.util.Map;
|
|||
|
||||
public class LibClient extends BaseClient{
|
||||
|
||||
private static final String SUB_SERVICE_PATH = "lib/";
|
||||
private static final String SUB_SERVICE_PATH = "2/lib/";
|
||||
private static Logger logger = LoggerFactory.getLogger(LibClient.class);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue