Class ConnectionManagerImpl
- java.lang.Object
-
- org.opendaylight.openflowplugin.impl.connection.ConnectionManagerImpl
-
- All Implemented Interfaces:
AutoCloseable
,SwitchConnectionHandler
,ConnectionManager
public class ConnectionManagerImpl extends Object implements ConnectionManager
-
-
Constructor Summary
Constructors Constructor Description ConnectionManagerImpl(OpenflowProviderConfig config, ExecutorService executorService, org.opendaylight.mdsal.binding.api.DataBroker dataBroker, @NonNull org.opendaylight.mdsal.binding.api.NotificationPublishService notificationPublishService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(InetAddress switchAddress)
Invoked to determine if a switch connection should be accepted.void
close()
void
onSwitchConnected(ConnectionAdapter connectionAdapter)
Invoked when a switch connects.void
setDeviceConnectedHandler(DeviceConnectedHandler deviceConnectedHandler)
Method registers handler responsible handling operations related to connected device after device is connected.void
setDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler)
Method registers handler responsible handling device disconnected event.
-
-
-
Constructor Detail
-
ConnectionManagerImpl
public ConnectionManagerImpl(OpenflowProviderConfig config, ExecutorService executorService, org.opendaylight.mdsal.binding.api.DataBroker dataBroker, @NonNull org.opendaylight.mdsal.binding.api.NotificationPublishService notificationPublishService)
-
-
Method Detail
-
onSwitchConnected
public void onSwitchConnected(ConnectionAdapter connectionAdapter)
Description copied from interface:SwitchConnectionHandler
Invoked when a switch connects.- Specified by:
onSwitchConnected
in interfaceSwitchConnectionHandler
- Parameters:
connectionAdapter
- to switch proving message sending/receiving, connection management
-
accept
public boolean accept(InetAddress switchAddress)
Description copied from interface:SwitchConnectionHandler
Invoked to determine if a switch connection should be accepted.- Specified by:
accept
in interfaceSwitchConnectionHandler
- Parameters:
switchAddress
- address of incoming connection (address + port)- Returns:
- true, if connection from switch having given address shell be accepted; false otherwise
-
setDeviceConnectedHandler
public void setDeviceConnectedHandler(DeviceConnectedHandler deviceConnectedHandler)
Description copied from interface:ConnectionManager
Method registers handler responsible handling operations related to connected device after device is connected.- Specified by:
setDeviceConnectedHandler
in interfaceConnectionManager
- Parameters:
deviceConnectedHandler
- device connected handler
-
setDeviceDisconnectedHandler
public void setDeviceDisconnectedHandler(DeviceDisconnectedHandler deviceDisconnectedHandler)
Description copied from interface:ConnectionManager
Method registers handler responsible handling device disconnected event.- Specified by:
setDeviceDisconnectedHandler
in interfaceConnectionManager
- Parameters:
deviceDisconnectedHandler
- device disconnected handler
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-