public interface TableAdminManager
TableProvider
is an interface that clients can implement and
represents their own plug-in to LiveView. By implementing this interface and it's associated classes, the client can
create objects on the server that act as LiveView Tables, fetching the data from their own back-end and feeding it to
LiveView clients through the normal LiveView channels. LiveView clients made with any of the client API's (Java,
JavaScript, and .NET), which includes LiveView DeskTop, will not know that the table is different from any LiveView
table, excepting the query language used for such tables is the native language of back-end. Use this method to start
one of these TableProviders on the server. LiveView comes with two standard instances of this plug-in, one that
presents StreamBase QueryTables on any running StreamBase server as LiveView Tables, and another that presents
LiveView Tables from another LiveView Server as if they are tables on this server. In addition, there is available a
plug-in that presents ActiveSpaces Spaces as if they are LiveView tables. Note that TableProviders can also be
started by making an LVConf that uses the external-connection element. That is exactly equivalent to starting one
through this method, except that it will be already available when the server starts.Modifier and Type | Interface and Description |
---|---|
static class |
TableAdminManager.TableProviderAPIHelper
Utility methods for working with the TableProviderAPI
|
Modifier and Type | Method and Description |
---|---|
void |
addTableProvider(String id,
com.streambase.liveview.internal.protocol.jaxb.ExternalConnectionTypeType externalConnectionType,
String javaClassName,
com.streambase.liveview.internal.protocol.jaxb.ExternalServerConnectionType.Parameters parameters,
com.streambase.liveview.internal.protocol.jaxb.ExternalServerConnectionType.Mappings mappings,
int maxFailAttempts,
int waitSeconds)
Connect to a TableProvider, which then allows for remote connections to behave as if they were LiveView Tables.
|
void |
createAggregateTable(String tablename,
String descripton,
QueryConfig aggregateQuery,
List<List<String>> indices)
Create a table that is based on an aggregate query against an existing table.
|
void |
createTable(String tableName,
String description,
Schema schema,
List<List<String>> indices)
Create a table on the server without any LVConf which represents it.
|
void |
createTable(String tableName,
String description,
Schema schema,
String... primaryKeyFields)
Convenience form of the previous method, used if there is only a primary key, and that key is only a single field.
|
void |
createTable(String tableName,
String description,
String schema,
List<List<String>> indices)
Create a table on the server without any LVConf which represents it.
|
void |
createTable(String tableName,
String description,
String schema,
String... primaryKeyFields)
Convenience form of the previous method, used if there is only a primary key, and that key is only a single field.
|
void |
dropTables(String... tables)
This will drop the tables in the list.
|
boolean |
isValidFieldName(String name)
Checks whether or not the name is a valid field name to be used by createTable.
|
void |
removeTableProvider(String id)
Disconnect a previously-connected TableProvider
|
void |
startTables(String... tables)
This will start all the tables in the list AND any applications or elements upon which they depend.
|
void startTables(String... tables) throws LiveViewException
tables
- LiveViewException
void dropTables(String... tables) throws LiveViewException
tables
- LiveViewException
void createTable(String tableName, String description, Schema schema, List<List<String>> indices) throws LiveViewException
tableName
- description
- schema
- Defines the columns in the tableindices
- Each index is a list of field names; the first index in the list is the primary key, and the rest are secondary keysLiveViewException
void createTable(String tableName, String description, Schema schema, String... primaryKeyFields) throws LiveViewException
tableName
- description
- schema
- Defines the columns in the tableprimaryKeyFields
- The only key is the primary key.LiveViewException
void createTable(String tableName, String description, String schema, List<List<String>> indices) throws LiveViewException
tableName
- description
- schema
- Defines the columns in the tableindices
- Each index is a list of field names; the first index in the list is the primary key, and the rest are secondary keysLiveViewException
void createTable(String tableName, String description, String schema, String... primaryKeyFields) throws LiveViewException
tableName
- description
- schema
- Defines the columns in the tableprimaryKeyFields
- The only key is the primary key.LiveViewException
void createAggregateTable(String tablename, String descripton, QueryConfig aggregateQuery, List<List<String>> indices) throws LiveViewException
tablename
- descripton
- aggregateQuery
- The query against an existing table which will provide the source of data for this new oneindices
- Each index is a list of field names; the first index in the list is the primary key, and the rest are secondary keys. Primary key must match
the group-by of the query, or the aliased version of the group-by of the query.LiveViewException
boolean isValidFieldName(String name)
name
- void addTableProvider(String id, com.streambase.liveview.internal.protocol.jaxb.ExternalConnectionTypeType externalConnectionType, String javaClassName, com.streambase.liveview.internal.protocol.jaxb.ExternalServerConnectionType.Parameters parameters, com.streambase.liveview.internal.protocol.jaxb.ExternalServerConnectionType.Mappings mappings, int maxFailAttempts, int waitSeconds) throws LiveViewException
TableProvider
is an interface that clients can implement and represents their own plug-in to LiveView.
By implementing this interface and its associated classes, the client can create objects on the server that act as LiveView Tables, fetching the data from
their own back-end and feeding it to LiveView clients through the normal LiveView channels. LiveView clients made with any of the client API's (Java,
JavaScript, and .NET), which includes LiveView DeskTop, will not know that the table is any different from any LIveView table.
Use this method to start one of these TableProviders on the server. LiveView comes with two standard instances of this plug-in, one that presents
StreamBase QueryTables on any running StreamBase Server as LiveView Tables, and another that presents LiveView Tables from another LiveView
Server as if they are tables on this server. In addition, there is available a plug-in that presents ActiveSpaces Spaces as if they are LiveView tables.
Note that TableProviders can also be started by making an LVConf that uses the external-connection element. That is exactly equivalent to starting
one through this method, except that it will be already available when the server starts.id
- must be unique on the LiveView server.externalConnectionType
- one of CEP_QUERY_TABLES, LIVE_VIEW, CUSTOM_TABLE_PROVIDER ExternalConnectionTypeType
javaClassName
- The className of a class that implements com.streambase.liveview.server.table.TableProvider. Only used if type is CUSTOM_TABLE_PROVIDER.parameters
- key-value pairs that are specific to your TableProvider. Use utility function TableProviderAPIHelper#addMapping(Mappings, String, String)
to create and extend.mappings
- Table name selector and mapping definitions. Use utility function TableProviderAPIHelper#addParameter(Parameters, String, String)
to create and extend.maxFailAttempts
- Maximum failures before giving up. Anything less than 1 for infinite attempts.waitSeconds
- Time to wait after a failure before trying. Anything less than 1 becomes the default of 120 seconds.LiveViewException
LiveViewConnection.TableProviderAPIHelper
void removeTableProvider(String id) throws LiveViewException
id
- The exact id of the TableProvider.LiveViewException