Interface TableProviderControl

All Known Implementing Classes:
TableProviderControlImpl

public interface TableProviderControl
When implementing a TableProvider, you should hold on to the TableProviderControl that is passed to you in your initialize method. This will provide access to all the operations you will need to do in providing and removing Tables.
Since:
LiveView 1.6
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This will set the failedRetryCount to zero.
    void
    delete(String remappedName)
    Delete the table with this ID.
    void
    When a condition arises where the table provider is unable to service any of tables, but it does not wish to have its tables removed from the system.
    com.streambase.liveview.server.table.CatalogedTable
    getTable(String remappedName)
    Find the Table with this ID.
    Collection<com.streambase.liveview.server.table.CatalogedTable>
    Get a collection of all the CatalogedTables that belong to your TableProvider.
    void
    insert(com.streambase.liveview.server.table.CatalogedTable catalogedTable)
    Insert this Table.
    locateFile(String filename, boolean required)
    This will attempt to locate a file within the project.
    void
    setEnabled(String tableId, boolean enabled)
    Change the enabled state of an existing table.
    void
    Shut down the associated TableProvider.
    void
    update(com.streambase.liveview.server.table.CatalogedTable catalogedTable)
    Update this Table.
    void
    upsert(com.streambase.liveview.server.table.CatalogedTable catalogedTable)
    Insert or Update the Table, depending on whether or not it already exists.
  • Method Details

    • setEnabled

      void setEnabled(String tableId, boolean enabled) throws LiveViewException
      Change the enabled state of an existing table. This is a shortcut over update when you only need to enable or disable the Table. However, it will not update anything else in the Table.
      Parameters:
      tableId - The ID of the Table to change.
      enabled - The new state to change it to.
      Throws:
      LiveViewException - if attempting to set a table that does not exist enabled. (Setting a non-existant table disabled is ignored.)
    • getTable

      com.streambase.liveview.server.table.CatalogedTable getTable(String remappedName)
      Find the Table with this ID. If one doesn't exist, then it will return null.
      Parameters:
      remappedName - The ID by which the table is saved (i.e. the remapped name)
      Returns:
      null if no Table has that name.
    • getTables

      Collection<com.streambase.liveview.server.table.CatalogedTable> getTables()
      Get a collection of all the CatalogedTables that belong to your TableProvider. This list it returns is a copy of the real list, so it will not reflect any changes you might make.
      Returns:
      all the CatalogedTables that belong to your TableProvider
      Since:
      2.0.1
    • insert

      void insert(com.streambase.liveview.server.table.CatalogedTable catalogedTable)
      Insert this Table. It is an error if a Table with that ID already exists.
      Parameters:
      catalogedTable - The Table to insert. Note that the catalogedTable will be copied so further changes to it will not affect anything until you update or upsert.
    • update

      void update(com.streambase.liveview.server.table.CatalogedTable catalogedTable)
      Update this Table. It is an error if a Table with that ID does not already exist.
      Parameters:
      catalogedTable - The Table to insert. Note that the catalogedTable will be copied so further changes to it will not affect anything until you update or upsert.
    • upsert

      void upsert(com.streambase.liveview.server.table.CatalogedTable catalogedTable)
      Insert or Update the Table, depending on whether or not it already exists.
      Parameters:
      catalogedTable - The Table to insert. Note that the catalogedTable will be copied so further changes to it will not affect anything until you update or upsert.
    • delete

      void delete(String remappedName)
      Delete the table with this ID. It is an error if a Table with that ID does not already exist.
      Parameters:
      remappedName -
    • shutMeDown

      void shutMeDown()
      Shut down the associated TableProvider. This is called by the TableProvider upon his learning that his back end is no longer available. These steps will happen on your behalf: - Your tables will all be marked as disabled (which will prevent new queries) - All your active QueryListeners will be closed. This will cause your table's removeListener method to be called. - Your shutdown method will be called - (If you haven't already done so) all your tables will be removed from the Table List (as if you had called delete on them). - If requested in the LVConf or service call, after the specified delay a new instance of your TableProvider will be started up again with the same arguments.
    • disableAllAndRestart

      void disableAllAndRestart()
      When a condition arises where the table provider is unable to service any of tables, but it does not wish to have its tables removed from the system. This method will mark the providers tables as disabled and schedule a restart, if the provider has been so configured. The table provider is responsible for closing any active queries if it can no longer service them.
    • clearRetryCount

      void clearRetryCount()
      This will set the failedRetryCount to zero. The failedRetryCount is compared to the MaxRetryCount value that was set by the user in the LVConf (or the web service). This method will be called automatically if your start() method returns normally. However, if you keep the start thread and use it to poll your server (which you are welcome to do), then you should call this method yourself once you've successfully connected.
    • locateFile

      File locateFile(String filename, boolean required) throws LiveViewException
      This will attempt to locate a file within the project.
      Parameters:
      filename - indicates a file in the LiveView project
      required - if true, this method will throw an exception if the file can't be found.
      Returns:
      reference to the actual file, or null if it could not be found (or filename was empty) and required was false.
      Throws:
      LiveViewException - thrown if the required flag was true and either filename was empty or it couldn't find the file.