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)
connect API can be used by the applications to initiate Active connection from
the controller towards ovsdb-server.
|
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.
|
void |
setOvsdbRpcTaskTimeout(int interval) |
boolean |
startOvsdbManager(int ovsdbListenPort)
Method that initiates the Passive OVSDB channel listening functionality.
|
boolean |
startOvsdbManagerWithSsl(int ovsdbListenPort,
SSLContext sslContext)
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.
|
public static OvsdbConnection getService()
public OvsdbClient connect(InetAddress address, int port)
OvsdbConnection
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(int ovsdbListenPort)
startOvsdbManager
in interface OvsdbConnection
public boolean startOvsdbManagerWithSsl(int ovsdbListenPort, SSLContext sslContext)
startOvsdbManagerWithSsl
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 interval)
Copyright © 2017 OpenDaylight. All rights reserved.