Package: RequestHandlerContext

RequestHandlerContext

nameinstructionbranchcomplexitylinemethod
RequestHandlerContext(CloudNotificationPublisher, Map)
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getContextProperties()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getNotificationPublisher()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2018 Eurotech and/or its affiliates and others
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License v1.0
6: * which accompanies this distribution, and is available at
7: * http://www.eclipse.org/legal/epl-v10.html
8: *
9: *******************************************************************************/
10: package org.eclipse.kura.cloudconnection.request;
11:
12: import java.util.Collections;
13: import java.util.HashMap;
14: import java.util.Map;
15:
16: import org.eclipse.kura.cloudconnection.publisher.CloudNotificationPublisher;
17: import org.osgi.annotation.versioning.ProviderType;
18:
19: /**
20: * PoJo class used to wrap the context associated to a request received from the cloud and passed to a
21: * {@link RequestHandler}.
22: * It should be used, for example, to provide the context that will be leveraged by a {@link RequestHandler} to publish
23: * event notifications to a remote cloud platform.
24: *
25: * @noextend This class is not intended to be subclassed by clients.
26: * @since 2.0
27: */
28: @ProviderType
29: public class RequestHandlerContext {
30:
31: private final CloudNotificationPublisher notificationPublisher;
32: private final Map<String, String> contextProperties;
33:
34: public RequestHandlerContext(CloudNotificationPublisher notificationPublisher,
35: Map<String, String> contextProperties) {
36: this.notificationPublisher = notificationPublisher;
37: this.contextProperties = new HashMap<>(contextProperties);
38: }
39:
40: public CloudNotificationPublisher getNotificationPublisher() {
41: return this.notificationPublisher;
42: }
43:
44: public Map<String, String> getContextProperties() {
45: return Collections.unmodifiableMap(this.contextProperties);
46: }
47:
48: }