BUG-58: refactor to take advantage of netty
[bgpcep.git] / framework / src / main / java / org / opendaylight / protocol / framework / ProtocolSession.java
index 0cec78787cb8522f3b67f1f1c43dea329d0dd7ba..4b9895db5333c3481fe497e90b8e46813fca1bf6 100644 (file)
@@ -17,53 +17,7 @@ import java.io.Closeable;
  * 
  * This interface should be implemented by a final class representing a protocol specific session.
  */
-public interface ProtocolSession extends Closeable {
-
-       /**
-        * Starts the session. This method should be used only internally by the Dispatcher.
-        */
-       public void startSession();
-
-       /**
-        * Handles incoming message (parsing, reacting if necessary).
-        * 
-        * @param msg incoming message
-        */
-       public void handleMessage(final ProtocolMessage msg);
-
-       /**
-        * Handles malformed message when a deserializer exception occurred. The handling might be different from when a
-        * documented exception is thrown.
-        * 
-        * @param e deserializer exception that occurred
-        */
-       public void handleMalformedMessage(final DeserializerException e);
-
-       /**
-        * Handles malformed message when a documented exception occurred. The handling might be different from when a
-        * deserializer exception is thrown.
-        * 
-        * @param e documented exception that occurred
-        */
-       public void handleMalformedMessage(final DocumentedException e);
-
-       /**
-        * Called when reached the end of input stream while reading.
-        */
-       public void endOfInput();
-
-       /**
-        * Getter for message factory
-        * 
-        * @return protocol specific message factory
-        */
-       public ProtocolMessageFactory getMessageFactory();
-
-       /**
-        * Returns the maximum message size (in bytes) for purposes of dispatcher buffering -- the dispatcher allocates a
-        * buffer this big, and if it gets full without making decoding progress, the dispatcher terminates the session.
-        * 
-        * @return maximum message size
-        */
-       public int maximumMessageSize();
+public interface ProtocolSession<T extends ProtocolMessage> extends Closeable {
+       @Override
+       public void close();
 }