use of com.adobe.target.delivery.v1.model.DeliveryResponse in project target-java-sdk by adobe.
the class DefaultTargetService method executeRequest.
@Override
public TargetDeliveryResponse executeRequest(TargetDeliveryRequest deliveryRequest) {
TimingTool timer = new TimingTool();
timer.timeStart(TIMING_EXECUTE_REQUEST);
TargetDeliveryResponse targetDeliveryResponse;
Telemetry telemetry = telemetryService.getTelemetry();
if (!telemetry.getEntries().isEmpty()) {
deliveryRequest.getDeliveryRequest().setTelemetry(telemetry);
}
ResponseWrapper<DeliveryResponse> response = callDeliveryApi(deliveryRequest);
targetDeliveryResponse = getTargetDeliveryResponse(deliveryRequest, response.getHttpResponse());
/* capture Telemetry information once original request's response is received */
telemetryService.addTelemetry(deliveryRequest, timer, targetDeliveryResponse, response.getParsingTime(), response.getResponseSize());
return targetDeliveryResponse;
}
use of com.adobe.target.delivery.v1.model.DeliveryResponse in project target-java-sdk by adobe.
the class TargetAttributesResponse method toMap.
private static Map<String, Map<String, Object>> toMap(TargetDeliveryResponse targetResponse) {
if (targetResponse == null) {
return null;
}
Map<String, Map<String, Object>> result = new HashMap<>();
String globalMbox = getGlobalMbox(targetResponse);
DeliveryResponse response = targetResponse.getResponse();
PrefetchResponse prefetchResponse = response.getPrefetch();
ExecuteResponse executeResponse = response.getExecute();
processPrefetch(result, prefetchResponse, globalMbox);
processExecute(result, executeResponse, globalMbox);
return toReadOnlyMap(result);
}
Aggregations