use of org.n52.shetland.ogc.ows.OwsRequestMethod in project arctic-sea by 52North.
the class AbstractOperationHandler method getRequestMethodsForServiceURL.
private Stream<OwsRequestMethod> getRequestMethodsForServiceURL(OwsOperationKey operation) {
Map<String, Set<OwsValue>> mediaTypesByMethod = new HashMap<>(HTTPMethods.METHODS.size());
this.bindingRepository.getBindings().values().stream().forEach(binding -> HTTPMethods.METHODS.stream().filter(isMethodSupported(binding, operation)).forEach(method -> mediaTypesByMethod.computeIfAbsent(method, Functions.forSupplier(HashSet::new)).addAll(getMediaTypes(binding))));
return mediaTypesByMethod.entrySet().stream().map(e -> new OwsRequestMethod(this.serviceURL, e.getKey(), createContentTypeDomains(e.getValue())));
}
use of org.n52.shetland.ogc.ows.OwsRequestMethod in project arctic-sea by 52North.
the class OwsEncoderv110 method encodeOwsDCP.
private void encodeOwsDCP(OwsDCP dcp, DCP xdcp) {
if (dcp.isHTTP()) {
HTTP xhttp = xdcp.addNewHTTP();
OwsHttp http = dcp.asHTTP();
SortedSet<OwsRequestMethod> requestMethods = http.getRequestMethods();
requestMethods.forEach(method -> {
RequestMethodType xmethod;
switch(method.getHttpMethod()) {
case HTTPMethods.GET:
xmethod = xhttp.addNewGet();
break;
case HTTPMethods.POST:
xmethod = xhttp.addNewPost();
break;
default:
return;
}
encodeOnlineResource(method, xmethod);
method.getConstraints().forEach(x -> encodeOwsDomain(x, xmethod.addNewConstraint()));
});
}
}
use of org.n52.shetland.ogc.ows.OwsRequestMethod in project arctic-sea by 52North.
the class AbstractCapabilitiesBaseTypeDecoder method parseRequestMethod.
private OwsRequestMethod parseRequestMethod(String httpMethod, RequestMethodType method) {
if (method == null) {
return null;
}
URI href = Optional.ofNullable(method.getHref()).map(Strings::emptyToNull).map(URI::create).orElse(null);
URI role = Optional.ofNullable(method.getRole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
URI arcrole = Optional.ofNullable(method.getArcrole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
Show show = Optional.ofNullable(method.getShow()).map(Object::toString).map(Show::valueOf).orElse(null);
Actuate actuate = Optional.ofNullable(method.getActuate()).map(Object::toString).map(Actuate::valueOf).orElse(null);
String title = method.getTitle();
List<OwsDomain> constraints = parseDomains(method.getConstraintArray());
return new OwsRequestMethod(href, constraints, httpMethod, role, arcrole, title, show, actuate);
}
Aggregations