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;
}
Aggregations