velosurf
Class Velosurf

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.lang.Object>
          extended by velosurf.context.DBReference
              extended by velosurf.Velosurf
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>, HasParametrizedGetter

public class Velosurf
extends DBReference

This class is the Velosurf main entry class if you do not use the toolbox.xml mechanism. Unless you specify the model file to use, it will successively search for a model file :

Author:
Claude Brisson
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
private  java.io.File configFile
          Configuration file.
private  boolean initialized
          Initialization flag.
 
Fields inherited from class velosurf.context.DBReference
db
 
Constructor Summary
Velosurf()
          Empty constructor.
Velosurf(java.io.File configFile)
          Constructor taking a File object as model configuration file.
Velosurf(java.io.InputStream config)
          Deprecated. use others constructor
Velosurf(java.lang.String config)
          Constructor taking a File object as model configuration file.
 
Method Summary
 java.lang.String deobfuscate(java.lang.Object value)
          De-obfuscate the given value.
private  void findConfig()
          Tries to find a model configuration file using some default locations.
 java.lang.Object get(java.lang.Object key)
          Generic getter.
 Database getDatabase()
          Allows to access the underlying velosurf.sql.Database object
 java.lang.String getSchema()
          Schema name getter.
private  void init()
          Lazzy initialization.
private  void init(java.io.InputStream config)
          Lazzy initialization.
private  void initLogging()
          Initializes the logger.
 java.lang.String obfuscate(java.lang.Object value)
          Obfuscate the given value.
 java.lang.Object put(java.lang.String key, java.lang.Object value)
          Generic setter.
 void setConfigFile(java.lang.String config)
          Explicitely set the model configuration file.
 
Methods inherited from class velosurf.context.DBReference
getEntity, getError, getUserContext, getWithParams, init, setUserContext, toString
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

initialized

private boolean initialized
Initialization flag.


configFile

private java.io.File configFile
Configuration file.

Constructor Detail

Velosurf

public Velosurf()
Empty constructor.


Velosurf

public Velosurf(java.lang.String config)
         throws java.io.IOException,
                java.sql.SQLException
Constructor taking a File object as model configuration file.

Parameters:
configFile - model configuration file
Throws:
java.io.IOException
java.sql.SQLException

Velosurf

public Velosurf(java.io.File configFile)
         throws java.io.IOException,
                java.sql.SQLException
Constructor taking a File object as model configuration file.

Parameters:
configFile - model configuration file
Throws:
java.io.IOException
java.sql.SQLException

Velosurf

public Velosurf(java.io.InputStream config)
         throws java.io.IOException,
                java.sql.SQLException
Deprecated. use others constructor

Constructor taking an InputStream object as model configuration.

Parameters:
config -
Throws:
java.io.IOException
java.sql.SQLException
Method Detail

setConfigFile

public void setConfigFile(java.lang.String config)
Explicitely set the model configuration file.

Parameters:
config - model configuration pathname

initLogging

private void initLogging()
Initializes the logger.


findConfig

private void findConfig()
Tries to find a model configuration file using some default locations.


init

private void init(java.io.InputStream config)
           throws java.sql.SQLException,
                  java.io.IOException
Lazzy initialization.

Parameters:
config - model configuration file input stream
Throws:
java.sql.SQLException
java.io.IOException

init

private void init()
           throws java.sql.SQLException,
                  java.io.IOException
Lazzy initialization.

Throws:
java.sql.SQLException
java.io.IOException

getDatabase

public Database getDatabase()
Allows to access the underlying velosurf.sql.Database object

Returns:
a Database object

get

public java.lang.Object get(java.lang.Object key)
Generic getter.

Specified by:
get in interface java.util.Map<java.lang.String,java.lang.Object>
Overrides:
get in class DBReference
Parameters:
key -
Returns:
property

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Generic setter.

Specified by:
put in interface java.util.Map<java.lang.String,java.lang.Object>
Overrides:
put in class DBReference
Parameters:
key -
value -
Returns:
old value

getSchema

public java.lang.String getSchema()
Schema name getter.

Overrides:
getSchema in class DBReference
Returns:
the name of the current schema

obfuscate

public java.lang.String obfuscate(java.lang.Object value)
Obfuscate the given value.

Overrides:
obfuscate in class DBReference
Parameters:
value - value to obfuscate
Returns:
obfuscated value

deobfuscate

public java.lang.String deobfuscate(java.lang.Object value)
De-obfuscate the given value.

Overrides:
deobfuscate in class DBReference
Parameters:
value - value to de-obfuscate
Returns:
obfuscated value


~ooOoo~