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(java.lang.String id,
com.streambase.liveview.internal.protocol.jaxb.ExternalConnectionTypeType externalConnectionType,
java.lang.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(java.lang.String tablename,
java.lang.String descripton,
QueryConfig aggregateQuery,
java.util.List<java.util.List<java.lang.String>> indices)
Create a table that is based on an aggregate query against an existing table.
|
void |
createTable(java.lang.String tableName,
java.lang.String description,
Schema schema,
java.util.List<java.util.List<java.lang.String>> indices)
Create a table on the server without any LVConf which represents it.
|
void |
createTable(java.lang.String tableName,
java.lang.String description,
Schema schema,
java.lang.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(java.lang.String tableName,
java.lang.String description,
java.lang.String schema,
java.util.List<java.util.List<java.lang.String>> indices)
Create a table on the server without any LVConf which represents it.
|
void |
createTable(java.lang.String tableName,
java.lang.String description,
java.lang.String schema,
java.lang.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(TableConfig tableConfig)
Create a table using a TableConfig.
|
TableConfig |
createTableConfig(java.lang.String tablename)
Create a TableConfig for making tables with more advanced features
|
java.util.Map<java.lang.String,DynamicTableState> |
dropTables(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.String... tables)
Returns a Map
DynamicTableState . |
void |
dropTables(java.lang.String... tables)
This will drop the tables in the list.
|
boolean |
isValidFieldName(java.lang.String name)
Checks whether or not the name is a valid field name to be used by createTable.
|
void |
removeTableProvider(java.lang.String id)
Disconnect a previously-connected TableProvider.
|
java.util.Map<java.lang.String,DynamicTableState> |
startTables(long duration,
java.util.concurrent.TimeUnit timeUnit,
java.lang.String... tables)
Returns a Map
DynamicTableState . |
void |
startTables(java.lang.String... tables)
This will start all the tables in the list and any applications or elements upon which they depend.
|
void startTables(java.lang.String... tables) throws LiveViewException
tables
- is the list of table names to start on the LiveView serverLiveViewException
- in case the table configuration(LVConf) files have errors/missing files or if the table
is already in loading phase.void dropTables(java.lang.String... tables) throws LiveViewException
tables
- is the list of table names to drop on the LiveView server.LiveViewException
- in case the table is in the loading phase and not loaded yet. It also throws an
exception in case the tables are not present on the LiveView server.java.util.Map<java.lang.String,DynamicTableState> startTables(long duration, java.util.concurrent.TimeUnit timeUnit, java.lang.String... tables)
DynamicTableState
. Will return when either timeoutMS has been reached or
all tables are started/entered in error state.duration
- : timeToWait before returning; if all tables started/entered in error state before duration is
completed, the module returns otherwise waits till the specified duration ends; duration = 0 or any value less
than 0 uses the system property 'liveview.tablestart.idletime.ms'.timeUnit:
- A TimeUnit is mainly used to inform this method how a given timing parameter(duration) should be
interpreted. e.g.:TimeUnit.MILLISECONDStables
- : List of tables to start.DynamicTableState
holding the state of table on timeout; also
returns if each table is either started/entered in error state.java.util.Map<java.lang.String,DynamicTableState> dropTables(long duration, java.util.concurrent.TimeUnit timeUnit, java.lang.String... tables)
DynamicTableState
. Will return when either timeoutMS has been reached or
all tables are dropped/entered in error state.duration
- : timeToWait before returning; if all tables dropped/entered in error state before duration is
completed, the module returns otherwise waits till the specified duration ends; duration = 0 or any value less
than 0 uses the system property 'liveview.tabledrop.idletime.ms'.timeUnit:
- A TimeUnit is mainly used to inform this method how a given timing parameter(duration) should be
interpreted. e.g.:TimeUnit.MILLISECONDStables
- : List of tables to drop.DynamicTableState
holding the state of table on timeout; also
returns if each table is either dropped/entered in error state.void createTable(java.lang.String tableName, java.lang.String description, Schema schema, java.util.List<java.util.List<java.lang.String>> indices) throws LiveViewException
tableName
- : Unique name that identifies a table on the LiveView server.description
- : A statement that describes the LiveView table.schema
- : Defines the columns in LiveView table.indices
- Each index is a list of field names; the first index in the list is the primary key, and the rest are secondary keys.LiveViewException
- if the table is already present on the server or the table creation data has errors.void createTable(java.lang.String tableName, java.lang.String description, Schema schema, java.lang.String... primaryKeyFields) throws LiveViewException
tableName
- : Unique name that identifies a table on the LiveView server.description
- : A statement that describes the LiveView table.schema
- : Defines the columns in LiveView table.primaryKeyFields
- The only key is the primary key.LiveViewException
- if the table is already present on the server or the table creation data has errors.void createTable(java.lang.String tableName, java.lang.String description, java.lang.String schema, java.util.List<java.util.List<java.lang.String>> indices) throws LiveViewException
tableName
- : Unique name that identifies a table on the LiveView server.description
- : A statement that describes the LiveView table.schema
- : Defines the columns in LiveView table.indices
- Each index is a list of field names; the first index in the list is the primary key, and the rest are secondary keys.LiveViewException
- if the table is already present on the server or the table creation data has errors.void createTable(java.lang.String tableName, java.lang.String description, java.lang.String schema, java.lang.String... primaryKeyFields) throws LiveViewException
tableName
- : Unique name that identifies a table on the LiveView server.description
- : A statement that describes the LiveView table.schema
- : Defines the columns in LiveView table.primaryKeyFields
- The only key is the primary key.LiveViewException
- if the table is already present on the server or the table creation data has errors.void createAggregateTable(java.lang.String tablename, java.lang.String descripton, QueryConfig aggregateQuery, java.util.List<java.util.List<java.lang.String>> indices) throws LiveViewException
tableName
- : Unique name that identifies a table on the LiveView server.description
- : A statement that describes the LiveView table.aggregateQuery
- : The query against an existing table which will provide the source of data for this new table.indices
- : 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
- if the table is already present on the server or the table creation data has errors.TableConfig createTableConfig(java.lang.String tablename)
tablename
- : Unique name that identifies a table on the LiveView server.void createTable(TableConfig tableConfig) throws LiveViewException
tableConfig
- TableConfig
is used for the configuration of all properties of a table.LiveViewException
- if the table is already present on the server or the table creation data has errors.boolean isValidFieldName(java.lang.String name)
name
- void addTableProvider(java.lang.String id, com.streambase.liveview.internal.protocol.jaxb.ExternalConnectionTypeType externalConnectionType, java.lang.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
TableProviderAPIHelper}
void removeTableProvider(java.lang.String id) throws LiveViewException
id
- The exact id of the TableProvider.LiveViewException
TableProviderAPIHelper}