Merge "Activate enforcement of Path type"
authorTony Tkacik <ttkacik@cisco.com>
Tue, 18 Feb 2014 12:30:44 +0000 (12:30 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 18 Feb 2014 12:30:44 +0000 (12:30 +0000)
15 files changed:
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataChange.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataChangeEvent.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataChangeListener.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/DataCommitHandler.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-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataModificationTransactionFactory.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataProvider.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataReader.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataStore.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChain.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionChainFactory.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/routing/MutableRoutingTable.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/routing/RoutedRegistration.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/routing/RoutingTable.java

index 30a607d95b6a025619e836dd26097707704ecae3..ebffbcc811747307f2a3a67a7b83cb403d5757c2 100644 (file)
@@ -10,41 +10,40 @@ package org.opendaylight.controller.md.sal.common.api.data;
 import java.util.Map;
 import java.util.Set;
 
-// 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.Path;
 
-public interface DataChange<P/* extends Path<P> */, D> {
+public interface DataChange<P extends Path<P>, D> {
 
     /**
      * Returns a map of paths and newly created objects
-     * 
+     *
      * @return map of paths and newly created objects
      */
     Map<P, D> getCreatedOperationalData();
 
     /**
      * Returns a map of paths and newly created objects
-     * 
+     *
      * @return map of paths and newly created objects
      */
     Map<P, D> getCreatedConfigurationData();
 
     /**
      * Returns a map of paths and respective updated objects after update.
-     * 
+     *
      * Original state of the object is in
      * {@link #getOriginalOperationalData()}
-     * 
+     *
      * @return map of paths and newly created objects
      */
     Map<P, D> getUpdatedOperationalData();
 
     /**
      * Returns a map of paths and respective updated objects after update.
-     * 
+     *
      * Original state of the object is in
      * {@link #getOriginalConfigurationData()}
-     * 
+     *
      * @return map of paths and newly created objects
      */
     Map<P, D> getUpdatedConfigurationData();
@@ -53,34 +52,34 @@ public interface DataChange<P/* extends Path<P> */, D> {
 
     /**
      * Returns a set of paths of removed objects.
-     * 
+     *
      * Original state of the object is in
      * {@link #getOriginalConfigurationData()}
-     * 
+     *
      * @return map of paths and newly created objects
      */
     Set<P> getRemovedConfigurationData();
 
     /**
      * Returns a set of paths of removed objects.
-     * 
+     *
      * Original state of the object is in
      * {@link #getOriginalOperationalData()}
-     * 
+     *
      * @return map of paths and newly created objects
      */
     Set<P> getRemovedOperationalData();
 
     /**
      * Return a map of paths and original state of updated and removed objectd.
-     * 
+     *
      * @return map of paths and original state of updated and removed objectd.
      */
     Map<P, D> getOriginalConfigurationData();
 
     /**
      * Return a map of paths and original state of updated and removed objectd.
-     * 
+     *
      * @return map of paths and original state of updated and removed objectd.
      */
     Map<P, D> getOriginalOperationalData();
index d62e176e62d1beeb22c934f7c82aa3a713909b91..15d1daa1bbe882393f863e892728490c212f5e71 100644 (file)
@@ -8,36 +8,37 @@
 package org.opendaylight.controller.md.sal.common.api.data;
 
 import org.opendaylight.yangtools.concepts.Immutable;
+import org.opendaylight.yangtools.concepts.Path;
 
-public interface DataChangeEvent<P,D> extends DataChange<P, D>, Immutable {
+public interface DataChangeEvent<P extends Path<P>,D> extends DataChange<P, D>, Immutable {
 
     /**
      * Returns a orignal subtree of data, which starts at the path
      * where listener was registered.
-     * 
+     *
      */
     D getOriginalConfigurationSubtree();
 
     /**
      * Returns a new subtree of data, which starts at the path
      * where listener was registered.
-     * 
+     *
      */
     D getOriginalOperationalSubtree();
-    
-    
-    
+
+
+
     /**
      * Returns a updated subtree of data, which starts at the path
      * where listener was registered.
-     * 
+     *
      */
     D getUpdatedConfigurationSubtree();
 
     /**
      * Returns a udpated subtree of data, which starts at the path
      * where listener was registered.
-     * 
+     *
      */
     D getUpdatedOperationalSubtree();
 }
index 8b87139c7f97e78d09be1fad70fd192af52e48b2..8787a3fe8d82de85bc7e064177501e017d041cca 100644 (file)
@@ -9,10 +9,9 @@ package org.opendaylight.controller.md.sal.common.api.data;
 
 import java.util.EventListener;
 
-// 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.Path;
 
-public interface DataChangeListener<P/* extends Path<P> */,D> extends EventListener {
+public interface DataChangeListener<P extends Path<P>, D> extends EventListener {
 
     void onDataChanged(DataChangeEvent<P, D> change);
 }
index 66645e5538d6efb0935231100c0a72890ed09a70..0c4c6d179ff84faf955fb6989d8ca900cbb8722e 100644 (file)
@@ -7,12 +7,10 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
-
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Path;
 
-// FIXME: After 0.6 Release of YANGTools refactor to use Path marker interface for arguments.
-// import org.opendaylight.yangtools.concepts.Path;
-public interface DataChangePublisher<P/* extends Path<P> */,D, L extends DataChangeListener<P,D>> {
+public interface DataChangePublisher<P extends Path<P>, D, L extends DataChangeListener<P,D>> {
 
     ListenerRegistration<L> registerDataChangeListener(P path, L listener);
 
index 90de13d15e8229238f36c5ec59b1180babcff1ae..939ff9513513ff1de802746facfdd09844952b76 100644 (file)
@@ -8,30 +8,29 @@
 package org.opendaylight.controller.md.sal.common.api.data;
 
 import org.opendaylight.controller.sal.common.DataStoreIdentifier;
-// 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.Path;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 /**
  * Two phase commit handler (cohort) of the two-phase commit protocol of data.
- * 
+ *
  * <p>
  * The provider should expose the implementation of DataCommitHandler if it's
  * functionality depends on any subset of data stored in data repositories, in
  * order to participate in {@link DataBrokerService#commit(DataStoreIdentifier)
  * operation.
- * 
+ *
  * <p>
  * Operations of two-phase commit handlers should not change data in data store,
  * this is responsibility of the coordinator (broker or some component of the
  * broker).
- * 
+ *
  * The commit handlers are responsible for changing the internal state of the
  * provider to reflect the commited changes in data.
- * 
+ *
  * <h3>Two-phase commit</h3>
- * 
+ *
  * <h4>Commit Request Phase</h4>
- * 
+ *
  * <ol>
  * <li> <code>Consumer</code> edits data by invocation of
  * <code>DataBrokerService.editCandidateData(DataStoreIdentifier, DataRoot)</code>
@@ -51,9 +50,9 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
  * </ol>
  * <li><code>Broker</code> starts a commit finish phase
  * </ol>
- * 
+ *
  * <h4>Commit Finish Phase</h4>
- * 
+ *
  * <ol>
  * <li>For each <code>CommitTransaction</code> from Commit Request phase
  * <ol>
@@ -69,7 +68,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
  * <li>If error occured, the broker starts a commit rollback phase.
  * </ul>
  * </ol>
- * 
+ *
  * <h4>Commit Rollback Phase</h4>
  * <li>For each <code>DataCommitTransaction</code> from Commit Request phase
  * <ol>
@@ -78,43 +77,43 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
  * <li>The provider rollbacks a commit and returns an {@link RpcResult} of
  * rollback. </ol>
  * <li>Broker returns a error result to the consumer.
- * 
+ *
  * @param <P> Class representing a path
  * @param <D> Superclass from which all data objects are derived from.
  */
-public interface DataCommitHandler<P/* extends Path<P> */,D> {
+public interface DataCommitHandler<P extends Path<P>, D> {
+
 
-    
     DataCommitTransaction<P, D> requestCommit(DataModification<P,D> modification);
 
-    public interface DataCommitTransaction<P/* extends Path<P> */,D> {
+    public interface DataCommitTransaction<P extends Path<P>, D> {
 
         DataModification<P,D> getModification();
 
         /**
-         * 
+         *
          * Finishes a commit.
-         * 
+         *
          * This callback is invoked by commit coordinator to finish commit action.
-         * 
+         *
          * The implementation is required to finish transaction or return unsuccessful
          * rpc result if something went wrong.
-         * 
+         *
          * The provider (commit handler) should apply all changes to its state
          * which are a result of data change-
-         * 
+         *
          * @return
          */
         RpcResult<Void> finish() throws IllegalStateException;
 
         /**
          * Rollbacks a commit.
-         * 
+         *
          * This callback is invoked by commit coordinator to finish commit action.
-         * 
+         *
          * The provider (commit handler) should rollback all changes to its state
          * which were a result of previous request commit.
-         * 
+         *
          * @return
          * @throws IllegalStateException
          *             If the method is invoked after {@link #finish()}
index 00db6064aa3bb54fa2a1f123be45d67289e63c52..f6662c388aa36e0092cf0ec8b5f262dcf981d163 100644 (file)
@@ -10,11 +10,10 @@ package org.opendaylight.controller.md.sal.common.api.data;
 import java.util.concurrent.Future;
 
 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
+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> {
+public interface DataModification<P extends Path<P>, D> extends DataChange<P, D>, DataReader<P, D> {
 
     /**
      * Returns transaction identifier
index 64d90f6fd5e8ae0ceb471c051287eb8fb298bdbc..34f6fe970dd2e0105e6a21d32ca7049815ea87e7 100644 (file)
@@ -7,10 +7,9 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
-// 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.Path;
 
-public interface DataModificationTransactionFactory<P/* extends Path<P> */,D> {
+public interface DataModificationTransactionFactory<P extends Path<P> ,D> {
 
     DataModification<P, D> beginTransaction();
 }
index 6c108bf5e49c1c6cb7fc3717e5f77649558e830f..dae9a1144b966a2e3c5e61884c1281e09a6229f3 100644 (file)
@@ -7,9 +7,8 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
-// 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.Path;
 
-public interface DataProvider<P/* extends Path<P> */,D> extends DataReader<P, D> {
+public interface DataProvider<P extends Path<P>, D> extends DataReader<P, D> {
 
 }
index 7240a506bea5c0612f1c75424b85d544a09f9ec6..14731d688c964adaf264d8909a4c3e90ccc4484e 100644 (file)
@@ -7,23 +7,22 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
-// 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.Path;
 
 /**
  * Reader for reading YANG subtrees based on their path.
- * 
+ *
  * Reader is requested to return object at specified path and all it's subnodes
  * known to the reader or null if node is not found in this reader.
  *
  * @param <P> Path Type
  * @param <D> Data Type
  */
-public interface DataReader<P/* extends Path<P> */,D> {
+public interface DataReader<P extends Path<P> ,D> {
 
     /**
      * Reads data from Operational data store located at provided path
-     * 
+     *
      * @param path Path to data
      * @return
      */
index ed5499870a9402cb0a8ef6f625a7528d14f8797a..3520ba1819b42fb0ce37ae3548631cd80753334b 100644 (file)
@@ -7,7 +7,9 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
-public interface DataStore<P, D> extends //
+import org.opendaylight.yangtools.concepts.Path;
+
+public interface DataStore<P extends Path<P>, D> extends //
         DataReader<P, D>, //
         DataModificationTransactionFactory<P, D> {
 
index ff3aa2e325af0146d5cd878ea9aed88c350d4a6c..d542935dd6dbf0fdb91ce72b273d6bc9c87b2668 100644 (file)
@@ -7,12 +7,14 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
+import org.opendaylight.yangtools.concepts.Path;
+
 /**
  * A chain of transactions. Transactions in a chain need to be committed in sequence and each
  * transaction should see the effects of previous transactions as if they happened. A chain
  * makes no guarantees of atomicity, in fact transactions are committed as soon as possible.
  */
-public interface TransactionChain<P/* extends Path<P> */, D> extends AutoCloseable {
+public interface TransactionChain<P extends Path<P>, D> extends AutoCloseable {
     /**
      * Create a new transaction which will continue the chain. The previous transaction
      * has to be either COMMITTED or CANCELLED.
index 4e7e12e0a15e3c5060a59eff76c35d9896ff00eb..94d21f5fd6bb02736a360592dc6826a3c70e4ae4 100644 (file)
@@ -7,10 +7,12 @@
  */
 package org.opendaylight.controller.md.sal.common.api.data;
 
+import org.opendaylight.yangtools.concepts.Path;
+
 /**
  * Interface for creating transaction chains.
  */
-public interface TransactionChainFactory<P/* extends Path<P> */, D> {
+public interface TransactionChainFactory<P extends Path<P>, D> {
     /**
      * Create a new transaction chain. The chain will be initialized to read
      * from its backing datastore, with no outstanding transaction. Listener
index 1139d03357999f5d71d3b0326ab1c621a14da984..f99c13ecf53499ab6770d9107025cb7f91828b8a 100644 (file)
@@ -8,10 +8,9 @@
 package org.opendaylight.controller.md.sal.common.api.routing;
 
 import org.opendaylight.yangtools.concepts.Mutable;
-// 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.Path;
 
-public interface MutableRoutingTable<C,P/* extends Path<P> */,T> extends RoutingTable<C,P,T>, Mutable {
+public interface MutableRoutingTable<C, P extends Path<P>, T> extends RoutingTable<C,P,T>, Mutable {
     
     void setDefaultRoute(T target);
     void updateRoute(P path,T target);
index 37ec2f6f1f90d4bae0e681d40e5674c1076ec504..5200c90561ecdb464060e0ba112a687de065c9ec 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.md.sal.common.api.routing;
 
-// 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.Path;
 import org.opendaylight.yangtools.concepts.Registration;
 
-public interface RoutedRegistration<C,P/* extends Path<P> */,S> extends Registration<S> {
+public interface RoutedRegistration<C, P extends Path<P>, S> extends Registration<S> {
 
     void registerPath(C context, P path);
     void unregisterPath(C context, P path);
index 211cf188795a1feee2d2abe11a028ff0b6a0786f..4402f69a5f73896f8f905c190a7743f3f0b28e80 100644 (file)
@@ -9,10 +9,9 @@ package org.opendaylight.controller.md.sal.common.api.routing;
 
 import java.util.Map;
 
-// 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.Path;
 
-public interface RoutingTable<C,P/* extends Path<P> */,T> {
+public interface RoutingTable<C, P extends Path<P>, T> {
 
     C getIdentifier();