SRJRCFrames
v0.1.296

de.schwarzrot.app.config.support
Class AbstractSysConfig

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by de.schwarzrot.data.support.AbstractEntity
          extended by de.schwarzrot.app.config.support.AbstractConfigBase
              extended by de.schwarzrot.app.config.ApplicationConfig
                  extended by de.schwarzrot.app.config.support.AbstractSysConfig
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, DBConfig, Entity, Serializable, Comparable<Entity>
Direct Known Subclasses:
DesktopConfig, ServiceConfig

public abstract class AbstractSysConfig
extends ApplicationConfig
implements DBConfig

configuration base class for database clients. All properties are supposed to be system properties

Author:
Reinhard Mantey
See Also:
Serialized Form

Constructor Summary
AbstractSysConfig()
           
AbstractSysConfig(AbstractSysConfig other)
           
 
Method Summary
 void dump()
           
 String getDbType()
          returns the type of a data storage.
 Map<String,DriveMapping> getDriveMappings()
           
 String getDrvClassName()
          returns the classname of the JDBC driver
 File getDrvLibPath()
          returns the path of the jar-file that contains a jdbc-driver
 String getDrvUrl()
          returns the url used by the JDBC driver to access a data storage
 String getDsDB()
          returns the name of a data storage
 String getDsHost()
          returns the hostname of the data storage server
 String getDsPassword()
          returns the password used to access a data storage
 String getDsSchema()
          SRJRCFrames supports database schema usage even on databases, that don't support schemata.
 String getDsUser()
          returns the username used to access a data storage
 Map<String,String> getMappings()
          returns a map with mappings of logical property names to physical property names (column names in database terms).
 String getPluginDir()
           
 Map<String,Integer> getSkipList()
          startupSize and startupPosition are virtual properties, which are calculated at first access.
 Map<String,Boolean> getSupportedDBDrivers()
           
 List<String> getUserAttributes()
          return a list of properties, that are user attributes.
 void getValuesFrom(DBConfig other)
           
 boolean isSetupNeeded()
           
 void setDbType(String dbType)
          sets the type of the database (currently only mysql supported)
 void setDriveMappings(Map<String,DriveMapping> m)
           
 void setDrvClassName(String drvClassName)
          sets the classname of the JDBC-driver
 void setDrvLibPath(File drvLibPath)
           
 void setDrvUrl(String url)
          sets the url to access the data storage
 void setDsDB(String dsDB)
          sets the name of the data storage, i.e. the name of a database
 void setDsHost(String dsHost)
          sets the hostname of the server, that hosts the data storage
 void setDsPassword(String dsPassword)
          sets the password used to access the data storage
 void setDsSchema(String dsSchema)
          sets the default schema used by applications.
 void setDsUser(String dsUser)
          sets the user used to access the data storage
 void setMappings(Collection<DriveMapping> list)
           
 void setPluginDir(String pluginDir)
           
 void setSetupNeeded(boolean setupNeeded)
           
 
Methods inherited from class de.schwarzrot.app.config.ApplicationConfig
getArchive, getExtraTBOrientation, getStartupHeight, getStartupPosition, getStartupSize, getStartupWidth, getStartupX, getStartupY, getVersion, setArchive, setExtraTBOrientation, setStartupHeight, setStartupPosition, setStartupSize, setStartupWidth, setStartupX, setStartupY, setVersion, validate
 
Methods inherited from class de.schwarzrot.app.config.support.AbstractConfigBase
getPersistenceName, getSystemClass, isUserType
 
Methods inherited from class de.schwarzrot.data.support.AbstractEntity
adoptChildren, adoptChildren, adoptGroupedChildren, compareTo, equals, getCModified, getCode, getDefaultOrder, getDtCreated, getDtModified, getId, getLogger, getSchemaName, getUCreated, getUModified, getUniqColumnNames, getVariantColumnName, getVariantTypeMap, hashCode, isDirty, isVirtual, setCModified, setDirty, setDtCreated, setDtModified, setId, setSchemaName, setUCreated, setUModified, toString
 
Methods inherited from class com.jgoodies.binding.beans.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jgoodies.binding.beans.Observable
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

AbstractSysConfig

public AbstractSysConfig()

AbstractSysConfig

public AbstractSysConfig(AbstractSysConfig other)
Method Detail

dump

public void dump()

getDbType

public String getDbType()
Description copied from interface: DBConfig
returns the type of a data storage. Currently only mysql databases supported

Specified by:
getDbType in interface DBConfig
Returns:
- the type of the data storage

getDriveMappings

public final Map<String,DriveMapping> getDriveMappings()

getDrvClassName

public final String getDrvClassName()
Description copied from interface: DBConfig
returns the classname of the JDBC driver

Specified by:
getDrvClassName in interface DBConfig
Returns:
- the classname of the JDBC driver

getDrvLibPath

public final File getDrvLibPath()
Description copied from interface: DBConfig
returns the path of the jar-file that contains a jdbc-driver

Specified by:
getDrvLibPath in interface DBConfig
Returns:
- the path of the jar-file that contains a jdbc-driver

getDrvUrl

public String getDrvUrl()
Description copied from interface: DBConfig
returns the url used by the JDBC driver to access a data storage

Specified by:
getDrvUrl in interface DBConfig
Returns:
- the url used by the JDBC driver to access a database

getDsDB

public final String getDsDB()
Description copied from interface: DBConfig
returns the name of a data storage

Specified by:
getDsDB in interface DBConfig
Returns:
- the name of a data storage, i.e. name of a database

getDsHost

public final String getDsHost()
Description copied from interface: DBConfig
returns the hostname of the data storage server

Specified by:
getDsHost in interface DBConfig
Returns:
- the hostname of the data storage server

getDsPassword

public final String getDsPassword()
Description copied from interface: DBConfig
returns the password used to access a data storage

Specified by:
getDsPassword in interface DBConfig
Returns:
- the password used to access the data storage

getDsSchema

public final String getDsSchema()
Description copied from interface: DBConfig
SRJRCFrames supports database schema usage even on databases, that don't support schemata. This support is seamless, so there is no difference for the user/developer in using a database that supports schemata or a database whithout that support.

Specified by:
getDsSchema in interface DBConfig
Returns:
- the default schema to use

getDsUser

public final String getDsUser()
Description copied from interface: DBConfig
returns the username used to access a data storage

Specified by:
getDsUser in interface DBConfig
Returns:
- the user name used to access the data storage

getMappings

public Map<String,String> getMappings()
Description copied from interface: Entity
returns a map with mappings of logical property names to physical property names (column names in database terms).

Every implementation should respect the parents mappings. The following sample shows different mapping types:

 public Map<String, String> getMappings() {
     Map<String, String> mappings = super.getMappings();
     mappings.put("title", "name");
     mappings.put("streams", Stream.class.getName());
     mappings.put("pageDefinitions", "pageType|" + ThemeElement.class.getName());
     return mappings;
 }
 
The mappings explained:
"title" -> "name"
the logical "title"-attribute is stored to persistence with a physical name "name"
"streams" -> Stream.class.getName()
the "streams" property holds related children. Unknown children are hold in a List, known (named) children are hold in a Map. The mapped value is used as classname to create child instances.
"pageDefinitions" -> "pageType|" + ThemeElement.class.getName()
pageDefinitions is a property of type Map, that holds grouped children. Known children are hold by a Map, unknown children by a List, so "pageDefinitions" may contain elements of type Map, or List. pageType, a property of ThemeElement, is used to group the children. The word before the '|' is the property name used as key value for grouping and the type after '|' is used to create instances.

Specified by:
getMappings in interface Entity
Overrides:
getMappings in class AbstractEntity
Returns:
a Map with property names as keys and column names as values.

getPluginDir

public final String getPluginDir()

getSkipList

public Map<String,Integer> getSkipList()
Description copied from class: ApplicationConfig
startupSize and startupPosition are virtual properties, which are calculated at first access. So these properties should not go to persistence.

Specified by:
getSkipList in interface Entity
Overrides:
getSkipList in class ApplicationConfig
Returns:
a Map

getSupportedDBDrivers

public Map<String,Boolean> getSupportedDBDrivers()
Specified by:
getSupportedDBDrivers in interface DBConfig
Overrides:
getSupportedDBDrivers in class AbstractConfigBase

getUserAttributes

public List<String> getUserAttributes()
Description copied from interface: Entity
return a list of properties, that are user attributes. Default is to return null to signal, that all properties are user attributes. In case this entity is a system entity, there may exists attributes, that may be overridded by users. So return a list of those attributes.

Specified by:
getUserAttributes in interface Entity
Overrides:
getUserAttributes in class ApplicationConfig
Returns:
a list of property names

getValuesFrom

public void getValuesFrom(DBConfig other)

isSetupNeeded

public final boolean isSetupNeeded()

setDbType

public void setDbType(String dbType)
Description copied from interface: DBConfig
sets the type of the database (currently only mysql supported)

Specified by:
setDbType in interface DBConfig
Parameters:
dbType - - the type of the data storage

setDriveMappings

public final void setDriveMappings(Map<String,DriveMapping> m)

setDrvClassName

public final void setDrvClassName(String drvClassName)
Description copied from interface: DBConfig
sets the classname of the JDBC-driver

Specified by:
setDrvClassName in interface DBConfig
Parameters:
drvClassName - - the classname of the driver

setDrvLibPath

public final void setDrvLibPath(File drvLibPath)

setDrvUrl

public void setDrvUrl(String url)
Description copied from interface: DBConfig
sets the url to access the data storage

Specified by:
setDrvUrl in interface DBConfig
Parameters:
url - - url used to access the data storage

setDsDB

public final void setDsDB(String dsDB)
Description copied from interface: DBConfig
sets the name of the data storage, i.e. the name of a database

Specified by:
setDsDB in interface DBConfig
Parameters:
dsDB - - name of the data storage

setDsHost

public final void setDsHost(String dsHost)
Description copied from interface: DBConfig
sets the hostname of the server, that hosts the data storage

Specified by:
setDsHost in interface DBConfig
Parameters:
dsHost - - hostname of data storage server

setDsPassword

public final void setDsPassword(String dsPassword)
Description copied from interface: DBConfig
sets the password used to access the data storage

Specified by:
setDsPassword in interface DBConfig
Parameters:
dsPassword - - password for data storage

setDsSchema

public final void setDsSchema(String dsSchema)
Description copied from interface: DBConfig
sets the default schema used by applications. SRJRCFrames supports database schema usage even on databases, that don't support schemata. This support is seamless, so there is no difference for the user/developer in using a database that supports schemata or a database whithout that support.

Specified by:
setDsSchema in interface DBConfig
Parameters:
dsSchema - - the default schema name

setDsUser

public final void setDsUser(String dsUser)
Description copied from interface: DBConfig
sets the user used to access the data storage

Specified by:
setDsUser in interface DBConfig
Parameters:
dsUser - - user for data storage

setMappings

public final void setMappings(Collection<DriveMapping> list)

setPluginDir

public final void setPluginDir(String pluginDir)

setSetupNeeded

public final void setSetupNeeded(boolean setupNeeded)

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.