com.metamatrix.platform.config.persistence.impl.jdbc
Class JDBCPersistentConnection

java.lang.Object
  extended by com.metamatrix.platform.config.persistence.impl.jdbc.JDBCPersistentConnection
All Implemented Interfaces:
PersistentConnection

public class JDBCPersistentConnection
extends java.lang.Object
implements PersistentConnection


Constructor Summary
JDBCPersistentConnection(java.sql.Connection conn, ConfigurationModelContainerAdapter adapter, java.util.Properties props)
           
 
Method Summary
 void beginTransaction()
           
 void close()
          call close when the connection is no longer needed.
 void commit()
           
 void delete(ConfigurationID configID, java.lang.String principal)
          Writes the collection of models to its persistent store based on the implementation of the persistent connection.
protected  void finalize()
           
 int getServerState()
          Returns the int startup state, use constants in StartupStateController to interpret the meaning
 java.util.Date getStartupTime()
          Call to get the current state
 boolean isClosed()
          call to determine is the connection is still available.
 ConfigurationModelContainer read(ConfigurationID configID)
          Returns an ConfigurationModelContainer based on how the implementation read configuation information
 void rollback()
           
 void setServerStarted()
          Call to set the startup state to @see {StartupStateController.STARTED Started}.
 void setServerStarting()
          Call to set the startup state to @see {StartupStateController.STARTING Starting}.
 void setServerStarting(boolean force)
          Call to forcibly set the startup state to @see {StartupStateController.STARTING Starting}, regardless of the current state of the server.
 void setServerStopped()
          Call to set the startup state to @see {StartupStateController.STOPPED Stopped}.
 void write(ConfigurationModelContainer config, java.lang.String principalName)
          Writes the model to its persistent store based on the implementation of the persistent connection.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCPersistentConnection

public JDBCPersistentConnection(java.sql.Connection conn,
                                ConfigurationModelContainerAdapter adapter,
                                java.util.Properties props)
Method Detail

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

close

public void close()
Description copied from interface: PersistentConnection
call close when the connection is no longer needed. This resource will be cleaned up.

Specified by:
close in interface PersistentConnection

isClosed

public boolean isClosed()
Description copied from interface: PersistentConnection
call to determine is the connection is still available.

Specified by:
isClosed in interface PersistentConnection
Returns:
boolean true if the connection is available

setServerStarting

public void setServerStarting()
                       throws StartupStateException,
                              ConfigurationException
Call to set the startup state to @see {StartupStateController.STARTING Starting}. The server must be in the STOPPED state in order for this to work. Otherwise, a StartpStateException will be thrown.

Specified by:
setServerStarting in interface PersistentConnection
Throws:
StartupStateException - is thrown if the server state is not currently set to STOPPED.
ConfigurationException

setServerStarting

public void setServerStarting(boolean force)
                       throws StartupStateException,
                              ConfigurationException
Call to forcibly set the startup state to @see {StartupStateController.STARTING Starting}, regardless of the current state of the server.

Specified by:
setServerStarting in interface PersistentConnection
Throws:
StartupStateException - is thrown if the server state cannot be set.
ConfigurationException

setServerStarted

public void setServerStarted()
                      throws StartupStateException,
                             ConfigurationException
Call to set the startup state to @see {StartupStateController.STARTED Started}. The server must be in the STARTING state in order for this to work. Otherwise, a StartpStateException will be thrown.

Specified by:
setServerStarted in interface PersistentConnection
Throws:
StartupStateException - is thrown if the server state cannot be set.
ConfigurationException

setServerStopped

public void setServerStopped()
                      throws StartupStateException,
                             ConfigurationException
Call to set the startup state to @see {StartupStateController.STOPPED Stopped}. This is normally called when the system is shutdown.

Specified by:
setServerStopped in interface PersistentConnection
Throws:
StartupStateException - is thrown if the server state cannot be set.
ConfigurationException

getServerState

public int getServerState()
                   throws ConfigurationException
Returns the int startup state, use constants in StartupStateController to interpret the meaning

Specified by:
getServerState in interface PersistentConnection
Returns:
int state @see {StartupStateController Controller}
Throws:
ConfigurationException - if an error occurs

getStartupTime

public java.util.Date getStartupTime()
                              throws ConfigurationException
Call to get the current state

Specified by:
getStartupTime in interface PersistentConnection
Returns:
int state @see {StartupStateController Controller}
Throws:
ConfigurationException - if an error occurs

read

public ConfigurationModelContainer read(ConfigurationID configID)
                                 throws ConfigurationException
Returns an ConfigurationModelContainer based on how the implementation read configuation information

Specified by:
read in interface PersistentConnection
Parameters:
configID - indicates which configuration to read
Returns:
ConfigurationModel
Throws:
ConfigurationException - if an error occurs

write

public void write(ConfigurationModelContainer config,
                  java.lang.String principalName)
           throws ConfigurationException
Writes the model to its persistent store based on the implementation of the persistent connection.

Specified by:
write in interface PersistentConnection
Parameters:
model - to be writen to output
principal - is the user executing the write
Throws:
ConfigurationException - if an error occurs

delete

public void delete(ConfigurationID configID,
                   java.lang.String principal)
            throws ConfigurationException
Writes the collection of models to its persistent store based on the implementation of the persistent connection.

Specified by:
delete in interface PersistentConnection
Parameters:
models - to be writen to output
principal - is the user executing the write
Throws:
ConfigurationException - if an error occurs

beginTransaction

public void beginTransaction()
                      throws ConfigurationException
Specified by:
beginTransaction in interface PersistentConnection
Throws:
ConfigurationException

commit

public void commit()
            throws ConfigurationException
Specified by:
commit in interface PersistentConnection
Throws:
ConfigurationException

rollback

public void rollback()
              throws ConfigurationException
Specified by:
rollback in interface PersistentConnection
Throws:
ConfigurationException


Copyright © 2009. All Rights Reserved.