Package hec.heclib.dss
Class HecDSSFileAccess
java.lang.Object
hec.heclib.dss.HecDSSFileAccess
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
HecDssCatalog
,HecLocationManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static String
protected static String
protected HecDSSFileDataManager
static int
static int
protected static int
protected static Vector<DSSErrorMessage>
protected static boolean
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
appendNameToDirectory
(String directory, String name) static void
When called, catchSevereErrors() indicates that the calling software will check the status of severe errors after calls to the DSS software.int
checkAccessReset
(boolean forceReopen, int quiescentTimeMills) int
int
static boolean
boolean
checkForSevereError
(int[] dssTable) boolean
int
int
int
static boolean
cleanDSSFileName
(String inName, stringContainer outName) void
void
void
clearSevereError
(boolean reopenFile) void
clone()
void
close()
static void
void
closeAll()
static void
calling closeAllFiles should be avoided.void
void
int[]
debugLook
(long address, int numberWords) debugLook - a class only used for debugging file internalslong[]
debugLook7
(long address, int numberWords) void
debugModify
(long address, long value) debugModify - a class only used for debugging to change file internalsstatic String
static String
static boolean
doesDSSFileExist
(String dssFileName) void
done()
boolean
boolean
void
int
int
String[]
getCollectionList
(String seedPathname) Returns a string array of all the pathnames in a single collection in a DSS file.String[]
getCollectionSequenceList
(String seedPathname) Returns a string array of all the sequences in a single collection in a DSS file.int
getCollectionSize
(String seedPathname) Searches the database to count the number of records in a collection, given a pathname in the sequence Because this searches the database, it should be used sparingly Recommended to call getCollectionList(seedPathname) instead and use the size of that.int
static int
getDssFileVersion
(String dssFileName) void
getFileInfo
(stringContainer dssVersion, intContainer numberRecords, intContainer numberDeletedRecords, HecDouble pointerEfficiency, HecDouble fileSizeKbytes, HecDouble deadSpaceKbytes, HecTime creationDate, HecTime lastWriteTime) long
static int
getIrregBeginningDate
(String ePart, int jul, int[] year, int[] month, int[] day, int[] block) getIrregBeginningDate - an internal class to get the date of the beginning of an irregular time series blockstatic int
int
String[]
getPathnameList
(boolean forceUpdate) Deprecated.void
getProcessStatus
(int[] numberRecs, int[] currentRec) boolean
getTimeSeriesExtents
(String pathname, HecTime start, HecTime end) Gets the time of the first data and last data in a data set, (not just a single pathname)int
getTSRecordInfo
(String pathname, HecTime start, HecTime end, stringContainer units, stringContainer type) Get information about an individual time series record (pathname) This includes the time of the first and last values in the record, and the records units and type.boolean
nextTimeSeriesPathname
(String path) int
int
open()
int
static void
processStatus
(int[] numberRecs, int[] currentRec, int[] numberErrors) protected int[]
static void
setDefaultDirectory
(String directoryName) static void
setDefaultDSSFileName
(String dssFileName) static void
int
setDSSFileName
(String dssFileName) int
setDSSFileName
(String dssFileName, boolean fileMustExist) int
setDSSFileName
(String dssFileName, boolean fileMustExist, int dssVersion) int
setDSSFileName
(String dssFileName, int version) void
setInterrupt
(boolean interrupt) static void
setMessageLevel
(int level) int
setSpaceReclaimation
(boolean turnOn) int
setSpaceReclaimationPerm
(int reclaimLevel) static void
setUnit
(int unitNumber) boolean
static int
zgetMessageLevel
(int methodID) int
void
zinqir
(String parameter, stringContainer alpha, int[] number) long
void
static int
zquery
(String parameter, stringContainer alpha) static void
zquery
(String parameter, stringContainer alpha, int[] number) static void
int
static void
zsetMessageLevel
(int methodID, int levelID)
-
Field Details
-
MESS_LEVEL_NONE
public static final int MESS_LEVEL_NONE- See Also:
-
MESS_LEVEL_CRITICAL
public static final int MESS_LEVEL_CRITICAL- See Also:
-
MESS_LEVEL_TERSE
public static final int MESS_LEVEL_TERSE- See Also:
-
MESS_LEVEL_GENERAL
public static final int MESS_LEVEL_GENERAL- See Also:
-
MESS_LEVEL_USER_DIAG
public static final int MESS_LEVEL_USER_DIAG- See Also:
-
MESS_LEVEL_INTERNAL_DIAG_1
public static final int MESS_LEVEL_INTERNAL_DIAG_1- See Also:
-
MESS_LEVEL_INTERNAL_DIAG_2
public static final int MESS_LEVEL_INTERNAL_DIAG_2- See Also:
-
MESS_METHOD_GENERAL
public static final int MESS_METHOD_GENERAL- See Also:
-
MESS_METHOD_GLOBAL
public static final int MESS_METHOD_GLOBAL- See Also:
-
MESS_METHOD_GET
public static final int MESS_METHOD_GET- See Also:
-
MESS_METHOD_PUT
public static final int MESS_METHOD_PUT- See Also:
-
MESS_METHOD_READ
public static final int MESS_METHOD_READ- See Also:
-
MESS_METHOD_WRITE
public static final int MESS_METHOD_WRITE- See Also:
-
MESS_METHOD_PERM
public static final int MESS_METHOD_PERM- See Also:
-
MESS_METHOD_OPEN
public static final int MESS_METHOD_OPEN- See Also:
-
MESS_METHOD_CHECK
public static final int MESS_METHOD_CHECK- See Also:
-
MESS_METHOD_LOCKING
public static final int MESS_METHOD_LOCKING- See Also:
-
MESS_METHOD_TS_READ
public static final int MESS_METHOD_TS_READ- See Also:
-
MESS_METHOD_TS_WRITE
public static final int MESS_METHOD_TS_WRITE- See Also:
-
MESS_METHOD_ALIAS
public static final int MESS_METHOD_ALIAS- See Also:
-
MESS_METHOD_COPY
public static final int MESS_METHOD_COPY- See Also:
-
MESS_METHOD_UTILITY
public static final int MESS_METHOD_UTILITY- See Also:
-
MESS_METHOD_CATALOG
public static final int MESS_METHOD_CATALOG- See Also:
-
MESS_METHOD_FILE_CHECK
public static final int MESS_METHOD_FILE_CHECK- See Also:
-
MESS_METHOD_JNI
public static final int MESS_METHOD_JNI- See Also:
-
CONDENSED_CATALOG
public static final int CONDENSED_CATALOG- See Also:
-
ABBREVIATED_CATALOG
public static final int ABBREVIATED_CATALOG- See Also:
-
FULL_CATALOG
public static final int FULL_CATALOG- See Also:
-
_defaultDSSFileName
-
_defaultDirectory
-
_severeErrorIndex
protected static int _severeErrorIndex -
_severeErrorRaised
protected static boolean _severeErrorRaised -
_severeErrorMessages
-
_maxNumberReopensForError
public static int _maxNumberReopensForError -
_numberReopensForError
public static int _numberReopensForError -
_fileData
-
-
Constructor Details
-
HecDSSFileAccess
-
HecDSSFileAccess
public HecDSSFileAccess()
-
-
Method Details
-
catchSevereErrors
public static void catchSevereErrors()When called, catchSevereErrors() indicates that the calling software will check the status of severe errors after calls to the DSS software. Like Java's throw / catch proceedure, if a severe error is detected, and this statement has not been called, DSS will abort the process more damage to the DSS file and an excessive number of error messages. Errros can occur from a broken file link (a system error usually caused by how MS FAT handles files), or overwritten arrays (DSS tries to detect this before the file is damaged - one reason for the abort). Errors are checked by calling checkForSevereError(int dssTable[]) The error message is retrieved by calling lastSevereErrorMessage() Although the error flags may be cleared by clearSevereError(), it is usually best to print the error message and give the user a chance to save their files, then exit. This function only needs to be called once, at the beginning of the program. -
done
public void done() -
setDefaultDSSFileName
-
setDefaultDirectory
-
defaultDSSFileName
-
defaultDirectory
-
DSSFileName
-
fileOpened
public boolean fileOpened() -
fileAccessible
public boolean fileAccessible() -
getDssFileVersion
public int getDssFileVersion() -
getDssFileVersion
-
doesDSSFileExist
-
setUnit
public static void setUnit(int unitNumber) -
setDSSFileName
-
setDSSFileName
-
forceMultiUserAccess
public int forceMultiUserAccess() -
checkAccessReset
public int checkAccessReset(boolean forceReopen, int quiescentTimeMills) -
setSpaceReclaimation
public int setSpaceReclaimation(boolean turnOn) -
setSpaceReclaimationPerm
public int setSpaceReclaimationPerm(int reclaimLevel) -
isFileRemote
public boolean isFileRemote() -
setDSSFileName
-
setDSSFileName
-
open
-
open
public int open() -
close
public void close() -
closeDSSFile
public void closeDSSFile() -
closeAll
public void closeAll() -
closeAndClear
public void closeAndClear() -
close
-
closeAllFiles
public static void closeAllFiles()calling closeAllFiles should be avoided. better to call done() to release the file. A DSS file is similar to other files…. you open it, use it, and then close it. This is a lazy check to be sure everything is on disk at the very end of the program. could crash other programs that are actively using DSS files. quirk: doesn't do anything if CWMS_HOME environment variable is set -
requestSecondAccess
protected int[] requestSecondAccess() -
fileStatus
public void fileStatus() -
checkForSevereFileError
public boolean checkForSevereFileError() -
checkForSevereError
public boolean checkForSevereError(int[] dssTable) -
checkForSevereError
public static boolean checkForSevereError() -
checkForError
public int checkForError() -
clearError
public void clearError() -
clearSevereError
public void clearSevereError() -
clearSevereError
public void clearSevereError(boolean reopenFile) -
getLastError
-
lastSevereErrorMessage
-
allSevereErrorMessages
-
numberRecords
public int numberRecords() -
getNumberRecords
public int getNumberRecords() -
checkSystemError
public int checkSystemError() -
checkPathnameBins
public int checkPathnameBins() -
checkLinks
public int checkLinks() -
checkAllPathnames
public int checkAllPathnames() -
getFileLastWriteTime
-
getFileLastWriteTimeMillis
public long getFileLastWriteTimeMillis() -
getFileInfo
public void getFileInfo(stringContainer dssVersion, intContainer numberRecords, intContainer numberDeletedRecords, HecDouble pointerEfficiency, HecDouble fileSizeKbytes, HecDouble deadSpaceKbytes, HecTime creationDate, HecTime lastWriteTime) -
getProcessStatus
public void getProcessStatus(int[] numberRecs, int[] currentRec) -
setInterrupt
public void setInterrupt(boolean interrupt) -
clearStatus
public void clearStatus() -
getCollectionList
Returns a string array of all the pathnames in a single collection in a DSS file. Any of the pathnames from the collection can be used as a seed (defining the remainder of the pathname). The sequence for the seed does not have to exist (i.e., you can use "000000", even if there is not a pathname with the sequence 000000.- Parameters:
seedPathname
- String- Returns:
- String[]
-
getCollectionSequenceList
Returns a string array of all the sequences in a single collection in a DSS file. Any of the pathnames from the collection can be used as a seed (defining the remainder of the pathname).- Parameters:
seedPathname
- String- Returns:
- String[] sequences (e.g., "000042", "000053", ...)
-
getCollectionSize
Searches the database to count the number of records in a collection, given a pathname in the sequence Because this searches the database, it should be used sparingly Recommended to call getCollectionList(seedPathname) instead and use the size of that.- Parameters:
seedPathname
- String- Returns:
- int
-
cleanDSSFileName
-
appendNameToDirectory
-
zsetMessageLevel
public static void zsetMessageLevel(int methodID, int levelID) -
zgetMessageLevel
public static int zgetMessageLevel(int methodID) -
zset
-
zsetFile
-
processStatus
public static void processStatus(int[] numberRecs, int[] currentRec, int[] numberErrors) -
setMessageLevel
public static void setMessageLevel(int level) -
flushMessages
public int flushMessages() -
setDss
-
zinqir
-
zinquire
-
zinqir
-
zquery
-
getMessageLevel
public static int getMessageLevel() -
zquery
-
writeAccess
public boolean writeAccess() -
nextTimeSeriesPathname
-
debugLook
public int[] debugLook(long address, int numberWords) debugLook - a class only used for debugging file internals- Parameters:
address
- longnumberWords
- int
-
debugLook7
public long[] debugLook7(long address, int numberWords) -
debugModify
public void debugModify(long address, long value) debugModify - a class only used for debugging to change file internals- Parameters:
address
- int
-
getIrregBeginningDate
public static int getIrregBeginningDate(String ePart, int jul, int[] year, int[] month, int[] day, int[] block) getIrregBeginningDate - an internal class to get the date of the beginning of an irregular time series block- Parameters:
ePart
- Stringjul
- intyear
- int[]month
- int[]day
- int[]block
- int[]- Returns:
- int
-
getPathnameList
Deprecated.DEPRECIATED, use HecDssCatalog class. public String[] getCatalog(boolean sorted, String pathWithWildChars)- Returns:
- String[] - a sorted list of pathnames. Null or 0 if this function could not get a list This is here for compatibility only!
-
clone
-
getTSRecordInfo
public int getTSRecordInfo(String pathname, HecTime start, HecTime end, stringContainer units, stringContainer type) Get information about an individual time series record (pathname) This includes the time of the first and last values in the record, and the records units and type. This is for a single record, not an entire data set. Returns status of 0 = OK, ERROR = error -
getTimeSeriesExtents
Gets the time of the first data and last data in a data set, (not just a single pathname)- Parameters:
pathname
- Stringstart
- HecTime - time of first piece of dataend
- HecTime - time of last piece of data- Returns:
- boolean - true if found and time series; false if not TS
-
zmessage
-