|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpl.mipl.mdms.FileService.komodo.ui.savannah.tools.SessionCache
public class SessionCache
Purpose: Session cache JavaBean is used to cache session settings information. The cached data can be persisted in XML format to assist restarting of session. The cache data is stored with file name: <servergroup>.<filetype>.<subtype>.<restart|notify>. It is created per file type.
Copyright 2008, California Institute of Technology. ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledge. 2008.
============================================================================ Modification History : ---------------------- Date Who What ---------------------------------------------------------------------------- 09/05/0008 Nick Initial Release ============================================================================
Constructor Summary | |
---|---|
SessionCache()
Default constructor - required by JavaBean encoding architecture |
|
SessionCache(String cacheFilename)
Constructor |
|
SessionCache(String outputDir,
int options,
String cacheFilename)
Constructor |
Method Summary | |
---|---|
static boolean |
canRestoreFromCache()
Checks if a cache file associated with the parameters exists. |
void |
commit()
Method to persist this cache JavaBean in XML format. |
protected void |
commitBackup()
Copies existing restart file to a backup version in the name of fault tolerance. |
protected void |
copyFile(File src,
File dst)
Copies file using standard Java I/O library. |
protected void |
copyFileNIO(File src,
File dst)
Copies file using NIO package. |
String |
getCacheFilename()
Accessor method to return the cache file name |
String |
getCurrentDirectory()
Accessor to file output directory |
String |
getLastQueryTime()
Accessor to obtain the last query time in CCSDS formated time string |
boolean |
getOption(int option)
Method to return the option value |
int |
getOptions()
|
protected void |
moveFile(File src,
File dst)
Renames source file to destination file. |
static SessionCache |
restoreFromCache()
Factory method to create a session cache. |
void |
setCacheFilename(String cacheFilename)
Method to set the cache file name |
void |
setCurrentDirectory(String outputDir)
Method to set the output directory |
void |
setLastQueryTime(long utc)
Method to set the last query time in UTC long integer |
void |
setLastQueryTime(String ccsds)
Method to set the last query time in CCSDS-formated time |
void |
setOption(int option,
boolean value)
|
void |
setOptions(int options)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SessionCache()
public SessionCache(String cacheFilename)
outputDir
- Output directoryoptions
- Session optionscacheFilename
- the cache file namepublic SessionCache(String outputDir, int options, String cacheFilename)
outputDir
- Output directoryoptions
- Session optionscacheFilename
- the cache file nameMethod Detail |
---|
public static SessionCache restoreFromCache()
public void setOptions(int options)
public int getOptions()
public void setOption(int option, boolean value)
public boolean getOption(int option)
option
- the option
public static boolean canRestoreFromCache()
servergroup
- Servergroup namefiletype
- Filetype namesubtype
- Sub-filetype namecommand
- Character associated with commandoutputDir
- Output directory pathoutputDir
- Output directory path
public String getCacheFilename()
public void setCacheFilename(String cacheFilename)
cacheFilename
- the cache file namepublic String getLastQueryTime()
public void setLastQueryTime(long utc)
utc
- the UTC long integerpublic void setLastQueryTime(String ccsds)
ccsds
- the CCSDS formated timepublic String getCurrentDirectory()
public void setCurrentDirectory(String outputDir)
outputDir
- the output directorypublic void commit() throws SessionException
SessionException
protected void commitBackup()
protected void moveFile(File src, File dst) throws IOException
src
- Source filedst
- Destination file
IOException
protected void copyFile(File src, File dst) throws IOException
src
- Source filedst
- Destination file
IOException
protected void copyFileNIO(File src, File dst) throws IOException
src
- Source filedst
- Destination file
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |