Search in sources :

Example 6 with Notification

use of com.adobe.target.delivery.v1.model.Notification 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);
}
Also used : DeliveryRequest(com.adobe.target.delivery.v1.model.DeliveryRequest) TargetDeliveryRequest(com.adobe.target.edge.client.model.TargetDeliveryRequest) TargetDeliveryRequest(com.adobe.target.edge.client.model.TargetDeliveryRequest)

Aggregations

TargetDeliveryRequest (com.adobe.target.edge.client.model.TargetDeliveryRequest)5 Notification (com.adobe.target.delivery.v1.model.Notification)4 Context (com.adobe.target.delivery.v1.model.Context)3 DeliveryRequest (com.adobe.target.delivery.v1.model.DeliveryRequest)3 ExecuteRequest (com.adobe.target.delivery.v1.model.ExecuteRequest)2 PrefetchRequest (com.adobe.target.delivery.v1.model.PrefetchRequest)2 RequestDetails (com.adobe.target.delivery.v1.model.RequestDetails)2 TargetDeliveryResponse (com.adobe.target.edge.client.model.TargetDeliveryResponse)2 TargetTestDeliveryRequestUtils.getContext (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getContext)2 TimingTool (com.adobe.target.edge.client.utils.TimingTool)2 Test (org.junit.jupiter.api.Test)2 DeliveryResponse (com.adobe.target.delivery.v1.model.DeliveryResponse)1 MboxRequest (com.adobe.target.delivery.v1.model.MboxRequest)1 NotificationMbox (com.adobe.target.delivery.v1.model.NotificationMbox)1 Telemetry (com.adobe.target.delivery.v1.model.Telemetry)1 VisitorId (com.adobe.target.delivery.v1.model.VisitorId)1 OnDeviceDecisioningRuleSet (com.adobe.target.edge.client.model.ondevice.OnDeviceDecisioningRuleSet)1 TargetTestDeliveryRequestUtils.getLocalContext (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getLocalContext)1 TargetTestDeliveryRequestUtils.getMboxExecuteRequest (com.adobe.target.edge.client.utils.TargetTestDeliveryRequestUtils.getMboxExecuteRequest)1 ArrayList (java.util.ArrayList)1