use of org.ballerinalang.composer.server.spi.ServiceInfo in project ballerina by ballerina-lang.
the class ConfigService method getEndpoints.
private JsonObject getEndpoints() {
JsonObject endpoints = new JsonObject();
Set<Map.Entry<String, ServiceInfo>> entries = serviceEPMap.entrySet();
for (Map.Entry<String, ServiceInfo> entry : entries) {
JsonObject endpoint = new JsonObject();
endpoint.addProperty("endpoint", getEndpoint(entry.getKey()));
endpoints.add(entry.getKey(), endpoint);
}
return endpoints;
}
use of org.ballerinalang.composer.server.spi.ServiceInfo in project ballerina by ballerina-lang.
the class ConfigService method getEndpoint.
private String getEndpoint(String endpointName) {
if (!serviceEPMap.containsKey(endpointName)) {
return null;
}
ServiceInfo serviceInfo = serviceEPMap.get(endpointName);
String protocol = serviceInfo.getType() == ServiceType.HTTP ? "http" : "ws";
return protocol + "://" + serverConfig.getHost() + ":" + serverConfig.getPort() + ServerConstants.CONTEXT_ROOT + "/" + serviceInfo.getPath();
}
Aggregations