@Deprecated public interface BindingAwareConsumer
Semantically, a consumer may:
Consider using a BindingAwareProvider
Examples:
To get a NotificationService:
{code public void onSessionInitiated(ProviderContext session) { NotificationProviderService notificationService = session.getSALService(NotificationProviderService.class); notificationService.publish(notification) } where notification is an instance of a modeled Notification. For more information on sending notifications via the NotificationProviderService see org.opendaylight.controller.sal.binding.api.NotificationProviderService
A consumer can *invoke* and RPC ( ie, call foo(fooArgs)) but it cannot register an RPC implementation with the MD-SAL that others can invoke(call). To get an invokable RPC:
{code public void onSessionInitiated(ProviderContext session) { MyService rpcFlowSalService = session.getRpcService(MyService.class); }
Where MyService.class is a Service interface generated from a yang model with RPCs modeled in it. The returned rpcFlowSalService can be used like any other object by invoking its methods. Note, nothing special needs to be done for RoutedRPCs. They just work.
To get a DataBroker to allow access to the data tree:
{code public void onSessionInitiated(final ProviderContext session) { DataBroker databroker = session.getSALService(BindingDataBroker.class); } }
Modifier and Type | Method and Description |
---|---|
void |
onSessionInitialized(BindingAwareBroker.ConsumerContext session)
Deprecated.
Callback signaling initialization of the consumer session to the SAL.
|
void onSessionInitialized(BindingAwareBroker.ConsumerContext session)
The consumer MUST use the session for all communication with SAL or retrieving SAL infrastructure services.
This method is invoked by BindingAwareBroker.registerConsumer(BindingAwareConsumer)
session
- Unique session between consumer and SAL.Copyright © 2019 OpenDaylight. All rights reserved.