| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.smartlab.config.Element
net.smartlab.config.Node
net.smartlab.config.Configuration
net.smartlab.config.SQLConfiguration
public final class SQLConfiguration
Represents a configuration expressed through a database table.
| Field Summary | |
|---|---|
| protected static java.lang.String | LAST_UPDATEName used to identify the last update time on the database. | 
| Fields inherited from class net.smartlab.config.Configuration | 
|---|
| listeners, monitor | 
| Fields inherited from class net.smartlab.config.Node | 
|---|
| attributes, children, content, resolved | 
| Fields inherited from class net.smartlab.config.Element | 
|---|
| name, parent | 
| Constructor Summary | |
|---|---|
| SQLConfiguration(java.sql.Connection connection)Constructs a configuration structure from a JDBC connection. | |
| SQLConfiguration(javax.sql.DataSource pool)Constructs a configuration structure from a JDBC data source. | |
| Method Summary | |
|---|---|
|  long | getLastUpdate(boolean set)Extracts the last modification timestamp from the underling database. | 
|  boolean | isChanged()This method checks if the source from the configuration structure was modified since it was last read. | 
|  void | setLastUpdate(long timestamp)Sets the last modification timestamp into the underling database. | 
|  void | update()Ensures the in memory representation of the configuration matches with the underlying representation. | 
| Methods inherited from class net.smartlab.config.Configuration | 
|---|
| addListener, check, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getListeners, getResolve, init, removeListener, resolve, setResolve | 
| Methods inherited from class net.smartlab.config.Node | 
|---|
| getAttribute, getAttributeNames, getAttributes, getContent, getElement, getElements, getElements, getId, resolve, setContent | 
| Methods inherited from class net.smartlab.config.Element | 
|---|
| getAttributeValues, getElement, getElement, getName, toString | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
protected static final java.lang.String LAST_UPDATE
| Constructor Detail | 
|---|
public SQLConfiguration(java.sql.Connection connection)
                 throws ConfigurationException
connection - the connection to use to retrieve informations from the
        database.
ConfigurationException
public SQLConfiguration(javax.sql.DataSource pool)
                 throws ConfigurationException
pool - the data source providing database connections.
ConfigurationException| Method Detail | 
|---|
public boolean isChanged()
                  throws ConfigurationException
Configuration
isChanged in class Configurationtrue if the underlying representation of the
         structure was modified since last read.
ConfigurationException - if something wrong occurred while
            checking the underlaying structure like the file is no more
            readable or the stream no more available.Configuration.isChanged()
public void update()
            throws ConfigurationException
Configuration
update in class ConfigurationConfigurationException - if the underlying representation of the
            structure is no more accessible or the decoding process fails
            due to an unappropriately initialized Cipher.Configuration.update()
public long getLastUpdate(boolean set)
                   throws ConfigurationException
set - specifies if the last modification time must be set if not
        found
ConfigurationException - if something unexpected happens trying to
         retrieve the last modification timestamp or if the corresponding
         parameter has not been defined.
public void setLastUpdate(long timestamp)
                   throws ConfigurationException
timestamp - the last modification timestamp to set.
ConfigurationException - f something unexpected happens trying to
         set the last modification timestamp.| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||