org.cofax
Class OracleDataStore

java.lang.Object
  |
  +--org.cofax.DataStore
        |
        +--org.cofax.OracleDataStore

public class OracleDataStore
extends DataStore

Provides database connectivity to an Oracle RDBMS for Cofax. Due to Oracle's vagaries this class contains a lot of Oracle specific code.


Field Summary
static java.util.HashMap clobColumns
          Hashmap into a determination of if stored procedures contain clobs is placed to speed transactions.
static java.util.HashMap dbPackageTags
          Hashmap into which package tags may be placed into memory upon initialization.
static java.util.HashMap dbPackageTagsCache
          Hashmap into which package tag results are cached.
static java.util.HashMap dbPackageTagsCacheCommand
          Hashmap into which the cache results parameter (1,0) is thrown upon initialization.
 
Fields inherited from class org.cofax.DataStore
CLOB_COLUMNS, dataLog, dataLogLocation, dataLogMaxSize, PACKAGE_TAG_CACHE, PACKAGE_TAG_CACHE_COMMAND, PACKAGE_TAG_PROCESSED, PACKAGE_TAG_RESULTS
 
Constructor Summary
OracleDataStore()
          Initializes variables.
 
Method Summary
static java.util.HashMap checkInstance(java.lang.String tag, java.lang.String key)
           
 void clearCache(int whichCache)
          Clears the cache indicated with whichCache
 oracle.sql.CLOB clobber(java.lang.String text)
           
 boolean connect(java.lang.String dbPool)
          Connects to the database using a connection established in the database pool properties file.
 boolean connectFromPool()
          Connects to the database using a connection established in the database poo
 void destroy()
          Destroys the connection pool.
 boolean disConnect(java.lang.String dataStoreName)
          Frees a connection from the database pool.
static java.lang.String fillToolsTag(java.util.HashMap ht, java.lang.String tag)
          Populates A SQL String with query values from a HashMap when String is formatted as: select req:value from etc.
 java.lang.Object getCacheValue(java.lang.Object key, int whichCache)
          Gets a single value from a cache object
 java.util.List getPackageData(java.util.HashMap data, java.lang.String tagName, java.lang.String tagData, boolean init)
          Returns a set of content by tag for stored procedures, inserts, updates, or selects.
 java.util.List getPackageData(java.lang.String tag, java.lang.String tagStatement)
          Executes the tag definition and prefixes the name of returned values with the tag name.
 java.lang.String getPackageTag(java.lang.String tag, java.util.HashMap params)
          Gets the stored procedure that is used for the packageTag request and parses it with its parameters.
 void init(java.util.Properties dbProps)
          To be ran once before using the data store.
 void init(java.lang.String configFile)
          Initializes the connection pool.
 void initPool()
          To be ran once before using the data store.
 boolean insertArticle(java.util.HashMap article, java.lang.String approvedBy, java.lang.String xmlFileType, java.util.ArrayList mappings, java.util.ArrayList relatedLinks)
          The main insertArticle routine.
 void setCache(java.lang.Object cache, int whichCache)
          Set's this data store's cache object and caches all package tags.
 
Methods inherited from class org.cofax.DataStore
getError, getLastError, setError, setLastError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clobColumns

public static java.util.HashMap clobColumns
Hashmap into a determination of if stored procedures contain clobs is placed to speed transactions.

dbPackageTagsCacheCommand

public static java.util.HashMap dbPackageTagsCacheCommand
Hashmap into which the cache results parameter (1,0) is thrown upon initialization.

dbPackageTags

public static java.util.HashMap dbPackageTags
Hashmap into which package tags may be placed into memory upon initialization.

dbPackageTagsCache

public static java.util.HashMap dbPackageTagsCache
Hashmap into which package tag results are cached.
Constructor Detail

OracleDataStore

public OracleDataStore()
Initializes variables.
Method Detail

init

public void init(java.lang.String configFile)
Initializes the connection pool.
Overrides:
init in class DataStore

init

public void init(java.util.Properties dbProps)
To be ran once before using the data store. With a pre-loaded Properties object.
Overrides:
init in class DataStore

initPool

public void initPool()
Description copied from class: DataStore
To be ran once before using the data store. With a pre-loaded Properties object.
Overrides:
initPool in class DataStore

setCache

public void setCache(java.lang.Object cache,
                     int whichCache)
Set's this data store's cache object and caches all package tags.
Overrides:
setCache in class DataStore

clearCache

public void clearCache(int whichCache)
Description copied from class: DataStore
Clears the cache indicated with whichCache
Overrides:
clearCache in class DataStore

getCacheValue

public java.lang.Object getCacheValue(java.lang.Object key,
                                      int whichCache)
Description copied from class: DataStore
Gets a single value from a cache object
Overrides:
getCacheValue in class DataStore

connectFromPool

public final boolean connectFromPool()
Connects to the database using a connection established in the database poo
Overrides:
connectFromPool in class DataStore

connect

public final boolean connect(java.lang.String dbPool)
Connects to the database using a connection established in the database pool properties file.
Overrides:
connect in class DataStore

getPackageTag

public final java.lang.String getPackageTag(java.lang.String tag,
                                            java.util.HashMap params)
Gets the stored procedure that is used for the packageTag request and parses it with its parameters.
Overrides:
getPackageTag in class DataStore
Following copied from class: org.cofax.DataStore
Parameters:
tag - The tag name. The Data Store must have a lookup table of names and definitions. the command.

getPackageData

public final java.util.List getPackageData(java.util.HashMap data,
                                           java.lang.String tagName,
                                           java.lang.String tagData,
                                           boolean init)
Returns a set of content by tag for stored procedures, inserts, updates, or selects. Handles clobs both on the way in and the way out.
Overrides:
getPackageData in class DataStore

getPackageData

public final java.util.List getPackageData(java.lang.String tag,
                                           java.lang.String tagStatement)
Description copied from class: DataStore
Executes the tag definition and prefixes the name of returned values with the tag name. Requires getting a tagStatement with getPackageTag()
Overrides:
getPackageData in class DataStore

disConnect

public final boolean disConnect(java.lang.String dataStoreName)
Frees a connection from the database pool.
Overrides:
disConnect in class DataStore

destroy

public void destroy()
Destroys the connection pool.
Overrides:
destroy in class DataStore

insertArticle

public boolean insertArticle(java.util.HashMap article,
                             java.lang.String approvedBy,
                             java.lang.String xmlFileType,
                             java.util.ArrayList mappings,
                             java.util.ArrayList relatedLinks)
The main insertArticle routine.
Overrides:
insertArticle in class DataStore

clobber

public oracle.sql.CLOB clobber(java.lang.String text)

fillToolsTag

public static java.lang.String fillToolsTag(java.util.HashMap ht,
                                            java.lang.String tag)
Populates A SQL String with query values from a HashMap when String is formatted as: select req:value from etc. Duplex method exists for package tags that have fulfillable values.

checkInstance

public static java.util.HashMap checkInstance(java.lang.String tag,
                                              java.lang.String key)


Copyright 2001 KnightRidder.com. All Rights Reserved.