use of com.adobe.target.delivery.v1.model.DeliveryRequest in project target-java-sdk by adobe.
the class NotificationService method buildNotifications.
public void buildNotifications(TargetDeliveryRequest targetDeliveryRequest, TargetDeliveryResponse targetDeliveryResponse, List<Notification> notifications) {
boolean noNotifications = notifications == null || notifications.isEmpty();
if (noNotifications) {
return;
}
DeliveryRequest deliveryRequest = targetDeliveryRequest.getDeliveryRequest();
setBeaconToFalse(deliveryRequest);
String locationHint = targetDeliveryRequest.getLocationHint() != null ? targetDeliveryRequest.getLocationHint() : this.clusterLocator.getLocationHint();
TargetDeliveryRequest notificationRequest = TargetDeliveryRequest.builder().locationHint(locationHint).sessionId(targetDeliveryRequest.getSessionId()).visitor(targetDeliveryRequest.getVisitor()).decisioningMethod(DecisioningMethod.SERVER_SIDE).requestId(UUID.randomUUID().toString()).impressionId(UUID.randomUUID().toString()).id(deliveryRequest.getId() != null ? deliveryRequest.getId() : targetDeliveryResponse.getResponse().getId()).experienceCloud(deliveryRequest.getExperienceCloud()).context(deliveryRequest.getContext()).environmentId(deliveryRequest.getEnvironmentId()).qaMode(deliveryRequest.getQaMode()).property(deliveryRequest.getProperty()).notifications(notifications).trace(deliveryRequest.getTrace()).build();
this.sendNotification(notificationRequest);
}
use of com.adobe.target.delivery.v1.model.DeliveryRequest in project target-java-sdk by adobe.
the class TelemetryService method addTelemetry.
public void addTelemetry(TargetDeliveryRequest deliveryRequest, TimingTool timer, TargetDeliveryResponse targetDeliveryResponse) {
TelemetryEntry telemetryEntry = createTelemetryEntry(deliveryRequest, targetDeliveryResponse, timer.timeEnd(TIMING_EXECUTE_REQUEST));
if (telemetryEntry == null) {
return;
}
storedTelemetries.add(telemetryEntry);
}
use of com.adobe.target.delivery.v1.model.DeliveryRequest in project target-java-sdk by adobe.
the class LogUtils method getRequestDetails.
public static String getRequestDetails(TargetDeliveryRequest targetDeliveryRequest) {
DeliveryRequest deliveryRequest = targetDeliveryRequest.getDeliveryRequest();
StringBuilder builder = new StringBuilder();
builder.append("(");
Map<String, String> details = new HashMap<>();
details.put("sessionId", targetDeliveryRequest.getSessionId());
details.put("requestId", deliveryRequest.getRequestId());
Iterator<Map.Entry<String, String>> entrySet = details.entrySet().iterator();
while (entrySet.hasNext()) {
Map.Entry<String, String> entry = entrySet.next();
builder.append(entry.getKey() + ":" + entry.getValue());
if (entrySet.hasNext()) {
builder.append(", ");
}
}
builder.append(")");
return builder.toString();
}
Aggregations