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
8 package org.opendaylight.controller.md.sal.binding.util;
10 import java.util.concurrent.ExecutorService;
12 import org.opendaylight.controller.md.sal.common.api.RegistrationListener;
13 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
14 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandlerRegistration;
15 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
16 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
17 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
18 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
19 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
20 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
21 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
22 import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
23 import org.opendaylight.yangtools.concepts.ListenerRegistration;
24 import org.opendaylight.yangtools.concepts.Registration;
25 import org.opendaylight.yangtools.yang.binding.DataObject;
26 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
27 import org.opendaylight.yangtools.yang.binding.Notification;
28 import org.opendaylight.yangtools.yang.binding.RpcService;
30 public abstract class AbstractBindingSalProviderInstance<D extends DataProviderService, N extends NotificationProviderService, R extends RpcProviderRegistry> //
31 extends AbstractBindingSalConsumerInstance<D, N, R> //
33 DataProviderService, //
34 RpcProviderRegistry, //
35 NotificationProviderService {
37 public AbstractBindingSalProviderInstance(R rpcRegistry, N notificationBroker,
39 super(rpcRegistry, notificationBroker, dataBroker);
43 public Registration<DataReader<InstanceIdentifier<? extends DataObject>, DataObject>> registerDataReader(
44 InstanceIdentifier<? extends DataObject> path,
45 DataReader<InstanceIdentifier<? extends DataObject>, DataObject> reader) {
46 return getDataBrokerChecked().registerDataReader(path, reader);
50 public Registration<DataCommitHandler<InstanceIdentifier<? extends DataObject>, DataObject>> registerCommitHandler(
51 InstanceIdentifier<? extends DataObject> path,
52 DataCommitHandler<InstanceIdentifier<? extends DataObject>, DataObject> commitHandler) {
53 return getDataBrokerChecked().registerCommitHandler(path, commitHandler);
57 public ListenerRegistration<RegistrationListener<DataCommitHandlerRegistration<InstanceIdentifier<? extends DataObject>, DataObject>>> registerCommitHandlerListener(
58 RegistrationListener<DataCommitHandlerRegistration<InstanceIdentifier<? extends DataObject>, DataObject>> commitHandlerListener) {
59 return getDataBrokerChecked().registerCommitHandlerListener(commitHandlerListener);
63 public <T extends RpcService> RpcRegistration<T> addRpcImplementation(Class<T> type, T implementation)
64 throws IllegalStateException {
65 return getRpcRegistryChecked().addRpcImplementation(type, implementation);
69 public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T implementation)
70 throws IllegalStateException {
71 return getRpcRegistryChecked().addRoutedRpcImplementation(type, implementation);
76 public void notify(Notification notification) {
77 getNotificationBrokerChecked().notify(notification);
82 public void notify(Notification notification, ExecutorService service) {
83 getNotificationBrokerChecked().notify(notification, service);
87 public void publish(Notification notification) {
88 getNotificationBrokerChecked().publish(notification);
92 public void publish(Notification notification, ExecutorService service) {
93 getNotificationBrokerChecked().publish(notification, service);
97 public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
99 return getRpcRegistryChecked().registerRouteChangeListener(listener);
103 public ListenerRegistration<NotificationInterestListener> registerInterestListener(
104 NotificationInterestListener interestListener) {
105 return getNotificationBrokerChecked().registerInterestListener(interestListener);