Skip to content

Package: DeviceKeystoreManagementService

DeviceKeystoreManagementService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2021, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.device.management.keystore;
14:
15: import org.eclipse.kapua.KapuaException;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.service.certificate.info.CertificateInfo;
18: import org.eclipse.kapua.service.certificate.info.CertificateInfoService;
19: import org.eclipse.kapua.service.device.management.DeviceManagementService;
20: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystore;
21: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystoreCSR;
22: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystoreCSRInfo;
23: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystoreCertificate;
24: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystoreItem;
25: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystoreItemQuery;
26: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystoreItems;
27: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystoreKeypair;
28: import org.eclipse.kapua.service.device.management.keystore.model.DeviceKeystores;
29: import org.eclipse.kapua.service.device.registry.Device;
30:
31: /**
32: * {@link DeviceKeystore} {@link DeviceManagementService} definition.
33: *
34: * @see DeviceManagementService
35: * @since 1.5.0
36: */
37: public interface DeviceKeystoreManagementService extends DeviceManagementService {
38:
39: /**
40: * Gets the {@link DeviceKeystores} present on the {@link Device}.
41: *
42: * @param scopeId The {@link Device#getScopeId()}.
43: * @param deviceId The {@link Device#getId()}.
44: * @param timeout The timeout waiting for the device response.
45: * @return The {@link DeviceKeystores} retrieved from the {@link Device}.
46: * @throws KapuaException
47: * @since 1.5.0
48: */
49: DeviceKeystores getKeystores(KapuaId scopeId, KapuaId deviceId, Long timeout) throws KapuaException;
50:
51: /**
52: * Gets the {@link DeviceKeystoreItems} present on the {@link Device}.
53: *
54: * @param scopeId The {@link Device#getScopeId()}.
55: * @param deviceId The {@link Device#getId()}.
56: * @param timeout The timeout waiting for the device response.
57: * @return The {@link DeviceKeystoreItems} retrieved from the {@link Device}.
58: * @throws KapuaException
59: * @since 1.5.0
60: */
61: DeviceKeystoreItems getKeystoreItems(KapuaId scopeId, KapuaId deviceId, Long timeout) throws KapuaException;
62:
63: /**
64: * Gets the {@link DeviceKeystoreItems} present on the {@link Device}.
65: *
66: * @param scopeId The {@link Device#getScopeId()}.
67: * @param deviceId The {@link Device#getId()}.
68: * @param itemQuery The {@link DeviceKeystoreItemQuery} to filter results.
69: * @param timeout The timeout waiting for the device response.
70: * @return The {@link DeviceKeystoreItems} retrieved from the {@link Device}.
71: * @throws KapuaException
72: * @since 1.5.0
73: */
74: DeviceKeystoreItems getKeystoreItems(KapuaId scopeId, KapuaId deviceId, DeviceKeystoreItemQuery itemQuery, Long timeout) throws KapuaException;
75:
76: /**
77: * Gets a {@link DeviceKeystoreItem} present on the {@link Device}.
78: *
79: * @param scopeId The {@link Device#getScopeId()}.
80: * @param deviceId The {@link Device#getId()}.
81: * @param keystoreId The {@link DeviceKeystore#getId()}
82: * @param alias The {@link DeviceKeystoreItem#getAlias()}
83: * @param timeout The timeout waiting for the device response.
84: * @return The {@link DeviceKeystoreItem} retrieved from the {@link Device}.
85: * @throws KapuaException
86: */
87: DeviceKeystoreItem getKeystoreItem(KapuaId scopeId, KapuaId deviceId, String keystoreId, String alias, Long timeout) throws KapuaException;
88:
89: /**
90: * Creates a {@link CertificateInfo} as {@link DeviceKeystoreCertificate} into the {@link Device}.
91: * <p>
92: * It uses the {@link CertificateInfoService} to get the {@link CertificateInfo} to send.
93: *
94: * @param scopeId The {@link Device#getScopeId()}.
95: * @param deviceId The {@link Device#getId()}.
96: * @param keystoreId The {@link DeviceKeystore#getId()}.
97: * @param alias The {@link DeviceKeystoreItem#getAlias()}.
98: * @param certificateId The {@link CertificateInfo#getId()} to send.
99: * @param timeout The timeout waiting for the device response.
100: * @throws KapuaException
101: */
102: void createKeystoreCertificate(KapuaId scopeId, KapuaId deviceId, String keystoreId, String alias, KapuaId certificateId, Long timeout) throws KapuaException;
103:
104: /**
105: * Creates a {@link DeviceKeystoreCertificate} into the {@link Device}
106: *
107: * @param scopeId The {@link Device#getScopeId()}.
108: * @param deviceId The {@link Device#getId()}.
109: * @param keystoreCertificate The {@link DeviceKeystoreCertificate} to create.
110: * @param timeout The timeout waiting for the device response.
111: * @throws KapuaException
112: */
113: void createKeystoreCertificate(KapuaId scopeId, KapuaId deviceId, DeviceKeystoreCertificate keystoreCertificate, Long timeout) throws KapuaException;
114:
115: /**
116: * Creates a {@link DeviceKeystoreKeypair} into the {@link Device}
117: *
118: * @param scopeId The {@link Device#getScopeId()}.
119: * @param deviceId The {@link Device#getId()}.
120: * @param keystoreKeypair The {@link DeviceKeystoreKeypair} to create.
121: * @param timeout The timeout waiting for the device response.
122: * @throws KapuaException
123: */
124: void createKeystoreKeypair(KapuaId scopeId, KapuaId deviceId, DeviceKeystoreKeypair keystoreKeypair, Long timeout) throws KapuaException;
125:
126: /**
127: * Sends a {@link DeviceKeystoreCSRInfo} into the {@link Device}
128: *
129: * @param scopeId The {@link Device#getScopeId()}.
130: * @param deviceId The {@link Device#getId()}.
131: * @param keystoreCSRInfo The {@link DeviceKeystoreCSRInfo} to send.
132: * @param timeout The timeout waiting for the device response.
133: * @return The {@link DeviceKeystoreCSR} returned from the {@link Device}
134: * @throws KapuaException
135: */
136: DeviceKeystoreCSR createKeystoreCSR(KapuaId scopeId, KapuaId deviceId, DeviceKeystoreCSRInfo keystoreCSRInfo, Long timeout) throws KapuaException;
137:
138: /**
139: * Deletes a {@link DeviceKeystoreItem} present on the {@link Device}.
140: *
141: * @param scopeId The {@link Device#getScopeId()}.
142: * @param deviceId The {@link Device#getId()}.
143: * @param keystoreId The {@link DeviceKeystoreItem#getKeystoreId()}
144: * @param alias The {@link DeviceKeystoreItem#getAlias()}
145: * @param timeout The timeout waiting for the device response.
146: * @throws KapuaException
147: */
148: void deleteKeystoreItem(KapuaId scopeId, KapuaId deviceId, String keystoreId, String alias, Long timeout) throws KapuaException;
149:
150: }