JsonResponseSegmentList.java
1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.commons.json.JSONException
* org.apache.sling.commons.json.JSONObject
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.cq.aam.demdex;
import com.adobe.cq.aam.client.spi.AudienceManagerConfiguration;
import com.adobe.cq.aam.client.spi.AudienceManagerItem;
import com.adobe.cq.aam.client.spi.SegmentService;
import com.adobe.cq.aam.demdex.JsonResponseSegmentIdList;
import com.adobe.cq.aam.demdex.SegmentListException;
import java.util.Iterator;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JsonResponseSegmentList
implements Iterable<AudienceManagerItem> {
private static final Logger LOGGER = LoggerFactory.getLogger(JsonResponseSegmentList.class);
private Iterable<AudienceManagerItem> items;
public JsonResponseSegmentList(SegmentService segmentService, AudienceManagerConfiguration config, JSONObject json) throws SegmentListException {
JsonResponseSegmentIdList segmentIds = new JsonResponseSegmentIdList(segmentService, config, json);
this.items = segmentService.getSegments(config, segmentIds, "aam_sid");
try {
LOGGER.debug("Items is {} from {} ", this.items, (Object)json.toString(2));
}
catch (JSONException e) {
LOGGER.debug(e.getMessage(), (Throwable)e);
}
}
@Override
public Iterator<AudienceManagerItem> iterator() {
return this.items.iterator();
}
}