2 * Copyright (c) 2018 Inocybe Technologies and others. All rights reserved.
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
8 package org.opendaylight.aaa.shiro.web.env;
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;
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.
21 * @author Thomas Pantelis
23 public interface ThreadLocals {
24 ThreadLocal<DataBroker> DATABROKER_TL = new ThreadLocal<>();
26 ThreadLocal<ICertificateManager> CERT_MANAGER_TL = new ThreadLocal<>();
28 ThreadLocal<AuthenticationService> AUTH_SETVICE_TL = new ThreadLocal<>();
30 ThreadLocal<TokenStore> TOKEN_STORE_TL = new ThreadLocal<>();
32 ThreadLocal<TokenAuthenticators> TOKEN_AUTHENICATORS_TL = new ThreadLocal<>();
34 ThreadLocal<PasswordHashService> PASSWORD_HASH_SERVICE_TL = new ThreadLocal<>();