DODS 7.3 API

org.enhydra.dods
Class Common

java.lang.Object
  extended by org.enhydra.dods.Common

public class Common
extends java.lang.Object


Field Summary
protected static java.util.HashMap changeAutocommit
          HashMap with changeAutocommit parameter value (from app conf file) for all logical databases (declared in same file) - default true
protected static java.lang.String configDir
          dods configuration switch property
protected static boolean configured
          dods configuration switch property
protected static java.lang.String customTemplateDir
          last used template dir
static java.lang.String DATABASE_MANAGER_CONF_FILE
          default app configuration file.
protected static java.lang.String dbase
          last used database read from doml file
protected static java.util.Properties dods_conf
          dods configuration property
static java.lang.String DODS_CONF_JAR_PATH
          dods configuration path (in dods-runtime.jar file )
protected static org.enhydra.xml.XMLConfig dodsConf
          dods configuration
protected static java.util.Vector dodsDriverClassVec
           
protected static java.util.HashMap dodsDriversMap
          dods driver-vendor map
protected static java.util.Vector dodsDriversNamesVec
          dods (driver_name/vendor) map
protected static java.util.HashMap dodsVendorConfs
          dods vendor configuration
protected static java.util.Vector dodsVendorsNamesVec
           
protected static java.lang.String domlfile
          last used doml file
protected static java.lang.String projRoot
          last used project root
protected static java.lang.String templateSet
          last used template set
static java.lang.String VENDOR_ORDERED_RESULT_SET
          Database Vendor driver specific configuration parameter name.
 
Constructor Summary
Common()
           
 
Method Summary
static java.lang.String capitalizeName(java.lang.String name)
          Transform specify name in capital letters.
static java.util.HashSet getAllTemplateSets()
          Get all template set directories.
static java.io.InputStream getConfFileFromURL(java.net.URL confURL, java.lang.String confFile)
          Get configuration file from URL as inputStream.
static java.lang.String getConfigDir()
          Get used configuration folder.
static java.lang.String getCustomTemplateDir()
          Get Custom Template configuration folder.
static java.lang.String getDatabaseDriverClassFromDriverName(java.lang.String driverMetadataName)
          Get database driver full class name for given driver name.
static java.lang.String getDatabaseVendor()
          Get used databse vendor.
static java.lang.String getDatabaseVendor(java.lang.String driverClassName)
          Get database vendor name for given driver class name.
static java.lang.String getDatabaseVendorFromDriverName(java.lang.String driverMetadataName)
          Get database vendor name for given driver class name.
static java.lang.String getDefaultConfigDir()
          Get default configuration folder.
static org.enhydra.xml.XMLConfig getDodsConf()
          Get dods configuration.
static java.lang.String getDodsConfProperty(java.lang.String key, java.lang.String database)
          Get dods conf property.
static java.util.Set getDodsConfVendorNames()
          Get dods conf property.
static java.lang.String getDodsEjenPropertyFilename()
          Get path to dods-ejen.properties.
static java.lang.String getDODSRoot()
          Get enhydra root.
static java.lang.String getDomlFile()
          Get used doml file.
static java.lang.String getDomlFileName()
          Get used doml file name.
static java.lang.String getExtensions()
          Get used extensions (template set).
static java.lang.String getFileName()
          Get file name from used doml file name.
static java.lang.String getForce()
          Get force parameter.
static java.lang.String getInstallProperties()
          Get install properties file.
static java.lang.String getInstallPropertiesParam()
          Get install properties file.
static java.lang.String getProjectRoot()
          Get used project root.
static java.lang.String getSplitSQLPrimary()
          Get used databse vendor.
static java.lang.String getTemplateDir()
          Get template directory.
static java.lang.String getTemplateSet()
          Get used template set.
static boolean isChangeAutocommitEnabled(java.lang.String dbName)
          Return changeAutocommit value for given datbase name.
static void main(java.lang.String[] args)
           
static int objectIdentityTypeStr2Int(java.lang.String objectIdentityTypeStr)
          Converts IdentityType String parameters to int
static java.lang.String replaceAll(java.lang.String input, java.lang.String forReplace, java.lang.String replaceWith)
          Replace all occurence of forReplace with replaceWith in input string.
static void setChangeAutocommit(java.lang.String dbName, boolean value)
          Sets value of changeAutocommit
static void setConfigDir(java.lang.String confD)
          Set used configuration folder.
static void setCustomTemplateDir(java.lang.String dirString)
          Set Custom Template configuration folder.
static void setDomlFile(java.lang.String doml)
          Set used doml file.
static void setProjectRoot(java.lang.String projectRoot)
          Set used project root.
static void setTemplateSet(java.lang.String set)
          Set used template set.
static void showDodsConf()
          Show dods.config properties.
static java.lang.String upperCaseName(java.lang.String name)
          Transform name in upper case name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VENDOR_ORDERED_RESULT_SET

public static final java.lang.String VENDOR_ORDERED_RESULT_SET
Database Vendor driver specific configuration parameter name. values: true/false

See Also:
Constant Field Values

configured

protected static boolean configured
dods configuration switch property


configDir

protected static java.lang.String configDir
dods configuration switch property


DODS_CONF_JAR_PATH

public static final java.lang.String DODS_CONF_JAR_PATH
dods configuration path (in dods-runtime.jar file )

See Also:
Constant Field Values

DATABASE_MANAGER_CONF_FILE

public static final java.lang.String DATABASE_MANAGER_CONF_FILE
default app configuration file.

See Also:
Constant Field Values

dods_conf

protected static java.util.Properties dods_conf
dods configuration property


dbase

protected static java.lang.String dbase
last used database read from doml file


dodsConf

protected static org.enhydra.xml.XMLConfig dodsConf
dods configuration


dodsVendorConfs

protected static java.util.HashMap dodsVendorConfs
dods vendor configuration


dodsDriversMap

protected static java.util.HashMap dodsDriversMap
dods driver-vendor map


dodsDriversNamesVec

protected static java.util.Vector dodsDriversNamesVec
dods (driver_name/vendor) map


dodsVendorsNamesVec

protected static java.util.Vector dodsVendorsNamesVec

dodsDriverClassVec

protected static java.util.Vector dodsDriverClassVec

projRoot

protected static java.lang.String projRoot
last used project root


domlfile

protected static java.lang.String domlfile
last used doml file


customTemplateDir

protected static java.lang.String customTemplateDir
last used template dir


changeAutocommit

protected static java.util.HashMap changeAutocommit
HashMap with changeAutocommit parameter value (from app conf file) for all logical databases (declared in same file) - default true


templateSet

protected static java.lang.String templateSet
last used template set

Constructor Detail

Common

public Common()
Method Detail

setChangeAutocommit

public static void setChangeAutocommit(java.lang.String dbName,
                                       boolean value)
Sets value of changeAutocommit

Parameters:
dbName - database name
value - value to set

isChangeAutocommitEnabled

public static boolean isChangeAutocommitEnabled(java.lang.String dbName)
Return changeAutocommit value for given datbase name.

Parameters:
dbName - databse name
Returns:
changeAutocommit value for given datbase name.

getDatabaseVendor

public static java.lang.String getDatabaseVendor(java.lang.String driverClassName)
Get database vendor name for given driver class name.

Parameters:
driverClassName - Class name.
Returns:
Database Vendor name.

getDatabaseVendorFromDriverName

public static java.lang.String getDatabaseVendorFromDriverName(java.lang.String driverMetadataName)
                                                        throws com.lutris.util.ConfigException
Get database vendor name for given driver class name.

Parameters:
driverMetadataName -
Returns:
Database Vendor name
Throws:
com.lutris.util.ConfigException

getDatabaseDriverClassFromDriverName

public static java.lang.String getDatabaseDriverClassFromDriverName(java.lang.String driverMetadataName)
                                                             throws com.lutris.util.ConfigException
Get database driver full class name for given driver name.

Parameters:
driverMetadataName -
Returns:
Database Vendor name.
Throws:
com.lutris.util.ConfigException

getDodsConf

public static org.enhydra.xml.XMLConfig getDodsConf()
Get dods configuration.

Returns:
Dods configuration.

getDodsConfProperty

public static java.lang.String getDodsConfProperty(java.lang.String key,
                                                   java.lang.String database)
Get dods conf property.

Parameters:
key - Key of the property.
database - Used database.
Returns:
Dods conf property.

showDodsConf

public static void showDodsConf()
Show dods.config properties.


getDodsConfVendorNames

public static java.util.Set getDodsConfVendorNames()
Get dods conf property.

Returns:
Dods conf vendor names.

getDodsEjenPropertyFilename

public static java.lang.String getDodsEjenPropertyFilename()
Get path to dods-ejen.properties.

Returns:
Path to dods-ejen.properties.

getDomlFile

public static java.lang.String getDomlFile()
Get used doml file.

Returns:
Used doml file.

getDomlFileName

public static java.lang.String getDomlFileName()
Get used doml file name.

Returns:
Used doml file name.

getFileName

public static java.lang.String getFileName()
Get file name from used doml file name.

Returns:
file name from used doml file name.

getDatabaseVendor

public static java.lang.String getDatabaseVendor()
Get used databse vendor.

Returns:
used databse vendor.

getSplitSQLPrimary

public static java.lang.String getSplitSQLPrimary()
Get used databse vendor.

Returns:
used databse vendor.

setDomlFile

public static void setDomlFile(java.lang.String doml)
Set used doml file.

Parameters:
doml - Used doml file.

setConfigDir

public static void setConfigDir(java.lang.String confD)
Set used configuration folder.

Parameters:
confD - Used configurationfolder.

getDefaultConfigDir

public static java.lang.String getDefaultConfigDir()
Get default configuration folder.


getConfigDir

public static java.lang.String getConfigDir()
Get used configuration folder.


getConfFileFromURL

public static java.io.InputStream getConfFileFromURL(java.net.URL confURL,
                                                     java.lang.String confFile)
                                              throws com.lutris.util.ConfigException
Get configuration file from URL as inputStream.

Parameters:
confURL - Aditional search path for configuration file (folder or *.jar). If null then system classPath is used
confFile - configuration file name (from folder or *.jar file). If null then try to get default configuraton file from org/enhydra/dods/conf/databaseManager.conf
Returns:
InputStream with configuration file. If can not found confFile or confFile==null then try to get default.
Throws:
com.lutris.util.ConfigException

setCustomTemplateDir

public static void setCustomTemplateDir(java.lang.String dirString)
Set Custom Template configuration folder.

Parameters:
dirString - path to template folder

getCustomTemplateDir

public static java.lang.String getCustomTemplateDir()
Get Custom Template configuration folder.


getProjectRoot

public static java.lang.String getProjectRoot()
Get used project root.

Returns:
Project root.

setProjectRoot

public static void setProjectRoot(java.lang.String projectRoot)
Set used project root.

Parameters:
projectRoot - Project root.

getTemplateSet

public static java.lang.String getTemplateSet()
Get used template set.

Returns:
template set.

setTemplateSet

public static void setTemplateSet(java.lang.String set)
Set used template set.

Parameters:
set - Template set.

getExtensions

public static java.lang.String getExtensions()
Get used extensions (template set).

Returns:
extensions (template set).

getForce

public static java.lang.String getForce()
Get force parameter.

Returns:
Force parameter.

getInstallProperties

public static java.lang.String getInstallProperties()
Get install properties file.

Returns:
Get dods.properties file.

getDODSRoot

public static java.lang.String getDODSRoot()
Get enhydra root.

Returns:
Enhydra root.

getInstallPropertiesParam

public static java.lang.String getInstallPropertiesParam()
Get install properties file.

Returns:
Install properties file.

getTemplateDir

public static java.lang.String getTemplateDir()
Get template directory.

Returns:
Template directory.

getAllTemplateSets

public static java.util.HashSet getAllTemplateSets()
Get all template set directories.

Returns:
all template set directories.

capitalizeName

public static java.lang.String capitalizeName(java.lang.String name)
Transform specify name in capital letters.

Parameters:
name - Class member name (column table name).
Returns:
Capitalized name.

upperCaseName

public static java.lang.String upperCaseName(java.lang.String name)
Transform name in upper case name.

Parameters:
name - Class member name (column table name).
Returns:
upper case name.

replaceAll

public static java.lang.String replaceAll(java.lang.String input,
                                          java.lang.String forReplace,
                                          java.lang.String replaceWith)
Replace all occurence of forReplace with replaceWith in input string.

Parameters:
input - represents input string
forReplace - represents substring for replace
replaceWith - represents replaced string value
Returns:
new string with replaced values

objectIdentityTypeStr2Int

public static int objectIdentityTypeStr2Int(java.lang.String objectIdentityTypeStr)
                                     throws com.lutris.util.ConfigException,
                                            java.lang.Exception
Converts IdentityType String parameters to int

Parameters:
objectIdentityTypeStr -
Throws:
com.lutris.util.ConfigException
java.lang.Exception

main

public static void main(java.lang.String[] args)

DODS 7.3 API