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)
OvsdbClient
transact
in interface OvsdbClient
operations
- 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)
OvsdbClient
monitor
in interface OvsdbClient
monitorRequest
- 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)
OvsdbClient
monitor
in interface OvsdbClient
monitorRequest
- 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)
OvsdbClient
monitor
in interface OvsdbClient
monitorRequest
- 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)
OvsdbClient
monitor
in interface OvsdbClient
monitorRequest
- 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)
OvsdbClient
cancelMonitor
in interface OvsdbClient
handler
- Handle identifying a specific monitor request that is being cancelled.public void cancelMonitor(MonitorHandle handler, int timeout)
OvsdbClient
cancelMonitor
in interface OvsdbClient
handler
- 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()
OvsdbClient
echo
in interface OvsdbClient
public void lock(String lockId, LockAquisitionCallback lockedCallBack, LockStolenCallback stolenCallback)
OvsdbClient
lock
in interface OvsdbClient
lockId
- 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)
OvsdbClient
OvsdbClient.lock(String, LockAquisitionCallback, LockStolenCallback)
steal
in interface OvsdbClient
public com.google.common.util.concurrent.ListenableFuture<Boolean> unLock(String lockId)
OvsdbClient
OvsdbClient.unLock(String)
unLock
in interface OvsdbClient
public void startEchoService(EchoServiceCallbackFilters callbackFilters)
OvsdbClient
callbackFilters
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 OvsdbClient
callbackFilters
- callbacks for notifying the client of missing echo calls from remote.public void stopEchoService()
OvsdbClient
stopEchoService
in interface OvsdbClient
public TransactionBuilder transactBuilder(DatabaseSchema dbSchema)
OvsdbClient
transactBuilder
in interface OvsdbClient
public boolean isReady(int timeout) throws InterruptedException
InterruptedException
public com.google.common.util.concurrent.ListenableFuture<List<String>> getDatabases()
OvsdbClient
getDatabases
in interface OvsdbClient
public com.google.common.util.concurrent.ListenableFuture<DatabaseSchema> getSchema(String database)
OvsdbClient
getSchema
in interface OvsdbClient
database
- name of the database schemapublic void setRpc(OvsdbRPC rpc)
public DatabaseSchema getDatabaseSchema(String dbName)
getDatabaseSchema
in interface OvsdbClient
public <T extends TypedBaseTable<?>> T createTypedRowWrapper(Class<T> klazz)
createTypedRowWrapper
in interface OvsdbClient
klazz
- Typed Interfacepublic <T extends TypedBaseTable<?>> T createTypedRowWrapper(DatabaseSchema dbSchema, Class<T> klazz)
createTypedRowWrapper
in interface OvsdbClient
dbSchema
- Database Schema of interestklazz
- Typed Interfacepublic <T extends TypedBaseTable<?>> T getTypedRowWrapper(Class<T> klazz, Row<GenericTableSchema> row)
getTypedRowWrapper
in interface OvsdbClient
klazz
- 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 OvsdbClient
public boolean isActive()
isActive
in interface OvsdbClient
public void disconnect()
disconnect
in interface OvsdbClient
public boolean isConnectionPublished()
isConnectionPublished
in interface OvsdbClient
public void setConnectionPublished(boolean connectionPublished)
setConnectionPublished
in interface OvsdbClient
Copyright © 2018 OpenDaylight. All rights reserved.