Class BrowserModel

java.lang.Object
xal.service.pvlogger.apputils.browser.BrowserModel

public class BrowserModel extends Object
BrowserModel is the main document model.
Author:
tap
  • Field Details

  • Constructor Details

    • BrowserModel

      public BrowserModel()
      Constructor
  • Method Details

    • addBrowserModelListener

      public void addBrowserModelListener(BrowserModelListener listener)
      Add a listener of model events from this model.
      Parameters:
      listener - the listener to add for receiving model events.
    • removeBrowserModelListener

      public void removeBrowserModelListener(BrowserModelListener listener)
      Remove the listener from receiving model events from this model.
      Parameters:
      listener - the listener to remove from receiving model events.
    • setDatabaseConnection

      public void setDatabaseConnection(Connection connection, ConnectionDictionary dictionary)
      Set the database connection to the one specified.
      Parameters:
      connection - the new database connection
    • connect

      public void connect() throws DatabaseException
      Connect to the database with the default connection dictionary
      Throws:
      DatabaseException - if the connection or schema fetch fails
    • connect

      public void connect(ConnectionDictionary dictionary) throws DatabaseException
      Connect to the database with the specified connection dictionary
      Parameters:
      dictionary - The connection dictionary
      Throws:
      DatabaseException - if the connection or schema fetch fails
    • hasConnected

      public boolean hasConnected()
      Determine if we have successfully connected to the database. Note that this does not mean that the database connection is still valid.
      Returns:
      true if we have successfully connected to the database and false if not
    • fetchLoggerTypes

      protected String[] fetchLoggerTypes() throws SQLException
      Fetch the available logger types from the data store.
      Returns:
      an array of available logger types.
      Throws:
      SQLException
    • getLoggerTypes

      public String[] getLoggerTypes() throws SQLException
      Get the array of available logger types.
      Returns:
      the array of available logger types.
      Throws:
      SQLException
    • selectGroup

      public ChannelGroup selectGroup(String type) throws SQLException
      Select the specified channel group corresponding to the logger type.
      Parameters:
      type - the logger type identifying the channel group
      Returns:
      the channel group
      Throws:
      SQLException
    • getSelectedGroup

      public ChannelGroup getSelectedGroup()
      Get the selected channel group
      Returns:
      the selected channel group
    • getSnapshots

      public MachineSnapshot[] getSnapshots()
      Get the array of machine snapshots that had been fetched.
      Returns:
      the array of machine snapshots
    • fetchMachineSnapshots

      public void fetchMachineSnapshots(Date startTime, Date endTime) throws SQLException
      Fetch the machine snapshots that were taken between the selected times. Only identifier data is fetched into the machine snapshot.
      Parameters:
      startTime - the start time of the range
      endTime - the end time of the range
      Throws:
      SQLException
    • populateSnapshots

      public void populateSnapshots() throws SQLException
      Populate all fetched machine snapshots with all of their data.
      Throws:
      SQLException
    • populateSnapshot

      public MachineSnapshot populateSnapshot(MachineSnapshot snapshot) throws SQLException
      Populate the machine snapshot with all of its data.
      Parameters:
      snapshot - the machine snapshot to populate
      Returns:
      the machine snapshot that was populated (same object as the parameter)
      Throws:
      SQLException