Changed methods in DeviceContext, created DeviceReplyProcessor interface
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceContext.java
index 8b7d3e69c6ef9dafc4258e6f5b8a20d9860d032c..91506239dd13ca926115339f3bf9f3882ed69f78 100644 (file)
@@ -14,12 +14,20 @@ import java.util.concurrent.Future;
 import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
+import org.opendaylight.openflowplugin.api.openflow.device.exception.DeviceDataException;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.MessageHandler;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableFeatures;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
+import com.google.common.util.concurrent.SettableFuture;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Future;
+
 /**
  * The central entity of OFP is the Device Context, which encapsulate the logical state of a switch
  * as seen by the controller. Each OpenFlow session is tracked by a Connection Context.
@@ -33,8 +41,8 @@ import org.opendaylight.yangtools.yang.common.RpcResult;
  * which is enforced by keeping a cap on the number of outstanding requests a particular Request
  * Context can have at any point in time. Should this quota be exceeded, any further attempt to make
  * a request to the switch will fail immediately, with proper error indication.
- * <p/>
- * Created by Martin Bobak <mbobak@cisco.com> on 25.2.2015.
+ * <p>
+ * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
  */
 public interface DeviceContext extends MessageHandler {
 
@@ -99,27 +107,12 @@ public interface DeviceContext extends MessageHandler {
 
     Xid getNextXid();
 
-    <T extends DataObject> Future<RpcResult<T>> sendRequest(Xid xid);
-
-    /**
-     * Method provides requests map
-     * @return
-     */
-    public Map<Xid, RequestFutureContext> getRequests();
-
     /**
      * Method writes request context into request context map
      * @param xid
      * @param requestFutureContext
      */
-    public void hookRequestCtx(Xid xid, RequestFutureContext requestFutureContext);
-
-    /**
-     * Method that set future to context in Map
-     * @param xid
-     * @param ofHeader
-     */
-    public void processReply(Xid xid, OfHeader ofHeader);
+    public void hookRequestCtx(Xid xid, RequestContext requestFutureContext);
 
 }