public class OvsdbConnectionService extends Object implements AutoCloseable, OvsdbConnection
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.
Constructor and Description |
---|
OvsdbConnectionService() |
Modifier and Type | Method and Description |
---|---|
static void |
channelClosed(OvsdbClient client) |
void |
close() |
OvsdbClient |
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.
|
OvsdbClient |
connectWithSsl(InetAddress address,
int port,
SSLContext sslContext)
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.
|
OvsdbClient |
getClient(io.netty.channel.Channel channel) |
Collection<OvsdbClient> |
getConnections()
Returns a Collection of all the active OVSDB Connections.
|
static OvsdbConnection |
getService() |
static void |
notifyListenerForPassiveConnection(OvsdbClient client) |
void |
registerConnectionListener(OvsdbConnectionListener listener)
Method to register a Passive Connection Listener with the ConnectionService.
|
boolean |
restartOvsdbManagerWithSsl(int ovsdbListenPort,
SSLContext sslContext,
String[] protocols,
String[] cipherSuites)
Method to restart ovsdb server for passive connection with SSL and user
specifies protocols and cipher suites.
|
void |
setCertificatManager(org.opendaylight.aaa.cert.api.ICertificateManager certificateManagerSrv)
Set default Certificate manager service.
|
void |
setJsonRpcDecoderMaxFrameLength(int maxFrameLength)
Blueprint property setter method.
|
void |
setOvsdbListenerPort(int portNumber) |
void |
setOvsdbRpcTaskTimeout(int timeout) |
void |
setUseSsl(boolean flag)
Set useSSL flag.
|
boolean |
startOvsdbManager()
Method that initiates the Passive OVSDB channel listening functionality.
|
boolean |
startOvsdbManagerWithSsl(int ovsdbListenPort,
SSLContext sslContext,
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 |
unregisterConnectionListener(OvsdbConnectionListener listener)
Method to unregister a Passive Connection Listener with the ConnectionService.
|
void |
updateConfigParameter(Map<String,Object> configParameters) |
public static OvsdbConnection getService()
public OvsdbClient connect(InetAddress address, int port)
connect
in interface OvsdbConnection
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.public OvsdbClient connectWithSsl(InetAddress address, int port, SSLContext sslContext)
OvsdbConnection
connectWithSsl
in interface OvsdbConnection
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.sslContext
- Netty sslContext for channel configurationpublic void disconnect(OvsdbClient client)
OvsdbConnection
disconnect
in interface OvsdbConnection
client
- that represents the ovsdb connection.public void registerConnectionListener(OvsdbConnectionListener listener)
OvsdbConnection
registerConnectionListener
in interface OvsdbConnection
listener
- Passive Connection listener interested in Passive OVSDB connection requests.public void unregisterConnectionListener(OvsdbConnectionListener listener)
OvsdbConnection
unregisterConnectionListener
in interface OvsdbConnection
public boolean startOvsdbManager()
startOvsdbManager
in interface OvsdbConnection
public boolean startOvsdbManagerWithSsl(int ovsdbListenPort, SSLContext sslContext, String[] protocols, String[] cipherSuites)
startOvsdbManagerWithSsl
in interface OvsdbConnection
public boolean restartOvsdbManagerWithSsl(int ovsdbListenPort, SSLContext sslContext, String[] protocols, String[] cipherSuites)
OvsdbConnection
restartOvsdbManagerWithSsl
in interface OvsdbConnection
public static void channelClosed(OvsdbClient client)
public Collection<OvsdbClient> getConnections()
OvsdbConnection
getConnections
in interface OvsdbConnection
public void close() throws Exception
close
in interface AutoCloseable
Exception
public OvsdbClient getClient(io.netty.channel.Channel channel)
getClient
in interface OvsdbConnection
public static void notifyListenerForPassiveConnection(OvsdbClient client)
public void setOvsdbRpcTaskTimeout(int timeout)
public void setUseSsl(boolean flag)
flag
- boolean for using sslpublic void setCertificatManager(org.opendaylight.aaa.cert.api.ICertificateManager certificateManagerSrv)
certificateManagerSrv
- referencepublic void setJsonRpcDecoderMaxFrameLength(int maxFrameLength)
maxFrameLength
- Max frame length (default : 100000)public void setOvsdbListenerPort(int portNumber)
Copyright © 2018 OpenDaylight. All rights reserved.