Package: SingleNodeListenParams

SingleNodeListenParams

nameinstructionbranchcomplexitylinemethod
SingleNodeListenParams(Map)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
SingleNodeListenParams(ReadValueId, double, long, boolean)
M: 13 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
getDiscardOldest()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getQueueSize()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSamplingInterval()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2019 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:
11: package org.eclipse.kura.internal.driver.opcua.request;
12:
13: import static org.eclipse.kura.internal.driver.opcua.Utils.tryExtract;
14:
15: import java.util.Map;
16:
17: import org.eclipse.kura.internal.driver.opcua.OpcUaChannelDescriptor;
18: import org.eclipse.milo.opcua.stack.core.types.structured.ReadValueId;
19:
20: public class SingleNodeListenParams extends ListenParams {
21:
22: private final double samplingInterval;
23: private final long queueSize;
24: private final boolean discardOldest;
25:
26: public SingleNodeListenParams(final ReadValueId readValueId, final double samplingInterval, final long queueSize,
27: final boolean discardOldest) {
28: super(readValueId);
29: this.samplingInterval = samplingInterval;
30: this.queueSize = queueSize;
31: this.discardOldest = discardOldest;
32: }
33:
34: public SingleNodeListenParams(Map<String, Object> channelConfig) {
35: super(channelConfig);
36: this.samplingInterval = tryExtract(channelConfig, OpcUaChannelDescriptor::getSamplingInterval,
37: "Error while retrieving Sampling Interval");
38: this.queueSize = tryExtract(channelConfig, OpcUaChannelDescriptor::getQueueSize,
39: "Error while retrieving Queue Size");
40: this.discardOldest = tryExtract(channelConfig, OpcUaChannelDescriptor::getDiscardOldest,
41: "Error while retrieving Discard Oldest parameter");
42: }
43:
44: @Override
45: public double getSamplingInterval() {
46: return samplingInterval;
47: }
48:
49: @Override
50: public long getQueueSize() {
51: return queueSize;
52: }
53:
54: @Override
55: public boolean getDiscardOldest() {
56: return discardOldest;
57: }
58:
59: }