Package org.opendaylight.ovsdb.lib.impl
Class OvsdbClientImpl
java.lang.Object
org.opendaylight.ovsdb.lib.impl.OvsdbClientImpl
- All Implemented Interfaces:
OvsdbClient
-
Constructor Summary
ConstructorDescriptionOvsdbClientImpl
(OvsdbRPC rpc, io.netty.channel.Channel channel, OvsdbConnectionInfo.ConnectionType type, OvsdbConnectionInfo.SocketConnectionType socketConnType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancelMonitor
(MonitorHandle handler) Cancels an existing monitor method.void
cancelMonitor
(MonitorHandle handler, int timeout) Cancels an existing monitor method.<T extends TypedBaseTable<?>>
TcreateTypedRowWrapper
(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<?>>
TcreateTypedRowWrapper
(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
echo()
ovsdb echo operation.Gets the list of database names exposed by this ovsdb capable device.getDatabaseSchema
(String dbName) com.google.common.util.concurrent.ListenableFuture
<TypedDatabaseSchema> Asynchronously returns the schema object for a specific database.<T extends TypedBaseTable<?>>
TgetTypedRowWrapper
(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
boolean
isReady
(int timeout) void
lock
(String lockId, LockAquisitionCallback lockedCallBack, LockStolenCallback stolenCallback) ovsdb lock operation.<E extends TableSchema<E>>
TableUpdatesmonitor
(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorCallBack callback) ovsdb monitor operation.<E extends TableSchema<E>>
TableUpdatesmonitor
(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorCallBack callback, int timeout) ovsdb monitor operation.<E extends TableSchema<E>>
TableUpdatesmonitor
(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorHandle monitorHandle, MonitorCallBack callback) ovsdb monitor operation.<E extends TableSchema<E>>
TableUpdatesmonitor
(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorHandle monitorHandle, MonitorCallBack callback, int timeout) ovsdb monitor operation.void
setConnectionPublished
(boolean connectionPublished) void
void
startEchoService
(EchoServiceCallbackFilters callbackFilters) Starts the echo service.com.google.common.util.concurrent.ListenableFuture
<Boolean> ovsdb steal operation.void
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.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> ovsdb unlock operation.
-
Constructor Details
-
OvsdbClientImpl
public OvsdbClientImpl(OvsdbRPC rpc, io.netty.channel.Channel channel, OvsdbConnectionInfo.ConnectionType type, OvsdbConnectionInfo.SocketConnectionType socketConnType)
-
-
Method Details
-
transformingCallback
protected TableUpdates transformingCallback(com.fasterxml.jackson.databind.JsonNode tableUpdatesJson, DatabaseSchema dbSchema) -
transact
public com.google.common.util.concurrent.ListenableFuture<List<OperationResult>> transact(DatabaseSchema dbSchema, List<Operation> operations) Description copied from interface:OvsdbClient
Execute the list of operations in a single Transactions. Similar to the transactBuilder() method- Specified by:
transact
in interfaceOvsdbClient
- Parameters:
operations
- List of operations that needs to be part of a transact call- Returns:
- Future object representing the result of the transaction. Calling cancel on the Future would cause OVSDB cancel operation to be fired against the device.
-
monitor
public <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorCallBack callback) Description copied from interface:OvsdbClient
ovsdb monitor operation.- Specified by:
monitor
in interfaceOvsdbClient
- Parameters:
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 response
-
monitor
public <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorCallBack callback, int timeout) Description copied from interface:OvsdbClient
ovsdb monitor operation.- Specified by:
monitor
in interfaceOvsdbClient
- Parameters:
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 timeout
-
monitor
public <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorHandle monitorHandle, MonitorCallBack callback) Description copied from interface:OvsdbClient
ovsdb monitor operation.- Specified by:
monitor
in interfaceOvsdbClient
- Parameters:
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 response
-
monitor
public <E extends TableSchema<E>> TableUpdates monitor(DatabaseSchema dbSchema, List<MonitorRequest> monitorRequest, MonitorHandle monitorHandle, MonitorCallBack callback, int timeout) Description copied from interface:OvsdbClient
ovsdb monitor operation.- Specified by:
monitor
in interfaceOvsdbClient
- Parameters:
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 timeout
-
cancelMonitor
Description copied from interface:OvsdbClient
Cancels an existing monitor method.- Specified by:
cancelMonitor
in interfaceOvsdbClient
- Parameters:
handler
- Handle identifying a specific monitor request that is being cancelled.
-
cancelMonitor
Description copied from interface:OvsdbClient
Cancels an existing monitor method.- Specified by:
cancelMonitor
in interfaceOvsdbClient
- Parameters:
handler
- Handle identifying a specific monitor request that is being cancelled.timeout
- time in seconds for monitor transaction timeout
-
echo
Description copied from interface:OvsdbClient
ovsdb echo operation.- Specified by:
echo
in interfaceOvsdbClient
-
lock
public void lock(String lockId, LockAquisitionCallback lockedCallBack, LockStolenCallback stolenCallback) Description copied from interface:OvsdbClient
ovsdb lock operation.- Specified by:
lock
in interfaceOvsdbClient
- Parameters:
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 client
-
steal
Description copied from interface:OvsdbClient
ovsdb steal operation. SeeOvsdbClient.lock(String, LockAquisitionCallback, LockStolenCallback)
- Specified by:
steal
in interfaceOvsdbClient
-
unLock
Description copied from interface:OvsdbClient
ovsdb unlock operation. SeeOvsdbClient.unLock(String)
- Specified by:
unLock
in interfaceOvsdbClient
-
startEchoService
Description copied from interface:OvsdbClient
Starts the echo service. ThecallbackFilters
can be used to get notified on the absence of echo notifications from the remote device and control the frequency of such notifications.- Specified by:
startEchoService
in interfaceOvsdbClient
- Parameters:
callbackFilters
- callbacks for notifying the client of missing echo calls from remote.
-
stopEchoService
public void stopEchoService()Description copied from interface:OvsdbClient
Stops the echo service, i.e echo requests from the remote would not be acknowledged after this call.- Specified by:
stopEchoService
in interfaceOvsdbClient
-
transactBuilder
Description copied from interface:OvsdbClient
Allows for a mini DSL way of collecting the transactions to be executed against the ovsdb instance.- Specified by:
transactBuilder
in interfaceOvsdbClient
- Returns:
- TransactionBuilder
-
isReady
- Throws:
InterruptedException
-
getDatabases
Description copied from interface:OvsdbClient
Gets the list of database names exposed by this ovsdb capable device.- Specified by:
getDatabases
in interfaceOvsdbClient
- Returns:
- list of database names
-
getSchema
public com.google.common.util.concurrent.ListenableFuture<TypedDatabaseSchema> getSchema(String database) Description copied from interface:OvsdbClient
Asynchronously returns the schema object for a specific database.- Specified by:
getSchema
in interfaceOvsdbClient
- Parameters:
database
- name of the database schema- Returns:
- DatabaseSchema future
-
setRpc
-
getDatabaseSchema
- Specified by:
getDatabaseSchema
in interfaceOvsdbClient
-
createTypedRowWrapper
User friendly convenient method that make use of TyperUtils.getTypedRowWrapper to create a Typed Row Proxy given the Typed Table Class.- Specified by:
createTypedRowWrapper
in interfaceOvsdbClient
- Parameters:
klazz
- Typed Interface- Returns:
- Proxy wrapper for the actual raw Row class.
-
createTypedRowWrapper
public <T extends TypedBaseTable<?>> T 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.- Specified by:
createTypedRowWrapper
in interfaceOvsdbClient
- Parameters:
dbSchema
- Database Schema of interestklazz
- Typed Interface- Returns:
- Proxy wrapper for the actual raw Row class.
-
getTypedRowWrapper
public <T extends TypedBaseTable<?>> T 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.- Specified by:
getTypedRowWrapper
in interfaceOvsdbClient
- Parameters:
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.- Returns:
- Proxy wrapper for the actual raw Row class.
-
getConnectionInfo
- Specified by:
getConnectionInfo
in interfaceOvsdbClient
-
isActive
public boolean isActive()- Specified by:
isActive
in interfaceOvsdbClient
-
disconnect
public void disconnect()- Specified by:
disconnect
in interfaceOvsdbClient
-
isConnectionPublished
public boolean isConnectionPublished()- Specified by:
isConnectionPublished
in interfaceOvsdbClient
-
setConnectionPublished
public void setConnectionPublished(boolean connectionPublished) - Specified by:
setConnectionPublished
in interfaceOvsdbClient
-