Mechanical code cleanup (sal-dom-api)
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / sal / core / api / Broker.java
index 6af06255c7ef3adbbfd526404babf70b4b285a6b..01f78cd5aab6bd006acacd29496234edde526508 100644 (file)
@@ -7,20 +7,6 @@
  */
 package org.opendaylight.controller.sal.core.api;
 
-import java.util.Set;
-import java.util.concurrent.Future;
-
-import org.opendaylight.controller.md.sal.common.api.routing.RoutedRegistration;
-import org.opendaylight.controller.sal.core.api.data.DataBrokerService;
-import org.opendaylight.controller.sal.core.api.data.DataProviderService;
-import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
-import org.opendaylight.controller.sal.core.api.notify.NotificationService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.concepts.Registration;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.osgi.framework.BundleContext;
 
 /**
@@ -33,19 +19,6 @@ import org.osgi.framework.BundleContext;
  * removes direct dependencies between providers and consumers.
  *
  *
- * <h3>Infrastructure services</h3> Some examples of infrastructure services:
- *
- * <ul>
- * <li>RPC Invocation - see {@link ConsumerSession#rpc(QName, CompositeNode)},
- * {@link ProviderSession#addRpcImplementation(QName, RpcImplementation)} and
- * {@link RpcImplementation}
- * <li>Notification Service - see {@link NotificationService} and
- * {@link NotificationPublishService}
- * <li>Functionality and Data model
- * <li>Data Store access and modification - see {@link DataBrokerService} and
- * {@link DataProviderService}
- * </ul>
- *
  * The services are exposed via session.
  *
  * <h3>Session-based access</h3>
@@ -82,13 +55,18 @@ public interface Broker {
      *
      * @param cons
      *            Consumer to be registered.
-     * @param context
      * @return a session specific to consumer registration
      * @throws IllegalArgumentException
      *             If the consumer is <code>null</code>.
      * @throws IllegalStateException
      *             If the consumer is already registered.
      */
+    ConsumerSession registerConsumer(Consumer cons);
+
+    /*
+     * @deprecated Use registerConsumer(Consumer cons) instead (BundleContext is no longer used)
+     */
+    @Deprecated
     ConsumerSession registerConsumer(Consumer cons, BundleContext context);
 
     /**
@@ -99,12 +77,6 @@ public interface Broker {
      * from consumer, using the {@link Provider#getProviderFunctionality()}, and
      * register that functionality into system and concrete infrastructure
      * services.
-     *
-     * <p>
-     * Note that consumer could register additional functionality at later point
-     * by using service and functionality specific APIs (e.g.
-     * {@link ProviderSession#addRpcImplementation(QName, RpcImplementation)}
-     *
      * <p>
      * The consumer is <b>required to use</b> returned session for all
      * communication with broker or one of the broker services. The session is
@@ -114,13 +86,18 @@ public interface Broker {
      *
      * @param prov
      *            Provider to be registered.
-     * @param context
      * @return a session unique to the provider registration.
      * @throws IllegalArgumentException
      *             If the provider is <code>null</code>.
      * @throws IllegalStateException
      *             If the consumer is already registered.
      */
+    ProviderSession registerProvider(Provider prov);
+
+    /*
+     * @deprecated Use registerProvider(Provider cons) instead (BundleContext is no longer used)
+     */
+    @Deprecated
     ProviderSession registerProvider(Provider prov, BundleContext context);
 
     /**
@@ -139,19 +116,7 @@ public interface Broker {
      *
      *
      */
-    public interface ConsumerSession {
-
-        /**
-         * Sends an RPC to other components registered to the broker.
-         *
-         * @see RpcImplementation
-         * @param rpc
-         *            Name of RPC
-         * @param input
-         *            Input data to the RPC
-         * @return Result of the RPC call
-         */
-        Future<RpcResult<CompositeNode>> rpc(QName rpc, CompositeNode input);
+    interface ConsumerSession {
 
         boolean isClosed();
 
@@ -191,34 +156,7 @@ public interface Broker {
      * functionality provided by other {@link Provider}s.
      *
      */
-    public interface ProviderSession extends ConsumerSession {
-        /**
-         * Registers an implementation of the rpc.
-         *
-         * <p>
-         * The registered rpc functionality will be available to all other
-         * consumers and providers registered to the broker, which are aware of
-         * the {@link QName} assigned to the rpc.
-         *
-         * <p>
-         * There is no assumption that rpc type is in the set returned by
-         * invoking {@link RpcImplementation#getSupportedRpcs()}. This allows
-         * for dynamic rpc implementations.
-         *
-         * @param rpcType
-         *            Name of Rpc
-         * @param implementation
-         *            Provider's Implementation of the RPC functionality
-         * @throws IllegalArgumentException
-         *             If the name of RPC is invalid
-         */
-        RpcRegistration addRpcImplementation(QName rpcType, RpcImplementation implementation)
-                throws IllegalArgumentException;
-
-        RoutedRpcRegistration addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation);
-
-        RoutedRpcRegistration addMountedRpcImplementation(QName rpcType, RpcImplementation implementation);
-
+    interface ProviderSession extends ConsumerSession {
         /**
          * Closes a session between provider and SAL.
          *
@@ -227,24 +165,9 @@ public interface Broker {
          * functionality of the provider from the system.
          */
         @Override
-        public void close();
+        void close();
 
         @Override
         boolean isClosed();
-
-        Set<QName> getSupportedRpcs();
-
-        ListenerRegistration<RpcRegistrationListener> addRpcRegistrationListener(RpcRegistrationListener listener);
-    }
-
-    public interface RpcRegistration extends Registration<RpcImplementation> {
-        QName getType();
-
-        @Override
-        void close();
-    }
-
-    public interface RoutedRpcRegistration extends RpcRegistration,
-            RoutedRegistration<QName, InstanceIdentifier, RpcImplementation> {
     }
 }