public class OvsdbClientImpl extends Object implements OvsdbClient
| Constructor and Description |
|---|
OvsdbClientImpl(OvsdbRPC rpc,
io.netty.channel.Channel channel,
OvsdbConnectionInfo.ConnectionType type,
OvsdbConnectionInfo.SocketConnectionType socketConnType) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelMonitor(MonitorHandle handler)
Cancels an existing monitor method.
|
void |
cancelMonitor(MonitorHandle handler,
int timeout)
Cancels an existing monitor method.
|
<T extends TypedBaseTable<?>> |
createTypedRowWrapper(Class<T> klazz)
User friendly convenient method that make use of TyperUtils.getTypedRowWrapper to create a Typed Row Proxy
given the Typed Table Class.
|
<T extends TypedBaseTable<?>> |
createTypedRowWrapper(DatabaseSchema dbSchema,
Class<T> klazz)
User friendly convenient method that make use of getTypedRowWrapper to create a Typed Row Proxy given
DatabaseSchema and Typed Table Class.
|
void |
disconnect() |
com.google.common.util.concurrent.ListenableFuture<List<String>> |
echo()
ovsdb echo operation.
|
OvsdbConnectionInfo |
getConnectionInfo() |
com.google.common.util.concurrent.ListenableFuture<List<String>> |
getDatabases()
Gets the list of database names exposed by this ovsdb capable device.
|
DatabaseSchema |
getDatabaseSchema(String dbName) |
com.google.common.util.concurrent.ListenableFuture<DatabaseSchema> |
getSchema(String database)
Asynchronously returns the schema object for a specific database.
|
<T extends TypedBaseTable<?>> |
getTypedRowWrapper(Class<T> klazz,
Row<GenericTableSchema> row)
User friendly convenient method to get a Typed Row Proxy given a Typed Table Class and the Row to be wrapped.
|
boolean |
isActive() |
boolean |
isConnectionPublished() |
boolean |
isReady(int timeout) |
void |
lock(String lockId,
LockAquisitionCallback lockedCallBack,
LockStolenCallback stolenCallback)
ovsdb lock operation.
|
<E extends TableSchema<E>> |
monitor(DatabaseSchema dbSchema,
List<MonitorRequest> monitorRequest,
MonitorCallBack callback)
ovsdb monitor operation.
|
<E extends TableSchema<E>> |
monitor(DatabaseSchema dbSchema,
List<MonitorRequest> monitorRequest,
MonitorCallBack callback,
int timeout)
ovsdb monitor operation.
|
<E extends TableSchema<E>> |
monitor(DatabaseSchema dbSchema,
List<MonitorRequest> monitorRequest,
MonitorHandle monitorHandle,
MonitorCallBack callback)
ovsdb monitor operation.
|
<E extends TableSchema<E>> |
monitor(DatabaseSchema dbSchema,
List<MonitorRequest> monitorRequest,
MonitorHandle monitorHandle,
MonitorCallBack callback,
int timeout)
ovsdb monitor operation.
|
void |
setConnectionPublished(boolean connectionPublished) |
void |
setRpc(OvsdbRPC rpc) |
void |
startEchoService(EchoServiceCallbackFilters callbackFilters)
Starts the echo service.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
steal(String lockId)
ovsdb steal operation.
|
void |
stopEchoService()
Stops the echo service, i.e echo requests from the remote would not be acknowledged after this call.
|
com.google.common.util.concurrent.ListenableFuture<List<OperationResult>> |
transact(DatabaseSchema dbSchema,
List<Operation> operations)
Execute the list of operations in a single Transactions.
|
TransactionBuilder |
transactBuilder(DatabaseSchema dbSchema)
Allows for a mini DSL way of collecting the transactions to be executed against the ovsdb instance.
|
protected TableUpdates |
transformingCallback(com.fasterxml.jackson.databind.JsonNode tableUpdatesJson,
DatabaseSchema dbSchema) |
com.google.common.util.concurrent.ListenableFuture<Boolean> |
unLock(String lockId)
ovsdb unlock operation.
|
public OvsdbClientImpl(OvsdbRPC rpc, io.netty.channel.Channel channel, OvsdbConnectionInfo.ConnectionType type, OvsdbConnectionInfo.SocketConnectionType socketConnType)
protected TableUpdates transformingCallback(com.fasterxml.jackson.databind.JsonNode tableUpdatesJson, DatabaseSchema dbSchema)
public com.google.common.util.concurrent.ListenableFuture<List<OperationResult>> transact(DatabaseSchema dbSchema, List<Operation> operations)
OvsdbClienttransact in interface OvsdbClientoperations - List of operations that needs to be part of a transact callpublic <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorCallBack callback)
OvsdbClientmonitor in interface OvsdbClientmonitorRequest - represents what needs to be monitored including a client specified monitor handle. This
handle is used to later cancel (OvsdbClient.cancelMonitor(MonitorHandle)) the monitor.callback - receives the monitor responsepublic <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorCallBack callback, int timeout)
OvsdbClientmonitor in interface OvsdbClientmonitorRequest - represents what needs to be monitored including a client specified monitor handle. This
handle is used to later cancel (OvsdbClient.cancelMonitor(MonitorHandle)) the monitor.callback - receives the monitor responsetimeout - time in seconds for monitor transaction timeoutpublic <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorHandle monitorHandle, MonitorCallBack callback)
OvsdbClientmonitor in interface OvsdbClientmonitorRequest - represents what needs to be monitoredmonitorHandle - A client specified monitor handle. This handle is used to later cancel
(OvsdbClient.cancelMonitor(MonitorHandle)) the monitor.callback - receives the monitor responsepublic <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorHandle monitorHandle, MonitorCallBack callback, int timeout)
OvsdbClientmonitor in interface OvsdbClientmonitorRequest - represents what needs to be monitoredmonitorHandle - A client specified monitor handle. This handle is used to later cancel
(OvsdbClient.cancelMonitor(MonitorHandle)) the monitor.callback - receives the monitor responsetimeout - time in seconds for monitor transaction timeoutpublic void cancelMonitor(MonitorHandle handler)
OvsdbClientcancelMonitor in interface OvsdbClienthandler - Handle identifying a specific monitor request that is being cancelled.public void cancelMonitor(MonitorHandle handler, int timeout)
OvsdbClientcancelMonitor in interface OvsdbClienthandler - Handle identifying a specific monitor request that is being cancelled.timeout - time in seconds for monitor transaction timeoutpublic com.google.common.util.concurrent.ListenableFuture<List<String>> echo()
OvsdbClientecho in interface OvsdbClientpublic void lock(String lockId, LockAquisitionCallback lockedCallBack, LockStolenCallback stolenCallback)
OvsdbClientlock in interface OvsdbClientlockId - a client specified id for the lock; this can be used for unlocking (OvsdbClient.unLock(String))lockedCallBack - Callback to nofify when the lock is acquiredstolenCallback - Callback to notify when an acquired lock is stolen by another clientpublic com.google.common.util.concurrent.ListenableFuture<Boolean> steal(String lockId)
OvsdbClientOvsdbClient.lock(String, LockAquisitionCallback, LockStolenCallback)steal in interface OvsdbClientpublic com.google.common.util.concurrent.ListenableFuture<Boolean> unLock(String lockId)
OvsdbClientOvsdbClient.unLock(String)unLock in interface OvsdbClientpublic void startEchoService(EchoServiceCallbackFilters callbackFilters)
OvsdbClientcallbackFilters can be used to get notified on the absence of echo
notifications from the remote device and control the frequency of such notifications.startEchoService in interface OvsdbClientcallbackFilters - callbacks for notifying the client of missing echo calls from remote.public void stopEchoService()
OvsdbClientstopEchoService in interface OvsdbClientpublic TransactionBuilder transactBuilder(DatabaseSchema dbSchema)
OvsdbClienttransactBuilder in interface OvsdbClientpublic boolean isReady(int timeout)
throws InterruptedException
InterruptedExceptionpublic com.google.common.util.concurrent.ListenableFuture<List<String>> getDatabases()
OvsdbClientgetDatabases in interface OvsdbClientpublic com.google.common.util.concurrent.ListenableFuture<DatabaseSchema> getSchema(String database)
OvsdbClientgetSchema in interface OvsdbClientdatabase - name of the database schemapublic void setRpc(OvsdbRPC rpc)
public DatabaseSchema getDatabaseSchema(String dbName)
getDatabaseSchema in interface OvsdbClientpublic <T extends TypedBaseTable<?>> T createTypedRowWrapper(Class<T> klazz)
createTypedRowWrapper in interface OvsdbClientklazz - Typed Interfacepublic <T extends TypedBaseTable<?>> T createTypedRowWrapper(DatabaseSchema dbSchema, Class<T> klazz)
createTypedRowWrapper in interface OvsdbClientdbSchema - Database Schema of interestklazz - Typed Interfacepublic <T extends TypedBaseTable<?>> T getTypedRowWrapper(Class<T> klazz, Row<GenericTableSchema> row)
getTypedRowWrapper in interface OvsdbClientklazz - Typed Interfacerow - The actual Row that the wrapper is operating on.
It can be null if the caller is just interested in getting ColumnSchema.public OvsdbConnectionInfo getConnectionInfo()
getConnectionInfo in interface OvsdbClientpublic boolean isActive()
isActive in interface OvsdbClientpublic void disconnect()
disconnect in interface OvsdbClientpublic boolean isConnectionPublished()
isConnectionPublished in interface OvsdbClientpublic void setConnectionPublished(boolean connectionPublished)
setConnectionPublished in interface OvsdbClientCopyright © 2018 OpenDaylight. All rights reserved.