use of akka.http.javadsl.model.HttpHeader in project pinpoint by naver.
the class HttpRequestAdaptor method getHeaderNames.
@Override
public Collection<String> getHeaderNames(HttpRequest request) {
if (request == null) {
return Collections.emptyList();
}
final Iterable<HttpHeader> headers = request.getHeaders();
if (headers == null) {
return Collections.emptyList();
}
List<String> names = new ArrayList<>();
for (HttpHeader header : headers) {
names.add(header.name());
}
return names;
}
use of akka.http.javadsl.model.HttpHeader in project pinpoint by naver.
the class HttpRequestAdaptor method getHeader.
private String getHeader(HttpRequest request, String name, String defaultValue) {
if (request == null) {
return defaultValue;
}
Optional<HttpHeader> optional = request.getHeader(name);
if (optional == null) {
return defaultValue;
}
HttpHeader header = optional.orElse(null);
if (header == null) {
return defaultValue;
}
String value = header.value();
if (value == null) {
return defaultValue;
}
return value;
}
use of akka.http.javadsl.model.HttpHeader in project pinpoint by pinpoint-apm.
the class HttpRequestAdaptor method getHeaderNames.
@Override
public Collection<String> getHeaderNames(HttpRequest request) {
if (request == null) {
return Collections.emptyList();
}
final Iterable<HttpHeader> headers = request.getHeaders();
if (headers == null) {
return Collections.emptyList();
}
List<String> names = new ArrayList<>();
for (HttpHeader header : headers) {
names.add(header.name());
}
return names;
}
use of akka.http.javadsl.model.HttpHeader in project pinpoint by pinpoint-apm.
the class HttpRequestAdaptor method getHeader.
private String getHeader(HttpRequest request, String name, String defaultValue) {
if (request == null) {
return defaultValue;
}
Optional<HttpHeader> optional = request.getHeader(name);
if (optional == null) {
return defaultValue;
}
HttpHeader header = optional.orElse(null);
if (header == null) {
return defaultValue;
}
String value = header.value();
if (value == null) {
return defaultValue;
}
return value;
}
Aggregations