SyncAgentFactoryImpl.java
2.19 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Service
*/
package com.adobe.cq.dam.mac.sync.impl;
import com.adobe.cq.dam.mac.sync.api.SyncAgent;
import com.adobe.cq.dam.mac.sync.api.SyncAgentFactory;
import com.adobe.cq.dam.mac.sync.impl.SyncAgentImpl;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Service;
@Component(metatype=0)
@Service(value={SyncAgentFactory.class})
public class SyncAgentFactoryImpl
implements SyncAgentFactory {
@Override
public SyncAgent getSyncAgent(String type) {
if (type == null) {
throw new IllegalArgumentException("Type can not be null");
}
if ("Outbox".equals(type)) {
return new SyncAgentImpl(type, null, "cq/replication/components/agent", "/libs/cq/replication/templates/agent");
}
if ("Reverse".equals(type)) {
return new SyncAgentImpl(type, "GET", "cq/replication/components/revagent", "/libs/cq/replication/templates/revagent");
}
if ("Default".equals(type)) {
return new SyncAgentImpl(type, "POST", "cq/replication/components/agent", "/libs/cq/replication/templates/agent");
}
throw new IllegalArgumentException("Type " + type + " is not a recognized type");
}
@Override
public SyncAgent getSyncAgent(String type, String nameHint) {
if (type == null) {
throw new IllegalArgumentException("Type can not be null");
}
if ("Outbox".equals(type)) {
return new SyncAgentImpl(type, null, "cq/replication/components/agent", "/libs/cq/replication/templates/agent", nameHint);
}
if ("Reverse".equals(type)) {
return new SyncAgentImpl(type, "GET", "cq/replication/components/revagent", "/libs/cq/replication/templates/revagent", nameHint);
}
if ("Default".equals(type)) {
return new SyncAgentImpl(type, "POST", "cq/replication/components/agent", "/libs/cq/replication/templates/agent", nameHint);
}
throw new IllegalArgumentException("Type " + type + " is not a recognized type");
}
}