Disable to create duplicate (with same IP Address) PCEP sessions. 64/14964/4
authorMilos Fabian <milfabia@cisco.com>
Wed, 10 Dec 2014 15:21:54 +0000 (16:21 +0100)
committerMilos Fabian <milfabia@cisco.com>
Tue, 10 Feb 2015 16:34:02 +0000 (17:34 +0100)
commitba6ebfc5c376cdfb8351d21c1a7fe9c0bdcdd8b4
tree3384f2a5c98d9068e2654668ba9d5330ab93d3e2
parent275b6b5e4ef6664c21e9d97b49da16b161a3bf75
Disable to create duplicate (with same IP Address) PCEP sessions.

Moved duplicate session handling into AbstractSessionNegtiatorFactory (PCEPPeerRegistry),
to be usable for all session negotiators created by. PCEPPeerRegistry also handle session-id caching.

Session ref. entries stored in bi-map were identifed by byte array (raw IP Address of client),
casuing that already existing session in bi-map were not look-up properly => allowing to create duplicate sessions.
Changed type of bi-map's key to wrapper of byte array.

Fixed also removing of session refs. from map on channel close. Turned bi-map to map, since inverse map is not used anymore.

pcc-mock is reusing this code - need to create session negotiator factory per pcc.

Change-Id: I85670b083b6ea832f8b9a4891c812845174f03ff
Signed-off-by: Milos Fabian <milfabia@cisco.com>
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/AbstractPCEPSessionNegotiatorFactory.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPPeerRegistry.java [new file with mode: 0644]
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionNegotiator.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImplTest.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/Main.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCMockTest.java