Search in sources :

Example 1 with HTTP

use of net.opengis.ows.x11.HTTPDocument.HTTP 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()));
        });
    }
}
Also used : OwsHttp(org.n52.shetland.ogc.ows.OwsHttp) HTTP(net.opengis.ows.x11.HTTPDocument.HTTP) OwsRequestMethod(org.n52.shetland.ogc.ows.OwsRequestMethod) RequestMethodType(net.opengis.ows.x11.RequestMethodType)

Aggregations

HTTP (net.opengis.ows.x11.HTTPDocument.HTTP)1 RequestMethodType (net.opengis.ows.x11.RequestMethodType)1 OwsHttp (org.n52.shetland.ogc.ows.OwsHttp)1 OwsRequestMethod (org.n52.shetland.ogc.ows.OwsRequestMethod)1