Skip to content

Package: GenericOpenIDLocator

GenericOpenIDLocator

nameinstructionbranchcomplexitylinemethod
GenericOpenIDLocator()
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%
close()
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getProcessor()
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%
getService()
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%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Red Hat Inc 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: * Red Hat Inc - initial API and implementation
12: * Eurotech
13: *******************************************************************************/
14: package org.eclipse.kapua.plugin.sso.openid.provider.generic;
15:
16: import org.eclipse.kapua.plugin.sso.openid.JwtProcessor;
17: import org.eclipse.kapua.plugin.sso.openid.OpenIDService;
18: import org.eclipse.kapua.plugin.sso.openid.exception.OpenIDException;
19: import org.eclipse.kapua.plugin.sso.openid.provider.OpenIDProvider.ProviderLocator;
20: import org.eclipse.kapua.plugin.sso.openid.provider.generic.jwt.GenericJwtProcessor;
21:
22: /**
23: * The generic OpenID Connect service provider locator.
24: */
25: public class GenericOpenIDLocator implements ProviderLocator {
26:
27: private static JwtProcessor jwtProcessorInstance;
28: private static OpenIDService openidServiceInstance;
29:
30: @Override
31: public OpenIDService getService() {
32:• if (openidServiceInstance == null) {
33: synchronized (GenericOpenIDLocator.class) {
34:• if (openidServiceInstance == null) {
35: openidServiceInstance = new GenericOpenIDService();
36: }
37: }
38: }
39: return openidServiceInstance;
40: }
41:
42: @Override
43: public JwtProcessor getProcessor() throws OpenIDException {
44:• if (jwtProcessorInstance == null) {
45: synchronized (GenericOpenIDLocator.class) {
46:• if (jwtProcessorInstance == null) {
47: jwtProcessorInstance = new GenericJwtProcessor();
48: }
49: }
50: }
51: return jwtProcessorInstance;
52: }
53:
54: @Override
55: public void close() throws Exception {
56: }
57:
58: }