X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fapi%2FBindingAwareProvider.java;h=399eda53ee555a0971ba62363da74004596f5b1d;hp=cb26cad2f392cacc01757cd6c8bdff1b29920cad;hb=aaea3e9a92ae9d6fac04c4a065db4b35cbca9ed0;hpb=cbe83ca3074fa0182d4f079f528bb710a997ced7 diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareProvider.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareProvider.java index cb26cad2f3..399eda53ee 100644 --- a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareProvider.java +++ b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareProvider.java @@ -7,16 +7,12 @@ */ package org.opendaylight.controller.sal.binding.api; -import java.util.Collection; - -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext; -import org.opendaylight.yangtools.yang.binding.RpcService; /** - * * A developer implemented component that gets registered with the Broker. * + *
* Semantically, a provider may: * *
* If a class is not doing at least one of those three, consider using * a BindingAwareConsumer instead: - * @see org.opendaylight.controller.sal.binding.api.BindingAwareConsumer + * see {@link org.opendaylight.controller.sal.binding.api.BindingAwareConsumer} * *
- * - *In addition, a BindingAwareProvider can in pursuit of its goals: - * + * In addition, a BindingAwareProvider can in pursuit of its goals: *
- * + *
* Examples: * *
- * * To get a NotificationService: * - * {code + * {@code * public void onSessionInitiated(ProviderContext session) { * NotificationProviderService notificationService = session.getSALService(NotificationProviderService.class); * } + * } * For more information on sending notifications via the NotificationProviderService - * @see org.opendaylight.controller.sal.binding.api.NotificationProviderService + * see {@link org.opendaylight.controller.sal.binding.api.NotificationProviderService} * + *
* To register an RPC implementation:
*
- * {code
+ * {@code
* public void onSessionInitiated(ProviderContext session) {
* RpcRegistration
+ * Where MyService.class is a Service interface generated from a yang model with RPCs modeled in it and
+ * myImplementationInstance is an instance of a class that implements MyService.
*
- * Where MyService.class is a Service interface generated from a yang model with RPCs modeled in it and myImplementationInstance
- * is an instance of a class that implements MyService.
- *
+ *
* To register a Routed RPC Implementation:
- * {code
+ * {@code
* public void onSessionInitiated(ProviderContext session) {
- * RoutedRpcRegistration
+ * Where SalFlowService.class is a Service interface generated from a yang model with RPCs modeled in it and
+ * salFlowServiceImplementationInstance is an instance of a class that implements SalFlowService.
+ *
*
* The line:
- * {code
+ * {@code
* flowRegistration.registerPath(NodeContext.class, nodeInstanceId);
* }
- * Is indicating that the RPC implementation is registered to handle RPC invocations that have their NodeContext pointing to the node with instance id nodeInstanceId.
- * This bears a bit of further explanation. RoutedRPCs can be 'routed' to an implementation based upon 'context'. 'context' is a pointer (instanceId) to some place
- * in the data tree. In this example, the 'context' is a pointer to a Node. In this way, a provider can register its ability to provide a service for a particular
- * Node, but not *all* Nodes. The Broker routes the RPC by 'context' to the correct implementation, without the caller having to do extra work. Because of this when
- * a RoutedRPC is registered, it needs to also be able to indicate for which 'contexts' it is providing an implementation.
+ * Is indicating that the RPC implementation is registered to handle RPC invocations that have their NodeContext
+ * pointing to the node with instance id nodeInstanceId. This bears a bit of further explanation. RoutedRPCs can be
+ * 'routed' to an implementation based upon 'context'. 'context' is a pointer (instanceId) to some place in the data
+ * tree. In this example, the 'context' is a pointer to a Node. In this way, a provider can register its ability to
+ * provide a service for a particular Node, but not *all* Nodes. The Broker routes the RPC by 'context' to the correct
+ * implementation, without the caller having to do extra work. Because of this when a RoutedRPC is registered, it
+ * needs to also be able to indicate for which 'contexts' it is providing an implementation.
*
- * An example of a Routed RPC would be an updateFlow(node, flow) that would be routed based on node to the provider which had registered to provide
- * it *for that node*.
+ *
+ * An example of a Routed RPC would be an updateFlow(node, flow) that would be routed based on node to the provider
+ * which had registered to provide it *for that node*.
*
*
- *
* To get a DataBroker to allow access to the data tree:
*
- * {code
+ * {@code
* public void onSessionInitiated(final ProviderContext session) {
* DataBroker databroker = session.getSALService(BindingDataBroker.class);
* }
* }
- * @see org.opendaylight.controller.md.sal.common.api.data.BindingDataBroker
- * for more info on using the DataBroker.
- *
*/
+@Deprecated(forRemoval = true)
public interface BindingAwareProvider {
- /**
- * @deprecated
- *
- * This interface was originally intended to solve problems of how to get Implementations
- * of functionality from a provider, but that is no longer necessary because the Provider
- * Registers RPCs in onSessionInitiated.
- *
- * Recommend:
- * {code
- * public Collection extends RpcService> getImplementations() {
- * return Collections.emptySet();
- * }
- * }
- */
- @Deprecated
- Collection extends RpcService> getImplementations();
-
- /**
- * @deprecated
- *
- * This interface was originally intended to solve problems of how to get Functionality
- * a provider could provide, but that is no longer necessary because the Provider
- * Registers RPCs in onSessionInitiated.
- *
- * Recommend:
- * {code
- * public Collection extends ProviderFunctionality> getFunctionality() {
- * return Collections.emptySet();
- * }
- * }
- *
- */
- @Deprecated
- Collection extends ProviderFunctionality> getFunctionality();
-
- /**
- * Functionality provided by the {@link BindingAwareProvider}
- *
- *
- * Marker interface used to mark the interfaces describing specific
- * functionality which could be exposed by providers to other components.
- *
- *
- *
- */
- @Deprecated
- public interface ProviderFunctionality {
-
- }
/**
* Callback signaling initialization of the consumer session to the SAL.
*
+ *
* The consumer MUST use the session for all communication with SAL or
* retrieving SAL infrastructure services.
*
+ *
* This method is invoked by
* {@link BindingAwareBroker#registerProvider(BindingAwareProvider)}
*
* @param session Unique session between consumer and SAL.
*/
void onSessionInitiated(ProviderContext session);
-
- /*
- * @deprecated
- *
- * A provider was at one point considered an extension of a consumer, thus this
- * call. It is deprecated and the @see org.opendaylight.controller.sal.binding.api.BindingAwareConsumer#onSessionInitiated
- * used, or you should simply use {@link #onSessionInitiated(ProviderContext)}
- *
- * Recommend:
- * {code
- * public final void onSessionInitialized(ConsumerContext session) {
- * // NOOP - as method is deprecated
- * }
- * }
- */
- @Deprecated
- void onSessionInitialized(ConsumerContext session);
-
}