Updated SAL Binding APIs 12/1512/3
authorTony Tkacik <ttkacik@cisco.com>
Mon, 30 Sep 2013 13:33:31 +0000 (15:33 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 1 Oct 2013 13:28:46 +0000 (13:28 +0000)
  Data Services
    - Added DataModification contract which is used to track
      reads and writes regarding configuration change.

    - Updated Transaction APIs to use nwe DataModification object
    - Deprecated old APIs for Data Modification which supported
      only one unsubmitted transaction per consumer / provider

  Rpc Services
    - Added Registration for Routed Rpcs
    - Added Registration for Mounted Rpcs

  Util classes
    - Updated implementation of AbstractBindingAwareConsumer
    - Updated implementation of AbstractBindingAwareProvider

Change-Id: I0adb98ae6faf6d214484e4b276d6c3df930ca4e9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
26 files changed:
opendaylight/md-sal/model/model-flow-service/pom.xml
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/AbstractBindingAwareConsumer.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/AbstractBindingAwareProvider.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/BindingAwareBroker.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/NotificationProviderService.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/NotificationService.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataBrokerService.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataCommitHandler.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataModification.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataProviderService.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/RuntimeDataProvider.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeGenerator.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.xtend [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/BindingAwareBrokerImpl.xtend
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationBrokerImpl.xtend
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationServiceImpl.xtend [deleted file]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/OsgiProviderContext.xtend
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcServiceRegistrationImpl.xtend
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/_DataBrokerImpl.xtend
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/DelegateProxy.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/RpcRouter.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/RpcRoutingTable.java [new file with mode: 0644]
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/package-info.java [new file with mode: 0644]
opendaylight/md-sal/sal-connector-api/pom.xml
opendaylight/md-sal/sal-connector-api/src/main/java/org/opendaylight/controller/sal/connector/api/Connector.java
opendaylight/md-sal/sal-connector-api/src/main/java/org/opendaylight/controller/sal/connector/api/ConnectorListener.java [new file with mode: 0644]

index 583a7ac0106205b6ddb131e4e6d4e74e3dfd8347..6b8df6a4c8cd3ca42bdffa48160aad3c3b24dc78 100644 (file)
@@ -29,7 +29,7 @@
         <dependency>
             <groupId>org.opendaylight.yangtools.model</groupId>
             <artifactId>opendaylight-l2-types</artifactId>
         <dependency>
             <groupId>org.opendaylight.yangtools.model</groupId>
             <artifactId>opendaylight-l2-types</artifactId>
-            <version>2013.08.27-SNAPSHOT</version>
+            <version>2013.08.27.0</version>
         </dependency>
     </dependencies>
     <packaging>bundle</packaging>
         </dependency>
     </dependencies>
     <packaging>bundle</packaging>
index a176664ff9e377c129fe367cb50a842904f86118..ffb39d5e9223dd8823465e8820a1f8429d924a69 100644 (file)
@@ -16,7 +16,9 @@ public abstract class AbstractBindingAwareConsumer implements BindingAwareConsum
     }
 
     @Deprecated
     }
 
     @Deprecated
-    abstract protected void startImpl(BundleContext context);
+    protected void startImpl(BundleContext context) {
+        
+    }
     
     @Override
     public final  void stop(BundleContext context) throws Exception {
     
     @Override
     public final  void stop(BundleContext context) throws Exception {
index 20a7c0d779310037372a1a7ae5c4e1c6e8e59043..994d3f40a85946299693d285d61e79f308f01e6e 100644 (file)
@@ -1,5 +1,9 @@
 package org.opendaylight.controller.sal.binding.api;
 
 package org.opendaylight.controller.sal.binding.api;
 
+import java.util.Collection;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -10,16 +14,53 @@ public abstract class AbstractBindingAwareProvider implements BindingAwareProvid
     public final void start(BundleContext context) throws Exception {
             ServiceReference<BindingAwareBroker> brokerRef = context.getServiceReference(BindingAwareBroker.class);
             BindingAwareBroker broker = context.getService(brokerRef);
     public final void start(BundleContext context) throws Exception {
             ServiceReference<BindingAwareBroker> brokerRef = context.getServiceReference(BindingAwareBroker.class);
             BindingAwareBroker broker = context.getService(brokerRef);
-            broker.registerProvider(this, context);
+            
+            ProviderContext ctx = broker.registerProvider(this, context);
+            registerRpcImplementations(ctx);
+            registerFunctionality(ctx);
+            
             startImpl(context);
     }
     
             startImpl(context);
     }
     
-    @Deprecated
-    abstract protected void startImpl(BundleContext context);
+    private void registerFunctionality(ProviderContext ctx) {
+        Collection<? extends ProviderFunctionality> functionality = this.getFunctionality();
+        if(functionality == null || functionality.isEmpty()) {
+            return;
+        }
+        for (ProviderFunctionality providerFunctionality : functionality) {
+            ctx.registerFunctionality(providerFunctionality);
+        }
+        
+    }
+
+    private void registerRpcImplementations(ProviderContext ctx) {
+        Collection<? extends RpcService> rpcs = this.getImplementations();
+        if(rpcs == null || rpcs.isEmpty()) {
+            return;
+        }
+        for (RpcService rpcService : rpcs) {
+            //ctx.addRpcImplementation(type, implementation);
+        }
+        
+    }
+
+    protected void startImpl(BundleContext context) {
+        // NOOP
+    }
     
     @Override
     public final void stop(BundleContext context) throws Exception {
             
             
     }
     
     @Override
     public final void stop(BundleContext context) throws Exception {
             
             
     }
+    
+    @Override
+    public Collection<? extends ProviderFunctionality> getFunctionality() {
+        return null;
+    }
+    
+    @Override
+    public Collection<? extends RpcService> getImplementations() {
+        return null;
+    }
 }
 }
index 87008cd14b9e8780f4185d155a675c921467faf3..14db6e5a32d213142e28768a314693a6cfd9ac48 100644 (file)
@@ -7,8 +7,11 @@
  */
 package org.opendaylight.controller.sal.binding.api;
 
  */
 package org.opendaylight.controller.sal.binding.api;
 
+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.controller.sal.binding.api.data.DataBrokerService;
 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.osgi.framework.BundleContext;
 
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.osgi.framework.BundleContext;
 
@@ -161,14 +164,52 @@ public interface BindingAwareBroker {
      * 
      */
     public interface ProviderContext extends ConsumerContext {
      * 
      */
     public interface ProviderContext extends ConsumerContext {
+        /**
+         * Registers an global RpcService implementation.
+         * 
+         * @param type
+         * @param implementation
+         * @return
+         */
+        <T extends RpcService> RpcRegistration<T> addRpcImplementation(Class<T> type, T implementation)
+                throws IllegalStateException;
 
 
-        <T extends RpcService> RpcServiceRegistration<T> addRpcImplementation(Class<T> type, T implementation);
+        <T extends RpcService> RpcRegistration<T> addMountRpcImplementation(Class<T> type,
+                InstanceIdentifier mount, T implementation) throws IllegalStateException;
+
+        <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T implementation)
+                throws IllegalStateException;
+        
+        void registerFunctionality(ProviderFunctionality functionality);
+        void unregisterFunctionality(ProviderFunctionality functionality);
     }
 
     }
 
-    public interface RpcServiceRegistration<T extends RpcService> {
+    public interface RpcRegistration<T extends RpcService> {
 
 
+        /**
+         * 
+         * @return instance for which registration does exists.
+         */
         T getService();
 
         T getService();
 
+        /**
+         * Unregister an RpcService from broker.
+         * 
+         */
         void unregister();
     }
         void unregister();
     }
+
+    public interface RoutedRpcRegistration<T extends RpcService> extends RpcRegistration<T> {
+
+        /**
+         * Register particular instance identifier to be processed by this
+         * RpcService
+         * 
+         * @param context
+         * @param instance
+         */
+        void registerInstance(Class<? extends BaseIdentity> context, InstanceIdentifier instance);
+
+        void unregisterInstance(Class<? extends BaseIdentity> context, InstanceIdentifier instance);
+    }
 }
 }
index 86c9eebecd0b9b17b78c957e7ef30ecead94a0a5..7052ab0c45a2440e19b63a16bdbcd8c1cc78f7e0 100644 (file)
@@ -7,9 +7,13 @@
  */
 package org.opendaylight.controller.sal.binding.api;
 
  */
 package org.opendaylight.controller.sal.binding.api;
 
+import java.util.concurrent.ExecutorService;
+
 import org.opendaylight.yangtools.yang.binding.Notification;
 
 public interface NotificationProviderService extends NotificationService {
 
     void notify(Notification notification);
 import org.opendaylight.yangtools.yang.binding.Notification;
 
 public interface NotificationProviderService extends NotificationService {
 
     void notify(Notification notification);
+    
+    void notify(Notification notification, ExecutorService service);
 }
 }
index 3723c70e8c371115e44b1bf5f0bbeaa9e7da225a..38bf7a196c9e38628144734f7a4c8433de84fe09 100644 (file)
@@ -12,6 +12,7 @@ import org.opendaylight.yangtools.yang.binding.Notification;
 public interface NotificationService extends BindingAwareService {
 
     <T extends Notification> void addNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
 public interface NotificationService extends BindingAwareService {
 
     <T extends Notification> void addNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
-
+    void addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener);
+    void removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener);
     <T extends Notification> void removeNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
 }
     <T extends Notification> void removeNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
 }
index dd055aa3820d64c6ffaa084066ed0bf22c25a5d5..cd04d356a22242f7675cf20e6387faf80c0cf8a9 100644 (file)
@@ -11,7 +11,9 @@ import java.util.concurrent.Future;
 
 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
 
 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
+import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.DataRoot;
 import org.opendaylight.yangtools.yang.binding.DataRoot;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 /**
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
 /**
@@ -56,6 +58,7 @@ public interface DataBrokerService extends BindingAwareService {
      *            Data tree filter similar to the NETCONF filter
      * @return
      */
      *            Data tree filter similar to the NETCONF filter
      * @return
      */
+    @Deprecated
     <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
 
     /**
     <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
 
     /**
@@ -68,6 +71,7 @@ public interface DataBrokerService extends BindingAwareService {
      *            Identifier of the store, from which will be data retrieved
      * @return
      */
      *            Identifier of the store, from which will be data retrieved
      * @return
      */
+    @Deprecated
     <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType);
 
     /**
     <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType);
 
     /**
@@ -90,6 +94,7 @@ public interface DataBrokerService extends BindingAwareService {
      *            A filter data root
      * @return
      */
      *            A filter data root
      * @return
      */
+    @Deprecated
     <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);
 
     /**
     <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter);
 
     /**
@@ -104,6 +109,7 @@ public interface DataBrokerService extends BindingAwareService {
      * @return Result object containing the modified data tree if the operation
      *         was successful, otherwise list of the encountered errors.
      */
      * @return Result object containing the modified data tree if the operation
      *         was successful, otherwise list of the encountered errors.
      */
+    @Deprecated
     RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet);
 
     /**
     RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet);
 
     /**
@@ -130,5 +136,17 @@ public interface DataBrokerService extends BindingAwareService {
      * @return Result of the commit, containing success information or list of
      *         encountered errors, if commit was not successful.
      */
      * @return Result of the commit, containing success information or list of
      *         encountered errors, if commit was not successful.
      */
+    @Deprecated
     Future<RpcResult<Void>> commit(DataStoreIdentifier store);
     Future<RpcResult<Void>> commit(DataStoreIdentifier store);
+    
+    
+    DataObject getData(InstanceIdentifier data);
+    DataObject getConfigurationData(InstanceIdentifier data);
+    
+    /**
+     * Creates a data modification transaction.
+     * 
+     * @return new blank data modification transaction.
+     */
+    DataModification beginTransaction();
 }
 }
index ea5a16e27b3159dad19469c13e329c5971ee517c..b12dce6ea2efcce3dee94600dceea247a0ab7a92 100644 (file)
@@ -77,107 +77,6 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
  * <li>For each <code>CommitTransaction</code> from Commit Request phase
  * <ol>
  * <li><code>Broker</code>
  * <li>For each <code>CommitTransaction</code> from Commit Request phase
  * <ol>
  * <li><code>Broker</code>
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
- * 
  * broker invokes a {@link CommitTransaction#finish()}
  * <li>The provider rollbacks a commit and returns an {@link RpcResult} of
  * rollback. </ol>
  * broker invokes a {@link CommitTransaction#finish()}
  * <li>The provider rollbacks a commit and returns an {@link RpcResult} of
  * rollback. </ol>
@@ -234,6 +133,13 @@ public interface DataCommitHandler extends ProviderFunctionality {
          */
         DataStoreIdentifier getDataStore();
 
          */
         DataStoreIdentifier getDataStore();
 
+        /**
+         * Returns a modification transaction which is the source of this
+         * commit transaction.
+         * 
+         */
+        DataModification getModification();
+        
         /**
          * Returns the handler associated with this transaction.
          * 
         /**
          * Returns the handler associated with this transaction.
          * 
diff --git a/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataModification.java b/opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataModification.java
new file mode 100644 (file)
index 0000000..4506caf
--- /dev/null
@@ -0,0 +1,77 @@
+package org.opendaylight.controller.sal.binding.api.data;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Future;
+
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.Identifiable;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+
+public interface DataModification {
+    
+    /**
+     * Returns transaction identifier
+     * 
+     * @return Transaction identifier
+     */
+    Object getIdentifier();
+    
+    TransactionStatus getStatus();
+    
+    /**
+     * Reads data from overal data storage which includes
+     * runtime and configuration data.
+     * 
+     * @param path
+     * @return
+     */
+    DataObject read(InstanceIdentifier path);
+    
+    /**
+     * Reads data from configuration data storage.
+     * 
+     * @param path Instance identifier which 
+     * @return
+     */
+    DataObject readConfiguration(InstanceIdentifier path);
+    
+    void putRuntimeData(InstanceIdentifier path,DataObject data);
+    void putConfigurationData(InstanceIdentifier path,DataObject data);
+    void removeRuntimeData(InstanceIdentifier path);
+    void removeConfigurationData(InstanceIdentifier path);
+
+
+    Map<InstanceIdentifier,DataObject> getRuntimeDataUpdates();
+    Map<InstanceIdentifier,DataObject> getConfigurationDataUpdates();
+    Set<InstanceIdentifier> getRemovals();
+    Set<InstanceIdentifier> getConfigurationRemovals();
+    
+    /**
+     * Commits transaction to be stored in global data repository.
+     * 
+     * 
+     * @return  Future object which returns RpcResult with TransactionStatus 
+     *          when transaction is processed by store.
+     */
+    Future<RpcResult<TransactionStatus>> commit();
+    
+    void registerListener(DataTransactionListener listener);
+    void unregisterListener(DataTransactionListener listener);
+    
+    public enum TransactionStatus {
+        
+        UNSUBMITTED,
+        COMMITING,
+        COMMITED,
+        FAILED,
+        CANCELED
+    }
+    
+    public interface DataTransactionListener {
+        
+        void onStatusUpdated(DataModification transaction,TransactionStatus status);
+        
+    }
+}
index 857b07b5c7faa1e6028a5c20a642b37954bd625e..801a1c0d61316729a8b8db13f3b09ab40a37ec5f 100644 (file)
@@ -7,7 +7,12 @@
  */
 package org.opendaylight.controller.sal.binding.api.data;
 
  */
 package org.opendaylight.controller.sal.binding.api.data;
 
+import java.util.Map;
+import java.util.Set;
+
 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public interface DataProviderService extends DataBrokerService {
 
 
 public interface DataProviderService extends DataBrokerService {
 
@@ -61,5 +66,4 @@ public interface DataProviderService extends DataBrokerService {
      * @param refresher
      */
     void removeRefresher(DataStoreIdentifier store, DataRefresher refresher);
      * @param refresher
      */
     void removeRefresher(DataStoreIdentifier store, DataRefresher refresher);
-
 }
 }
index 4b01aed6ee7a285d91b9faddc5e03da27091cabf..68a2b29342cfe526a71599663004d56da0af3715 100644 (file)
@@ -2,11 +2,13 @@ package org.opendaylight.controller.sal.binding.api.data;
 
 import java.util.Set;
 
 
 import java.util.Set;
 
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.DataRoot;
 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.DataRoot;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 
-public interface RuntimeDataProvider {
+public interface RuntimeDataProvider extends ProviderFunctionality {
 
     Set<DataStoreIdentifier> getSupportedStores();
     
 
     Set<DataStoreIdentifier> getSupportedStores();
     
@@ -48,4 +50,7 @@ public interface RuntimeDataProvider {
      * @return
      */
     <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
      * @return
      */
     <T extends DataRoot> T getData(DataStoreIdentifier store, T filter);
+    
+    
+     <T extends DataObject> T getData(Class<T> dataType, InstanceIdentifier identifier);
 }
 }
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeGenerator.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/RuntimeCodeGenerator.java
new file mode 100644 (file)
index 0000000..9f7e05c
--- /dev/null
@@ -0,0 +1,81 @@
+package org.opendaylight.controller.sal.binding.codegen;
+
+import org.opendaylight.controller.sal.binding.spi.DelegateProxy;
+import org.opendaylight.controller.sal.binding.spi.RpcRouter;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.RpcService;
+import org.opendaylight.yangtools.yang.binding.annotations.RoutingContext;
+
+public interface RuntimeCodeGenerator {
+
+    /**
+     * Returns an instance of provided RpcService type which delegates all calls
+     * to the delegate.
+     * 
+     * <p>
+     * Returned instance:
+     * <ul>
+     * <li>implements provided subclass of RpcService type and
+     * {@link DelegateProxy} interface.
+     * <li>
+     * <p>
+     * delegates all invocations of methods, which are defined in RpcService
+     * subtype to delegate which is defined by
+     * {@link DelegateProxy#setDelegate(Object)}.
+     * <p>
+     * If delegate is not defined (<code>getDelegate() == null</code>)
+     * implementation throws {@link IllegalStateException}
+     * <li>{@link DelegateProxy#getDelegate()} - returns the delegate to which
+     * all calls are delegated.
+     * <li>{@link DelegateProxy#setDelegate(Object)} - sets the delegate for
+     * particular instance
+     * 
+     * </ul>
+     * 
+     * @param serviceType
+     *            - Subclass of RpcService for which direct proxy is to be
+     *            generated.
+     * @return Instance of RpcService of provided serviceType which implements
+     *         and {@link DelegateProxy}
+     * @throws IllegalArgumentException
+     * 
+     */
+    <T extends RpcService> T getDirectProxyFor(Class<T> serviceType) throws IllegalArgumentException;
+
+    /**
+     * Returns an instance of provided RpcService type which routes all calls to
+     * other instances selected on particular input field.
+     * 
+     * <p>
+     * Returned instance:
+     * <ul><li>Implements:
+     *     <ul><li>{@link DelegateProxy}
+     *         <li>{@link RpcRouter}
+     *     </ul>
+     *     <li>
+     *     routes all invocations of methods, which are defined in RpcService
+     *     subtype based on method arguments and routing information defined in the
+     *     RpcRoutingTables for this instance
+     *     {@link RpcRouter#getRoutingTable(Class)}.
+     *     <ul>
+     *     <li>
+     *     Implementation uses
+     *     {@link RpcRouter#getService(Class, InstanceIdentifier)} method to
+     *     retrieve particular instance to which call will be routed.
+     *    <li>
+     *    Instance of {@link InstanceIdentifier} is determined by first argument of
+     *    method and is retrieved via method which is annotated with
+     *    {@link RoutingContext}. Class representing Routing Context Identifier is
+     *    retrieved by {@link RoutingContext}.
+     *    <li>If first argument is not defined / {@link RoutingContext} annotation
+     *    is not present on any field invocation will be delegated to default
+     *    service {@link RpcRouter#getDefaultService()}.
+     * </ul>
+     * 
+     * @param serviceType
+     *            - Subclass of RpcService for which Router is to be generated.
+     * @return Instance of RpcService of provided serviceType which implements
+     *         also {@link RpcRouter}<T> and {@link DelegateProxy}
+     */
+    <T extends RpcService> T getRouterFor(Class<T> serviceType) throws IllegalArgumentException;
+}
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/BrokerImplClassLoader.xtend
new file mode 100644 (file)
index 0000000..522102b
--- /dev/null
@@ -0,0 +1,22 @@
+package org.opendaylight.controller.sal.binding.codegen.impl
+
+import java.lang.ClassLoader
+
+class BrokerImplClassLoader extends ClassLoader {
+
+    val ClassLoader spiClassLoader
+    
+    public new(ClassLoader model, ClassLoader spi) {
+        super(model)
+        spiClassLoader = spi;
+    }
+
+    override public loadClass(String name) throws ClassNotFoundException {
+        try {
+            return super.loadClass(name);
+        } catch (ClassNotFoundException e) {
+            return spiClassLoader.loadClass(name);
+        }
+    }
+
+}
index 298a74ece5f71982ae7bcbb48f205e4039c44046..8a3d2c0ecc12a49161bee2ec8012d5f2707279e7 100644 (file)
@@ -28,16 +28,19 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderCo
 
 import org.slf4j.LoggerFactory
 import org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator
 
 import org.slf4j.LoggerFactory
 import org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration
 
 class BindingAwareBrokerImpl implements BindingAwareBroker {
     private static val log = LoggerFactory.getLogger(BindingAwareBrokerImpl)
 
 class BindingAwareBrokerImpl implements BindingAwareBroker {
     private static val log = LoggerFactory.getLogger(BindingAwareBrokerImpl)
-    
+
     private val clsPool = ClassPool.getDefault()
     private var RuntimeCodeGenerator generator;
     private Map<Class<? extends RpcService>, RpcProxyContext> managedProxies = new HashMap();
     private var NotificationBrokerImpl notifyBroker
     private var ServiceRegistration<NotificationProviderService> notifyBrokerRegistration
     private val clsPool = ClassPool.getDefault()
     private var RuntimeCodeGenerator generator;
     private Map<Class<? extends RpcService>, RpcProxyContext> managedProxies = new HashMap();
     private var NotificationBrokerImpl notifyBroker
     private var ServiceRegistration<NotificationProviderService> notifyBrokerRegistration
-    
+
     @Property
     var BundleContext brokerBundleContext
 
     @Property
     var BundleContext brokerBundleContext
 
@@ -92,9 +95,9 @@ class BindingAwareBrokerImpl implements BindingAwareBroker {
      * If proxy class does not exist for supplied service class it will be generated automatically.
      */
     def <T extends RpcService> getManagedDirectProxy(Class<T> service) {
      * If proxy class does not exist for supplied service class it will be generated automatically.
      */
     def <T extends RpcService> getManagedDirectProxy(Class<T> service) {
-        
+
         var RpcProxyContext existing = null
         var RpcProxyContext existing = null
-        if ((existing = managedProxies.get(service)) != null) {
+        if((existing = managedProxies.get(service)) != null) {
             return existing.proxy
         }
         val proxyClass = generator.generateDirectProxy(service)
             return existing.proxy
         }
         val proxyClass = generator.generateDirectProxy(service)
@@ -107,6 +110,7 @@ class BindingAwareBrokerImpl implements BindingAwareBroker {
         managedProxies.put(service, rpcProxyCtx)
         return rpcProxyCtx.proxy
     }
         managedProxies.put(service, rpcProxyCtx)
         return rpcProxyCtx.proxy
     }
+
     /**
      * Registers RPC Implementation
      * 
     /**
      * Registers RPC Implementation
      * 
@@ -121,4 +125,15 @@ class BindingAwareBrokerImpl implements BindingAwareBroker {
         proxy.delegate = service;
         return new RpcServiceRegistrationImpl<T>(type, service, osgiReg);
     }
         proxy.delegate = service;
         return new RpcServiceRegistrationImpl<T>(type, service, osgiReg);
     }
+
+    def <T extends RpcService> RpcRegistration<T> registerMountedRpcImplementation(Class<T> tyoe, T service, InstanceIdentifier identifier,
+        OsgiProviderContext context, Hashtable<String, String> properties) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
+    def <T extends RpcService> RoutedRpcRegistration<T> registerRoutedRpcImplementation(Class<T> type, T service, OsgiProviderContext context,
+        Hashtable<String, String> properties) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+
 }
 }
index 22db73526e2e2e386636cc8b45320b3c246f24ad..8b0400f51254af1a2948f7c72f94bca17e0b292f 100644 (file)
@@ -49,4 +49,17 @@ class NotificationBrokerImpl implements NotificationProviderService {
     def notifyAll(Collection<NotificationListener<?>> listeners, Notification notification) {
         listeners.forEach[(it as NotificationListener).onNotification(notification)]
     }
     def notifyAll(Collection<NotificationListener<?>> listeners, Notification notification) {
         listeners.forEach[(it as NotificationListener).onNotification(notification)]
     }
+    
+    override addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+        
+    }
+    
+    override removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+    
+    override notify(Notification notification, ExecutorService service) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
 }
 }
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationServiceImpl.xtend b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationServiceImpl.xtend
deleted file mode 100644 (file)
index fb35ee3..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.sal.binding.impl
-
-import org.opendaylight.controller.sal.binding.api.NotificationService
-import org.opendaylight.controller.sal.binding.api.NotificationListener
-import org.opendaylight.yangtools.yang.binding.Notification
-import com.google.common.collect.Multimap
-import com.google.common.collect.HashMultimap
-
-class NotificationServiceImpl implements NotificationService {
-    val Multimap<Class<? extends Notification>, NotificationListener<?>> listeners;
-
-    new() {
-        listeners = HashMultimap.create()
-    }
-
-    override <T extends Notification> addNotificationListener(Class<T> notificationType,
-        NotificationListener<T> listener) {
-        listeners.put(notificationType, listener)
-    }
-
-    override <T extends Notification> removeNotificationListener(Class<T> notificationType,
-        NotificationListener<T> listener) {
-        listeners.remove(notificationType, listener)
-    }
-
-}
index c769ca1ee38509fa3dbebd52948f81735fddf59c..494118b694a0f9a43c96c5dd747ecf3e3f4ea8f1 100644 (file)
@@ -12,24 +12,26 @@ import java.util.Hashtable;
 import java.util.Map;
 
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import java.util.Map;
 
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcServiceRegistration;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.osgi.framework.BundleContext;
 
 import static org.opendaylight.controller.sal.binding.impl.osgi.Constants.*;
 import static extension org.opendaylight.controller.sal.binding.impl.osgi.PropertiesUtils.*;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.osgi.framework.BundleContext;
 
 import static org.opendaylight.controller.sal.binding.impl.osgi.Constants.*;
 import static extension org.opendaylight.controller.sal.binding.impl.osgi.PropertiesUtils.*;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
+import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality
 
 class OsgiProviderContext extends OsgiConsumerContext implements ProviderContext {
 
     @Property
 
 class OsgiProviderContext extends OsgiConsumerContext implements ProviderContext {
 
     @Property
-    val Map<Class<? extends RpcService>, RpcServiceRegistrationImpl<? extends RpcService>> registeredServices
+    val Map<Class<? extends RpcService>, RpcRegistration<? extends RpcService>> registeredServices
 
     new(BundleContext ctx, BindingAwareBrokerImpl broker) {
         super(ctx, broker);
         _registeredServices = new HashMap();
     }
 
 
     new(BundleContext ctx, BindingAwareBrokerImpl broker) {
         super(ctx, broker);
         _registeredServices = new HashMap();
     }
 
-    override def <T extends RpcService> RpcServiceRegistration<T> addRpcImplementation(Class<T> type, T implementation) {
+    override <T extends RpcService> addRpcImplementation(Class<T> type, T implementation) {
 
         // TODO Auto-generated method stub
         val properties = new Hashtable<String, String>();
 
         // TODO Auto-generated method stub
         val properties = new Hashtable<String, String>();
@@ -40,4 +42,32 @@ class OsgiProviderContext extends OsgiConsumerContext implements ProviderContext
         registeredServices.put(type, salReg)
         return salReg;
     }
         registeredServices.put(type, salReg)
         return salReg;
     }
+
+    override <T extends RpcService> addMountRpcImplementation(Class<T> type, InstanceIdentifier mount, T implementation) throws IllegalStateException {
+
+        val properties = new Hashtable<String, String>();
+        properties.salServiceType = SAL_SERVICE_TYPE_PROVIDER
+
+        // Fill requirements
+        val salReg = broker.registerMountedRpcImplementation(type, implementation, mount, this, properties)
+        registeredServices.put(type, salReg)
+        return salReg;
+    }
+
+    override <T extends RpcService> addRoutedRpcImplementation(Class<T> type, T implementation) throws IllegalStateException {
+        val properties = new Hashtable<String, String>();
+        properties.salServiceType = SAL_SERVICE_TYPE_PROVIDER
+
+        // Fill requirements
+        val salReg = broker.registerRoutedRpcImplementation(type, implementation, this, properties)
+        registeredServices.put(type, salReg)
+        return salReg;
+    }
+
+    override registerFunctionality(ProviderFunctionality functionality) {
+    
+    }
+
+    override unregisterFunctionality(ProviderFunctionality functionality) {
+    }
 }
 }
index afb27b47c6a78572ab25e20f7f4c64e4838c0901..5b31b5f50df5c42ebc8288613268fee03c14d457 100644 (file)
@@ -7,11 +7,11 @@
  */
 package org.opendaylight.controller.sal.binding.impl
 
  */
 package org.opendaylight.controller.sal.binding.impl
 
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcServiceRegistration
 import org.osgi.framework.ServiceRegistration
 import org.opendaylight.yangtools.yang.binding.RpcService
 import org.osgi.framework.ServiceRegistration
 import org.opendaylight.yangtools.yang.binding.RpcService
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration
 
 
-class RpcServiceRegistrationImpl<T extends RpcService> implements RpcServiceRegistration<T> {
+class RpcServiceRegistrationImpl<T extends RpcService> implements RpcRegistration<T> {
 
     val ServiceRegistration<T> osgiRegistration;
     private val T service;
 
     val ServiceRegistration<T> osgiRegistration;
     private val T service;
index b278df56f8f7db0e7d4a1983157d85b247bbe6a3..794e028ab25f5a442030580d090d71a77d35fd48 100644 (file)
@@ -17,6 +17,7 @@ import org.opendaylight.controller.sal.binding.api.data.DataValidator
 import org.opendaylight.yangtools.yang.common.RpcResult
 import org.opendaylight.controller.sal.binding.api.data.RuntimeDataProvider
 import java.util.Map
 import org.opendaylight.yangtools.yang.common.RpcResult
 import org.opendaylight.controller.sal.binding.api.data.RuntimeDataProvider
 import java.util.Map
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
 
 class _DataBrokerImpl implements DataProviderService {
 
 
 class _DataBrokerImpl implements DataProviderService {
 
@@ -74,5 +75,17 @@ class _DataBrokerImpl implements DataProviderService {
 
     def DataProviderContext resolveProvider(DataStoreIdentifier store, Class<? extends DataRoot> root) {
     }
 
     def DataProviderContext resolveProvider(DataStoreIdentifier store, Class<? extends DataRoot> root) {
     }
+    
+    override beginTransaction() {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+    
+    override getConfigurationData(InstanceIdentifier data) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
+    
+    override getData(InstanceIdentifier data) {
+        throw new UnsupportedOperationException("TODO: auto-generated method stub")
+    }
 
 }
 
 }
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/DelegateProxy.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/DelegateProxy.java
new file mode 100644 (file)
index 0000000..085228c
--- /dev/null
@@ -0,0 +1,7 @@
+package org.opendaylight.controller.sal.binding.spi;
+
+public interface DelegateProxy<T> {
+    
+    void setDelegate(T delegate);
+    T getDelegate();
+}
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/RpcRouter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/RpcRouter.java
new file mode 100644 (file)
index 0000000..360f039
--- /dev/null
@@ -0,0 +1,62 @@
+package org.opendaylight.controller.sal.binding.spi;
+
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.RpcService;
+
+/**
+ * RpcRouter is responsible for selecting RpcService based on provided routing
+ * context identifier {@link RpcRoutingTable#getContextIdentifier()} and path in
+ * overal data tree (@link {@link InstanceIdentifier}.
+ * 
+ * 
+ * @author Tony Tkacik <ttkacik@cisco.com>
+ * 
+ * @param <T>
+ *            Type of RpcService for which router provides routing information
+ *            and route selection.
+ */
+public interface RpcRouter<T extends RpcService> {
+
+    /**
+     * Returns a type of RpcService which is served by this instance of router.
+     * 
+     * @return type of RpcService which is served by this instance of router.
+     */
+    Class<T> getRpcServiceType();
+
+    /**
+     * Returns a routing table for particular route context
+     * 
+     * @param routeContext
+     * @return Routing Table for particular route context.
+     */
+    <C extends BaseIdentity> RpcRoutingTable<C, T> getRoutingTable(Class<C> routeContext);
+
+    /**
+     * Returns an instance of RpcService which is responsible for processing
+     * particular path.
+     * 
+     * @param context
+     *            Rpc Routing Context
+     * @param path
+     *            Instance Identifier which is used as a selector of instance.
+     * @return instance of RpcService which is responsible for processing
+     *         particular path.
+     */
+    T getService(Class<? extends BaseIdentity> context, InstanceIdentifier path);
+
+    /**
+     * Returns a default fallback instance of RpcService which is responsible
+     * for handling all unknown imports.
+     * 
+     * @return default instance responsible for processing RPCs.
+     */
+    T getDefaultService();
+    
+    /**
+     * 
+     */
+    void setDefaultService();
+
+}
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/RpcRoutingTable.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/RpcRoutingTable.java
new file mode 100644 (file)
index 0000000..f2d3825
--- /dev/null
@@ -0,0 +1,38 @@
+package org.opendaylight.controller.sal.binding.spi;
+
+import java.util.Map;
+
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.RpcService;
+
+public interface RpcRoutingTable<C extends BaseIdentity,S extends RpcService> {
+
+    Class<C> getContextIdentifier();
+    
+    /**
+     * Updates route for particular path to specified instance of {@link RpcService}. 
+     * 
+     * @param path Path for which RpcService routing is to be updated
+     * @param service Instance of RpcService which is responsible for processing Rpc Requests.
+     */
+    void updateRoute(InstanceIdentifier path,S service);
+    
+    /**
+     * Deletes a route for particular path
+     * 
+     * @param path Path for which 
+     */
+    void deleteRoute(InstanceIdentifier path);
+    
+    /**
+     * 
+     */
+    S getService(InstanceIdentifier nodeInstance);
+    
+    /**
+     * 
+     * @return
+     */
+    Map<InstanceIdentifier,S> getRoutes();
+}
diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/package-info.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/spi/package-info.java
new file mode 100644 (file)
index 0000000..774571b
--- /dev/null
@@ -0,0 +1,8 @@
+/**
+ * 
+ */
+/**
+ * @author ttkacik
+ *
+ */
+package org.opendaylight.controller.sal.binding.spi;
\ No newline at end of file
index 68c8756e4694d2a421f05de4c43ef79e46fdde24..3be5b82806437fb973ad5525ba59e6749ccaa592 100644 (file)
     </scm>
 
     <dependencies>
     </scm>
 
     <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>sal-core-api</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-data-api</artifactId>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-data-api</artifactId>
index e47d67e8cf020164ea60601a79ecbf2d999c0dd7..55f8b8ced964ff4fd179066be8afb97c04c3d661 100644 (file)
@@ -2,8 +2,18 @@ package org.opendaylight.controller.sal.connector.api;
 
 import java.util.Set;
 
 
 import java.util.Set;
 
+import org.opendaylight.controller.sal.core.api.RpcImplementation;
+import org.opendaylight.controller.sal.core.api.notify.NotificationListener;
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
 
 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
 
-public interface Connector {
+public interface Connector extends RpcImplementation, NotificationListener {
 
 
+    
+    
+    Set<InstanceIdentifier> getConfigurationPrefixes();
+    Set<InstanceIdentifier> getRuntimePrefixes();
+    
+    void registerListener(ConnectorListener listener);
+    void unregisterListener(ConnectorListener listener);
 }
 }
diff --git a/opendaylight/md-sal/sal-connector-api/src/main/java/org/opendaylight/controller/sal/connector/api/ConnectorListener.java b/opendaylight/md-sal/sal-connector-api/src/main/java/org/opendaylight/controller/sal/connector/api/ConnectorListener.java
new file mode 100644 (file)
index 0000000..ac9c893
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.sal.connector.api;
+
+import java.util.Set;
+
+import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
+
+public interface ConnectorListener {
+
+    void onPrefixesAnnounced(Set<InstanceIdentifier> prefixes);
+    void onPrefixesWithdrawn(Set<InstanceIdentifier> prefixes);
+
+}