Remove dependency on Exificient due to licensing incompatibility
[controller.git] / opendaylight / netconf / netconf-api / src / main / java / org / opendaylight / controller / netconf / api / NetconfSession.java
index eb7235f04490eaaef675e7f993da23455223222f..6c747dbe244fde8812a17a8f923eff49c67fba4d 100644 (file)
@@ -8,25 +8,16 @@
 package org.opendaylight.controller.netconf.api;
 
 import io.netty.channel.Channel;
-import io.netty.channel.ChannelHandler;
 import org.opendaylight.protocol.framework.AbstractProtocolSession;
-import org.opendaylight.protocol.framework.ProtocolMessageDecoder;
-import org.opendaylight.protocol.framework.ProtocolMessageEncoder;
 import org.opendaylight.protocol.framework.SessionListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.util.Map;
 
 public abstract class NetconfSession extends AbstractProtocolSession<NetconfMessage> {
-
-    private ChannelHandler exiEncoder;
-    private String exiEncoderName;
-    private String removeAfterMessageSentname;
-    private String pmeName,pmdName;
-    protected final  Channel channel;
-    private final  SessionListener sessionListener;
+    protected final Channel channel;
+    private final SessionListener sessionListener;
     private final long sessionId;
     private boolean up = false;
     private static final Logger logger = LoggerFactory.getLogger(NetconfSession.class);
@@ -36,18 +27,6 @@ public abstract class NetconfSession extends AbstractProtocolSession<NetconfMess
         this.channel = channel;
         this.sessionId = sessionId;
         logger.debug("Session {} created", toString());
-
-        ChannelHandler pmd = channel.pipeline().get(ProtocolMessageDecoder.class);
-        ChannelHandler pme = channel.pipeline().get(ProtocolMessageEncoder.class);
-
-        for (Map.Entry<String, ChannelHandler> entry:channel.pipeline().toMap().entrySet()){
-            if (entry.getValue().equals(pmd)){
-                pmdName = entry.getKey();
-            }
-            if (entry.getValue().equals(pme)){
-                pmeName = entry.getKey();
-            }
-        }
     }
     @Override
     public void close() {
@@ -64,15 +43,6 @@ public abstract class NetconfSession extends AbstractProtocolSession<NetconfMess
 
     public void sendMessage(NetconfMessage netconfMessage) {
         channel.writeAndFlush(netconfMessage);
-        if (exiEncoder!=null){
-            if (channel.pipeline().get(exiEncoderName)== null){
-                channel.pipeline().addBefore(pmeName, exiEncoderName, exiEncoder);
-            }
-        }
-        if (removeAfterMessageSentname!=null){
-            channel.pipeline().remove(removeAfterMessageSentname);
-            removeAfterMessageSentname = null;
-        }
     }
 
     @Override
@@ -106,39 +76,5 @@ public abstract class NetconfSession extends AbstractProtocolSession<NetconfMess
     public long getSessionId() {
         return sessionId;
     }
-
-    public <T extends ChannelHandler> T remove(Class<T> handlerType) {
-        return channel.pipeline().remove(handlerType);
-    }
-
-    public <T extends ChannelHandler> T getHandler(Class<T> handlerType) {
-        return channel.pipeline().get(handlerType);
-   }
-
-    public void addFirst(ChannelHandler handler, String name){
-        channel.pipeline().addFirst(name, handler);
-    }
-    public void addLast(ChannelHandler handler, String name){
-        channel.pipeline().addLast(name, handler);
-    }
-
-    public void addExiDecoder(String name,ChannelHandler handler){
-        if (channel.pipeline().get(name)== null){
-            channel.pipeline().addBefore(pmdName, name, handler);
-        }
-    }
-    public void addExiEncoderAfterMessageSent(String name, ChannelHandler handler){
-        this.exiEncoder = handler;
-        this.exiEncoderName = name;
-    }
-
-    public void addExiEncoder(String name, ChannelHandler handler){
-        channel.pipeline().addBefore(pmeName, name, handler);
-    }
-
-    public void removeAfterMessageSent(String handlerName){
-        this.removeAfterMessageSentname = handlerName;
-    }
-
 }