2 * Copyright (c) 2014 Cisco Systems, Inc. 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
9 package org.opendaylight.aaa.authz.srv;
11 import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
12 import org.opendaylight.controller.sal.core.api.Broker;
13 import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
14 import org.opendaylight.controller.sal.core.api.BrokerService;
15 import org.opendaylight.controller.sal.core.spi.ForwardingProviderSession;
18 * Created by wdec on 28/08/2014.
20 public class AuthzProviderContextImpl extends ForwardingProviderSession {
22 private final Broker.ProviderSession realSession;
24 public AuthzProviderContextImpl(Broker.ProviderSession providerSession,
25 AuthzBrokerImpl authzBroker) {
26 this.realSession = providerSession;
30 protected ProviderSession delegate() {
31 // TODO Auto-generated method stub
36 public <T extends BrokerService> T getService(Class<T> tClass) {
38 // Check for class and return Authz broker only for DOMBroker
39 if (tClass == DOMDataBroker.class) {
40 t = (T) AuthzDomDataBroker.getInstance();
42 t = realSession.getService(tClass);
44 // AuthzDomDataBroker.getInstance().setDomDataBroker((DOMDataBroker)t);