Cleanup imports/whitespace in MD-SAL 83/5183/3
authorRobert Varga <rovarga@cisco.com>
Fri, 7 Feb 2014 20:01:21 +0000 (21:01 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 10 Feb 2014 11:54:33 +0000 (11:54 +0000)
Change-Id: I0f18ffe229ed213308a0cd5cf343fd64ff79a17c
Signed-off-by: Robert Varga <rovarga@cisco.com>
57 files changed:
opendaylight/md-sal/compatibility/sal-compatibility/src/main/java/org/opendaylight/controller/sal/compatibility/adsal/FlowServiceAdapter.java
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/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/RpcProviderRegistry.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/DataModificationTransaction.java
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/DataRefresher.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/data/RuntimeDataProvider.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountInstance.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/mount/MountProviderService.java
opendaylight/md-sal/sal-binding-api/src/main/java/org/opendaylight/controller/sal/binding/api/rpc/RpcRouter.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/BindingBrokerImplModule.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/NotificationBrokerImplModule.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/RuntimeMappingModule.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRouterCodegenInstance.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/RpcRoutingTableImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/codegen/impl/SingletonHolder.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataBrokerImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/DataTransactionImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/DataModificationTracker.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/AbstractDataServiceTest.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/RuntimeCodeGeneratorTest.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/util/BindingBrokerTestFactory.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug01Test.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug02Test.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/DOMCodecBug03Test.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/bugfix/PutAugmentationTest.java
opendaylight/md-sal/sal-binding-dom-it/src/test/java/org/opendaylight/controller/sal/binding/test/connect/dom/CrossBrokerMountPointTest.java
opendaylight/md-sal/sal-binding-it/src/main/java/org/opendaylight/controller/test/sal/binding/it/TestHelper.java
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/AbstractTestProvider.java
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/NoficationTest.java
opendaylight/md-sal/sal-binding-it/src/test/java/org/opendaylight/controller/test/sal/binding/it/RoutedServiceTest.java
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/AbstractBindingSalConsumerInstance.java
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/AbstractBindingSalProviderInstance.java
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/BindingContextUtils.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataChangePublisher.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataModification.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/ListenerRegistry.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/util/AbstractLockableDelegator.java
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractProvider.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/data/DataModificationTransaction.java
opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/mount/MountProvisionInstance.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/NotificationModule.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/NotificationRouterImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/MountProviderServiceProxy.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/spi/RpcRouter.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfRemoteSchemaSourceProvider.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/YangModelInputStreamAdapter.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/json/test/CnSnToJsonNotExistingLeafTypeTest.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/cnsn/to/xml/test/CnSnToXmlNotExistingLeafTypeTest.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/websockets/client/WebSocketClientHandler.java

index 40de6e5..84508ca 100644 (file)
@@ -14,9 +14,7 @@ import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.common.util.Futures;
 import org.opendaylight.controller.sal.common.util.Rpcs;
 import org.opendaylight.controller.sal.compatibility.InventoryMapping;
-import org.opendaylight.controller.sal.compatibility.NodeMapping;
 import org.opendaylight.controller.sal.compatibility.ToSalConversionsUtils;
-import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.flowprogrammer.Flow;
 import org.opendaylight.controller.sal.flowprogrammer.IFlowProgrammerListener;
 import org.opendaylight.controller.sal.flowprogrammer.IFlowProgrammerService;
index fc145c8..02bb6b3 100644 (file)
@@ -7,10 +7,7 @@
  */
 package org.opendaylight.controller.sal.binding.api;
 
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
 
 public abstract class AbstractBindingAwareConsumer extends AbstractBrokerAwareActivator implements BindingAwareConsumer {
 
index 9d3bff4..068b6c2 100644 (file)
@@ -13,12 +13,10 @@ import java.util.Collections;
 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;
-import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
 
 public abstract class AbstractBindingAwareProvider extends AbstractBrokerAwareActivator implements BindingAwareProvider {
-    
+
     @Override
     protected final void onBrokerAvailable(BindingAwareBroker broker, BundleContext context) {
         ProviderContext ctx = broker.registerProvider(this, context);
@@ -57,13 +55,13 @@ public abstract class AbstractBindingAwareProvider extends AbstractBrokerAwareAc
     public Collection<? extends RpcService> getImplementations() {
         return Collections.emptySet();
     }
-    
+
     /**
      * Initialization of consumer context.
-     * 
+     *
      * {@link ProviderContext} is replacement of {@link ConsumerContext}
      * so this method is not needed in case of Provider.
-     * 
+     *
      */
     @Deprecated
     @Override
index c28b03e..08029dc 100644 (file)
@@ -12,7 +12,6 @@ import java.util.concurrent.ExecutorService;
 
 import org.opendaylight.controller.md.sal.common.api.notify.NotificationPublishService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
 public interface NotificationProviderService extends NotificationService, NotificationPublishService<Notification> {
@@ -20,7 +19,7 @@ public interface NotificationProviderService extends NotificationService, Notifi
 
     /**
      * Deprecated. Use {@link #publish(Notification)}.
-     * 
+     *
      * @param notification
      */
     @Deprecated
@@ -28,7 +27,7 @@ public interface NotificationProviderService extends NotificationService, Notifi
 
     /**
      * Deprecated. Use {@link #publish(Notification,ExecutorService)}.
-     * 
+     *
      * @param notification
      */
     @Deprecated
@@ -36,17 +35,17 @@ public interface NotificationProviderService extends NotificationService, Notifi
 
     /**
      * Publishes a notification.
-     * 
+     *
      * @param Notification
      *            notification to publish.
-     * 
+     *
      */
     @Override
     void publish(Notification notification);
 
     /**
      * Publishes a notification, listener calls are done in provided executor.
-     * 
+     *
      */
     @Override
     void publish(Notification notification, ExecutorService service);
index 10b29f7..24ca2a3 100644 (file)
@@ -7,25 +7,23 @@
  */
 package org.opendaylight.controller.sal.binding.api;
 
-import org.opendaylight.controller.md.sal.common.api.notify.NotificationSubscriptionService;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
 public interface NotificationService extends BindingAwareService {
     /**
-     * 
+     *
      * Deprecated: use {@link #addNotificationListener(Class, NotificationListener)} istead.
-     * 
+     *
      * @param listener
      */
     @Deprecated
     <T extends Notification> void addNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
 
     /**
-     * 
+     *
      * Deprecated: use {@link #addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener)} istead.
-     * 
+     *
      * @param listener
      */
     @Deprecated
@@ -45,10 +43,10 @@ public interface NotificationService extends BindingAwareService {
     @Deprecated
     <T extends Notification> void removeNotificationListener(Class<T> notificationType, NotificationListener<T> listener);
 
-    
+
     /**
      * Register a generic listener for specified notification type only.
-     * 
+     *
      * @param notificationType
      * @param listener
      * @return Registration for listener. To unregister listener invoke {@link Registration#close()} method.
@@ -61,7 +59,7 @@ public interface NotificationService extends BindingAwareService {
      * Register a listener which implements generated notification interfaces derived from
      * {@link org.opendaylight.yangtools.yang.binding.NotificationListener}.
      * Listener is registered for all notifications present in implemented interfaces.
-     * 
+     *
      * @param listener
      * @return Registration for listener. To unregister listener invoke {@link Registration#close()} method.
      */
index fcf8ed5..c64e24c 100644 (file)
@@ -11,23 +11,22 @@ import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublishe
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
 import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 
 /**
  * Interface defining provider's access to the Rpc Registry which could be used
  * to register their implementations of service to the MD-SAL.
- * 
+ *
  * @author ttkacik
- * 
+ *
  */
 public interface RpcProviderRegistry extends //
         RpcConsumerRegistry, //
         RouteChangePublisher<RpcContextIdentifier, InstanceIdentifier<?>> {
     /**
      * Registers an global RpcService implementation.
-     * 
+     *
      * @param type
      * @param implementation
      * @return
@@ -36,10 +35,10 @@ public interface RpcProviderRegistry extends //
             throws IllegalStateException;
 
     /**
-     * 
+     *
      * Register an Routed RpcService where routing is determined on annotated
      * (in YANG model) context-reference and value of annotated leaf.
-     * 
+     *
      * @param type
      *            Type of RpcService, use generated interface class, not your
      *            implementation clas
@@ -47,7 +46,7 @@ public interface RpcProviderRegistry extends //
      *            Implementation of RpcService
      * @return Registration object for routed Rpc which could be used to close
      *         an
-     * 
+     *
      * @throws IllegalStateException
      */
     <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type, T implementation)
index 9ce11c7..7190638 100644 (file)
@@ -11,9 +11,9 @@ import java.util.EventListener;
 import java.util.concurrent.Future;
 
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
+import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler;
 import org.opendaylight.controller.md.sal.common.api.data.DataModification;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
@@ -22,28 +22,28 @@ public interface DataModificationTransaction extends DataModification<InstanceId
 
     /**
      * Returns an unique identifier for transaction
-     * 
+     *
      */
     @Override
     public Object getIdentifier();
-    
+
     /**
      * Initiates a two-phase commit of candidate data.
-     * 
+     *
      * <p>
      * The {@link Consumer} could initiate a commit of candidate data
-     * 
+     *
      * <p>
      * The successful commit changes the state of the system and may affect
      * several components.
-     * 
+     *
      * <p>
      * The effects of successful commit of data are described in the
      * specifications and YANG models describing the {@link Provider} components
      * of controller. It is assumed that {@link Consumer} has an understanding
      * of this changes.
-     * 
-     * 
+     *
+     *
      * @see DataCommitHandler for further information how two-phase commit is
      *      processed.
      * @param store
@@ -53,12 +53,12 @@ public interface DataModificationTransaction extends DataModification<InstanceId
      */
     @Override
     public Future<RpcResult<TransactionStatus>> commit();
-    
-    
-    
+
+
+
     /**
      * Register a listener for transaction
-     * 
+     *
      * @param listener
      * @return
      */
@@ -68,13 +68,13 @@ public interface DataModificationTransaction extends DataModification<InstanceId
 
     /**
      * Listener for transaction state changes
-     * 
+     *
      *
      */
     public interface DataTransactionListener extends EventListener {
         /**
          * Callback is invoked after each transaction status change.
-         * 
+         *
          * @param transaction Transaction
          * @param status New status
          */
index 523abb5..7d662cf 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.controller.sal.binding.api.data;
 import org.opendaylight.controller.md.sal.common.api.data.DataProvisionService;
 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.common.DataStoreIdentifier;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -23,15 +22,15 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  */
 public interface DataProviderService extends DataBrokerService, DataProvisionService<InstanceIdentifier<? extends DataObject>, DataObject> {
 
-    
+
     /**
      * Registers a data reader for particular subtree of overal YANG data tree.
-     * 
-     * Registered data reader is called if anyone tries to read data from 
+     *
+     * Registered data reader is called if anyone tries to read data from
      * paths which are nested to provided path.
-     * 
+     *
      * @param path Subpath which is handled by registered data reader
-     * @param reader Instance of reader which 
+     * @param reader Instance of reader which
      * @return Registration object for reader. Invoking {@link Registration#close()} will unregister reader.
      */
     Registration<DataReader<InstanceIdentifier<? extends DataObject>,DataObject>> registerDataReader(InstanceIdentifier<? extends DataObject> path,DataReader<InstanceIdentifier<? extends DataObject>,DataObject> reader);
index f54e131..3334f2a 100644 (file)
@@ -8,19 +8,18 @@
 package org.opendaylight.controller.sal.binding.api.data;
 
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
 
 /**
  * Trigger for refreshing of the data exposed by the {@link Provider}
- * 
- * 
- * 
+ *
+ *
+ *
  */
 public interface DataRefresher extends BindingAwareProvider.ProviderFunctionality {
 
     /**
      * Fired when some component explicitly requested the data refresh.
-     * 
+     *
      * The provider which exposed the {@link DataRefresher} should republish its
      * provided data by editing the data in all affected data stores.
      */
index 652e14b..85a2b82 100644 (file)
@@ -7,23 +7,19 @@
  */
 package org.opendaylight.controller.sal.binding.api.data;
 
-import java.util.Set;
-
 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
 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.yangtools.yang.binding.InstanceIdentifier;
 
 /**
- * Utility interface which does type capture for BindingAware DataReader. 
- * 
- * @author 
+ * Utility interface which does type capture for BindingAware DataReader.
+ *
+ * @author
  *
  */
 public interface RuntimeDataProvider extends ProviderFunctionality,DataReader<InstanceIdentifier<? extends DataObject>, DataObject> {
-    
-    
+
+
 
 }
index 844b03a..b444160 100644 (file)
@@ -12,7 +12,6 @@ import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
 import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.RpcService;
 
 public interface MountInstance //
         extends //
index f7b5845..6af9093 100644 (file)
@@ -9,21 +9,19 @@ package org.opendaylight.controller.sal.binding.api.mount;
 
 import java.util.EventListener;
 
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
  * Provider MountProviderService, this version allows access to MD-SAL services
  * specific for this mountpoint and registration / provision of interfaces for
  * mount point.
- * 
+ *
  * @author ttkacik
- * 
+ *
  */
 public interface MountProviderService extends MountService {
-    
+
     @Override
     public MountProviderInstance getMountPoint(InstanceIdentifier<?> path);
 
index 31fed62..81fe39c 100644 (file)
@@ -14,17 +14,16 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcR
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.RpcImplementation;
 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.
@@ -34,23 +33,23 @@ public interface RpcRouter<T extends RpcService> extends //
 
     /**
      * 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> getServiceType();
-    
-    
+
+
     /**
      * Returns a instance of T which is associated with this router instance
      * and routes messages based on routing tables.
-     * 
+     *
      * @return type of RpcService which is served by this instance of router.
      */
     T getInvocationProxy();
 
     /**
      * Returns a routing table for particular route context
-     * 
+     *
      * @param routeContext
      * @return Routing Table for particular route context.
      */
@@ -59,7 +58,7 @@ public interface RpcRouter<T extends RpcService> extends //
     /**
      * Returns an instance of RpcService which is responsible for processing
      * particular path.
-     * 
+     *
      * @param context
      *            Rpc Routing Context
      * @param path
@@ -72,15 +71,15 @@ public interface RpcRouter<T extends RpcService> extends //
     /**
      * Returns a default fallback instance of RpcService which is responsible
      * for handling all unknown imports.
-     * 
+     *
      * @return default instance responsible for processing RPCs.
      */
     T getDefaultService();
 
     Set<Class<? extends BaseIdentity>> getContexts();
-    
+
     RoutedRpcRegistration<T> addRoutedRpcImplementation(T service);
-    
+
     RpcRegistration<T> registerDefaultService(T service);
 
 }
index 0a503d5..b6c27a6 100644 (file)
@@ -7,15 +7,10 @@
  */
 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
 
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-
 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
 import org.opendaylight.controller.sal.binding.impl.NotificationBrokerImpl;
 
 import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
 
 /**
 *
index 5835916..0762739 100644 (file)
@@ -11,8 +11,6 @@ import java.util.Hashtable;
 import java.util.Map.Entry;
 import java.util.Set;
 
-import javassist.ClassPool;
-
 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
 import org.opendaylight.yangtools.concepts.Delegator;
 import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
@@ -115,39 +113,47 @@ public final class RuntimeMappingModule extends
             this.delegate = Preconditions.checkNotNull(delegate);
         }
 
+        @Override
         public CodecRegistry getCodecRegistry() {
             return delegate.getCodecRegistry();
         }
 
+        @Override
         public CompositeNode toDataDom(DataObject data) {
             return delegate.toDataDom(data);
         }
 
+        @Override
         public Entry<InstanceIdentifier, CompositeNode> toDataDom(
                 Entry<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject>, DataObject> entry) {
             return delegate.toDataDom(entry);
         }
 
+        @Override
         public InstanceIdentifier toDataDom(
                 org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject> path) {
             return delegate.toDataDom(path);
         }
 
+        @Override
         public DataObject dataObjectFromDataDom(
                 org.opendaylight.yangtools.yang.binding.InstanceIdentifier<? extends DataObject> path,
                 CompositeNode result) throws DeserializationException {
             return delegate.dataObjectFromDataDom(path, result);
         }
 
+        @Override
         public org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?> fromDataDom(InstanceIdentifier entry)
                 throws DeserializationException {
             return delegate.fromDataDom(entry);
         }
 
+        @Override
         public Set<QName> getRpcQNamesFor(Class<? extends RpcService> service) {
             return delegate.getRpcQNamesFor(service);
         }
 
+        @Override
         public DataContainer dataObjectFromDataDom(Class<? extends DataContainer> inputClass, CompositeNode domInput) {
             return delegate.dataObjectFromDataDom(inputClass, domInput);
         }
index 4f994e5..5578f75 100644 (file)
@@ -7,29 +7,26 @@
  */
 package org.opendaylight.controller.sal.binding.codegen.impl;
 
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
-import org.opendaylight.controller.sal.binding.api.rpc.RpcRouter;
-import org.opendaylight.controller.sal.binding.api.rpc.RpcRoutingTable;
-import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper;
-import org.opendaylight.yangtools.yang.binding.BaseIdentity;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
-import static org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper.*;
+import static org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper.setRoutingTable;
 
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
-import java.util.HashMap;
 
-import org.opendaylight.yangtools.yang.binding.DataContainer;
-import org.opendaylight.yangtools.yang.binding.RpcImplementation;
-import org.opendaylight.controller.md.sal.common.api.routing.MutableRoutingTable;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChange;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
+import org.opendaylight.controller.sal.binding.api.rpc.RpcRouter;
+import org.opendaylight.controller.sal.binding.api.rpc.RpcRoutingTable;
+import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper;
 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.util.ListenerRegistry;
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+import org.opendaylight.yangtools.yang.binding.DataContainer;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -66,11 +63,11 @@ public class RpcRouterCodegenInstance<T extends RpcService> implements //
         Map<Class<? extends BaseIdentity>, RpcRoutingTableImpl<? extends BaseIdentity, T>> mutableRoutingTables = new HashMap<>();
         for (Class<? extends BaseIdentity> ctx : contexts) {
             RpcRoutingTableImpl<? extends BaseIdentity, T> table = new RpcRoutingTableImpl<>(name,ctx,type);
-            
+
             @SuppressWarnings("rawtypes")
             Map invokerView = table.getRoutes();
-            
-            setRoutingTable((RpcService) invocationProxy, ctx, invokerView);
+
+            setRoutingTable(invocationProxy, ctx, invokerView);
             mutableRoutingTables.put(ctx, table);
             table.registerRouteChangeListener(this);
         }
index 500b1b3..ce159b8 100644 (file)
@@ -7,24 +7,21 @@
  */
 package org.opendaylight.controller.sal.binding.codegen.impl;
 
-import org.opendaylight.controller.sal.binding.api.rpc.RpcRoutingTable;
-import org.opendaylight.yangtools.yang.binding.BaseIdentity;
-import org.opendaylight.yangtools.yang.binding.RpcService;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
 import java.util.Collections;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
+import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
 import org.opendaylight.controller.md.sal.common.impl.routing.RoutingUtils;
+import org.opendaylight.controller.sal.binding.api.rpc.RpcRoutingTable;
 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
-import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Mutable;
+import org.opendaylight.yangtools.yang.binding.BaseIdentity;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -44,7 +41,7 @@ implements //
 
     private RouteChangeListener<Class<? extends BaseIdentity>, InstanceIdentifier<?>> listener;
     private S defaultRoute;
-    
+
     public RpcRoutingTableImpl(String routerName,Class<C> contextType, Class<S> serviceType) {
         super();
         this.routerName = routerName;
@@ -67,9 +64,9 @@ implements //
     @Override
     public <L extends RouteChangeListener<Class<? extends BaseIdentity>, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
             L listener) {
-        return (ListenerRegistration<L>) new SingletonListenerRegistration<L>(listener);
+        return new SingletonListenerRegistration<L>(listener);
     }
-        
+
     @Override
     public Class<C> getIdentifier() {
         return contextType;
@@ -79,7 +76,7 @@ implements //
     @SuppressWarnings("unchecked")
     public void updateRoute(InstanceIdentifier<?> path, S service) {
         S previous = this.routes.put(path, service);
-        
+
         LOGGER.debug("Route {} updated to {} in routing table {}",path,service,this);
         @SuppressWarnings("rawtypes")
         RouteChangeListener listenerCapture = listener;
@@ -88,7 +85,7 @@ implements //
         }
     }
 
-    
+
     @Override
     @SuppressWarnings("unchecked")
     public void removeRoute(InstanceIdentifier<?> path) {
@@ -100,7 +97,7 @@ implements //
             listenerCapture.onRouteChange(RoutingUtils.removalChange(contextType, path));
         }
     }
-    
+
     public void removeRoute(InstanceIdentifier<?> path, S service) {
         @SuppressWarnings("rawtypes")
         RouteChangeListener listenerCapture = listener;
@@ -123,12 +120,12 @@ implements //
     public Map<InstanceIdentifier<?>, S> getRoutes() {
         return unmodifiableRoutes;
     }
-    
+
     protected void removeAllReferences(S service) {
-        
+
     }
-    
-    
+
+
 
     @Override
     public String toString() {
index 244e350..291677a 100644 (file)
@@ -9,9 +9,10 @@ package org.opendaylight.controller.sal.binding.codegen.impl;
 
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ThreadFactory;
 
+import javassist.ClassPool;
+
 import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator;
 import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory;
 
@@ -19,8 +20,6 @@ import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 
-import javassist.ClassPool;
-
 public class SingletonHolder {
 
     public static final ClassPool CLASS_POOL = new ClassPool();
index 3cc66c3..ddf6771 100644 (file)
@@ -8,19 +8,18 @@
 package org.opendaylight.controller.sal.binding.impl;\r
 \r
 import java.util.Set;
-import java.util.concurrent.Future;\r
-import java.util.concurrent.atomic.AtomicLong;\r
-\r
-import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataBroker;\r
-import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;\r
-import org.opendaylight.controller.sal.binding.api.data.DataProviderService;\r
-import org.opendaylight.controller.sal.binding.impl.util.BindingAwareDataReaderRouter;\r
-import org.opendaylight.controller.sal.common.DataStoreIdentifier;\r
-import org.opendaylight.yangtools.yang.binding.DataObject;\r
-import org.opendaylight.yangtools.yang.binding.DataRoot;\r
-import org.opendaylight.yangtools.yang.binding.Identifiable;\r
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
-import org.opendaylight.yangtools.yang.common.RpcResult;\r
+import java.util.concurrent.Future;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataBroker;
+import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
+import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
+import org.opendaylight.controller.sal.binding.impl.util.BindingAwareDataReaderRouter;
+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;
+import org.opendaylight.yangtools.yang.common.RpcResult;
 \r
 \r
 public class DataBrokerImpl extends AbstractDataBroker<InstanceIdentifier<? extends DataObject>, DataObject, DataChangeListener> //\r
@@ -28,7 +27,7 @@ public class DataBrokerImpl extends AbstractDataBroker<InstanceIdentifier<? exte
 \r
     private final AtomicLong nextTransaction = new AtomicLong();\r
     private final AtomicLong createdTransactionsCount = new AtomicLong();\r
-    \r
+\r
     public AtomicLong getCreatedTransactionsCount() {\r
         return createdTransactionsCount;\r
     }\r
@@ -104,13 +103,12 @@ public class DataBrokerImpl extends AbstractDataBroker<InstanceIdentifier<? exte
             DataChangeListener changeListener) {\r
         throw new UnsupportedOperationException("Deprecated");\r
     }\r
-    \r
+\r
     @Override\r
     public void close() throws Exception {\r
-        \r
+\r
     }
-    
-    
+
     @Override
     protected boolean isAffectedBy(InstanceIdentifier<? extends DataObject> key,
             Set<InstanceIdentifier<? extends DataObject>> paths) {
index 290ff22..1ea2eba 100644 (file)
@@ -10,18 +10,17 @@ package org.opendaylight.controller.sal.binding.impl;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.impl.service.AbstractDataTransaction;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction.DataTransactionListener;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
-public class DataTransactionImpl extends AbstractDataTransaction<InstanceIdentifier<? extends DataObject>, DataObject> 
+public class DataTransactionImpl extends AbstractDataTransaction<InstanceIdentifier<? extends DataObject>, DataObject>
     implements DataModificationTransaction {
     private final ListenerRegistry<DataTransactionListener> listeners = new ListenerRegistry<DataTransactionListener>();
-    
-    
-    
+
+
+
     public DataTransactionImpl(Object identifier,DataBrokerImpl dataBroker) {
         super(identifier,dataBroker);
     }
@@ -31,6 +30,7 @@ public class DataTransactionImpl extends AbstractDataTransaction<InstanceIdentif
         return listeners.register(listener);
     }
 
+    @Override
     protected void onStatusChange(TransactionStatus status) {
         for (ListenerRegistration<DataTransactionListener> listenerRegistration : listeners) {
             listenerRegistration.getInstance().onStatusUpdated(this, status);
index f934571..a5da8a0 100644 (file)
@@ -7,29 +7,28 @@
  */
 package org.opendaylight.controller.sal.binding.impl;
 
+import static com.google.common.base.Preconditions.checkState;
+
 import java.util.EventListener;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.HashMap;
 import java.util.Set;
 import java.util.WeakHashMap;
 
-import javax.swing.tree.ExpandVetoException;
-
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChange;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
 import org.opendaylight.controller.md.sal.common.impl.routing.RoutingUtils;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
+import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
 import org.opendaylight.controller.sal.binding.api.rpc.RpcRouter;
 import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeGenerator;
 import org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper;
 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
-import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
-import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.util.ListenerRegistry;
 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
@@ -38,8 +37,6 @@ import org.opendaylight.yangtools.yang.binding.RpcService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static com.google.common.base.Preconditions.*;
-
 public class RpcProviderRegistryImpl implements //
         RpcProviderRegistry, //
         RouteChangePublisher<RpcContextIdentifier, InstanceIdentifier<?>> {
@@ -56,7 +53,7 @@ public class RpcProviderRegistryImpl implements //
 
     private final String name;
 
-    private ListenerRegistry<GlobalRpcRegistrationListener> globalRpcListeners = ListenerRegistry.create();
+    private final ListenerRegistry<GlobalRpcRegistrationListener> globalRpcListeners = ListenerRegistry.create();
 
     public String getName() {
         return name;
@@ -109,7 +106,7 @@ public class RpcProviderRegistryImpl implements //
 
             potentialProxy = (T) publicProxies.get(type);
             if (potentialProxy != null) {
-                return (T) potentialProxy;
+                return potentialProxy;
             }
             T proxy = rpcFactory.getDirectProxyFor(type);
             LOG.debug("Created {} as public proxy for {} in {}", proxy, type.getSimpleName(), this);
@@ -151,7 +148,7 @@ public class RpcProviderRegistryImpl implements //
                 LOG.error("Unhandled exception during invoking listener {}", e);
             }
         }
-        
+
     }
 
     private void notifyListenersRoutedCreated(RpcRouter router) {
@@ -196,7 +193,7 @@ public class RpcProviderRegistryImpl implements //
     public interface RouterInstantiationListener extends EventListener {
         void onRpcRouterCreated(RpcRouter<?> router);
     }
-    
+
     public ListenerRegistration<GlobalRpcRegistrationListener> registerGlobalRpcRegistrationListener(GlobalRpcRegistrationListener listener) {
         return globalRpcListeners.register(listener);
     }
@@ -204,7 +201,7 @@ public class RpcProviderRegistryImpl implements //
     public interface GlobalRpcRegistrationListener extends EventListener {
         void onGlobalRpcRegistered(Class<? extends RpcService> cls);
         void onGlobalRpcUnregistered(Class<? extends RpcService> cls);
-        
+
     }
 
     private class RouteChangeForwarder<T extends RpcService> implements
index e89797c..8278b36 100644 (file)
@@ -13,19 +13,13 @@ import java.util.concurrent.ConcurrentMap;
 import org.opendaylight.controller.md.sal.common.api.data.DataModification;
 import org.opendaylight.yangtools.concepts.Path;
 
-import com.google.common.util.concurrent.JdkFutureAdapters;
-
 public final class DataModificationTracker<P extends Path<P>,D> {
-
     ConcurrentMap<Object, DataModification<P,D>> trackedTransactions = new ConcurrentHashMap<>();
-    
-    
+
     public void startTrackingModification(DataModification<P,D> modification) {
         trackedTransactions.putIfAbsent(modification.getIdentifier(), modification);
-        
-        
     }
-    
+
     public boolean containsIdentifier(Object identifier) {
         return trackedTransactions.containsKey(identifier);
     }
index 7c38ff2..6c80f4d 100644 (file)
@@ -10,12 +10,11 @@ package org.opendaylight.controller.sal.binding.test;
 import org.junit.After;
 import org.junit.Before;
 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
 import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactory;
 import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
 import org.opendaylight.controller.sal.core.api.data.DataStore;
 import org.opendaylight.controller.sal.dom.broker.impl.DataStoreStatsWrapper;
-import org.opendaylight.controller.sal.dom.broker.impl.HashMapDataStore;
+import org.opendaylight.yangtools.yang.data.impl.codec.BindingIndependentMappingService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 76abd83..4afbc29 100644 (file)
@@ -7,22 +7,20 @@
  */
 package org.opendaylight.controller.sal.binding.test;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import javassist.ClassPool;
 
 import org.junit.Before;
 import org.junit.Test;
-
-import static org.opendaylight.controller.sal.binding.codegen.RuntimeCodeHelper.*;
-
-import org.opendaylight.controller.sal.binding.api.NotificationListener;
 import org.opendaylight.controller.sal.binding.api.rpc.RpcRouter;
 import org.opendaylight.controller.sal.binding.api.rpc.RpcRoutingTable;
 import org.opendaylight.controller.sal.binding.codegen.impl.RuntimeCodeGenerator;
@@ -30,12 +28,10 @@ import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory;
 import org.opendaylight.controller.sal.binding.spi.NotificationInvokerFactory.NotificationInvoker;
 import org.opendaylight.controller.sal.binding.test.mock.BarListener;
 import org.opendaylight.controller.sal.binding.test.mock.BarUpdate;
-import org.opendaylight.controller.sal.binding.test.mock.CompositeListener;
 import org.opendaylight.controller.sal.binding.test.mock.FlowDelete;
 import org.opendaylight.controller.sal.binding.test.mock.FooListener;
 import org.opendaylight.controller.sal.binding.test.mock.FooService;
 import org.opendaylight.controller.sal.binding.test.mock.FooUpdate;
-import org.opendaylight.controller.sal.binding.test.mock.InheritedContextInput;
 import org.opendaylight.controller.sal.binding.test.mock.ReferencableObject;
 import org.opendaylight.controller.sal.binding.test.mock.ReferencableObjectKey;
 import org.opendaylight.controller.sal.binding.test.mock.SimpleInput;
@@ -47,8 +43,6 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.IdentifiableItem;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.PathArgument;
 
-import static org.mockito.Mockito.*;
-
 public class RuntimeCodeGeneratorTest {
 
     private RuntimeCodeGenerator codeGenerator;
@@ -84,7 +78,7 @@ public class RuntimeCodeGeneratorTest {
 
         NotificationInvoker invokerFoo = invokerFactory.invokerFor(fooListener);
 
-        
+
         assertSame(fooListener,invokerFoo.getDelegate());
         assertNotNull(invokerFoo.getSupportedNotifications());
         assertEquals(1, invokerFoo.getSupportedNotifications().size());
index 2b0865a..e5b57e3 100644 (file)
@@ -11,11 +11,6 @@ import java.util.concurrent.ExecutorService;
 
 import javassist.ClassPool;
 
-import org.opendaylight.controller.sal.core.api.data.DataStore;
-import org.opendaylight.controller.sal.dom.broker.impl.DataStoreStatsWrapper;
-import org.opendaylight.controller.sal.dom.broker.impl.HashMapDataStore;
-import org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareDataStoreAdapter;
-
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
@@ -27,7 +22,7 @@ public class BindingBrokerTestFactory {
     private ExecutorService executor;
     private ClassPool classPool;
 
-    
+
     public boolean isStartWithParsedSchema() {
         return startWithParsedSchema;
     }
@@ -55,7 +50,7 @@ public class BindingBrokerTestFactory {
         if(classPool == null) {
             return CLASS_POOL;
         }
-        
+
         return classPool;
     }
 
index ec8c837..d016754 100644 (file)
@@ -7,6 +7,10 @@
  */
 package org.opendaylight.controller.sal.binding.test.bugfix;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -15,17 +19,10 @@ import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
-
-
-
-
-
-
-
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
-import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
+import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.PopMplsActionCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.pop.mpls.action._case.PopMplsActionBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
@@ -40,15 +37,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instru
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.apply.actions._case.ApplyActionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.VlanMatchBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._3.match.Ipv4MatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.TcpMatchBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.vlan.match.fields.VlanIdBuilder;
 import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -63,8 +58,6 @@ import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 
-import static org.junit.Assert.*;
-
 public class DOMCodecBug01Test extends AbstractDataServiceTest {
 
     private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
@@ -182,7 +175,7 @@ public class DOMCodecBug01Test extends AbstractDataServiceTest {
         flow.setNode(NODE_REF);
         InstructionsBuilder instructions = new InstructionsBuilder();
         InstructionBuilder instruction = new InstructionBuilder();
-        
+
         instruction.setOrder(10);
         ApplyActionsBuilder applyActions = new ApplyActionsBuilder();
         List<Action> actionList = new ArrayList<>();
@@ -204,7 +197,7 @@ public class DOMCodecBug01Test extends AbstractDataServiceTest {
         assertNotNull(ret);
         assertEquals(TransactionStatus.COMMITED, ret.getResult());
     }
-    
+
     private void createFlow2() throws Exception {
         DataModificationTransaction modification = baDataService.beginTransaction();
         long id = 123;
@@ -215,7 +208,7 @@ public class DOMCodecBug01Test extends AbstractDataServiceTest {
         MatchBuilder match = new MatchBuilder();
         match.setLayer4Match(new TcpMatchBuilder().build());
         flow.setMatch(match.build());
-        
+
         path1 = InstanceIdentifier.builder(Flows.class).child(Flow.class, key).toInstance();
        // DataObject cls = (DataObject) modification.readConfigurationData(path1);
         modification.putConfigurationData(path1, flow.build());
index 929eb66..9d60440 100644 (file)
@@ -7,6 +7,9 @@
  */
 package org.opendaylight.controller.sal.binding.test.bugfix;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
 import java.util.Collections;
 import java.util.Map;
 import java.util.concurrent.Callable;
@@ -16,29 +19,24 @@ import java.util.concurrent.Future;
 
 import javassist.ClassPool;
 
-import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
+import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
 import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.controller.sal.binding.test.util.BindingBrokerTestFactory;
-import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.config.rev130819.flows.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodesBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 import com.google.common.util.concurrent.ListeningExecutorService;
 import com.google.common.util.concurrent.MoreExecutors;
 
-import static org.junit.Assert.*;
-
 public class DOMCodecBug02Test extends AbstractDataServiceTest {
 
     private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
@@ -70,10 +68,11 @@ public class DOMCodecBug02Test extends AbstractDataServiceTest {
     /**
      * This test is ignored, till found out better way to test generation
      * of classes without leaking of instances from previous run
-     * 
+     *
      * @throws Exception
      */
-    
+
+    @Override
     public void setUp() {
         ListeningExecutorService executor = MoreExecutors.sameThreadExecutor();
         BindingBrokerTestFactory factory = new BindingBrokerTestFactory();
@@ -82,13 +81,13 @@ public class DOMCodecBug02Test extends AbstractDataServiceTest {
         factory.setStartWithParsedSchema(getStartWithSchema());
         testContext = factory.getTestContext();
         testContext.start();
-        
+
         baDataService = testContext.getBindingDataBroker();
         biDataService = testContext.getDomDataBroker();
         dataStore = testContext.getDomDataStore();
         mappingService = testContext.getBindingToDomMappingService();
     };
-    
+
     @Test
     public void testSchemaContextNotAvailable() throws Exception {
 
@@ -104,11 +103,11 @@ public class DOMCodecBug02Test extends AbstractDataServiceTest {
                 return transaction.commit();
             }
         });
-        
-        
+
+
         RpcResult<TransactionStatus> result = future.get().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-        
+
         Nodes nodes = checkForNodes();
         assertNotNull(nodes);
 
@@ -118,7 +117,7 @@ public class DOMCodecBug02Test extends AbstractDataServiceTest {
         return (Nodes) baDataService.readOperationalData(NODES_INSTANCE_ID_BA);
 
     }
-    
+
     @Override
     protected boolean getStartWithSchema() {
         return false;
index f2576e9..6a050ef 100644 (file)
@@ -6,7 +6,11 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 package org.opendaylight.controller.sal.binding.test.bugfix;
-import java.util.Arrays;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -14,35 +18,31 @@ import java.util.Map;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
-import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
+import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SupportedActions;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SupportedActionsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.supported.actions.ActionType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.supported.actions.ActionTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.SupportType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.SupportType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 
-import static org.junit.Assert.*;
-
 public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataChangeListener {
 
     private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
@@ -60,15 +60,15 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
     private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier//
             .builder(NODES_INSTANCE_ID_BA) //
             .child(Node.class, NODE_KEY).toInstance();
-    
-    
+
+
     private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = InstanceIdentifier//
             .builder(NODES_INSTANCE_ID_BA) //
             .child(Node.class, NODE_KEY) //
             .augmentation(FlowCapableNode.class) //
             .child(SupportedActions.class)
             .toInstance();
-    
+
 
     private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier NODE_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.builder() //
@@ -77,35 +77,35 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
             .toInstance();
     private static final QName SUPPORTED_ACTIONS_QNAME = QName.create(FlowCapableNode.QNAME, SupportedActions.QNAME.getLocalName());
 
-    
+
     private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier SUPPORTED_ACTIONS_INSTANCE_ID_BI = //
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.builder() //
                     .node(Nodes.QNAME) //
                     .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
                     .node(SUPPORTED_ACTIONS_QNAME) //
                     .toInstance();
-    
+
     private DataChangeEvent<InstanceIdentifier<?>, DataObject> receivedChangeEvent;
 
-    
-    
+
+
     /**
      * Test for Bug 148
-     * 
+     *
      * @throws Exception
      */
     @Test
     public void testAugmentSerialization() throws Exception {
 
-        
+
         baDataService.registerDataChangeListener(NODES_INSTANCE_ID_BA, this);
-        
+
         NodeBuilder nodeBuilder = new NodeBuilder();
         nodeBuilder.setId(new NodeId(NODE_ID));
         nodeBuilder.setKey(NODE_KEY);
         DataModificationTransaction transaction = baDataService.beginTransaction();
-        
-        
+
+
         FlowCapableNodeBuilder fnub = new FlowCapableNodeBuilder();
         fnub.setHardware("Hardware Foo");
         fnub.setManufacturer("Manufacturer Foo");
@@ -116,47 +116,47 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
         nodeBuilder.addAugmentation(FlowCapableNode.class, fnu);
         Node original = nodeBuilder.build();
         transaction.putOperationalData(NODE_INSTANCE_ID_BA, original);
-        
+
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-        
+
         assertNotNull(receivedChangeEvent);
-        
+
         verifyNodes((Nodes) receivedChangeEvent.getUpdatedOperationalSubtree(),original);
         assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
         Nodes nodes = checkForNodes();
         verifyNodes(nodes,original);
-        
+
         testAddingNodeConnector();
         testNodeRemove();
 
     }
-    
+
     @Test
     public void testAugmentNestedSerialization() throws Exception {
         DataModificationTransaction transaction = baDataService.beginTransaction();
-        
+
         SupportedActionsBuilder actions = new SupportedActionsBuilder();
         ActionTypeBuilder action = new ActionTypeBuilder();
         action.setAction("foo-action");
         action.setSupportState(SupportType.Native);
         List<ActionType> actionTypes = Collections.singletonList(action.build());
         actions.setActionType(actionTypes );
-        
+
         transaction.putOperationalData(SUPPORTED_ACTIONS_INSTANCE_ID_BA, actions.build());
         RpcResult<TransactionStatus> putResult = transaction.commit().get();
         assertNotNull(putResult);
         assertEquals(TransactionStatus.COMMITED, putResult.getResult());
         SupportedActions readedTable = (SupportedActions) baDataService.readOperationalData(SUPPORTED_ACTIONS_INSTANCE_ID_BA);
         assertNotNull(readedTable);
-        
+
         CompositeNode biSupportedActions = biDataService.readOperationalData(SUPPORTED_ACTIONS_INSTANCE_ID_BI);
         assertNotNull(biSupportedActions);
-        
+
     }
 
     private void testAddingNodeConnector() throws Exception {
-        
+
         NodeConnectorId ncId = new NodeConnectorId("openflow:1:bar");
         NodeConnectorKey nodeKey = new NodeConnectorKey(ncId );
         InstanceIdentifier<NodeConnector> ncInstanceId = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA).child(NodeConnector.class, nodeKey).toInstance();
@@ -181,7 +181,7 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
         transaction.removeOperationalData(NODE_INSTANCE_ID_BA);
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-        
+
         Node node = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
         assertNull(node);
     }
@@ -193,13 +193,13 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
         Node readedNode = nodes.getNode().get(0);
         assertEquals(original.getId(), readedNode.getId());
         assertEquals(original.getKey(), readedNode.getKey());
-        
+
         FlowCapableNode fnu = original.getAugmentation(FlowCapableNode.class);
         FlowCapableNode readedAugment = readedNode.getAugmentation(FlowCapableNode.class);
         assertNotNull(fnu);
         assertEquals(fnu.getDescription(), readedAugment.getDescription());
         assertEquals(fnu.getSerialNumber(), readedAugment.getSerialNumber());
-        
+
     }
 
     private void assertBindingIndependentVersion(
@@ -211,7 +211,7 @@ public class DOMCodecBug03Test extends AbstractDataServiceTest implements DataCh
     private Nodes checkForNodes() {
         return (Nodes) baDataService.readOperationalData(NODES_INSTANCE_ID_BA);
     }
-    
+
     @Override
     public void onDataChanged(DataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
         receivedChangeEvent = change;
index 8003e37..598743a 100644 (file)
@@ -6,46 +6,39 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 package org.opendaylight.controller.sal.binding.test.bugfix;
-import java.util.Arrays;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
 import java.util.Collections;
-import java.util.List;
 import java.util.Map;
 
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
 import org.opendaylight.controller.md.sal.common.api.data.DataChangeEvent;
-import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
+import org.opendaylight.controller.sal.binding.test.AbstractDataServiceTest;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SupportedActions;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.SupportedActionsBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.supported.actions.ActionType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.flow.node.supported.actions.ActionTypeBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnector;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.node.NodeConnectorKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.SupportType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeaturesKey;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 
-import static org.junit.Assert.*;
-
 public class PutAugmentationTest extends AbstractDataServiceTest implements DataChangeListener {
 
     private static final QName NODE_ID_QNAME = QName.create(Node.QNAME, "id");
@@ -63,15 +56,15 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
     private static final InstanceIdentifier<Node> NODE_INSTANCE_ID_BA = InstanceIdentifier//
             .builder(NODES_INSTANCE_ID_BA) //
             .child(Node.class, NODE_KEY).toInstance();
-    
-    
+
+
     private static final InstanceIdentifier<SupportedActions> SUPPORTED_ACTIONS_INSTANCE_ID_BA = InstanceIdentifier//
             .builder(NODES_INSTANCE_ID_BA) //
             .child(Node.class, NODE_KEY) //
             .augmentation(FlowCapableNode.class) //
             .child(SupportedActions.class)
             .toInstance();
-    
+
 
     private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier NODE_INSTANCE_ID_BI = //
     org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.builder() //
@@ -80,28 +73,28 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
             .toInstance();
     private static final QName SUPPORTED_ACTIONS_QNAME = QName.create(FlowCapableNode.QNAME, SupportedActions.QNAME.getLocalName());
 
-    
+
     private static final org.opendaylight.yangtools.yang.data.api.InstanceIdentifier SUPPORTED_ACTIONS_INSTANCE_ID_BI = //
             org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.builder() //
                     .node(Nodes.QNAME) //
                     .nodeWithKey(Node.QNAME, NODE_KEY_BI) //
                     .node(SUPPORTED_ACTIONS_QNAME) //
                     .toInstance();
-    
+
     private DataChangeEvent<InstanceIdentifier<?>, DataObject> receivedChangeEvent;
 
-    
-    
+
+
     /**
      * Test for Bug 148
-     * 
+     *
      * @throws Exception
      */
     @Test
     public void putNodeAndAugmentation() throws Exception {
 
         baDataService.registerDataChangeListener(NODES_INSTANCE_ID_BA, this);
-        
+
         NodeBuilder nodeBuilder = new NodeBuilder();
         nodeBuilder.setId(new NodeId(NODE_ID));
         nodeBuilder.setKey(NODE_KEY);
@@ -113,7 +106,7 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         Node node = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
         assertNotNull(node);
         assertEquals(NODE_KEY, node.getKey());
-        
+
         FlowCapableNodeBuilder fnub = new FlowCapableNodeBuilder();
         fnub.setHardware("Hardware Foo");
         fnub.setManufacturer("Manufacturer Foo");
@@ -124,11 +117,11 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         InstanceIdentifier<FlowCapableNode> augmentIdentifier = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA).augmentation(FlowCapableNode.class).toInstance();
         DataModificationTransaction augmentedTransaction = baDataService.beginTransaction();
         augmentedTransaction.putOperationalData(augmentIdentifier, fnu);
-        
+
         result = augmentedTransaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-        
-        
+
+
         Node augmentedNode = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
         assertNotNull(node);
         assertEquals(NODE_KEY, augmentedNode.getKey());
@@ -139,10 +132,10 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         assertBindingIndependentVersion(NODE_INSTANCE_ID_BI);
         testNodeRemove();
     }
-    
+
     @Test
     public void putNodeWithAugmentation() throws Exception {
-        
+
         NodeBuilder nodeBuilder = new NodeBuilder();
         nodeBuilder.setId(new NodeId(NODE_ID));
         nodeBuilder.setKey(NODE_KEY);
@@ -153,41 +146,41 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         fnub.setDescription("Description Foo");
         fnub.setSoftware("JUnit emulated");
         FlowCapableNode fnu = fnub.build();
-        
+
         nodeBuilder.addAugmentation(FlowCapableNode.class, fnu);
         DataModificationTransaction baseTransaction = baDataService.beginTransaction();
         baseTransaction.putOperationalData(NODE_INSTANCE_ID_BA, nodeBuilder.build());
         RpcResult<TransactionStatus> result = baseTransaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-        
+
         FlowCapableNode readedAugmentation = (FlowCapableNode) baDataService.readOperationalData(InstanceIdentifier.builder(NODE_INSTANCE_ID_BA).augmentation(FlowCapableNode.class).toInstance());
         assertNotNull(readedAugmentation);
         assertEquals(fnu.getHardware(), readedAugmentation.getHardware());
-        
+
         testPutNodeConnectorWithAugmentation();
         testNodeRemove();
     }
 
-    
+
     private void testPutNodeConnectorWithAugmentation() throws Exception {
         NodeConnectorKey ncKey = new NodeConnectorKey(new NodeConnectorId("test:0:0"));
         InstanceIdentifier<NodeConnector> ncPath = InstanceIdentifier.builder(NODE_INSTANCE_ID_BA)
         .child(NodeConnector.class, ncKey).toInstance();
         InstanceIdentifier<FlowCapableNodeConnector> ncAugmentPath = InstanceIdentifier.builder(ncPath)
         .augmentation(FlowCapableNodeConnector.class).toInstance();
-        
+
         NodeConnectorBuilder nc = new NodeConnectorBuilder();
         nc.setKey(ncKey);
-        
+
         FlowCapableNodeConnectorBuilder fncb = new FlowCapableNodeConnectorBuilder();
         fncb.setName("Baz");
         nc.addAugmentation(FlowCapableNodeConnector.class, fncb.build());
-        
+
         DataModificationTransaction baseTransaction = baDataService.beginTransaction();
         baseTransaction.putOperationalData(ncPath, nc.build());
         RpcResult<TransactionStatus> result = baseTransaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-        
+
         FlowCapableNodeConnector readedAugmentation = (FlowCapableNodeConnector) baDataService.readOperationalData(ncAugmentPath);
         assertNotNull(readedAugmentation);
         assertEquals(fncb.getName(), readedAugmentation.getName());
@@ -198,7 +191,7 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         transaction.removeOperationalData(NODE_INSTANCE_ID_BA);
         RpcResult<TransactionStatus> result = transaction.commit().get();
         assertEquals(TransactionStatus.COMMITED, result.getResult());
-        
+
         Node node = (Node) baDataService.readOperationalData(NODE_INSTANCE_ID_BA);
         assertNull(node);
     }
@@ -210,13 +203,13 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
         Node readedNode = nodes.getNode().get(0);
         assertEquals(original.getId(), readedNode.getId());
         assertEquals(original.getKey(), readedNode.getKey());
-        
+
         FlowCapableNode fnu = original.getAugmentation(FlowCapableNode.class);
         FlowCapableNode readedAugment = readedNode.getAugmentation(FlowCapableNode.class);
         assertNotNull(fnu);
         assertEquals(fnu.getDescription(), readedAugment.getDescription());
         assertEquals(fnu.getSerialNumber(), readedAugment.getSerialNumber());
-        
+
     }
 
     private void assertBindingIndependentVersion(
@@ -228,7 +221,7 @@ public class PutAugmentationTest extends AbstractDataServiceTest implements Data
     private Nodes checkForNodes() {
         return (Nodes) baDataService.readOperationalData(NODES_INSTANCE_ID_BA);
     }
-    
+
     @Override
     public void onDataChanged(DataChangeEvent<InstanceIdentifier<?>, DataObject> change) {
         receivedChangeEvent = change;
index ab86836..63094ef 100644 (file)
@@ -14,11 +14,8 @@ import java.math.BigInteger;
 import java.util.Collections;
 import java.util.Map;
 
-import javax.management.Notification;
-
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.DataModification;
 import org.opendaylight.controller.md.sal.common.api.data.DataReader;
 import org.opendaylight.controller.sal.binding.api.mount.MountProviderInstance;
 import org.opendaylight.controller.sal.binding.api.mount.MountProviderService;
@@ -27,11 +24,8 @@ import org.opendaylight.controller.sal.binding.test.util.BindingTestContext;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionInstance;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.TableKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.NodeGroupStatistics;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.statistics.rev131111.group.statistics.GroupStatistics;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.GroupId;
@@ -42,14 +36,11 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.data.impl.ImmutableCompositeNode;
-import org.opendaylight.yangtools.yang.data.impl.util.CompositeNodeBuilder;
 
-import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.MoreExecutors;
 
 public class CrossBrokerMountPointTest {
@@ -127,8 +118,8 @@ public class CrossBrokerMountPointTest {
         assertNotNull(bindingMountPoint);
 
         final BigInteger packetCount = BigInteger.valueOf(500L);
-        
-        
+
+
         DataReader<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, CompositeNode> simpleReader = new DataReader<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, CompositeNode>() {
 
             @Override
@@ -136,7 +127,7 @@ public class CrossBrokerMountPointTest {
                 return null;
             }
 
-            
+
             @Override
             public CompositeNode readOperationalData(org.opendaylight.yangtools.yang.data.api.InstanceIdentifier arg0) {
                 if (arg0.equals(GROUP_STATISTICS_ID_BI)) {
@@ -153,7 +144,7 @@ public class CrossBrokerMountPointTest {
 
         };
         domMountPoint.registerOperationalReader(NODE_INSTANCE_ID_BI, simpleReader);
-        
+
         GroupStatistics data = (GroupStatistics) bindingMountPoint.readOperationalData(GROUP_STATISTICS_ID_BA);
         assertNotNull(data);
         assertEquals(packetCount,data.getPacketCount().getValue());
index 3c5efa5..4e44167 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.controller.test.sal.binding.it;
 import static org.ops4j.pax.exam.CoreOptions.frameworkProperty;
 import static org.ops4j.pax.exam.CoreOptions.junitBundles;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.repository;
-import static org.ops4j.pax.exam.CoreOptions.repositories;
 import static org.ops4j.pax.exam.CoreOptions.systemProperty;
 
 import org.ops4j.pax.exam.Option;
@@ -91,9 +89,9 @@ public class TestHelper {
     public static Option bindingAwareSalBundles() {
         return new DefaultCompositeOption( //
                 mdSalCoreBundles(),
-                
+
                 mavenBundle("org.javassist", "javassist").versionAsInProject(), // //
-                
+
                 mavenBundle(YANGTOOLS, "yang-data-api").versionAsInProject(), // //
                 mavenBundle(YANGTOOLS, "yang-data-impl").versionAsInProject(), // //
                 mavenBundle(YANGTOOLS, "yang-model-api").versionAsInProject(), // //
@@ -109,7 +107,7 @@ public class TestHelper {
                         "binding-generator-spi").versionAsInProject(), //
                 mavenBundle(YANGTOOLS, "binding-generator-impl").versionAsInProject(),
                 mavenBundle(YANGTOOLS + ".thirdparty", "antlr4-runtime-osgi-nohead").versionAsInProject(), // //
-                
+
                 mavenBundle(CONTROLLER, "sal-core-api").versionAsInProject().update(), //
                 mavenBundle(CONTROLLER, "sal-binding-api").versionAsInProject(), // //
                 mavenBundle(CONTROLLER, "sal-binding-config").versionAsInProject(), //
@@ -118,7 +116,7 @@ public class TestHelper {
                 mavenBundle(CONTROLLER, "sal-common-util").versionAsInProject(), // //
 
 
-                
+
                 mavenBundle(CONTROLLER, "sal-broker-impl").versionAsInProject(), // //
                 mavenBundle(CONTROLLER, "sal-core-spi").versionAsInProject().update(), //
 
index 2aa7493..da47b17 100644 (file)
@@ -11,7 +11,6 @@ import java.util.Collection;
 import java.util.Collections;
 
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 
index a55e395..b23ceaa 100644 (file)
@@ -19,7 +19,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
 import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
@@ -38,8 +37,8 @@ import org.opendaylight.yangtools.yang.binding.RpcService;
 
 public class NoficationTest extends AbstractTest {
 
-    private FlowListener listener1 = new FlowListener();
-    private FlowListener listener2 = new FlowListener();
+    private final FlowListener listener1 = new FlowListener();
+    private final FlowListener listener2 = new FlowListener();
 
     private Registration<NotificationListener> listener1Reg;
     private Registration<NotificationListener> listener2Reg;
@@ -53,9 +52,9 @@ public class NoficationTest extends AbstractTest {
     @Test
     public void notificationTest() throws Exception {
         /**
-         * 
+         *
          * The registration of the Provider 1.
-         * 
+         *
          */
         AbstractTestProvider provider1 = new AbstractTestProvider() {
             @Override
@@ -69,10 +68,10 @@ public class NoficationTest extends AbstractTest {
         assertNotNull(notifyProviderService);
 
         /**
-         * 
+         *
          * The registration of the Consumer 1. It retrieves Notification Service
          * from MD-SAL and registers SalFlowListener as notification listener
-         * 
+         *
          */
         BindingAwareConsumer consumer1 = new BindingAwareConsumer() {
             @Override
@@ -97,7 +96,7 @@ public class NoficationTest extends AbstractTest {
 
         /**
          * Check that one notification was delivered and has correct cookie.
-         * 
+         *
          */
         assertEquals(1, listener1.addedFlows.size());
         assertEquals(0, listener1.addedFlows.get(0).getCookie().intValue());
@@ -107,31 +106,31 @@ public class NoficationTest extends AbstractTest {
          * registered as notification listener.
          */
         BindingAwareProvider provider = new BindingAwareProvider() {
-            
+
             @Override
             public void onSessionInitiated(ProviderContext session) {
                 listener2Reg = session.getSALService(NotificationProviderService.class).registerNotificationListener(
                         listener2);
             }
-            
+
             @Override
             public void onSessionInitialized(ConsumerContext session) {
                 // TODO Auto-generated method stub
-                
+
             }
-            
+
             @Override
             public Collection<? extends RpcService> getImplementations() {
                 // TODO Auto-generated method stub
                 return null;
             }
-            
+
             @Override
             public Collection<? extends ProviderFunctionality> getFunctionality() {
                 // TODO Auto-generated method stub
                 return null;
             }
-            
+
         };
 
         // registerConsumer method calls onSessionInitialized method above
@@ -153,19 +152,19 @@ public class NoficationTest extends AbstractTest {
         /**
          * Check that 3 notification was delivered to both listeners (first one
          * received 4 in total, second 3 in total).
-         * 
+         *
          */
         assertEquals(4, listener1.addedFlows.size());
         assertEquals(3, listener2.addedFlows.size());
 
         /**
          * The second listener is closed (unregistered)
-         * 
+         *
          */
         listener2Reg.close();
 
         /**
-         * 
+         *
          * The notification 5 is published
          */
         notifyProviderService.publish(flowAdded(10));
@@ -180,7 +179,7 @@ public class NoficationTest extends AbstractTest {
          * Check that first consumer received 5 notifications in total, second
          * consumer received only three. Last notification was never received by
          * second consumer because its listener was unregistered.
-         * 
+         *
          */
         assertEquals(5, listener1.addedFlows.size());
         assertEquals(3, listener2.addedFlows.size());
@@ -190,7 +189,7 @@ public class NoficationTest extends AbstractTest {
     /**
      * Creates instance of the type FlowAdded. Only cookie value is set. It is
      * used only for testing purpose.
-     * 
+     *
      * @param i
      *            cookie value
      * @return instance of the type FlowAdded
@@ -202,7 +201,7 @@ public class NoficationTest extends AbstractTest {
     }
 
     /**
-     * 
+     *
      * Implements
      * {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowListener
      * SalFlowListener} and contains attributes which keep lists of objects of
@@ -225,7 +224,7 @@ public class NoficationTest extends AbstractTest {
         @Override
         public void onFlowRemoved(FlowRemoved notification) {
             removedFlows.add(notification);
-        }; 
+        };
 
         @Override
         public void onFlowUpdated(FlowUpdated notification) {
@@ -235,20 +234,20 @@ public class NoficationTest extends AbstractTest {
         @Override
         public void onSwitchFlowRemoved(SwitchFlowRemoved notification) {
             // TODO Auto-generated method stub
-            
+
         }
 
         @Override
         public void onNodeErrorNotification(NodeErrorNotification notification) {
             // TODO Auto-generated method stub
-            
+
         }
 
         @Override
         public void onNodeExperimenterErrorNotification(
                 NodeExperimenterErrorNotification notification) {
             // TODO Auto-generated method stub
-            
+
         }
 
     }
index 8c81987..befe703 100644 (file)
@@ -15,7 +15,6 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
 import java.math.BigInteger;
-import java.util.concurrent.Future;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -26,9 +25,7 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef;
@@ -36,7 +33,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.common.RpcResult;
 
 public class RoutedServiceTest extends AbstractTest {
 
@@ -71,7 +67,7 @@ public class RoutedServiceTest extends AbstractTest {
         /**
          * Register provider 1 with first implementation of SalFlowService -
          * service1
-         * 
+         *
          */
         broker.registerProvider(provider1, getBundleContext());
         assertNotNull("Registration should not be null", firstReg);
@@ -89,7 +85,7 @@ public class RoutedServiceTest extends AbstractTest {
         /**
          * Register provider 2 with first implementation of SalFlowService -
          * service2
-         * 
+         *
          */
         broker.registerProvider(provider2, getBundleContext());
         assertNotNull("Registration should not be null", firstReg);
@@ -117,7 +113,7 @@ public class RoutedServiceTest extends AbstractTest {
         /**
          * Consumer creates addFlow message for node one and sends it to the
          * MD-SAL
-         * 
+         *
          */
         AddFlowInput addFlowFirstMessage = createSampleAddFlow(nodeOne, 1);
         consumerService.addFlow(addFlowFirstMessage);
@@ -125,19 +121,19 @@ public class RoutedServiceTest extends AbstractTest {
         /**
          * Verifies that implementation of the first provider received the same
          * message from MD-SAL.
-         * 
+         *
          */
         verify(salFlowService1).addFlow(addFlowFirstMessage);
 
         /**
          * Verifies that second instance was not invoked with first message
-         * 
+         *
          */
         verify(salFlowService2, times(0)).addFlow(addFlowFirstMessage);
 
         /**
          * Provider 2 registers path of node 2
-         * 
+         *
          */
         NodeRef nodeTwo = createNodeRef("foo:node:2");
         secondReg.registerPath(NodeContext.class, nodeTwo.getValue());
@@ -154,26 +150,26 @@ public class RoutedServiceTest extends AbstractTest {
         /**
          * Verifies that second instance was invoked 3 times with second message
          * and first instance wasn't invoked.
-         * 
+         *
          */
         verify(salFlowService2, times(3)).addFlow(AddFlowSecondMessage);
         verify(salFlowService1, times(0)).addFlow(AddFlowSecondMessage);
 
         /**
          * Unregisteration of the path for the node one in the first provider
-         * 
+         *
          */
         firstReg.unregisterPath(NodeContext.class, nodeOne.getValue());
 
         /**
          * Provider 2 registers path of node 1
-         * 
+         *
          */
         secondReg.registerPath(NodeContext.class, nodeOne.getValue());
 
         /**
          * A consumer sends third message to node 1
-         * 
+         *
          */
         AddFlowInput AddFlowThirdMessage = createSampleAddFlow(nodeOne, 3);
         consumerService.addFlow(AddFlowThirdMessage);
@@ -189,7 +185,7 @@ public class RoutedServiceTest extends AbstractTest {
 
     /**
      * Returns node reference from string which represents path
-     * 
+     *
      * @param string
      *            string with key(path)
      * @return instance of the type NodeRef
@@ -204,7 +200,7 @@ public class RoutedServiceTest extends AbstractTest {
 
     /**
      * Creates flow AddFlowInput for which only node and cookie are set
-     * 
+     *
      * @param node
      *            NodeRef value
      * @param cookie
index 0c562f5..77b4110 100644 (file)
@@ -8,20 +8,14 @@
 package org.opendaylight.controller.md.sal.binding.util;
 
 import java.util.concurrent.Future;
-import java.util.zip.Checksum;
 
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
 import org.opendaylight.controller.sal.binding.api.NotificationListener;
 import org.opendaylight.controller.sal.binding.api.NotificationService;
 import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
-import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.api.data.DataBrokerService;
 import org.opendaylight.controller.sal.binding.api.data.DataChangeListener;
 import org.opendaylight.controller.sal.binding.api.data.DataModificationTransaction;
-import org.opendaylight.controller.sal.binding.api.mount.MountInstance;
 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
-import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -54,7 +48,7 @@ public abstract class AbstractBindingSalConsumerInstance<D extends DataBrokerSer
     protected final D getDataBroker() {
         return dataBroker;
     }
-    
+
     protected final R getRpcRegistryChecked() {
         Preconditions.checkState(rpcRegistry != null,"Rpc Registry is not available.");
         return rpcRegistry;
@@ -69,7 +63,7 @@ public abstract class AbstractBindingSalConsumerInstance<D extends DataBrokerSer
         Preconditions.checkState(dataBroker != null, "Data Broker is not available");
         return dataBroker;
     }
-    
+
 
     protected AbstractBindingSalConsumerInstance(R rpcRegistry, N notificationBroker, D dataBroker) {
         this.rpcRegistry = rpcRegistry;
@@ -77,106 +71,127 @@ public abstract class AbstractBindingSalConsumerInstance<D extends DataBrokerSer
         this.dataBroker = dataBroker;
     }
 
+    @Override
     public <T extends RpcService> T getRpcService(Class<T> module) {
         return getRpcRegistryChecked().getRpcService(module);
     }
 
+    @Override
     @Deprecated
     public <T extends Notification> void addNotificationListener(Class<T> notificationType,
             NotificationListener<T> listener) {
         getNotificationBrokerChecked().addNotificationListener(notificationType, listener);
     }
 
+    @Override
     @Deprecated
     public void addNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
         getNotificationBrokerChecked().addNotificationListener(listener);
     }
 
+    @Override
     @Deprecated
     public void removeNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
         getNotificationBrokerChecked().removeNotificationListener(listener);
     }
 
+    @Override
     @Deprecated
     public <T extends Notification> void removeNotificationListener(Class<T> notificationType,
             NotificationListener<T> listener) {
         getNotificationBrokerChecked().removeNotificationListener(notificationType, listener);
     }
 
+    @Override
     public <T extends Notification> Registration<NotificationListener<T>> registerNotificationListener(
             Class<T> notificationType, NotificationListener<T> listener) {
         return getNotificationBrokerChecked().registerNotificationListener(notificationType, listener);
     }
 
+    @Override
     public Registration<org.opendaylight.yangtools.yang.binding.NotificationListener> registerNotificationListener(
             org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
         return getNotificationBrokerChecked().registerNotificationListener(listener);
     }
 
+    @Override
     @Deprecated
     public <T extends DataRoot> T getData(DataStoreIdentifier store, Class<T> rootType) {
         return getDataBrokerChecked().getData(store, rootType);
     }
 
+    @Override
     @Deprecated
     public <T extends DataRoot> T getData(DataStoreIdentifier store, T filter) {
         return getDataBrokerChecked().getData(store, filter);
     }
 
+    @Override
     @Deprecated
     public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, Class<T> rootType) {
         return getDataBrokerChecked().getCandidateData(store, rootType);
     }
 
+    @Override
     @Deprecated
     public <T extends DataRoot> T getCandidateData(DataStoreIdentifier store, T filter) {
         return getDataBrokerChecked().getCandidateData(store, filter);
     }
 
+    @Override
     @Deprecated
     public RpcResult<DataRoot> editCandidateData(DataStoreIdentifier store, DataRoot changeSet) {
         return getDataBrokerChecked().editCandidateData(store, changeSet);
     }
 
+    @Override
     @Deprecated
     public Future<RpcResult<Void>> commit(DataStoreIdentifier store) {
         return getDataBrokerChecked().commit(store);
     }
 
+    @Override
     @Deprecated
     public DataObject getData(InstanceIdentifier<? extends DataObject> data) {
         return getDataBrokerChecked().getData(data);
     }
 
+    @Override
     @Deprecated
     public DataObject getConfigurationData(InstanceIdentifier<?> data) {
         return getDataBrokerChecked().getConfigurationData(data);
     }
 
+    @Override
     public DataModificationTransaction beginTransaction() {
         return getDataBrokerChecked().beginTransaction();
     }
 
+    @Override
     @Deprecated
     public void registerChangeListener(InstanceIdentifier<? extends DataObject> path, DataChangeListener changeListener) {
         getDataBrokerChecked().registerChangeListener(path, changeListener);
     }
 
+    @Override
     @Deprecated
     public void unregisterChangeListener(InstanceIdentifier<? extends DataObject> path,
             DataChangeListener changeListener) {
         getDataBrokerChecked().unregisterChangeListener(path, changeListener);
     }
 
+    @Override
     @Deprecated
     public DataObject readConfigurationData(InstanceIdentifier<? extends DataObject> path) {
         return getDataBrokerChecked().readConfigurationData(path);
     }
 
+    @Override
     public DataObject readOperationalData(InstanceIdentifier<? extends DataObject> path) {
         return getDataBrokerChecked().readOperationalData(path);
     }
 
+    @Override
     @Deprecated
     public ListenerRegistration<DataChangeListener> registerDataChangeListener(
             InstanceIdentifier<? extends DataObject> path, DataChangeListener listener) {
index c7d6640..efa02e0 100644 (file)
@@ -19,7 +19,6 @@ import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistr
 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.controller.sal.binding.api.data.DataProviderService;
-import org.opendaylight.controller.sal.binding.api.mount.MountProviderInstance;
 import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
@@ -99,7 +98,7 @@ public abstract class AbstractBindingSalProviderInstance<D extends DataProviderS
             L listener) {
         return getRpcRegistryChecked().registerRouteChangeListener(listener);
     }
-    
+
     @Override
     public ListenerRegistration<NotificationInterestListener> registerInterestListener(
             NotificationInterestListener interestListener) {
index d164f82..dc22891 100644 (file)
@@ -7,26 +7,24 @@
  */
 package org.opendaylight.controller.md.sal.binding.util;
 
-import java.awt.image.SinglePixelPackedSampleModel;
+import static com.google.common.base.Preconditions.checkNotNull;
 
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
+import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
 import org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality;
-import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
-import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
 import org.opendaylight.controller.sal.binding.api.BindingAwareService;
 import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 
-import static com.google.common.base.Preconditions.*;
-
 import com.google.common.collect.ClassToInstanceMap;
 import com.google.common.collect.MutableClassToInstanceMap;
 
@@ -38,7 +36,7 @@ public class BindingContextUtils {
         checkNotNull(serviceProvider,"Service map should not be null");
         return new SingleConsumerContextImpl(serviceProvider);
     }
-    
+
     public static ProviderContext createProviderContext(BindingAwareProvider provider,
             ClassToInstanceMap<BindingAwareService> serviceProvider) {
         checkNotNull(provider,"Provider should not be null");
@@ -52,7 +50,7 @@ public class BindingContextUtils {
         consumer.onSessionInitialized(context);
         return context;
     }
-    
+
     public static ProviderContext createProviderContextAndInitialize(BindingAwareProvider provider,
             ClassToInstanceMap<BindingAwareService> serviceProvider) {
         ProviderContext context = createProviderContext(provider, serviceProvider);
@@ -64,9 +62,9 @@ public class BindingContextUtils {
         // FIXME: Create Proxy
         return instance;
     }
-    
+
     private static class SingleConsumerContextImpl implements ConsumerContext, AutoCloseable {
-        
+
         private ClassToInstanceMap<BindingAwareService> alreadyRetrievedServices;
         private ClassToInstanceMap<BindingAwareService> serviceProvider;
 
@@ -79,7 +77,7 @@ public class BindingContextUtils {
         public final <T extends RpcService> T getRpcService(Class<T> module) {
             return getSALService(RpcConsumerRegistry.class).getRpcService(module);
         }
-        
+
         @Override
         public final <T extends BindingAwareService> T getSALService(Class<T> service) {
             checkNotNull(service,"Service class should not be null.");
@@ -89,7 +87,7 @@ public class BindingContextUtils {
             }
             return tryToRetrieveSalService(service);
         }
-        
+
         private synchronized <T extends BindingAwareService> T tryToRetrieveSalService(Class<T> service) {
             final T potential = alreadyRetrievedServices.getInstance(service);
             if(potential != null) {
@@ -103,44 +101,44 @@ public class BindingContextUtils {
             alreadyRetrievedServices.put(service, retrieved);
             return retrieved;
         }
-        
+
         @Override
         public final void close() throws Exception {
             alreadyRetrievedServices = null;
             serviceProvider = null;
         }
     }
-    
+
     private static class SingleProviderContextImpl extends SingleConsumerContextImpl implements ProviderContext {
 
         public SingleProviderContextImpl(ClassToInstanceMap<BindingAwareService> serviceProvider) {
             super(serviceProvider);
         }
-        
+
         @Override
         public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
                 L listener) {
             return getSALService(RpcProviderRegistry.class).registerRouteChangeListener(listener);
         }
-        
+
         @Override
         public <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type,
                 T implementation) throws IllegalStateException {
             return getSALService(RpcProviderRegistry.class).addRoutedRpcImplementation(type, implementation);
         }
-        
+
         @Override
         public <T extends RpcService> RpcRegistration<T> addRpcImplementation(Class<T> type, T implementation)
                 throws IllegalStateException {
             return getSALService(RpcProviderRegistry.class).addRpcImplementation(type, implementation);
         }
-        
+
         @Deprecated
         @Override
         public void registerFunctionality(ProviderFunctionality functionality) {
             // NOOP
         }
-        
+
         @Deprecated
         @Override
         public void unregisterFunctionality(ProviderFunctionality functionality) {
index 1700411..66645e5 100644 (file)
@@ -9,10 +9,9 @@ package org.opendaylight.controller.md.sal.common.api.data;
 
 
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
+
 // FIXME: After 0.6 Release of YANGTools refactor to use Path marker interface for arguments.
 // import org.opendaylight.yangtools.concepts.Path;
-import org.opendaylight.yangtools.concepts.Registration;
-
 public interface DataChangePublisher<P/* extends Path<P> */,D, L extends DataChangeListener<P,D>> {
 
     ListenerRegistration<L> registerDataChangeListener(P path, L listener);
index 29ba192..00db606 100644 (file)
@@ -7,20 +7,18 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
-import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.Future;
 
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
-// FIXME: After 0.6 Release of YANGTools refactor to use Path marker interface for arguments.
-// import org.opendaylight.yangtools.concepts.Path;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
+//FIXME: After 0.6 Release of YANGTools refactor to use Path marker interface for arguments.
+//import org.opendaylight.yangtools.concepts.Path;
 public interface DataModification<P/* extends Path<P> */, D> extends DataChange<P, D>, DataReader<P, D> {
 
     /**
      * Returns transaction identifier
-     * 
+     *
      * @return Transaction identifier
      */
     Object getIdentifier();
@@ -28,9 +26,9 @@ public interface DataModification<P/* extends Path<P> */, D> extends DataChange<
     TransactionStatus getStatus();
 
     /**
-     * 
+     *
      * @deprecated Use {@link #putOperationalData(Object, Object)} instead.
-     * 
+     *
      * @param path
      * @param data
      */
@@ -81,7 +79,7 @@ public interface DataModification<P/* extends Path<P> */, D> extends DataChange<
 
     /**
      * @deprecated Use {@link #removeOperationalData(Object)}
-     * 
+     *
      * @param path
      */
     @Deprecated
@@ -93,18 +91,18 @@ public interface DataModification<P/* extends Path<P> */, D> extends DataChange<
 
     /**
      * Initiates a two-phase commit of modification.
-     * 
+     *
      * <p>
      * The successful commit changes the state of the system and may affect
      * several components.
-     * 
+     *
      * <p>
      * The effects of successful commit of data are described in the
      * specifications and YANG models describing the Provider components of
      * controller. It is assumed that Consumer has an understanding of this
      * changes.
-     * 
-     * 
+     *
+     *
      * @see DataCommitHandler for further information how two-phase commit is
      *      processed.
      * @param store
index fed75f7..f337b55 100644 (file)
@@ -7,13 +7,12 @@
  */
 package org.opendaylight.controller.md.sal.common.impl;
 
+import static com.google.common.base.Preconditions.checkNotNull;
+
 import java.util.Collections;
 import java.util.EventListener;
 import java.util.HashSet;
 import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-
-import static com.google.common.base.Preconditions.*;
 
 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
@@ -32,15 +31,15 @@ public class ListenerRegistry<T extends EventListener> {
         return unmodifiableView;
     }
 
-    
+
     public ListenerRegistration<T> register(T listener) {
         checkNotNull(listener, "Listener should not be null.");
         ListenerRegistrationImpl<T> ret = new ListenerRegistrationImpl<T>(listener);
         listeners.add(ret);
         return ret;
     }
-    
-    
+
+
     @SuppressWarnings("rawtypes")
     private void remove(ListenerRegistrationImpl registration) {
         listeners.remove(registration);
index bd9748d..4d756f1 100644 (file)
@@ -8,8 +8,6 @@
 package org.opendaylight.controller.md.sal.common.impl.util;
 
 import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
@@ -23,8 +21,8 @@ public class AbstractLockableDelegator<T> implements Delegator<T> {
     private final ReentrantReadWriteLock delegateLock = new ReentrantReadWriteLock();
     private final ReadLock delegateReadLock = delegateLock.readLock();
     private final WriteLock delegateWriteLock = delegateLock.writeLock();
-    
-    
+
+
     protected Lock getDelegateReadLock() {
         return delegateReadLock;
     }
@@ -60,7 +58,7 @@ public class AbstractLockableDelegator<T> implements Delegator<T> {
     }
 
     /**
-     * 
+     *
      * @param newDelegate
      * @return oldDelegate
      */
@@ -75,8 +73,8 @@ public class AbstractLockableDelegator<T> implements Delegator<T> {
             delegateWriteLock.unlock();
         }
     }
-    
-    
+
+
     protected void onDelegateChanged(T oldDelegate, T newDelegate) {
         // NOOP in abstract calss;
     }
index 356ec8f..f7fc714 100644 (file)
@@ -8,9 +8,7 @@
 package org.opendaylight.controller.sal.common.util;
 
 import java.io.Serializable;
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.yang.common.RpcError;
@@ -19,12 +17,12 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
 import com.google.common.collect.ImmutableList;
 
 public class Rpcs {
-    
+
     public static <T> RpcResult<T> getRpcResult(boolean successful) {
         RpcResult<T> ret = new RpcResultTO<T>(successful, null, ImmutableList.<RpcError>of());
         return ret;
     }
-    
+
     public static <T> RpcResult<T> getRpcResult(boolean successful, T result,
             Collection<RpcError> errors) {
         RpcResult<T> ret = new RpcResultTO<T>(successful, result, errors);
@@ -34,7 +32,7 @@ public class Rpcs {
     public static <T> RpcResult<T> getRpcResult(boolean successful, Collection<RpcError> errors) {
         return new RpcResultTO<T>(successful, null, errors);
     }
-    
+
     private static class RpcResultTO<T> implements RpcResult<T>, Serializable, Immutable {
 
         private final Collection<RpcError> errors;
index 1cb1a2b..22b0bf2 100644 (file)
@@ -10,9 +10,6 @@ package org.opendaylight.controller.sal.core.api;
 import java.util.Collection;
 import java.util.Collections;
 
-import javax.naming.Context;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
@@ -59,18 +56,18 @@ public abstract class AbstractProvider implements BundleActivator, Provider,Serv
             broker.registerProvider(this, context);
             return broker;
         }
-        
+
         return null;
     }
-    
+
     @Override
     public void modifiedService(ServiceReference<Broker> reference, Broker service) {
         // NOOP
     }
-    
+
     @Override
     public void removedService(ServiceReference<Broker> reference, Broker service) {
         stopImpl(context);
     }
-    
+
 }
index 774de27..9706bba 100644 (file)
@@ -8,8 +8,6 @@
 package org.opendaylight.controller.sal.core.api.data;
 
 import java.util.EventListener;
-import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.Future;
 
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
@@ -23,31 +21,28 @@ public interface DataModificationTransaction extends DataModification<InstanceId
 
     /**
      * Returns transaction identifier
-     * 
+     *
      * @return Transaction identifier
      */
+    @Override
     Object getIdentifier();
-    
+
+    @Override
     TransactionStatus getStatus();
-    
+
     /**
      * Commits transaction to be stored in global data repository.
-     * 
-     * 
-     * @return  Future object which returns RpcResult with TransactionStatus 
+     *
+     *
+     * @return  Future object which returns RpcResult with TransactionStatus
      *          when transaction is processed by store.
      */
+    @Override
     Future<RpcResult<TransactionStatus>> commit();
-    
+
     ListenerRegistration<DataTransactionListener> registerListener(DataTransactionListener listener);
-    
-    
+
     public interface DataTransactionListener extends EventListener {
-        
         void onStatusUpdated(DataModificationTransaction transaction,TransactionStatus status);
-        
     }
-    
-    
-    
 }
index 299fe1b..29e3b91 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.controller.sal.core.api.mount;
 import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
 import org.opendaylight.controller.sal.core.api.data.DataProviderService;
 import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
-import com.google.common.base.Optional;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 public interface MountProvisionInstance extends //
index 403f7c8..bbe017f 100644 (file)
@@ -9,14 +9,13 @@ package org.opendaylight.controller.sal.dom.broker;
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
-import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
 import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
+import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.controller.sal.core.api.Consumer.ConsumerFunctionality;
 import org.opendaylight.controller.sal.core.api.Provider.ProviderFunctionality;
 import org.opendaylight.controller.sal.core.api.notify.NotificationListener;
@@ -37,7 +36,7 @@ public class NotificationModule implements BrokerModule {
     private static Logger log = LoggerFactory
             .getLogger(NotificationModule.class);
 
-    private Multimap<QName, NotificationListener> listeners = HashMultimap
+    private final Multimap<QName, NotificationListener> listeners = HashMultimap
             .create();
 
     private static final Set<Class<? extends BrokerService>> PROVIDED_SERVICE_TYPE = ImmutableSet
@@ -114,11 +113,12 @@ public class NotificationModule implements BrokerModule {
     private class NotificationConsumerSessionImpl implements
             NotificationService {
 
-        private Multimap<QName, NotificationListener> consumerListeners = HashMultimap
+        private final Multimap<QName, NotificationListener> consumerListeners = HashMultimap
                 .create();
         private boolean closed = false;
 
 
+        @Override
         public Registration<NotificationListener> addNotificationListener(QName notification,
                 NotificationListener listener) {
             checkSessionState();
index 0b184fc..50af3fb 100644 (file)
@@ -8,21 +8,8 @@
 package org.opendaylight.controller.sal.dom.broker.impl;
 
 import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
 
-import org.opendaylight.controller.sal.core.api.BrokerService;
-import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.sal.core.api.Consumer.ConsumerFunctionality;
-import org.opendaylight.controller.sal.core.api.Provider.ProviderFunctionality;
 import org.opendaylight.controller.sal.core.api.notify.NotificationListener;
-import org.opendaylight.controller.sal.core.api.notify.NotificationPublishService;
-import org.opendaylight.controller.sal.core.api.notify.NotificationService;
-import org.opendaylight.controller.sal.core.spi.BrokerModule;
 import org.opendaylight.controller.sal.dom.broker.spi.NotificationRouter;
 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
 import org.opendaylight.yangtools.concepts.Registration;
@@ -32,16 +19,15 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.collect.HashMultimap;
-import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Multimap;
 import com.google.common.collect.Multimaps;
 
 public class NotificationRouterImpl implements NotificationRouter {
     private static Logger log = LoggerFactory.getLogger(NotificationRouterImpl.class);
 
-    private Multimap<QName, Registration<NotificationListener>> listeners = Multimaps.synchronizedSetMultimap(HashMultimap.<QName, Registration<NotificationListener>>create());
+    private final Multimap<QName, Registration<NotificationListener>> listeners = Multimaps.synchronizedSetMultimap(HashMultimap.<QName, Registration<NotificationListener>>create());
 //    private Registration<NotificationListener> defaultListener;
-    
+
     private void sendNotification(CompositeNode notification) {
         final QName type = notification.getNodeType();
         final Collection<Registration<NotificationListener>> toNotify = listeners.get(type);
@@ -66,7 +52,7 @@ public class NotificationRouterImpl implements NotificationRouter {
     public void publish(CompositeNode notification) {
         sendNotification(notification);
     }
-    
+
     @Override
     public Registration<NotificationListener> addNotificationListener(QName notification, NotificationListener listener) {
         ListenerRegistration ret = new ListenerRegistration(notification, listener);
index 0e63126..24d5430 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.controller.sal.dom.broker.osgi;
 
-import org.opendaylight.controller.sal.core.api.data.DataBrokerService;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionInstance;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionService;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
@@ -16,23 +15,26 @@ import org.osgi.framework.ServiceReference;
 
 public class MountProviderServiceProxy extends AbstractBrokerServiceProxy<MountProvisionService> implements MountProvisionService{
 
-    
+
     public MountProviderServiceProxy(ServiceReference<MountProvisionService> ref, MountProvisionService delegate) {
         super(ref, delegate);
     }
 
+    @Override
     public MountProvisionInstance getMountPoint(InstanceIdentifier path) {
         return getDelegate().getMountPoint(path);
     }
 
+    @Override
     public MountProvisionInstance createMountPoint(InstanceIdentifier path) {
         return getDelegate().createMountPoint(path);
     }
 
+    @Override
     public MountProvisionInstance createOrGetMountPoint(InstanceIdentifier path) {
         return getDelegate().createOrGetMountPoint(path);
     }
-    
+
     @Override
     public ListenerRegistration<MountProvisionListener> registerProvisionListener(MountProvisionListener listener) {
         return getDelegate().registerProvisionListener(listener);
index 9881be0..d1523a0 100644 (file)
@@ -9,12 +9,10 @@ package org.opendaylight.controller.sal.dom.broker.spi;
 
 import java.util.Set;
 
-import org.opendaylight.controller.sal.core.api.RpcImplementation;
-import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
 import org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration;
 import org.opendaylight.controller.sal.core.api.Broker.RpcRegistration;
-import org.opendaylight.controller.sal.core.api.RpcRegistrationListener;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.controller.sal.core.api.RpcImplementation;
+import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
@@ -23,14 +21,14 @@ public interface RpcRouter extends RpcProvisionRegistry, RpcImplementation {
 
     @Override
     public RoutedRpcRegistration addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation);
-    
+
     @Override
     public RpcRegistration addRpcImplementation(QName rpcType, RpcImplementation implementation)
             throws IllegalArgumentException;
-    
+
     @Override
     public Set<QName> getSupportedRpcs();
-    
+
     @Override
     public RpcResult<CompositeNode> invokeRpc(QName rpc, CompositeNode input);
 }
index a816819..c16ee17 100644 (file)
@@ -7,15 +7,21 @@
  */
 package org.opendaylight.controller.sal.connect.netconf;
 
+import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_ACTION_QNAME;
+import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_CANDIDATE_QNAME;
+import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_COMMIT_QNAME;
+import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_CONFIG_QNAME;
+import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_EDIT_CONFIG_QNAME;
+import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_RUNNING_QNAME;
+import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.NETCONF_TARGET_QNAME;
+
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
-import java.util.Set;
 
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.opendaylight.controller.md.sal.common.api.data.DataModification;
 import org.opendaylight.controller.md.sal.common.api.data.DataCommitHandler.DataCommitTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.DataModification;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
@@ -28,18 +34,14 @@ import org.opendaylight.yangtools.yang.data.impl.util.CompositeNodeBuilder;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.Collections2;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 
-import static org.opendaylight.controller.sal.connect.netconf.NetconfMapping.*;
-
 public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransaction<InstanceIdentifier, CompositeNode> {
 
-    private NetconfDevice device;
+    private final NetconfDevice device;
     private final DataModification<InstanceIdentifier, CompositeNode> modification;
-    private boolean candidateSupported = true;
+    private final boolean candidateSupported = true;
 
     public NetconfDeviceTwoPhaseCommitTransaction(NetconfDevice device,
             DataModification<InstanceIdentifier, CompositeNode> modification) {
@@ -70,15 +72,15 @@ public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransac
         CompositeNodeBuilder<ImmutableCompositeNode> builder = configurationRpcBuilder();
         builder.setQName(NETCONF_EDIT_CONFIG_QNAME);
         builder.add(editStructure);
-        
+
         RpcResult<CompositeNode> rpcResult = device.invokeRpc(NETCONF_EDIT_CONFIG_QNAME, builder.toInstance());
         Preconditions.checkState(rpcResult.isSuccessful(),"Rpc Result was unsuccessful");
-        
+
     }
 
     private CompositeNodeBuilder<ImmutableCompositeNode> configurationRpcBuilder() {
         CompositeNodeBuilder<ImmutableCompositeNode> ret = ImmutableCompositeNode.builder();
-        
+
         Node<?> targetNode;
         if(candidateSupported) {
             targetNode = ImmutableCompositeNode.create(NETCONF_CANDIDATE_QNAME, ImmutableList.<Node<?>>of());
@@ -106,7 +108,7 @@ public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransac
             for (Entry<QName, Object> entry : predicates.entrySet()) {
                 builder.addLeaf(entry.getKey(), entry.getValue());
             }
-            
+
             if (isLast) {
                 if (action.isPresent()) {
                     builder.setAttribute(NETCONF_ACTION_QNAME, action.get());
@@ -118,7 +120,7 @@ public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransac
                             builder.add(child);
                         }
                     }
-                    
+
                 }
             } else {
                 builder.add(previous);
index 49f7020..fa6b6f7 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.sal.connect.netconf;
 
 import java.util.Set;
 
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
@@ -19,7 +18,6 @@ import org.opendaylight.yangtools.yang.data.impl.util.CompositeNodeBuilder;
 import org.opendaylight.yangtools.yang.model.util.repo.SchemaSourceProvider;
 
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 
 class NetconfRemoteSchemaSourceProvider implements SchemaSourceProvider<String> {
 
index a34aaff..bc819b6 100644 (file)
@@ -10,13 +10,12 @@ package org.opendaylight.controller.sal.connect.netconf;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringBufferInputStream;
-import java.io.StringReader;
 
 import org.opendaylight.yangtools.concepts.Delegator;
 import org.opendaylight.yangtools.yang.common.QName;
 
 /**
- * 
+ *
  *
  */
 public class YangModelInputStreamAdapter extends InputStream implements Delegator<InputStream> {
@@ -24,9 +23,9 @@ public class YangModelInputStreamAdapter extends InputStream implements Delegato
     final String source;
     final QName moduleIdentifier;
     final InputStream delegate;
-    
-    
-    
+
+
+
     private YangModelInputStreamAdapter(String source, QName moduleIdentifier, InputStream delegate) {
         super();
         this.source = source;
@@ -34,46 +33,57 @@ public class YangModelInputStreamAdapter extends InputStream implements Delegato
         this.delegate = delegate;
     }
 
+    @Override
     public int read() throws IOException {
         return delegate.read();
     }
 
+    @Override
     public int hashCode() {
         return delegate.hashCode();
     }
 
+    @Override
     public int read(byte[] b) throws IOException {
         return delegate.read(b);
     }
 
+    @Override
     public boolean equals(Object obj) {
         return delegate.equals(obj);
     }
 
+    @Override
     public int read(byte[] b, int off, int len) throws IOException {
         return delegate.read(b, off, len);
     }
 
+    @Override
     public long skip(long n) throws IOException {
         return delegate.skip(n);
     }
 
+    @Override
     public int available() throws IOException {
         return delegate.available();
     }
 
+    @Override
     public void close() throws IOException {
         delegate.close();
     }
 
+    @Override
     public void mark(int readlimit) {
         delegate.mark(readlimit);
     }
 
+    @Override
     public void reset() throws IOException {
         delegate.reset();
     }
 
+    @Override
     public boolean markSupported() {
         return delegate.markSupported();
     }
index 17d7fe6..dd1502b 100644 (file)
@@ -12,12 +12,10 @@ import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.util.Collections;
-import java.util.Set;
 
 import javax.ws.rs.WebApplicationException;
 
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.sal.rest.impl.StructuredDataToJsonProvider;
 import org.opendaylight.controller.sal.restconf.impl.test.DummyType;
@@ -29,7 +27,6 @@ import org.opendaylight.yangtools.yang.data.api.MutableCompositeNode;
 import org.opendaylight.yangtools.yang.data.api.MutableSimpleNode;
 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.parser.builder.impl.ContainerSchemaNodeBuilder;
 import org.opendaylight.yangtools.yang.parser.builder.impl.LeafSchemaNodeBuilder;
 import org.slf4j.Logger;
@@ -49,7 +46,7 @@ public class CnSnToJsonNotExistingLeafTypeTest extends YangAndXmlAndDataSchemaLo
         String jsonOutput = null;
         jsonOutput = TestUtils
                 .writeCompNodeWithSchemaContextToOutput(prepareCompositeNode(),
-                        (Set<Module>) Collections.EMPTY_SET, prepareDataSchemaNode(),
+                        Collections.EMPTY_SET, prepareDataSchemaNode(),
                         StructuredDataToJsonProvider.INSTANCE);
         assertNotNull(jsonOutput);
         assertTrue(jsonOutput.contains("\"lf1\": \"\""));
index 4218a69..f81c1d6 100644 (file)
@@ -7,12 +7,10 @@
  */
 package org.opendaylight.controller.sal.restconf.impl.cnsn.to.xml.test;
 
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
 import java.util.Collections;
-import java.util.Set;
 
 import javax.ws.rs.WebApplicationException;
 
@@ -21,10 +19,12 @@ import org.junit.Test;
 import org.opendaylight.controller.sal.rest.impl.StructuredDataToXmlProvider;
 import org.opendaylight.controller.sal.restconf.impl.test.DummyType;
 import org.opendaylight.controller.sal.restconf.impl.test.TestUtils;
-import org.opendaylight.yangtools.yang.data.api.*;
+import org.opendaylight.yangtools.yang.data.api.CompositeNode;
+import org.opendaylight.yangtools.yang.data.api.ModifyAction;
+import org.opendaylight.yangtools.yang.data.api.MutableCompositeNode;
+import org.opendaylight.yangtools.yang.data.api.MutableSimpleNode;
 import org.opendaylight.yangtools.yang.data.impl.NodeFactory;
 import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
-import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.parser.builder.impl.ContainerSchemaNodeBuilder;
 import org.opendaylight.yangtools.yang.parser.builder.impl.LeafSchemaNodeBuilder;
 import org.slf4j.Logger;
@@ -41,7 +41,7 @@ public class CnSnToXmlNotExistingLeafTypeTest {
         boolean nullPointerExceptionRaised = false;
         try {
             TestUtils.writeCompNodeWithSchemaContextToOutput(prepareCompositeNode(),
-                    (Set<Module>) Collections.EMPTY_SET, prepareDataSchemaNode(), StructuredDataToXmlProvider.INSTANCE);
+                    Collections.EMPTY_SET, prepareDataSchemaNode(), StructuredDataToXmlProvider.INSTANCE);
         } catch (WebApplicationException | IOException e) {
             LOG.error("WebApplicationException or IOException was raised");
         } catch (NullPointerException e) {
index f2d6aaf..1e01020 100644 (file)
@@ -7,12 +7,11 @@
  */
 package org.opendaylight.controller.sal.restconf.impl.test;
 
-import static org.junit.Assert.*;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
-import static org.mockito.Mockito.verify;
 import static org.opendaylight.controller.sal.restconf.impl.test.RestOperationUtils.createUri;
 
 import java.io.FileNotFoundException;
@@ -23,14 +22,14 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
-import javax.ws.rs.core.Response;
 
 import javax.ws.rs.core.Application;
 import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
 import org.glassfish.jersey.server.ResourceConfig;
 import org.glassfish.jersey.test.JerseyTest;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.opendaylight.controller.sal.core.api.mount.MountInstance;
 import org.opendaylight.controller.sal.core.api.mount.MountService;
@@ -385,7 +384,7 @@ public class RestGetOperationTest extends JerseyTest {
                         responseBody).find());
         String[] split = responseBody.split("\"module\"");
         assertEquals("\"module\" element is returned more then once",2,split.length);
-        
+
 
         response = target(uri).request("application/yang.api+xml").get();
         assertEquals(200, response.getStatus());
@@ -396,9 +395,9 @@ public class RestGetOperationTest extends JerseyTest {
                         .find());
         split = responseBody.split("<module");
         assertEquals("<module element is returned more then once",2,split.length);
-        
-        
-        
+
+
+
 
     }
 
index 02e1632..0a16e25 100644 (file)
@@ -15,7 +15,6 @@ import io.netty.channel.SimpleChannelInboundHandler;
 import io.netty.handler.codec.http.FullHttpResponse;
 import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
-import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker;
 import io.netty.handler.codec.http.websocketx.WebSocketFrame;
 import io.netty.util.CharsetUtil;
@@ -28,7 +27,7 @@ public class WebSocketClientHandler extends SimpleChannelInboundHandler<Object>
     private static final Logger logger = LoggerFactory.getLogger(WebSocketClientHandler.class.toString());
     private final WebSocketClientHandshaker handshaker;
     private ChannelPromise handshakeFuture;
-    private IClientMessageCallback messageListener;
+    private final IClientMessageCallback messageListener;
 
 
     public WebSocketClientHandler(WebSocketClientHandshaker handshaker,IClientMessageCallback listener) {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.