X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fapi%2FBindingAwareBroker.java;h=32984ef3345c04aea17add5706013846219b7d1e;hb=aaea3e9a92ae9d6fac04c4a065db4b35cbca9ed0;hp=5b700703bc0b522357f42ec2580e9b64e94c924e;hpb=e27d63bdcfbfb0c1078a9c3e5aabf59ae7e2315f;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareBroker.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareBroker.java index 5b700703bc..32984ef334 100644 --- a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareBroker.java +++ b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareBroker.java @@ -8,9 +8,6 @@ package org.opendaylight.controller.sal.binding.api; import org.opendaylight.controller.md.sal.common.api.routing.RoutedRegistration; -import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality; -import org.opendaylight.controller.sal.binding.api.data.DataBrokerService; -import org.opendaylight.controller.sal.binding.api.data.DataProviderService; import org.opendaylight.yangtools.concepts.ObjectRegistration; import org.opendaylight.yangtools.yang.binding.BaseIdentity; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -20,17 +17,18 @@ import org.osgi.framework.BundleContext; /** * Binding-aware core of the SAL layer responsible for wiring the SAL consumers. * + *

* The responsibility of the broker is to maintain registration of SAL - * functionality {@link Consumer}s and {@link Provider}s, store provider and + * functionality Consumers and Providers, store provider and * consumer specific context and functionality registration via * {@link ConsumerContext} and provide access to infrastructure services, which * removes direct dependencies between providers and consumers. * + *

* The Binding-aware broker is also responsible for translation from Java * classes modeling the functionality and data to binding-independent form which * is used in SAL Core. * - * *

Infrastructure services

Some examples of infrastructure services: * * * + *

* The services are exposed via session. * *

Session-based access

* + *

* The providers and consumers needs to register in order to use the * binding-independent SAL layer and to expose functionality via SAL layer. * + *

* For more information about session-based access see {@link ConsumerContext} * and {@link ProviderContext} - * - * - * */ +@Deprecated(forRemoval = true) public interface BindingAwareBroker { + @Deprecated + ConsumerContext registerConsumer(BindingAwareConsumer consumer, BundleContext ctx); + /** * Registers the {@link BindingAwareConsumer}, which will use the SAL layer. * @@ -68,9 +67,9 @@ public interface BindingAwareBroker { * The consumer is required to use returned session for all communication * with broker or one of the broker services. The session is announced to * the consumer by invoking - * {@link Consumer#onSessionInitiated(ConsumerContext)}. + * {@link BindingAwareConsumer#onSessionInitialized(ConsumerContext)}. * - * @param cons + * @param consumer * Consumer to be registered. * @return a session specific to consumer registration * @throws IllegalArgumentException @@ -78,7 +77,14 @@ public interface BindingAwareBroker { * @throws IllegalStateException * If the consumer is already registered. */ - ConsumerContext registerConsumer(BindingAwareConsumer consumer, BundleContext ctx); + @Deprecated + ConsumerContext registerConsumer(BindingAwareConsumer consumer); + + /* + * @deprecated Use registerProvider(BindingAwareProvider prov) instead (BundleContext is no longer used) + */ + @Deprecated + ProviderContext registerProvider(BindingAwareProvider provider, BundleContext ctx); /** * Registers the {@link BindingAwareProvider}, which will use the SAL layer. @@ -86,7 +92,7 @@ public interface BindingAwareBroker { *

* During the registration, the broker obtains the initial functionality * from consumer, using the - * {@link BindingAwareProvider#getImplementations()}, and register that + * BindingAwareProvider#getImplementations(), and register that * functionality into system and concrete infrastructure services. * *

@@ -100,7 +106,7 @@ public interface BindingAwareBroker { * {@link BindingAwareProvider#onSessionInitiated(ProviderContext)}. * * - * @param prov + * @param provider * Provider to be registered. * @return a session unique to the provider registration. * @throws IllegalArgumentException @@ -108,7 +114,8 @@ public interface BindingAwareBroker { * @throws IllegalStateException * If the consumer is already registered. */ - ProviderContext registerProvider(BindingAwareProvider provider, BundleContext ctx); + @Deprecated + ProviderContext registerProvider(BindingAwareProvider provider); /** * {@link BindingAwareConsumer} specific access to the SAL functionality. @@ -121,24 +128,19 @@ public interface BindingAwareBroker { * The session serves to store SAL context (e.g. registration of * functionality) for the consumer and provides access to the SAL * infrastructure services and other functionality provided by - * {@link Provider}s. - * - * - * + * {@link BindingAwareProvider}s. */ - public interface ConsumerContext extends RpcConsumerRegistry { + @Deprecated + interface ConsumerContext extends RpcConsumerRegistry { /** - * Returns a session specific instance (implementation) of requested - * binding-aware infrastructural service + * Returns a session specific instance (implementation) of requested binding-aware infrastructure service. * * @param service * Broker service * @return Session specific implementation of service */ T getSALService(Class service); - - } /** @@ -157,43 +159,49 @@ public interface BindingAwareBroker { * functionality provided by other {@link BindingAwareConsumer}s. * */ - public interface ProviderContext extends ConsumerContext, RpcProviderRegistry { - - @Deprecated - void registerFunctionality(ProviderFunctionality functionality); + @Deprecated + interface ProviderContext extends ConsumerContext, RpcProviderRegistry { - @Deprecated - void unregisterFunctionality(ProviderFunctionality functionality); } - public interface RpcRegistration extends ObjectRegistration { + /** + * Represents an RPC implementation registration. Users should call the + * {@link ObjectRegistration#close close} method when the registration is no longer needed. + * + * @param the implemented RPC service interface + */ + interface RpcRegistration extends ObjectRegistration { + /** + * Returns the implemented RPC service interface. + */ Class getServiceType(); + + @Override + void close(); } - public interface RoutedRpcRegistration extends RpcRegistration, + /** + * Represents a routed RPC implementation registration. Users should call the + * {@link RoutedRegistration#close close} method when the registration is no longer needed. + * + * @param the implemented RPC service interface + */ + interface RoutedRpcRegistration extends RpcRegistration, RoutedRegistration, InstanceIdentifier, T> { /** - * Register particular instance identifier to be processed by this - * RpcService - * - * Deprecated in favor of {@link RoutedRegistration#registerPath(Object, Object)}. + * Register particular instance identifier to be processed by this RpcService. * - * @param context - * @param instance + * @deprecated in favor of RoutedRegistration#registerPath(Object, Object). */ @Deprecated void registerInstance(Class context, InstanceIdentifier instance); /** - * Unregister particular instance identifier to be processed by this - * RpcService - * - * Deprecated in favor of {@link RoutedRegistration#unregisterPath(Object, Object)}. + * Unregister particular instance identifier to be processed by this RpcService. * - * @param context - * @param instance + * @deprecated in favor of RoutedRegistration#unregisterPath(Class, InstanceIdentifier). */ @Deprecated void unregisterInstance(Class context, InstanceIdentifier instance);