Interface TypedDatabaseSchema
- All Superinterfaces:
DatabaseSchema
-
Method Summary
Modifier and TypeMethodDescription<T extends TypedBaseTable<?>>
Map<UUID,T> extractRowsOld
(Class<T> klazz, TableUpdates updates) This method extracts all row updates of Class<T> klazz from a TableUpdates that correspond to old version of rows of type klazz that have been updated.<T extends TypedBaseTable<?>>
Map<UUID,T> extractRowsRemoved
(Class<T> klazz, TableUpdates updates) This method extracts all row updates of Class<T> klazz from a TableUpdates that correspond to removal of rows of type klazz.<T extends TypedBaseTable<?>>
Map<UUID,T> extractRowsUpdated
(Class<T> klazz, TableUpdates updates) This method extracts all row updates of Class<T> klazz from a TableUpdates that correspond to insertion or updates of rows of type klazz.getTableSchema
(Class<?> klazz) Retrieve the table schema for the given table in the given database schema.default <T extends TypedBaseTable<?>>
TgetTypedRowWrapper
(Class<T> klazz) Returns a Typed Proxy implementation for the klazz passed as a parameter.<T extends TypedBaseTable<?>>
TgetTypedRowWrapper
(Class<T> klazz, Row<GenericTableSchema> row) Returns a Typed Proxy implementation for the klazz passed as a parameter.static TypedDatabaseSchema
of
(DatabaseSchema delegate) Methods inherited from interface org.opendaylight.ovsdb.lib.schema.DatabaseSchema
getName, getTables, getVersion, hasTable, table
-
Method Details
-
of
-
withInternallyGeneratedColumns
TypedDatabaseSchema withInternallyGeneratedColumns()- Specified by:
withInternallyGeneratedColumns
in interfaceDatabaseSchema
-
getTableSchema
Retrieve the table schema for the given table in the given database schema.- Parameters:
klazz
- The class whose table schema should be retrieved. Classes are matched in the database schema either using theirTypedTable
annotation, if they have one, or by name.- Returns:
- the table schema.
-
getTypedRowWrapper
Returns a Typed Proxy implementation for the klazz passed as a parameter. Per design choice, the Typed Proxy implementation is just a Wrapper on top of the actual Row which is untyped.Being just a wrapper, it is state-less and more of a convenience functionality to provide a type-safe infrastructure for the applications to built on top of. And this Typed infra is completely optional.
It is the applications responsibility to pass on the raw Row parameter and this method will return the appropriate Proxy wrapper for the passed klazz Type. The raw Row parameter may be null if the caller is interested in just the ColumnSchema. But that is not a very common use-case.
- Parameters:
klazz
- Typed Class that represents a Table
-
getTypedRowWrapper
Returns a Typed Proxy implementation for the klazz passed as a parameter. Per design choice, the Typed Proxy implementation is just a Wrapper on top of the actual Row which is untyped.Being just a wrapper, it is state-less and more of a convenience functionality to provide a type-safe infrastructure for the applications to built on top of. And this Typed infra is completely optional.
It is the applications responsibility to pass on the raw Row parameter and this method will return the appropriate Proxy wrapper for the passed klazz Type. The raw Row parameter may be null if the caller is interested in just the ColumnSchema. But that is not a very common use-case.
- Parameters:
klazz
- Typed Class that represents a Tablerow
- The actual Row that the wrapper is operating on. It can be null if the caller is just interested in getting ColumnSchema.
-
extractRowsOld
This method extracts all row updates of Class<T> klazz from a TableUpdates that correspond to old version of rows of type klazz that have been updated. Example:Map<UUID,Bridge> oldBridges = extractRowsOld(Bridge.class,updates,dbSchema)
- Parameters:
klazz
- Class for row type to be extractedupdates
- TableUpdates from which to extract rowUpdates- Returns:
- Map<UUID,T> for the type of things being sought
-
extractRowsRemoved
This method extracts all row updates of Class<T> klazz from a TableUpdates that correspond to removal of rows of type klazz. Example:Map<UUID,Bridge> updatedBridges = extractRowsRemoved(Bridge.class,updates,dbSchema)
- Parameters:
klazz
- Class for row type to be extractedupdates
- TableUpdates from which to extract rowUpdates- Returns:
- Map<UUID,T> for the type of things being sought
-
extractRowsUpdated
This method extracts all row updates of Class<T> klazz from a TableUpdates that correspond to insertion or updates of rows of type klazz. Example:Map<UUID,Bridge> updatedBridges = extractRowsUpdated(Bridge.class,updates,dbSchema)
- Parameters:
klazz
- Class for row type to be extractedupdates
- TableUpdates from which to extract rowUpdates- Returns:
- Map<UUID,T> for the type of things being sought
-