Skip to content

Package: ConnectionUserCouplingMode

ConnectionUserCouplingMode

nameinstructionbranchcomplexitylinemethod
ConnectionUserCouplingMode(String, int)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
ConnectionUserCouplingMode(String, int, boolean)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
isUsableAsAccountDefault()
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%
static {...}
M: 35 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 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.registry;
14:
15: /**
16: * Defines the strategy to validate credentials during device login.
17: *
18: * @since 1.0
19: *
20: */
21: public enum ConnectionUserCouplingMode {
22: /**
23: * Strategy to use will be picked up from the default value set for the current account.
24: *
25: * This value cannot be used as a default for the account.
26: */
27: INHERITED(false),
28:
29: /**
30: * Device can change login credentials between credentials and
31: * can use credentials that are used by another device.<br>
32: * <br>
33: * This is the most insecure strategy.
34: */
35: LOOSE,
36:
37: /**
38: * Device cannot change login credentials between logins and
39: * cannot use credentials that are used by another device.<br>
40: * <br>
41: * This is the most secure strategy.
42: */
43: STRICT;
44:
45: private boolean usableAsAccountDefault;
46:
47: /**
48: * Constructor
49: */
50: ConnectionUserCouplingMode() {
51: this(true);
52: }
53:
54: ConnectionUserCouplingMode(boolean usableAsAccountDefault) {
55: this.usableAsAccountDefault = usableAsAccountDefault;
56: }
57:
58: /**
59: * Returns whether or not this value can be used as a default for the default tight value in an account.
60: *
61: * @return true if it is usable, false if not
62: */
63: public boolean isUsableAsAccountDefault() {
64: return usableAsAccountDefault;
65: }
66: }