use of org.wso2.transport.http.netty.config.TransportsConfiguration in project carbon-apimgt by wso2.
the class RestApiUtil method getHost.
public static String getHost(String protocol) {
TransportsConfiguration transportsConfiguration = YAMLTransportConfigurationBuilder.build();
Set<ListenerConfiguration> listenerConfigurationSet = transportsConfiguration.getListenerConfigurations();
String host = apimConfigurations.getHostname();
if (!apimConfigurations.isReverseProxyEnabled()) {
if (HTTP.equals(protocol)) {
for (ListenerConfiguration listenerConfiguration : listenerConfigurationSet) {
if (HTTP.equals(listenerConfiguration.getScheme())) {
host = host.concat(":").concat(String.valueOf(listenerConfiguration.getPort()));
break;
}
}
} else {
for (ListenerConfiguration listenerConfiguration : listenerConfigurationSet) {
if (HTTPS.equals(listenerConfiguration.getScheme())) {
host = host.concat(":").concat(String.valueOf(listenerConfiguration.getPort()));
}
}
}
}
return host;
}
Aggregations