BUG8607 Fix checkstyle issues
[openflowplugin.git] / applications / forwardingrules-manager / src / main / java / org / opendaylight / openflowplugin / applications / frm / ForwardingRulesCommiter.java
index 5d9c693d64f18f834115c32275992747b513c970..967d3e48d83a553d0c9b60fe3cdf1d2a4c7b572d 100644 (file)
@@ -8,59 +8,83 @@
 
 package org.opendaylight.openflowplugin.applications.frm;
 
-import org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener;
+import java.util.concurrent.Future;
+import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcResult;
 
 /**
- * forwardingrules-manager
- * org.opendaylight.openflowplugin.applications.frm
+ * forwardingrules-manager org.opendaylight.openflowplugin.applications.frm
  *
- * ForwardingRulesCommiter
- * It represent a contract between DataStore DataChangeEvent and relevant
- * SalRpcService for device. Every implementation has to be registered for
- * Configurational/DS tree path.
- *
- * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
- *
- * Created: Aug 25, 2014
+ * <p>
+ * ForwardingRulesCommiter It represent a contract between DataStore
+ * DataTreeModification and relevant SalRpcService for device. Every
+ * implementation has to be registered for Configurational/DS tree path.
  */
-public interface ForwardingRulesCommiter <D extends DataObject> extends AutoCloseable, DataTreeChangeListener<D> {
+public interface ForwardingRulesCommiter<D extends DataObject>
+        extends AutoCloseable, ClusteredDataTreeChangeListener<D> {
 
     /**
-     * Method removes DataObject which is identified by InstanceIdentifier
-     * from device.
+     * Method removes DataObject which is identified by InstanceIdentifier from
+     * device.
      *
-     * @param identifier - the whole path to DataObject
-     * @param del - DataObject for removing
-     * @param nodeIdent Node InstanceIdentifier
+     * @param identifier
+     *            - the whole path to DataObject
+     * @param del
+     *            - DataObject for removing
+     * @param nodeIdent
+     *            Node InstanceIdentifier
      */
-    void remove(InstanceIdentifier<D> identifier, D del,
-            InstanceIdentifier<FlowCapableNode> nodeIdent);
+    void remove(InstanceIdentifier<D> identifier, D del, InstanceIdentifier<FlowCapableNode> nodeIdent);
 
     /**
-     * Method updates the original DataObject to the update DataObject
-     * in device. Both are identified by same InstanceIdentifier
+     * Method updates the original DataObject to the update DataObject in device.
+     * Both are identified by same InstanceIdentifier
      *
-     * @param identifier - the whole path to DataObject
-     * @param original - original DataObject (for update)
-     * @param update - changed DataObject (contain updates)
-     * @param nodeIdent Node InstanceIdentifier
+     * @param identifier
+     *            - the whole path to DataObject
+     * @param original
+     *            - original DataObject (for update)
+     * @param update
+     *            - changed DataObject (contain updates)
+     * @param nodeIdent
+     *            Node InstanceIdentifier
      */
-    void update(InstanceIdentifier<D> identifier, D original, D update,
+    void update(InstanceIdentifier<D> identifier, D original, D update, InstanceIdentifier<FlowCapableNode> nodeIdent);
+
+    /**
+     * Method adds the DataObject which is identified by InstanceIdentifier to
+     * device.
+     *
+     * @param identifier
+     *            - the whole path to new DataObject
+     * @param add
+     *            - new DataObject
+     * @param nodeIdent
+     *            Node InstanceIdentifier
+     * @return A future associated with RPC task. {@code null} is set to the future
+     *         if this method does not invoke RPC.
+     */
+    Future<? extends RpcResult<?>> add(InstanceIdentifier<D> identifier, D add,
             InstanceIdentifier<FlowCapableNode> nodeIdent);
 
     /**
-     * Method adds the DataObject which is identified by InstanceIdentifier
-     * to device.
+     * Method creates stale-marked DataObject which is identified by
+     * InstanceIdentifier from device.
      *
-     * @param identifier - the whole path to new DataObject
-     * @param add - new DataObject
-     * @param nodeIdent Node InstanceIdentifier
+     * @param identifier
+     *            - the whole path to DataObject
+     * @param del
+     *            - DataObject removed. Stale-Mark object to be created from this
+     *            object
+     * @param nodeIdent
+     *            Node InstanceIdentifier
      */
-    void add(InstanceIdentifier<D> identifier, D add,
+    void createStaleMarkEntity(InstanceIdentifier<D> identifier, D del, InstanceIdentifier<FlowCapableNode> nodeIdent);
+
+    Future<? extends RpcResult<?>> removeWithResult(InstanceIdentifier<D> identifier, D del,
             InstanceIdentifier<FlowCapableNode> nodeIdent);
 
 }
-