GetStatus.java
2.24 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
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.dps.client.producer.EntityProducerDAO
* com.adobe.dps.client.producer.exceptions.ProducerException
* com.adobe.dps.client.producer.exceptions.ProducerRequestException
* com.adobe.dps.client.producer.utils.AccessToken
* com.adobe.dps.client.producer.utils.Session
* com.adobe.dps.producer.entity.dto.StatusList
* org.apache.sling.commons.json.JSONException
* org.apache.sling.commons.json.JSONObject
*/
package com.adobe.cq.mobile.dps.impl.service.actions;
import com.adobe.cq.mobile.dps.impl.service.actions.AbstractCallableDPSAction;
import com.adobe.cq.mobile.dps.impl.ui.PerfTimer;
import com.adobe.cq.mobile.dps.impl.utils.MetadataJSONUtil;
import com.adobe.dps.client.producer.EntityProducerDAO;
import com.adobe.dps.client.producer.exceptions.ProducerException;
import com.adobe.dps.client.producer.exceptions.ProducerRequestException;
import com.adobe.dps.client.producer.utils.AccessToken;
import com.adobe.dps.client.producer.utils.Session;
import com.adobe.dps.producer.entity.dto.StatusList;
import java.util.concurrent.Callable;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.JSONObject;
public class GetStatus
extends AbstractCallableDPSAction
implements Callable<JSONObject> {
public static final String KEY_ID = "id";
public static final String KEY_STATUS = "status";
private final String entityHref;
public GetStatus(EntityProducerDAO entityAccess, AccessToken accessToken, Session session, String entityHref) {
super(entityAccess, accessToken, session);
this.entityHref = entityHref;
}
@Override
public JSONObject call() throws Exception {
return this.getStatus();
}
private JSONObject getStatus() throws ProducerException, ProducerRequestException, JSONException {
PerfTimer perfTimer = PerfTimer.startTimer(this, this.getClass().getName());
JSONObject statusJSON = new JSONObject();
StatusList status = this.getStatus(this.entityHref);
statusJSON.put("id", (Object)this.entityHref);
statusJSON.put("status", (Object)MetadataJSONUtil.getStatusJSON(status));
perfTimer.end();
return statusJSON;
}
}