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