Add get configuration function to be able to access the openflow connection config...
[openflowjava.git] / openflow-protocol-spi / src / main / java / org / opendaylight / openflowjava / protocol / spi / connection / SwitchConnectionProvider.java
index abcaabac7e40c2d5986db0543ee045181ab3d1cc..b013471f3b7388d75bd8099a5eba357ecb333ece 100644 (file)
@@ -11,11 +11,8 @@ package org.opendaylight.openflowjava.protocol.spi.connection;
 
 import org.opendaylight.openflowjava.protocol.api.connection.ConnectionConfiguration;
 import org.opendaylight.openflowjava.protocol.api.connection.SwitchConnectionHandler;
-import org.opendaylight.openflowjava.protocol.api.extensibility.MessageTypeKey;
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
-import org.opendaylight.openflowjava.protocol.api.extensibility.MessageCodeKey;
-import org.opendaylight.openflowjava.protocol.api.extensibility.OFGeneralDeserializer;
-import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.openflowjava.protocol.api.extensibility.DeserializerExtensionProvider;
+import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerExtensionProvider;
 
 import com.google.common.util.concurrent.ListenableFuture;
 
@@ -24,44 +21,35 @@ import com.google.common.util.concurrent.ListenableFuture;
  * @author michal.polkorab
  *
  */
-public interface SwitchConnectionProvider extends AutoCloseable {
+public interface SwitchConnectionProvider extends AutoCloseable,
+        SerializerExtensionProvider, DeserializerExtensionProvider {
 
     /**
      * @param configuration [protocol, port, address and supported features]
      */
     void setConfiguration(ConnectionConfiguration configuration);
-    
+
+    /**
+     * return the connection configuration
+     * @return configuration [protocol, port, address and supported features]
+     */
+    ConnectionConfiguration getConfiguration();
+
     /**
      * start listening to switches, but please don't forget to do
      * {@link #setSwitchConnectionHandler(SwitchConnectionHandler)} first
      * @return future, triggered to true, when listening channel is up and running
      */
     ListenableFuture<Boolean> startup();
-    
+
     /**
      * stop listening to switches
      * @return future, triggered to true, when all listening channels are down
      */
     ListenableFuture<Boolean> shutdown();
-    
+
     /**
      * @param switchConHandler instance being informed when new switch connects
      */
     void setSwitchConnectionHandler(SwitchConnectionHandler switchConHandler);
-
-    /**
-     * Registers custom serializer
-     * @param key used for serializer lookup
-     * @param serializer serializer implementation
-     */
-    public  <KEY_TYPE, E extends DataObject> void registerCustomSerializer(MessageTypeKey<KEY_TYPE> key,
-            OFSerializer<E> serializer);
-            
-    /**
-     * Registers custom deserializer
-     * @param key used for deserializer lookup
-     * @param deserializer deserializer instance
-     */
-    public void registerDeserializer(MessageCodeKey key, OFGeneralDeserializer deserializer);
-
-}
+}
\ No newline at end of file