com.metamatrix.platform.config.persistence.api
Interface PersistentConnection

All Known Implementing Classes:
FilePersistentConnection, JDBCPersistentConnection

public interface PersistentConnection


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.
 int getServerState()
          Call to get the current state
 java.util.Date getStartupTime()
          Call to get the startup time of the server.
 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 model, java.lang.String principal)
          Writes the model to its persistent store based on the implementation of the persistent connection.
 

Method Detail

close

void close()
call close when the connection is no longer needed. This resource will be cleaned up.

Throws:
ConfigurationException

isClosed

boolean isClosed()
call to determine is the connection is still available.

Returns:
boolean true if the connection is available

setServerStarting

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.

Throws:
StartupStateException - is thrown if the server state is not currently set to STOPPED.
ConfigurationException

setServerStarting

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.

Throws:
StartupStateException - is thrown if the server state cannot be set.
ConfigurationException

setServerStarted

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.

Throws:
StartupStateException - is thrown if the server state cannot be set.
ConfigurationException

setServerStopped

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.

Throws:
StartupStateException - is thrown if the server state cannot be set.
ConfigurationException

getServerState

int getServerState()
                   throws ConfigurationException
Call to get the current state

Returns:
int state @see {StartupStateController Controller}
Throws:
ConfigurationException - if an error occurs

getStartupTime

java.util.Date getStartupTime()
                              throws ConfigurationException
Call to get the startup time of the server. If the current state of the server is not @see {StartupStateController.STARTED STARTED}, then the return value will be null.

Returns:
time the server stated, may be null if not in a started state
Throws:
ConfigurationException - if an error occurs

read

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

Parameters:
configID - indicates which configuration to read
Returns:
ConfigurationModel
Throws:
ConfigurationException - if an error occurs

write

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

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

delete

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.

Parameters:
models - to be writen to output
principal - is the user executing the write
Throws:
ConfigurationException - if an error occurs

beginTransaction

void beginTransaction()
                      throws ConfigurationException
Throws:
ConfigurationException

rollback

void rollback()
              throws ConfigurationException
Throws:
ConfigurationException

commit

void commit()
            throws ConfigurationException
Throws:
ConfigurationException


Copyright © 2009. All Rights Reserved.