Package org.opendaylight.ovsdb.lib.impl
Class OvsdbConnectionService
java.lang.Object
org.opendaylight.ovsdb.lib.impl.OvsdbConnectionService
- All Implemented Interfaces:
AutoCloseable
,OvsdbConnection
@Singleton
public class OvsdbConnectionService
extends Object
implements AutoCloseable, OvsdbConnection
OvsDBConnectionService provides OVSDB connection management functionality which includes
both Active and Passive connections.
From the Library perspective, Active OVSDB connections are those that are initiated from
the Controller towards the ovsdb-manager.
While Passive OVSDB connections are those that are initiated from the ovs towards
the controller.
Applications that use OvsDBConnectionService can use the OvsDBConnection class' connect APIs to initiate Active connections and can listen to the asynchronous Passive connections via registerConnectionListener listener API.
The library is designed as Java modular component that can work in both OSGi and non-OSGi environment. Hence a single instance of the service will be active (via Service Registry in OSGi) and a Singleton object in a non-OSGi environment.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionOvsdbConnectionService
(NettyBootstrapFactory bootstrapFactory, org.opendaylight.aaa.cert.api.ICertificateManager certManagerSrv) OvsdbConnectionService
(NettyBootstrapFactory bootstrapFactory, org.opendaylight.aaa.cert.api.ICertificateManager certManagerSrv, String listenerIp, int listenerPort, int ovsdbRpcTaskTimeout, boolean useSSL, int jsonRpcDecoderMaxFrameLength) OvsdbConnectionService
(NettyBootstrapFactory bootstrapFactory, org.opendaylight.aaa.cert.api.ICertificateManager certManagerSrv, OvsdbConnectionService.Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
channelClosed
(OvsdbClient client) void
close()
connect
(InetAddress address, int port) If the SSL flag is enabled, the method internally will establish TLS communication using the default ODL certificateManager SSLContext and attributes.connectWithSsl
(InetAddress address, int port, org.opendaylight.aaa.cert.api.ICertificateManager certificateManagerSrv) connect API can be used by the applications to initiate Active ssl connection from the controller towards ovsdb-server.void
disconnect
(OvsdbClient client) Method to disconnect an existing connection.getClient
(io.netty.channel.Channel channel) Returns a Collection of all the active OVSDB Connections.static void
void
Method to register a Passive Connection Listener with the ConnectionService.boolean
restartOvsdbManagerWithSsl
(String ovsdbListenIp, int ovsdbListenPort, org.opendaylight.aaa.cert.api.ICertificateManager certificateManagerSrv, String[] protocols, String[] cipherSuites) Method to restart ovsdb server for passive connection with SSL and user specifies protocols and cipher suites.boolean
Method that initiates the Passive OVSDB channel listening functionality.boolean
startOvsdbManagerWithSsl
(String ovsdbListenIp, int ovsdbListenPort, org.opendaylight.aaa.cert.api.ICertificateManager certificateManagerSrv, String[] protocols, String[] cipherSuites) Method that initiates the Passive OVSDB channel listening functionality with ssl.By default the ovsdb passive connection will listen in port 6640 which can be overridden using the ovsdb.listenPort system property.void
Method to unregister a Passive Connection Listener with the ConnectionService.
-
Constructor Details
-
OvsdbConnectionService
@Inject public OvsdbConnectionService(NettyBootstrapFactory bootstrapFactory, org.opendaylight.aaa.cert.api.ICertificateManager certManagerSrv) -
OvsdbConnectionService
public OvsdbConnectionService(NettyBootstrapFactory bootstrapFactory, org.opendaylight.aaa.cert.api.ICertificateManager certManagerSrv, OvsdbConnectionService.Configuration configuration) -
OvsdbConnectionService
public OvsdbConnectionService(NettyBootstrapFactory bootstrapFactory, org.opendaylight.aaa.cert.api.ICertificateManager certManagerSrv, String listenerIp, int listenerPort, int ovsdbRpcTaskTimeout, boolean useSSL, int jsonRpcDecoderMaxFrameLength)
-
-
Method Details
-
connect
If the SSL flag is enabled, the method internally will establish TLS communication using the default ODL certificateManager SSLContext and attributes.- Specified by:
connect
in interfaceOvsdbConnection
- Parameters:
address
- IP Address of the remote server that hosts the ovsdb server.port
- Layer 4 port on which the remote ovsdb server is listening on.- Returns:
- OvsDBClient The primary Client interface for the ovsdb connection.
-
connectWithSsl
public OvsdbClient connectWithSsl(InetAddress address, int port, org.opendaylight.aaa.cert.api.ICertificateManager certificateManagerSrv) Description copied from interface:OvsdbConnection
connect API can be used by the applications to initiate Active ssl connection from the controller towards ovsdb-server.- Specified by:
connectWithSsl
in interfaceOvsdbConnection
- Parameters:
address
- IP Address of the remote server that hosts the ovsdb server.port
- Layer 4 port on which the remote ovsdb server is listening on.certificateManagerSrv
- Certificate manager for SSL/TLS- Returns:
- OvsDBClient The primary Client interface for the ovsdb connection.
-
disconnect
Description copied from interface:OvsdbConnection
Method to disconnect an existing connection.- Specified by:
disconnect
in interfaceOvsdbConnection
- Parameters:
client
- that represents the ovsdb connection.
-
registerConnectionListener
Description copied from interface:OvsdbConnection
Method to register a Passive Connection Listener with the ConnectionService.- Specified by:
registerConnectionListener
in interfaceOvsdbConnection
- Parameters:
listener
- Passive Connection listener interested in Passive OVSDB connection requests.
-
unregisterConnectionListener
Description copied from interface:OvsdbConnection
Method to unregister a Passive Connection Listener with the ConnectionService.- Specified by:
unregisterConnectionListener
in interfaceOvsdbConnection
-
startOvsdbManager
public boolean startOvsdbManager()Method that initiates the Passive OVSDB channel listening functionality. By default the ovsdb passive connection will listen in port 6640 which can be overridden using the ovsdb.listenPort system property.- Specified by:
startOvsdbManager
in interfaceOvsdbConnection
-
startOvsdbManagerWithSsl
public boolean startOvsdbManagerWithSsl(String ovsdbListenIp, int ovsdbListenPort, org.opendaylight.aaa.cert.api.ICertificateManager certificateManagerSrv, String[] protocols, String[] cipherSuites) Method that initiates the Passive OVSDB channel listening functionality with ssl.By default the ovsdb passive connection will listen in port 6640 which can be overridden using the ovsdb.listenPort system property.- Specified by:
startOvsdbManagerWithSsl
in interfaceOvsdbConnection
-
restartOvsdbManagerWithSsl
public boolean restartOvsdbManagerWithSsl(String ovsdbListenIp, int ovsdbListenPort, org.opendaylight.aaa.cert.api.ICertificateManager certificateManagerSrv, String[] protocols, String[] cipherSuites) Description copied from interface:OvsdbConnection
Method to restart ovsdb server for passive connection with SSL and user specifies protocols and cipher suites.- Specified by:
restartOvsdbManagerWithSsl
in interfaceOvsdbConnection
-
channelClosed
-
getConnections
Description copied from interface:OvsdbConnection
Returns a Collection of all the active OVSDB Connections.- Specified by:
getConnections
in interfaceOvsdbConnection
- Returns:
- Collection of all the active OVSDB Connections
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
getClient
- Specified by:
getClient
in interfaceOvsdbConnection
-
notifyListenerForPassiveConnection
-