use of com.adobe.target.edge.client.model.TargetDeliveryResponse in project target-java-sdk by adobe.
the class DefaultTargetClient method getOffersAsync.
@Override
public CompletableFuture<TargetDeliveryResponse> getOffersAsync(TargetDeliveryRequest request) {
try {
Objects.requireNonNull(request, "request cannot be null");
CompletableFuture<TargetDeliveryResponse> targetDeliveryResponse;
DecisioningMethod decisioningMethod = getDecisioningMethod(request);
updatePropertyToken(request);
if (decisioningMethod == DecisioningMethod.ON_DEVICE || (decisioningMethod == DecisioningMethod.HYBRID && localService.evaluateLocalExecution(request).isAllLocal())) {
targetDeliveryResponse = localService.executeRequestAsync(request);
} else {
targetDeliveryResponse = targetService.executeRequestAsync(request);
}
return targetDeliveryResponse;
} catch (Exception e) {
TargetRequestException targetRequestException = new TargetRequestException(e.getMessage(), e, request);
logger.error(targetRequestException.getMessage());
throw targetRequestException;
}
}
Aggregations