Class TableProviderManager
java.lang.Object
com.streambase.liveview.server.table.plugin.TableProviderManager
-
Field Summary
Modifier and TypeFieldDescriptionstatic boolean
protected PriorityBlockingQueue<TableProviderControlImpl>
protected Map<String,
TableProviderControlImpl> -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDependentTable
(com.streambase.liveview.server.table.CatalogedTable baseTable, String dependentTableName) It adds the dependent table name to the dependents maps that every table provider has.boolean
This method should be called as early as possible in the createTable path.void
addTableProvider
(com.streambase.liveview.internal.protocol.jaxb.ExternalServerConnectionType externalServer, int retryCount) Connect to a TableProvider, which then allows for remote connections as if they were LiveView TablescompileLVConfs
(List<File> tableFiles, boolean buildYaml) void
createTable
(String name, com.streambase.liveview.config.model.lvconf.LiveviewConfiguration conf, boolean saveInProject) Does pre-checks, saves lvconf file and registers the table in defined state with the services layervoid
deleteTable
(com.streambase.liveview.server.table.CatalogedTable catalogedTable) void
dropTables
(List<String> tables) static TableProviderManager
get()
(package private) com.streambase.liveview.server.table.system.TableColumnsTable
com.streambase.liveview.server.core.LiveViewServerConfig
getCreateTableDir
(boolean create) static String
getJavaClassname
(com.streambase.liveview.internal.protocol.jaxb.ExternalServerConnectionType externalServer) Get the projectBin, which is the writable base directory where all stuff that we write should go.getTableDependants
(String baseCatalogedName) It returns the set of dependent tables of a particular cataloged table.com.streambase.liveview.server.table.system.TablesTable
static boolean
hasDangerousConnection
(com.streambase.liveview.config.AbstractConfigObject configObject) static void
initialize
(com.streambase.liveview.server.core.LiveViewServer lvServer) static void
initialize
(com.streambase.liveview.server.table.system.TablesTable tt, com.streambase.liveview.server.table.system.TableColumnsTable tct, com.streambase.liveview.server.core.LiveViewServerConfig conf, com.streambase.liveview.server.table.StreamBaseConnectionPool sbConnPool) (package private) void
killQueriesAndPublishers
(String tableName, LiveViewException exForQueries, LiveViewException exForPublishers) Kills all queries and publishers that are attached to it.(package private) void
queueRestart
(TableProviderControlImpl control) void
registerDependentTables
(com.streambase.liveview.config.model.lvconf.TableType tableInfo, com.streambase.liveview.server.table.CatalogedTable baseCatalogedTable, boolean useDynamicStates) void
registerNewDynamicTable
(String name, com.streambase.liveview.config.model.lvconf.LiveviewConfiguration.DataTable dataTable, Table.TableStatus initialStatus, String statusMessage) boolean
This method MUST be called with the same table name if AddingNew has been called.void
Disconnect a previously-connected TableProvider.void
saveLVConf
(String name, com.streambase.liveview.config.model.lvconf.LiveviewConfiguration conf, boolean saveInProject) void
shutdown()
void
startTables
(List<String> tables) void
validateDependentTables
(com.streambase.liveview.config.model.lvconf.LiveviewConfiguration conf) void
-
Field Details
-
restartIsOK
public static boolean restartIsOK -
tableProviderMap
-
restartQueue
-
-
Method Details
-
queueRestart
-
get
-
initialize
public static void initialize(com.streambase.liveview.server.core.LiveViewServer lvServer) -
initialize
public static void initialize(com.streambase.liveview.server.table.system.TablesTable tt, com.streambase.liveview.server.table.system.TableColumnsTable tct, com.streambase.liveview.server.core.LiveViewServerConfig conf, com.streambase.liveview.server.table.StreamBaseConnectionPool sbConnPool) -
validateTablesContainers
public void validateTablesContainers() -
getTablesTable
public com.streambase.liveview.server.table.system.TablesTable getTablesTable() -
getColumnsTable
com.streambase.liveview.server.table.system.TableColumnsTable getColumnsTable() -
getConfig
public com.streambase.liveview.server.core.LiveViewServerConfig getConfig()- Returns:
- the config
-
addTableProvider
public void addTableProvider(com.streambase.liveview.internal.protocol.jaxb.ExternalServerConnectionType externalServer, int retryCount) throws LiveViewException Connect to a TableProvider, which then allows for remote connections as if they were LiveView Tables- Parameters:
externalServer
- id must be uniqueretryCount
- The number of failed tries we've already made.- Throws:
LiveViewException
- Since:
- LiveView 1.6
-
getJavaClassname
public static String getJavaClassname(com.streambase.liveview.internal.protocol.jaxb.ExternalServerConnectionType externalServer) -
getTableDependants
It returns the set of dependent tables of a particular cataloged table. Returns null if base table doesn't exist- Returns:
-
removeTableProvider
Disconnect a previously-connected TableProvider. This is called from outside, so no part has happened, yet, and it shouldn't be requeued for restart- Parameters:
id
-- Throws:
LiveViewException
- Since:
- LiveView 1.6
-
shutdown
- Throws:
LiveViewException
-
dropTables
public void dropTables(List<String> tables) throws LiveViewException, TupleException, StreamBaseException - Parameters:
tables
-- Throws:
LiveViewException
TupleException
StreamBaseException
-
startTables
public void startTables(List<String> tables) throws LiveViewException, StreamBaseException, com.streambase.liveview.config.ConfigExceptionType.ConfigException, TupleException, NullValueException - Parameters:
tables
-- Throws:
LiveViewException
StreamBaseException
com.streambase.liveview.config.ConfigExceptionType.ConfigException
TupleException
NullValueException
-
compileLVConfs
public Map<String,com.streambase.liveview.config.AbstractConfigObject> compileLVConfs(List<File> tableFiles, boolean buildYaml) throws LiveViewException, StreamBaseException - Throws:
LiveViewException
StreamBaseException
-
getCreateTableDir
-
getProjectBin
Get the projectBin, which is the writable base directory where all stuff that we write should go.- Returns:
-
deleteTable
public void deleteTable(com.streambase.liveview.server.table.CatalogedTable catalogedTable) throws TupleException, StreamBaseException - Throws:
TupleException
StreamBaseException
-
killQueriesAndPublishers
void killQueriesAndPublishers(String tableName, LiveViewException exForQueries, LiveViewException exForPublishers) throws LiveViewException Kills all queries and publishers that are attached to it. It also sends the exception to the query listener.- Throws:
LiveViewException
-
addingNew
This method should be called as early as possible in the createTable path. It is intended to prevent multiple clients from trying to create the same table simultaneously You must call RemoveNew(tableName) regardless if the table is created successfully or not.- Parameters:
tableName
-- Returns:
- true if the table is really new. False if the table exists, or is in the process of being created.
-
removeNew
This method MUST be called with the same table name if AddingNew has been called.- Parameters:
tableName
-- Returns:
- true if the table was in the currently creating state.
-
createTable
public void createTable(String name, com.streambase.liveview.config.model.lvconf.LiveviewConfiguration conf, boolean saveInProject) throws jakarta.xml.bind.JAXBException, StreamBaseException Does pre-checks, saves lvconf file and registers the table in defined state with the services layer- Parameters:
conf
-saveInProject
- TODO- Throws:
jakarta.xml.bind.JAXBException
StreamBaseException
-
validateDependentTables
public void validateDependentTables(com.streambase.liveview.config.model.lvconf.LiveviewConfiguration conf) throws LiveViewException - Throws:
LiveViewException
-
saveLVConf
public void saveLVConf(String name, com.streambase.liveview.config.model.lvconf.LiveviewConfiguration conf, boolean saveInProject) throws jakarta.xml.bind.JAXBException, LiveViewException - Throws:
jakarta.xml.bind.JAXBException
LiveViewException
-
registerNewDynamicTable
public void registerNewDynamicTable(String name, com.streambase.liveview.config.model.lvconf.LiveviewConfiguration.DataTable dataTable, Table.TableStatus initialStatus, String statusMessage) throws LiveViewException - Throws:
LiveViewException
-
registerDependentTables
public void registerDependentTables(com.streambase.liveview.config.model.lvconf.TableType tableInfo, com.streambase.liveview.server.table.CatalogedTable baseCatalogedTable, boolean useDynamicStates) throws LiveViewException - Throws:
LiveViewException
-
hasDangerousConnection
public static boolean hasDangerousConnection(com.streambase.liveview.config.AbstractConfigObject configObject) -
addDependentTable
public void addDependentTable(com.streambase.liveview.server.table.CatalogedTable baseTable, String dependentTableName) It adds the dependent table name to the dependents maps that every table provider has.- Parameters:
baseTable
-dependentTableName
-
-