Package org.opendaylight.ovsdb.lib.impl
Class StalePassiveConnectionService
- java.lang.Object
-
- org.opendaylight.ovsdb.lib.impl.StalePassiveConnectionService
-
- All Implemented Interfaces:
AutoCloseable
public class StalePassiveConnectionService extends Object implements AutoCloseable
StalePassiveConnectionService provides functionalities to clean up stale passive connections from the same node before new connection request arrives, especially for connection flapping scenarios.When new connection arrives all connections from the same node are pinged. The pings cause the stale netty connections to close due to IOException. Those have not been closed after a timeout will be closed programmatically. New connection request handling is then proceeded after all stale connections are cleaned up in the OvsdbConnectionService
- Author:
- Vinh Nguyen (vinh.nguyen@hcl.com) on 6/10/16.
-
-
Constructor Summary
Constructors Constructor Description StalePassiveConnectionService(Function<OvsdbClient,Void> clientNotificationCallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clientDisconnected(OvsdbClient disconnectedClient)
Notify the service that the given client has disconnected.void
close()
Map<OvsdbClient,Set<OvsdbClient>>
getPendingClients()
void
handleNewPassiveConnection(OvsdbClient newOvsdbClient, List<OvsdbClient> clientsFromSameNode)
This method makes sure that all stale connections from the same node are properly cleaned up before processing new connection request.void
onInactiveClient(OvsdbClient disconnectedClient)
-
-
-
Constructor Detail
-
StalePassiveConnectionService
public StalePassiveConnectionService(Function<OvsdbClient,Void> clientNotificationCallback)
-
-
Method Detail
-
getPendingClients
public Map<OvsdbClient,Set<OvsdbClient>> getPendingClients()
-
handleNewPassiveConnection
public void handleNewPassiveConnection(OvsdbClient newOvsdbClient, List<OvsdbClient> clientsFromSameNode)
This method makes sure that all stale connections from the same node are properly cleaned up before processing new connection request.- Parameters:
newOvsdbClient
- the connecting OvsdbClientclientsFromSameNode
- list of existing OvsdbClients from the same node as the new OvsdbClient
-
clientDisconnected
public void clientDisconnected(OvsdbClient disconnectedClient)
Notify the service that the given client has disconnected.- Parameters:
disconnectedClient
- the client just disconnected
-
onInactiveClient
public void onInactiveClient(OvsdbClient disconnectedClient)
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
-