Skip to content

Package: KuraNotifyChannel

KuraNotifyChannel

nameinstructionbranchcomplexitylinemethod
KuraNotifyChannel(String, String, String)
M: 12 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getParts()
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getResources()
M: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
setResources(String[])
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 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.call.message.kura.app.notification;
14:
15: import org.eclipse.kapua.service.device.call.message.app.notification.DeviceNotifyChannel;
16: import org.eclipse.kapua.service.device.call.message.kura.app.KuraAppChannel;
17:
18: import java.util.Arrays;
19: import java.util.List;
20:
21: /**
22: * {@link DeviceNotifyChannel} {@link org.eclipse.kapua.service.device.call.kura.Kura} implementation.
23: *
24: * @since 1.0.0
25: */
26: public class KuraNotifyChannel extends KuraAppChannel implements DeviceNotifyChannel {
27:
28: /**
29: * The notification resource.
30: *
31: * @since 1.0.0
32: */
33: private String[] resources;
34:
35: /**
36: * Constructor.
37: *
38: * @param messageClassification The message classification.
39: * @param scopeNamespace The scope namespace.
40: * @param clientId The clientId
41: * @see org.eclipse.kapua.service.device.call.message.DeviceChannel
42: * @since 1.0.0
43: */
44: public KuraNotifyChannel(String messageClassification, String scopeNamespace, String clientId) {
45: this.messageClassification = messageClassification;
46: this.scopeNamespace = scopeNamespace;
47: this.clientId = clientId;
48: }
49:
50: @Override
51: public String[] getResources() {
52:• if (resources == null) {
53: resources = new String[0];
54: }
55:
56: return resources;
57: }
58:
59: @Override
60: public void setResources(String[] resources) {
61: this.resources = resources;
62: }
63:
64: @Override
65: public List<String> getParts() {
66: List<String> parts = super.getParts();
67: parts.addAll(Arrays.asList(getResources()));
68: return parts;
69: }
70: }