public class BrowserModel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ChannelGroup |
_group |
protected boolean |
_hasConnected |
protected java.lang.String[] |
_loggerTypes |
protected PVLogger |
_pvLogger |
protected MachineSnapshot[] |
_snapshots |
protected BrowserModelListener |
EVENT_PROXY |
protected MessageCenter |
MESSAGE_CENTER |
Constructor and Description |
---|
BrowserModel()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addBrowserModelListener(BrowserModelListener listener)
Add a listener of model events from this model.
|
void |
connect()
Connect to the database with the default connection dictionary
|
void |
connect(ConnectionDictionary dictionary)
Connect to the database with the specified connection dictionary
|
protected java.lang.String[] |
fetchLoggerTypes()
Fetch the available logger types from the data store.
|
void |
fetchMachineSnapshots(java.util.Date startTime,
java.util.Date endTime)
Fetch the machine snapshots that were taken between the selected times.
|
java.lang.String[] |
getLoggerTypes()
Get the array of available logger types.
|
ChannelGroup |
getSelectedGroup()
Get the selected channel group
|
MachineSnapshot[] |
getSnapshots()
Get the array of machine snapshots that had been fetched.
|
boolean |
hasConnected()
Determine if we have successfully connected to the database.
|
MachineSnapshot |
populateSnapshot(MachineSnapshot snapshot)
Populate the machine snapshot with all of its data.
|
void |
populateSnapshots()
Populate all fetched machine snapshots with all of their data.
|
void |
removeBrowserModelListener(BrowserModelListener listener)
Remove the listener from receiving model events from this model.
|
ChannelGroup |
selectGroup(java.lang.String type)
Select the specified channel group corresponding to the logger type.
|
void |
setDatabaseConnection(java.sql.Connection connection,
ConnectionDictionary dictionary)
Set the database connection to the one specified.
|
protected final MessageCenter MESSAGE_CENTER
protected final BrowserModelListener EVENT_PROXY
protected boolean _hasConnected
protected PVLogger _pvLogger
protected java.lang.String[] _loggerTypes
protected MachineSnapshot[] _snapshots
protected ChannelGroup _group
public void addBrowserModelListener(BrowserModelListener listener)
listener
- the listener to add for receiving model events.public void removeBrowserModelListener(BrowserModelListener listener)
listener
- the listener to remove from receiving model events.public void setDatabaseConnection(java.sql.Connection connection, ConnectionDictionary dictionary)
connection
- the new database connectionpublic void connect() throws DatabaseException
DatabaseException
- if the connection or schema fetch failspublic void connect(ConnectionDictionary dictionary) throws DatabaseException
dictionary
- The connection dictionaryDatabaseException
- if the connection or schema fetch failspublic boolean hasConnected()
protected java.lang.String[] fetchLoggerTypes() throws java.sql.SQLException
java.sql.SQLException
public java.lang.String[] getLoggerTypes() throws java.sql.SQLException
java.sql.SQLException
public ChannelGroup selectGroup(java.lang.String type) throws java.sql.SQLException
type
- the logger type identifying the channel groupjava.sql.SQLException
public ChannelGroup getSelectedGroup()
public MachineSnapshot[] getSnapshots()
public void fetchMachineSnapshots(java.util.Date startTime, java.util.Date endTime) throws java.sql.SQLException
startTime
- the start time of the rangeendTime
- the end time of the rangejava.sql.SQLException
public void populateSnapshots() throws java.sql.SQLException
java.sql.SQLException
public MachineSnapshot populateSnapshot(MachineSnapshot snapshot) throws java.sql.SQLException
snapshot
- the machine snapshot to populatejava.sql.SQLException