com.metamatrix.platform.config.persistence.impl.file
Class FilePersistentConnection

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

public class FilePersistentConnection
extends java.lang.Object
implements PersistentConnection


Field Summary
static java.lang.String CONFIG_FILE_PATH_PROPERTY
          Defines the path location for the configuration files.
static java.lang.String CONFIG_NS_FILE_NAME_PROPERTY
          Defines the configuration file override to be used as NextStartup
static java.lang.String NEXT_STARTUP_FILE_NAME
          The actual name of the NextStart Configuration.
 
Constructor Summary
FilePersistentConnection(java.util.Properties props, ConfigurationModelContainerAdapter adapter)
           
 
Method Summary
 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.
 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 write(ConfigurationModelContainer model, java.lang.String principal)
          Writes the model to its persistent store based on the implementation of the persistent connection.
 void write(ConfigurationModelContainer model, java.lang.String fileName, java.lang.String principal)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_NS_FILE_NAME_PROPERTY

public static final java.lang.String CONFIG_NS_FILE_NAME_PROPERTY
Defines the configuration file override to be used as NextStartup

See Also:
Constant Field Values

CONFIG_FILE_PATH_PROPERTY

public static final java.lang.String CONFIG_FILE_PATH_PROPERTY
Defines the path location for the configuration files. If null then no path will be used and it assumed the file is in the classpath.

See Also:
Constant Field Values

NEXT_STARTUP_FILE_NAME

public static final java.lang.String NEXT_STARTUP_FILE_NAME
The actual name of the NextStart Configuration. If the user provides an override @see {#CONFIG_NS_FILE_NAME_PROPERTY}, then it will be copied to this name.

See Also:
Constant Field Values
Constructor Detail

FilePersistentConnection

public FilePersistentConnection(java.util.Properties props,
                                ConfigurationModelContainerAdapter adapter)
                         throws ConfigurationException
Throws:
ConfigurationException
Method Detail

close

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

Specified by:
close in interface PersistentConnection
Throws:
ConfigurationException

isClosed

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

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

read

public ConfigurationModelContainer read(ConfigurationID configID)
                                 throws ConfigurationException
Description copied from interface: PersistentConnection
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 model,
                  java.lang.String principal)
           throws ConfigurationException
Description copied from interface: PersistentConnection
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

write

public void write(ConfigurationModelContainer model,
                  java.lang.String fileName,
                  java.lang.String principal)
           throws ConfigurationException
Throws:
ConfigurationException

delete

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

Specified by:
delete in interface PersistentConnection
principal - is the user executing the write
Throws:
ConfigurationException - if an error occurs

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.