Split out datastore implementation from aaa-shiro
[aaa.git] / aaa-shiro / impl / src / main / java / org / opendaylight / aaa / shiro / web / env / ThreadLocals.java
1 /*
2  * Copyright (c) 2018 Inocybe Technologies and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.aaa.shiro.web.env;
9
10 import org.opendaylight.aaa.api.AuthenticationService;
11 import org.opendaylight.aaa.api.TokenStore;
12 import org.opendaylight.aaa.api.password.service.PasswordHashService;
13 import org.opendaylight.aaa.cert.api.ICertificateManager;
14 import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators;
15 import org.opendaylight.mdsal.binding.api.DataBroker;
16
17 /**
18  * Holds ThreadLocal variables used to indirectly inject instances into classes that are instantiated by the Shiro
19  * lib. Not ideal but a necessary evil to avoid static instances.
20  *
21  * @author Thomas Pantelis
22  */
23 public interface ThreadLocals {
24     ThreadLocal<DataBroker> DATABROKER_TL = new ThreadLocal<>();
25
26     ThreadLocal<ICertificateManager> CERT_MANAGER_TL = new ThreadLocal<>();
27
28     ThreadLocal<AuthenticationService> AUTH_SETVICE_TL = new ThreadLocal<>();
29
30     ThreadLocal<TokenStore> TOKEN_STORE_TL = new ThreadLocal<>();
31
32     ThreadLocal<TokenAuthenticators> TOKEN_AUTHENICATORS_TL = new ThreadLocal<>();
33
34     ThreadLocal<PasswordHashService> PASSWORD_HASH_SERVICE_TL = new ThreadLocal<>();
35 }