DeviceManagerImpl.java
3.17 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* javax.annotation.Nonnull
* javax.jcr.RepositoryException
* org.apache.commons.collections.Predicate
* org.apache.sling.api.resource.ResourceResolver
* org.apache.sling.commons.json.JSONException
* org.apache.sling.commons.json.JSONObject
*/
package com.adobe.cq.screens.device.impl;
import com.adobe.cq.screens.device.Device;
import com.adobe.cq.screens.device.DeviceConfig;
import com.adobe.cq.screens.device.DeviceManager;
import com.adobe.cq.screens.device.DeviceStatus;
import com.adobe.cq.screens.device.impl.DeviceService;
import java.util.Iterator;
import javax.annotation.Nonnull;
import javax.jcr.RepositoryException;
import org.apache.commons.collections.Predicate;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.JSONObject;
public class DeviceManagerImpl
implements DeviceManager {
private final DeviceService service;
private final ResourceResolver resolver;
public DeviceManagerImpl(DeviceService service, ResourceResolver resolver) {
this.service = service;
this.resolver = resolver;
}
@Override
public DeviceStatus getDeviceStatus(String deviceId) {
return this.service.getDeviceStatus(this.resolver, deviceId);
}
@Override
public Device createDevice(String tenant) throws RepositoryException {
return this.service.createDevice(this.resolver, tenant);
}
@Override
public void deleteDevice(String deviceId) throws RepositoryException {
this.service.deleteDevice(this.resolver, deviceId);
}
@Nonnull
@Override
public String updatePassword(@Nonnull Device device) throws RepositoryException {
return this.service.setPassword(this.resolver, device);
}
@Nonnull
@Override
public Device setMetadata(@Nonnull Device device, @Nonnull JSONObject metadata) throws JSONException, RepositoryException {
return this.service.setMetadata(this.resolver, device, metadata);
}
@Nonnull
@Override
public Device getDevice(@Nonnull String deviceId) {
return this.service.getDevice(this.resolver, deviceId);
}
@Nonnull
@Override
public Iterator<Device> getDevices(Predicate predicate) {
return this.service.getDevices(this.resolver, predicate);
}
@Nonnull
@Override
public Iterator<Device> getDevices() {
return this.service.getDevices(this.resolver, null);
}
@Nonnull
@Override
public Device assignDeviceConfig(@Nonnull Device device, @Nonnull DeviceConfig config) throws RepositoryException {
return this.service.assignDeviceConfig(this.resolver, device, config);
}
@Nonnull
@Override
public Device assignDisplay(@Nonnull Device device, @Nonnull String displayPath) throws RepositoryException {
return this.service.assignDisplay(this.resolver, device, displayPath);
}
@Nonnull
@Override
public Device removeDisplay(@Nonnull Device device, boolean removeConfig) throws RepositoryException {
return this.service.removeDisplay(this.resolver, device, removeConfig);
}
}