Revert "Fixed PCE's remote and local address" 55/10055/1
authorDana Kutenicsova <dkutenic@cisco.com>
Tue, 19 Aug 2014 08:21:42 +0000 (08:21 +0000)
committerDana Kutenicsova <dkutenic@cisco.com>
Tue, 19 Aug 2014 08:21:42 +0000 (08:21 +0000)
This reverts commit eba1a2fb790c5d3b5b0b667c5a2550b4262f81a9.

Change-Id: I4e8b016ce85883417cbe2e2ce1d2d9b80b8e536b
Signed-off-by: Dana Kutenicsova <dkutenic@cisco.com>
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionImpl.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/FiniteStateMachineTest.java
pcep/topology-provider/src/test/java/org/opendaylight/bgpcep/pcep/topology/provider/ParserToSalTest.java

index 07bb6386afddf6a49866b8b33cae2492e43b6f99..5739ad1767c4b3248b595179d03b5174b681b966 100644 (file)
@@ -119,7 +119,7 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
             }, getKeepAliveTimerValue(), TimeUnit.SECONDS);
         }
 
-        LOG.info("Session {}[{}] <-> {}[{}] started", getLocalAddress(), localOpen.getSessionId(), getRemoteAddress(),
+        LOG.info("Session {}[{}] <-> {}[{}] started", channel.localAddress(), localOpen.getSessionId(), channel.remoteAddress(),
             remoteOpen.getSessionId());
     }
 
@@ -233,19 +233,9 @@ public class PCEPSessionImpl extends AbstractProtocolSession<Message> implements
 
     @Override
     public InetAddress getRemoteAddress() {
-        if (this.channel.parent() != null) {
-            return ((InetSocketAddress) this.channel.localAddress()).getAddress();
-        }
         return ((InetSocketAddress) this.channel.remoteAddress()).getAddress();
     }
 
-    private InetAddress getLocalAddress() {
-        if (this.channel.parent() != null) {
-            return ((InetSocketAddress) this.channel.remoteAddress()).getAddress();
-        }
-        return ((InetSocketAddress) this.channel.localAddress()).getAddress();
-    }
-
     private synchronized void terminate(final TerminationReason reason) {
         LOG.info("Local PCEP session termination : {}", reason);
         this.listener.onSessionTerminated(this, new PCEPCloseTermination(reason));
index 4f5a1e9ef3d0010e0b2401a52440ddbc65f9a328..e8b8966419538e0c3c5aae6d411567e3590cedca 100644 (file)
@@ -88,7 +88,6 @@ public class FiniteStateMachineTest {
                 return future;
             }
         }).when(this.clientListener).writeAndFlush(any(Notification.class));
-        doReturn(null).when(this.clientListener).parent();
         doReturn("TestingChannel").when(this.clientListener).toString();
         doReturn(this.pipeline).when(this.clientListener).pipeline();
         doReturn(this.address).when(this.clientListener).localAddress();
index 013ab9a52ca41d01a2376a9eb871d5be2a87e1bc..c3d819f72bf790d5ac2e0e68b60da5cefb016fd3 100644 (file)
@@ -111,7 +111,6 @@ public class ParserToSalTest extends AbstractDataBrokerTest {
         doReturn(ra).when(this.clientListener).remoteAddress();
         final SocketAddress la = new InetSocketAddress("127.0.0.1", 30000);
         doReturn(la).when(this.clientListener).localAddress();
-        doReturn(null).when(this.clientListener).parent();
 
         doReturn(mock(ChannelFuture.class)).when(this.clientListener).close();