Skip to content

Package: MfaAuthenticatorServiceLocator

MfaAuthenticatorServiceLocator

nameinstructionbranchcomplexitylinemethod
MfaAuthenticatorServiceLocator()
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%
getInstance()
M: 17 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
getMfaAuthenticator()
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) 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.authentication.shiro.mfa;
13:
14: import org.eclipse.kapua.service.authentication.mfa.MfaAuthenticator;
15:
16: /**
17: * The {@link MfaAuthenticator} service locator.
18: */
19: public class MfaAuthenticatorServiceLocator {
20:
21: private static MfaAuthenticatorServiceLocator locator;
22:
23: private final MfaAuthenticator mfaAuthenticator;
24:
25: private MfaAuthenticatorServiceLocator() {
26: // for the moment the one implemented in MfaAuthenticatorImpl is the only available authenticator
27: mfaAuthenticator = new MfaAuthenticatorImpl();
28: }
29:
30: public static MfaAuthenticatorServiceLocator getInstance() {
31:• if (locator == null) {
32: synchronized (MfaAuthenticatorServiceLocator.class) {
33:• if (locator == null) {
34: locator = new MfaAuthenticatorServiceLocator();
35: }
36: }
37: }
38: return locator;
39: }
40:
41: /**
42: * Retrieve the {@link MfaAuthenticator} service.
43: *
44: * @return a {@link MfaAuthenticator} object.
45: */
46: public MfaAuthenticator getMfaAuthenticator() {
47: return mfaAuthenticator;
48: }
49:
50: }