Search in sources :

Example 1 with AdapterMetadata

use of io.knotx.knot.action.ActionKnotConfiguration.AdapterMetadata in project knotx by Cognifide.

the class ActionKnotProxyImpl method prepareAdapterRequest.

private AdapterRequest prepareAdapterRequest(KnotContext knotContext, FormEntity formEntity) {
    AdapterMetadata metadata = formEntity.adapter();
    ClientRequest request = new ClientRequest().setPath(knotContext.getClientRequest().getPath()).setMethod(knotContext.getClientRequest().getMethod()).setFormAttributes(knotContext.getClientRequest().getFormAttributes()).setHeaders(getFilteredHeaders(knotContext.getClientRequest().getHeaders(), metadata.getAllowedRequestHeaders()));
    AdapterRequest adapterRequest = new AdapterRequest().setRequest(request).setParams(new JsonObject(metadata.getParams())).setAdapterParams(formEntity.adapterParams());
    LOGGER.info("Adapter [{}] call with request [{}]", metadata.getAddress(), adapterRequest);
    return adapterRequest;
}
Also used : AdapterRequest(io.knotx.dataobjects.AdapterRequest) JsonObject(io.vertx.core.json.JsonObject) AdapterMetadata(io.knotx.knot.action.ActionKnotConfiguration.AdapterMetadata) ClientRequest(io.knotx.dataobjects.ClientRequest)

Aggregations

AdapterRequest (io.knotx.dataobjects.AdapterRequest)1 ClientRequest (io.knotx.dataobjects.ClientRequest)1 AdapterMetadata (io.knotx.knot.action.ActionKnotConfiguration.AdapterMetadata)1 JsonObject (io.vertx.core.json.JsonObject)1