Skip to content

Package: AccessTokenEntityManagerFactory

AccessTokenEntityManagerFactory

nameinstructionbranchcomplexitylinemethod
AccessTokenEntityManagerFactory()
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%
getInstance()
M: 2 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: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 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.authentication.token.shiro;
14:
15: import java.util.HashMap;
16: import java.util.Map;
17:
18: import org.eclipse.kapua.commons.jpa.AbstractEntityManagerFactory;
19: import org.eclipse.kapua.commons.jpa.EntityManager;
20: import org.eclipse.kapua.commons.jpa.EntityManagerFactory;
21:
22: /**
23: * Entity manager factory for the {@link AccessTokenServiceImpl} module.
24: *
25: * @since 1.0.0
26: */
27: public class AccessTokenEntityManagerFactory extends AbstractEntityManagerFactory {
28:
29: private static final String PERSISTENCE_UNIT_NAME = "kapua-authentication";
30: private static final String DATASOURCE_NAME = "kapua-dbpool";
31: private static final Map<String, String> UNIQUE_CONSTRAINTS = new HashMap<>();
32:
33: private static AccessTokenEntityManagerFactory instance = new AccessTokenEntityManagerFactory();
34:
35: /**
36: * Constructs a new entity manager factory and configure it to use the user persistence unit.
37: */
38: private AccessTokenEntityManagerFactory() {
39: super(PERSISTENCE_UNIT_NAME, DATASOURCE_NAME, UNIQUE_CONSTRAINTS);
40: }
41:
42: /**
43: * Return the {@link EntityManager} singleton instance
44: *
45: * @return
46: */
47: public static EntityManagerFactory getInstance() {
48: return instance;
49: }
50: }