dbStorage
Class DataSetWorker

java.lang.Object
  extended by dbStorage.DataSetWorker

public class DataSetWorker
extends java.lang.Object


Nested Class Summary
 class DataSetWorker.ExternalDataSetInfoObj
           Title:
 
Field Summary
(package private) static org.apache.log4j.Category log
           
private  int MAX_DIMENSION
           
private  DataAccess oDataAccess
           
 
Constructor Summary
DataSetWorker()
           
 
Method Summary
 void bulkInsertData(java.lang.String filename)
           
 void bulkInsertDataNodeMapping(java.lang.String filename, java.lang.String datasetPath)
           
 boolean checkDatasetDirectFlag(java.lang.String datasetPath)
           
 int checkNewDataSet(java.lang.String path)
           
 void deleteData(S_DataSet oS_DataSet)
           removes a dataset/dictionary in the repository
 S_DataSet getData(java.lang.String name, java.lang.String path)
           gets Dictionary/Dataset in repository
 S_DataSet getDataSet(java.lang.String path)
           gets Dataset listing in repository
 S_DataSet getDataSetAndDic(java.lang.String dataSetPath)
          getDataSetAndDic
 java.util.Vector getDatasets()
           gets Dataset listing in repository
 java.util.Vector getDictionaries()
           gets Dictionary listing in repository
 S_DataSet getDictionary(java.lang.String dictionary_path)
           gets Dictionary in repository
 int[] getDSIDandDict(java.lang.String dataSetPath)
          Returns an integer array containing the data set ID and the dictionary ID for a given data set path.
 java.util.Vector<java.lang.String> getDSParameters(java.lang.String dataSetPath, int dsID)
           
 S_DataSet getExternalDataset(java.lang.String path)
          getExternalDataset This method will return an external dataset from the repository in an S_DataSet object
 java.util.List getExternalDatasetByDictionary(java.lang.String dictionaryPath)
          getExternalDatasetByDictionary This method will return a list of ExternalDataSetInfo objects that match the dictionary passed in.
 java.util.ArrayList getFileList(java.lang.String basePath, java.lang.String extension)
          This method gets a listing of the files or directories in the database
 java.util.ArrayList getNodeValuesDirect(java.lang.String nodeVariableName, java.lang.String datasetPath)
          getNodeValuesDirect
 java.sql.ResultSet getParameterValuesIndexesDirect(java.lang.String paramVarName, java.lang.String datasetPath)
          getParameterValuesIndexesDirect
 java.util.ArrayList getRelatedFiles(java.lang.String baseFilename)
          A method to return a list of related files given a base filename
 java.sql.ResultSet getTimeValuesDirect(java.lang.String timeVariableName, java.lang.String datasetPath)
          getTimeValuesDirect
 int getVariableID(int newDataID, java.lang.String varName)
          getVariableID
static void main(java.lang.String[] args)
           
 void updateData(S_DataSet oS_DataSet)
           updates a dataset/dictionary in the repository, adding it if need be
private  void updateDataset(S_DataSet oS_DataSet)
           updates a dataset in the repository, adding it if need be
 int updateDatasetDirect_NodeMapping(S_DataSet dataset)
           
 int updateDatasetDirect(S_DataSet dataset)
          updateDatasetDirect
 void updateDatasetNamePath(java.lang.String oldPath, java.lang.String newPath, java.lang.String newName)
          updateDatasetNamePath
private  void updateDictionary(S_DataSet oS_DataSet)
           updates a dictionary in the repository, adding it if need be
 void updateExternalDataset(S_DataSet oS_DataSet)
           updates an external dataset in the repository, adding it if need be
 void updateExternalVarValueDirect(int datasetID, S_Variable oS_Variable, int parameterID, S_Value oS_Value)
           
 void updateExternalVarValueDirect(int datasetID, S_Variable oS_Variable, int parameterID, S_Value oS_Value, java.io.PrintWriter out)
           
 void updateVarValueDirect(int datasetID, S_Variable oS_Variable, int parameterID, S_Value oS_Value)
           
 void updateVarValueDirect(int datasetID, S_Variable oS_Variable, int parameterID, S_Value oS_Value, java.io.PrintWriter out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DIMENSION

private int MAX_DIMENSION

oDataAccess

private DataAccess oDataAccess

log

static org.apache.log4j.Category log
Constructor Detail

DataSetWorker

public DataSetWorker()
Method Detail

getRelatedFiles

public java.util.ArrayList getRelatedFiles(java.lang.String baseFilename)
A method to return a list of related files given a base filename

Parameters:
baseFilename - String
Returns:
ArrayList

getFileList

public java.util.ArrayList getFileList(java.lang.String basePath,
                                       java.lang.String extension)
This method gets a listing of the files or directories in the database

Parameters:
basePath - String
extension - String
Returns:
ArrayList

checkDatasetDirectFlag

public boolean checkDatasetDirectFlag(java.lang.String datasetPath)
                               throws dbDirectException
Throws:
dbDirectException

checkNewDataSet

public int checkNewDataSet(java.lang.String path)
                    throws dbDirectException
Throws:
dbDirectException

getData

public S_DataSet getData(java.lang.String name,
                         java.lang.String path)
                  throws dbDirectException

gets Dictionary/Dataset in repository

Parameters:
name - String
path - String
Returns:
S_DataSet
Throws:
dbDirectException

updateData

public void updateData(S_DataSet oS_DataSet)
                throws dbDirectException

updates a dataset/dictionary in the repository, adding it if need be

Parameters:
oS_DataSet - S_DataSet
Throws:
dbDirectException

updateDatasetDirect

public int updateDatasetDirect(S_DataSet dataset)
                        throws dbDirectException
updateDatasetDirect

Parameters:
dataset - S_DataSet
Returns:
int
Throws:
dbDirectException

updateDatasetDirect_NodeMapping

public int updateDatasetDirect_NodeMapping(S_DataSet dataset)
                                    throws dbDirectException
Throws:
dbDirectException

bulkInsertData

public void bulkInsertData(java.lang.String filename)
                    throws dbDirectException
Throws:
dbDirectException

bulkInsertDataNodeMapping

public void bulkInsertDataNodeMapping(java.lang.String filename,
                                      java.lang.String datasetPath)
                               throws dbDirectException
Throws:
dbDirectException

updateDataset

private void updateDataset(S_DataSet oS_DataSet)
                    throws dbDirectException

updates a dataset in the repository, adding it if need be

Parameters:
oS_DataSet - S_DataSet
Throws:
dbDirectException

updateVarValueDirect

public void updateVarValueDirect(int datasetID,
                                 S_Variable oS_Variable,
                                 int parameterID,
                                 S_Value oS_Value)
                          throws dbDirectException
Throws:
dbDirectException

updateVarValueDirect

public void updateVarValueDirect(int datasetID,
                                 S_Variable oS_Variable,
                                 int parameterID,
                                 S_Value oS_Value,
                                 java.io.PrintWriter out)
                          throws dbDirectException
Throws:
dbDirectException

updateDictionary

private void updateDictionary(S_DataSet oS_DataSet)
                       throws dbDirectException

updates a dictionary in the repository, adding it if need be

Parameters:
oS_DataSet - S_DataSet
Throws:
dbDirectException

deleteData

public void deleteData(S_DataSet oS_DataSet)
                throws dbDirectException

removes a dataset/dictionary in the repository

Parameters:
oS_DataSet - S_DataSet
Throws:
dbDirectException

getDictionaries

public java.util.Vector getDictionaries()
                                 throws dbDirectException

gets Dictionary listing in repository

Returns:
Vector
Throws:
dbDirectException

getDatasets

public java.util.Vector getDatasets()
                             throws dbDirectException

gets Dataset listing in repository

Returns:
Vector
Throws:
dbDirectException

getDictionary

public S_DataSet getDictionary(java.lang.String dictionary_path)
                        throws dbDirectException

gets Dictionary in repository

Parameters:
dictionary_path - String
Returns:
S_DataSet
Throws:
dbDirectException

getDataSet

public S_DataSet getDataSet(java.lang.String path)
                     throws dbDirectException

gets Dataset listing in repository

Parameters:
path - String
Returns:
S_DataSet
Throws:
dbDirectException

getDataSetAndDic

public S_DataSet getDataSetAndDic(java.lang.String dataSetPath)
getDataSetAndDic

Parameters:
dataSetPath - String
Returns:
S_DataSet

getVariableID

public int getVariableID(int newDataID,
                         java.lang.String varName)
                  throws dbDirectException
getVariableID

Parameters:
newDataID - int
varName - String
Returns:
int
Throws:
dbDirectException

updateDatasetNamePath

public void updateDatasetNamePath(java.lang.String oldPath,
                                  java.lang.String newPath,
                                  java.lang.String newName)
                           throws dbDirectException
updateDatasetNamePath

Parameters:
oldPath - String
newPath - String
newName - String
Throws:
dbDirectException

getNodeValuesDirect

public java.util.ArrayList getNodeValuesDirect(java.lang.String nodeVariableName,
                                               java.lang.String datasetPath)
                                        throws dbDirectException
getNodeValuesDirect

Parameters:
nodeVariableName - String
datasetPath - String
Returns:
Vector
Throws:
dbDirectException

getTimeValuesDirect

public java.sql.ResultSet getTimeValuesDirect(java.lang.String timeVariableName,
                                              java.lang.String datasetPath)
                                       throws dbDirectException
getTimeValuesDirect

Parameters:
timeVariableName - String
datasetPath - String
Returns:
ResultSet
Throws:
dbDirectException

getParameterValuesIndexesDirect

public java.sql.ResultSet getParameterValuesIndexesDirect(java.lang.String paramVarName,
                                                          java.lang.String datasetPath)
                                                   throws dbDirectException
getParameterValuesIndexesDirect

Parameters:
paramVarName - String
datasetPath - String
Returns:
ResultSet
Throws:
dbDirectException

main

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

getExternalDatasetByDictionary

public java.util.List getExternalDatasetByDictionary(java.lang.String dictionaryPath)
                                              throws dbDirectException
getExternalDatasetByDictionary This method will return a list of ExternalDataSetInfo objects that match the dictionary passed in.

Parameters:
dictionaryPath - String
Returns:
List
Throws:
dbDirectException

getExternalDataset

public S_DataSet getExternalDataset(java.lang.String path)
                             throws dbDirectException
getExternalDataset This method will return an external dataset from the repository in an S_DataSet object

Parameters:
path - String
Returns:
S_DataSet
Throws:
dbDirectException

updateExternalDataset

public void updateExternalDataset(S_DataSet oS_DataSet)
                           throws dbDirectException

updates an external dataset in the repository, adding it if need be

Parameters:
oS_DataSet - S_DataSet
Throws:
dbDirectException

updateExternalVarValueDirect

public void updateExternalVarValueDirect(int datasetID,
                                         S_Variable oS_Variable,
                                         int parameterID,
                                         S_Value oS_Value)
                                  throws dbDirectException
Throws:
dbDirectException

updateExternalVarValueDirect

public void updateExternalVarValueDirect(int datasetID,
                                         S_Variable oS_Variable,
                                         int parameterID,
                                         S_Value oS_Value,
                                         java.io.PrintWriter out)
                                  throws dbDirectException
Throws:
dbDirectException

getDSIDandDict

public int[] getDSIDandDict(java.lang.String dataSetPath)
Returns an integer array containing the data set ID and the dictionary ID for a given data set path.

Parameters:
dataSetPath -
Returns:
array containing the dataset ID([0]) and the dictionary id ([1])

getDSParameters

public java.util.Vector<java.lang.String> getDSParameters(java.lang.String dataSetPath,
                                                          int dsID)