CodeUpgraderFactoryImpl.java
1.7 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.jcr.Session
* org.apache.felix.scr.annotations.Component
* org.apache.felix.scr.annotations.Property
* org.apache.felix.scr.annotations.Service
* org.osgi.service.component.ComponentContext
*/
package com.day.cq.compat.codeupgrade.impl;
import com.day.cq.compat.codeupgrade.impl.CodeUpgraderImpl;
import com.day.cq.compat.codeupgrade.impl.NodeBackupImpl;
import com.day.cq.compat.codeupgrade.internal.api.CodeUpgrader;
import com.day.cq.compat.codeupgrade.internal.api.CodeUpgraderFactory;
import com.day.cq.compat.codeupgrade.internal.api.NodeBackup;
import java.util.Dictionary;
import javax.jcr.Session;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.osgi.service.component.ComponentContext;
@Component(metatype=1, label="%CodeUpgraderFactoryImpl.name", description="%CodeUpgraderFactoryImpl.description")
@Service
public class CodeUpgraderFactoryImpl
implements CodeUpgraderFactory {
private String backupRootPath;
@Property(value={"/var/upgrade/backup/5.3"})
public static final String PROP_BACKUP_ROOT_PATH = "backup.root.path";
@Override
public CodeUpgrader createUpgrader(Session s, String configPath) throws Exception {
return new CodeUpgraderImpl(s, configPath);
}
@Override
public NodeBackup createNodeBackup() {
return new NodeBackupImpl(this.backupRootPath);
}
public void activate(ComponentContext ctx) throws Exception {
Dictionary properties = ctx.getProperties();
this.backupRootPath = (String)properties.get("backup.root.path");
}
}