2 * Copyright © 2017 Brocade Communications Systems 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;
10 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
15 * Provider for AAA shiro implementation.
17 * @author Ryan Goulding (ryandgoulding@gmail.com)
19 public class AAAShiroProvider {
21 private static final Logger LOG = LoggerFactory.getLogger(AAAShiroProvider.class);
23 private static AAAShiroProvider INSTANCE;
24 private DataBroker dataBroker;
27 * Provider for this bundle.
29 * @param dataBroker injected from blueprint
31 private AAAShiroProvider(final DataBroker dataBroker) {
32 this.dataBroker = dataBroker;
38 * @return the Provider
40 public static AAAShiroProvider newInstance(final DataBroker dataBroker) {
41 INSTANCE = new AAAShiroProvider(dataBroker);
46 * Singleton extraction
48 * @return the Provider
50 public static AAAShiroProvider getInstance() {
51 if (INSTANCE == null) {
58 * Method called when the blueprint container is created.
61 LOG.info("AAAShiroProvider Session Initiated");
65 * Method called when the blueprint container is destroyed.
68 LOG.info("AAAShiroProvider Closed");
72 * Extract the data broker.
74 * @return the data broker
76 public DataBroker getDataBroker() {
77 return this.dataBroker;