DPSConnectionImpl.java
3.13 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.dps.client.authorization.AuthorizationDao
* com.adobe.dps.client.factory.DaoFactory
* com.adobe.dps.client.producer.ContentProducerDAO
* com.adobe.dps.client.producer.EntityProducerDAO
* com.adobe.dps.client.producer.api.ProducerApi
* com.adobe.dps.client.producer.api.ProducerApiImpl
* com.adobe.dps.client.producer.utils.AccessToken
* com.adobe.dps.client.producer.utils.Session
* com.adobe.dps.client.utils.Config
* com.day.cq.wcm.webservicesupport.Configuration
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.cq.mobile.dps.impl.service;
import com.adobe.cq.mobile.dps.DPSException;
import com.adobe.cq.mobile.dps.impl.DPSConnection;
import com.adobe.cq.mobile.dps.impl.service.AdobeDPSClient;
import com.adobe.dps.client.authorization.AuthorizationDao;
import com.adobe.dps.client.factory.DaoFactory;
import com.adobe.dps.client.producer.ContentProducerDAO;
import com.adobe.dps.client.producer.EntityProducerDAO;
import com.adobe.dps.client.producer.api.ProducerApi;
import com.adobe.dps.client.producer.api.ProducerApiImpl;
import com.adobe.dps.client.producer.utils.AccessToken;
import com.adobe.dps.client.producer.utils.Session;
import com.adobe.dps.client.utils.Config;
import com.day.cq.wcm.webservicesupport.Configuration;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DPSConnectionImpl
implements DPSConnection {
private static final Logger LOGGER = LoggerFactory.getLogger(DPSConnectionImpl.class);
private Configuration configuration = null;
private AdobeDPSClient adobeDPSClient = null;
private Config config = null;
public DPSConnectionImpl(Configuration configuration, AdobeDPSClient adobePublishClient) {
this.configuration = configuration;
this.adobeDPSClient = adobePublishClient;
}
@Override
public ContentProducerDAO getContentAccess() throws DPSException {
return DaoFactory.getContentAccess((Config)this.getConfig(), (Properties)this.adobeDPSClient.getHttpProperties());
}
@Override
public EntityProducerDAO getEntityAccess() throws DPSException {
return DaoFactory.getEntityAccess((Config)this.getConfig(), (Properties)this.adobeDPSClient.getHttpProperties());
}
@Override
public ProducerApi getProducerAPI(String projectId) throws DPSException {
return new ProducerApiImpl(this.getAccessToken(), this.getEntityAccess(), this.getContentAccess(), projectId);
}
@Override
public AccessToken getAccessToken() throws DPSException {
return this.adobeDPSClient.getAccessToken(this.getConfig());
}
@Override
public AuthorizationDao getAuthorizationAccess() throws DPSException {
return new AuthorizationDao(this.getConfig());
}
@Override
public Session getSession() throws DPSException {
return new Session();
}
private Config getConfig() throws DPSException {
if (this.config == null) {
this.config = this.adobeDPSClient.getConfig(this.configuration);
}
return this.config;
}
}