OffloadingConfigurator.java
2.77 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.felix.scr.annotations.Activate
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Modified
* org.apache.felix.scr.annotations.Property
* org.apache.felix.scr.annotations.Service
* org.apache.sling.api.resource.ValueMap
* org.apache.sling.api.wrappers.ValueMapDecorator
*/
package com.adobe.granite.offloading.impl;
import java.util.Collections;
import java.util.Map;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Modified;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.api.wrappers.ValueMapDecorator;
@Component(label="Adobe Granite Offloading Configuration", description="The central offloading configuration component", metatype=1)
@Service(value={OffloadingConfigurator.class})
public class OffloadingConfigurator {
private static final String JOB_TYPE_DEFAULT = "slingevent:Job";
private static final String OFFLOADING_JOB_PATH_DEFAULT = "/var/eventing/offloading/assigned";
private static final String SLING_JOB_PATH_DEFAULT = "/var/eventing/jobs/assigned";
private static final String TRANSPORTER_NAME_DEFAULT = "offloading.transporter.default";
private static final String PACKAGE_PATH_PREFIX = "/var/eventing/offloading/packages";
private ValueMap properties = new ValueMapDecorator(Collections.EMPTY_MAP);
@Property(label="Offloading Transporter", description="Name of the offloading transporter implementation. Transporter name must match the service property 'offloading.transporter.name' of the transporter service implementation of choice. The value ''offloading.transporter.default'' selects the default implementation (replication based transport).", value={"offloading.transporter.default"})
private static final String TRANSPORTER = "offloading.transporter";
@Activate
protected void activate(Map<String, Object> props) {
this.modified(props);
}
@Modified
protected void modified(Map<String, Object> props) {
this.properties = new ValueMapDecorator(props);
}
public String getJobType() {
return "slingevent:Job";
}
public String getOffloadingJobPath() {
return "/var/eventing/offloading/assigned";
}
public String getSlingJobPath() {
return "/var/eventing/jobs/assigned";
}
public String getTransporterName() {
return (String)this.properties.get("offloading.transporter", (Object)"offloading.transporter.default");
}
public String getPackagePath() {
return "/var/eventing/offloading/packages";
}
}