Merge "Removed unused fields"
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / device / DeviceContext.java
index 2d9b377bd2ceed728ac10ee51224a99493b201ab..6eb8b322a89c7db5dc7981b3e1985926cd55e542 100644 (file)
@@ -10,24 +10,24 @@ package org.opendaylight.openflowplugin.api.openflow.device;
 
 import io.netty.util.Timeout;
 import java.math.BigInteger;
+import java.util.List;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginTimer;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceContextClosedHandler;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceDisconnectedHandler;
 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.device.listener.OpenflowMessageListenerFacade;
+import org.opendaylight.openflowplugin.api.openflow.device.handlers.MultiMsgCollector;
+import org.opendaylight.openflowplugin.api.openflow.registry.ItemLifeCycleRegistry;
 import org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry;
 import org.opendaylight.openflowplugin.api.openflow.registry.group.DeviceGroupRegistry;
 import org.opendaylight.openflowplugin.api.openflow.registry.meter.DeviceMeterRegistry;
 import org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific.MessageSpy;
-import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrarian;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.MultipartReply;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
@@ -51,10 +51,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 public interface DeviceContext extends AutoCloseable,
         OpenFlowPluginTimer,
         MessageHandler,
-        TranslatorLibrarian,
-        OutstandingMessageExtractor,
         DeviceReplyProcessor,
-        DeviceDisconnectedHandler {
+        DeviceDisconnectedHandler,
+        PortNumberCache {
 
 
     /**
@@ -89,6 +88,12 @@ public interface DeviceContext extends AutoCloseable,
      */
     <T extends DataObject> void addDeleteToTxChain(final LogicalDatastoreType store, final InstanceIdentifier<T> path);
 
+    /**
+     * Method submits Transaction to DataStore.
+     * @return transaction is submitted successfully
+     */
+    boolean submitTransaction();
+
     /**
      * Method exposes transaction created for device
      * represented by this context. This read only transaction has a fresh dataStore snapshot.
@@ -112,54 +117,6 @@ public interface DeviceContext extends AutoCloseable,
      */
     ConnectionContext getAuxiliaryConnectiobContexts(BigInteger cookie);
 
-    /**
-     * Method generates unique XID value.
-     *
-     * @return
-     */
-    Xid getNextXid();
-
-    /**
-     * @param xid key
-     * @return request by xid
-     */
-    RequestContext lookupRequest(Xid xid);
-
-    /**
-     * @return number of outstanding requests in map
-     */
-    int getNumberOfOutstandingRequests();
-
-    /**
-     * Method writes request context into request context map. This method
-     * is ment to be used by org.opendaylight.openflowplugin.impl.services.OFJResult2RequestCtxFuture#processResultFromOfJava.
-     *
-     * @param xid
-     * @param requestFutureContext
-     */
-    void hookRequestCtx(Xid xid, RequestContext requestFutureContext);
-
-    /**
-     * Method removes request context from request context map.
-     *
-     * @param xid
-     */
-    RequestContext unhookRequestCtx(Xid xid);
-
-    /**
-     * Method that attaches anyMessageTypeListener to connection adapters as message listener.
-     *
-     * @param openflowMessageListenerFacade
-     */
-    void attachOpenflowMessageListener(OpenflowMessageListenerFacade openflowMessageListenerFacade);
-
-    /**
-     * Method returns registered {@link org.opendaylight.openflowplugin.api.openflow.device.listener.OpenflowMessageListenerFacade}
-     *
-     * @return
-     */
-    OpenflowMessageListenerFacade getOpenflowMessageListenerFacade();
-
     /**
      * Method exposes flow registry used for storing flow ids identified by calculated flow hash.
      *
@@ -182,6 +139,11 @@ public interface DeviceContext extends AutoCloseable,
     DeviceMeterRegistry getDeviceMeterRegistry();
 
 
+    /**
+     * @return translator library
+     */
+    TranslatorLibrary oook();
+
     /**
      * store cancellable timeout handler of currently running barrier task
      */
@@ -199,20 +161,34 @@ public interface DeviceContext extends AutoCloseable,
      */
     void setNotificationService(NotificationService notificationService);
 
-    void setNotificationPublishService(NotificationPublishService  notificationPublishService);
+    void setNotificationPublishService(NotificationPublishService notificationPublishService);
 
     MessageSpy getMessageSpy();
 
-    void setDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler);
-
     /**
      * Method sets reference to handler used for cleanup after device context about to be closed.
      */
     void addDeviceContextClosedHandler(DeviceContextClosedHandler deviceContextClosedHandler);
 
-    void startGatheringOperationsToOneTransaction();
+    MultiMsgCollector getMultiMsgCollector(final RequestContext<List<MultipartReply>> requestContext);
+
+    Long getReservedXid();
 
-    void commitOperationsGatheredInOneTransaction();
+    /**
+     * indicates that device context is fully published (e.g.: packetIn messages should be passed)
+     */
+    void onPublished();
 
+    /**
+     * change packetIn rate limiter borders
+     *
+     * @param upperBound max amount of outstanding packetIns
+     */
+    void updatePacketInRateLimit(long upperBound);
+
+    /**
+     * @return registry point for item life cycle sources of device
+     */
+    ItemLifeCycleRegistry getItemLifeCycleSourceRegistry();
 }