public methods imlemented only in impl's extracted to parent interfaces
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceContext.java
index 0ff3d737c805731485157342fff2c2cbde5ede98..ca700310836b21a509e758d0e4ad393b72ea8d12 100644 (file)
@@ -8,10 +8,17 @@
 
 package org.opendaylight.openflowplugin.api.openflow.device;
 
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
+import java.math.BigInteger;
+import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
+import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceReplyProcessor;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.MessageHandler;
+import org.opendaylight.openflowplugin.api.openflow.device.handlers.OutstandingMessageExtractor;
+import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.TableFeatures;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
  * The central entity of OFP is the Device Context, which encapsulate the logical state of a switch
@@ -27,9 +34,9 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.Table
  * 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.
+ * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
  */
-public interface DeviceContext extends MessageHandler {
+public interface DeviceContext extends MessageHandler, TranslatorLibrarian, OutstandingMessageExtractor, DeviceReplyProcessor {
 
 
     /**
@@ -55,18 +62,18 @@ public interface DeviceContext extends MessageHandler {
     DeviceState getDeviceState();
 
     /**
-     * Method sets transaction chain used for all data store operations on device
-     * represented by this context. This transaction chain is write only.
-     *
-     * @param transactionChain
+     * Method exposes possibility for write a child of {@link DataObject} to transaction for DataStore.
      */
-    void setTransactionChain(TransactionChain transactionChain);
+    <T extends DataObject> void writeToTransaction(final LogicalDatastoreType store, final InstanceIdentifier<T> path, final T data);
 
     /**
      * Method exposes transaction created for device
-     * represented by this context. This should be used as write only.
+     * represented by this context. This should be used as read only.
+     * This read only transaction has a fresh dataStore snapshot and
+     * here is a possibility to get different data set from  DataStore
+     * as have a write transaction in this context.
      */
-    TransactionChain getTransactionChain();
+    ReadTransaction getReadTransaction();
 
     /**
      * Method provides capabilities of connected device.
@@ -75,5 +82,30 @@ public interface DeviceContext extends MessageHandler {
      */
     TableFeatures getCapabilities();
 
+    /**
+     * Method provides current devices connection context.
+     *
+     * @return
+     */
+    ConnectionContext getPrimaryConnectionContext();
+
+    /**
+     * Method provides current devices auxiliary connection contexts.
+     *
+     * @return
+     */
+    ConnectionContext getAuxiliaryConnectiobContexts(BigInteger cookie);
+
+    Xid getNextXid();
+
+    /**
+     * Method writes request context into request context map. This method
+     * is ment to be used by {@link org.opendaylight.openflowplugin.impl.services.OFJResult2RequestCtxFuture#processResultFromOfJava}
+     *
+     * @param xid
+     * @param requestFutureContext
+     */
+    public void hookRequestCtx(Xid xid, RequestContext requestFutureContext);
+
 }