Class BrowserModel
java.lang.Object
xal.service.pvlogger.apputils.browser.BrowserModel
BrowserModel is the main document model.
- Author:
- tap
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BrowserModelListener
protected ChannelGroup
protected boolean
protected String[]
protected final MessageCenter
protected PVLogger
protected MachineSnapshot[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBrowserModelListener
(BrowserModelListener listener) Add a listener of model events from this model.void
connect()
Connect to the database with the default connection dictionaryvoid
connect
(ConnectionDictionary dictionary) Connect to the database with the specified connection dictionaryprotected String[]
Fetch the available logger types from the data store.void
fetchMachineSnapshots
(Date startTime, Date endTime) Fetch the machine snapshots that were taken between the selected times.String[]
Get the array of available logger types.Get the selected channel groupGet the array of machine snapshots that had been fetched.boolean
Determine if we have successfully connected to the database.populateSnapshot
(MachineSnapshot snapshot) Populate the machine snapshot with all of its data.void
Populate all fetched machine snapshots with all of their data.void
Remove the listener from receiving model events from this model.selectGroup
(String type) Select the specified channel group corresponding to the logger type.void
setDatabaseConnection
(Connection connection, ConnectionDictionary dictionary) Set the database connection to the one specified.
-
Field Details
-
messageCenter
-
eventProxy
-
hasConnected
protected boolean hasConnected -
pvLogger
-
loggerTypes
-
snapshots
-
group
-
-
Constructor Details
-
BrowserModel
public BrowserModel()Constructor
-
-
Method Details
-
addBrowserModelListener
Add a listener of model events from this model.- Parameters:
listener
- the listener to add for receiving model events.
-
removeBrowserModelListener
Remove the listener from receiving model events from this model.- Parameters:
listener
- the listener to remove from receiving model events.
-
setDatabaseConnection
Set the database connection to the one specified.- Parameters:
connection
- the new database connection
-
connect
Connect to the database with the default connection dictionary- Throws:
DatabaseException
- if the connection or schema fetch fails
-
connect
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
Fetch the available logger types from the data store.- Returns:
- an array of available logger types.
- Throws:
SQLException
-
getLoggerTypes
Get the array of available logger types.- Returns:
- the array of available logger types.
- Throws:
SQLException
-
selectGroup
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
Get the selected channel group- Returns:
- the selected channel group
-
getSnapshots
Get the array of machine snapshots that had been fetched.- Returns:
- the array of machine snapshots
-
fetchMachineSnapshots
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 rangeendTime
- the end time of the range- Throws:
SQLException
-
populateSnapshots
Populate all fetched machine snapshots with all of their data.- Throws:
SQLException
-
populateSnapshot
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
-