|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultTreeModel
edu.harvard.mgh.purcell.gCLINE.data.Record
public abstract class Record
This class manages the operation annotations. As an extention of DefaultTreeModel that allows Record to be pass to a JTree constructor for the user to interact with. Notes: All files are identified by their full file names. All operation names are unique.
Nested Class Summary | |
---|---|
private static class |
Record.myHostKeyValidator
This is a host key validator that automatically accepts any host key sent but doesn't actually save any of them. |
Field Summary | |
---|---|
private com.sshtools.j2ssh.SshClient |
conn
conn is a SshClient that we use to connect with a remote server. |
static java.lang.String |
DEFAULT_EDITOR
This is the default text editor. |
StartFrame |
frame
frame is a StartFrame (an extention of JFrame) that holds the main GUI. |
protected java.util.Properties |
globalConfig
globalConfig is a Properties that holds the global configuration data. |
private java.util.HashMap<java.lang.String,java.lang.String> |
globalFileNotes
globalFileNotes is a HashMap |
boolean |
isNew
isNew is a boolean that flags if this Record is new or recreated from stored data. |
protected java.util.Properties |
localConfig
localConfig is a Properties that holds the local project configuration data. |
private static org.apache.log4j.Logger |
logger
logger is a Logger that optionally log messages for debugging/troubleshooting. |
Lock |
myLock
myLock is a Lock that keeps track of the permissions to work on this project. |
private java.lang.String |
OP_LOG_EXT
OP_LOG_EXT is a String that identifies the file extention for the operation log file. |
protected java.util.Properties |
remoteConfig
remoteConfig is a Properties that holds the information for the remote connection. |
AutoUpdater |
update
update is an AutoUpdater that automatically checks the home directory for new files and updates the displays. |
Fields inherited from class javax.swing.tree.DefaultTreeModel |
---|
asksAllowsChildren, listenerList, root |
Fields inherited from interface edu.harvard.mgh.purcell.gCLINE.data.KeyWords |
---|
BROWSE_KEY, CLINE_KEY, COMMAND_KEY, COMMAND_PREFIX_KEY, FILE_KEY, FOLDER_KEY, GLOBAL_CONFIG, HOME_KEY, HOST_KEY, INFILE_KEY, LOCAL_DIR, LOCAL_FOLDER_KEY, LOCAL_UPDATE_INTERVAL_KEY, LOCK_FILE, META_FILE, NAME_KEY, OP_KEY, OUTFILE_KEY, P1_KEY, P2_KEY, P3_KEY, P4_KEY, PORT_KEY, REMOTE_CONFIG_FILE, REMOTE_FOLDER_KEY, REMOTE_GLOBAL_CONFIG, REMOTE_UPDATE_INTERVAL_KEY, TIMESTAMP_KEY, USER_EDITOR_KEY, USER_KEY, VS_KEY |
Constructor Summary | |
---|---|
Record()
Create a Record with null or empty fields. |
|
Record(StartFrame f)
Create a Record initalized to a particular StartFrame. |
|
Record(StartFrame f,
java.lang.String localName)
Create a Record. |
|
Record(StartFrame f,
java.lang.String localName,
java.lang.String remoteFileName,
java.lang.String hostname,
java.lang.String username,
java.lang.String portnum,
com.sshtools.j2ssh.SshClient c)
Create a Record. |
Method Summary | |
---|---|
boolean |
addOperation(java.lang.String opName,
java.lang.String opDisc,
java.lang.String cline,
java.lang.String createTime,
java.util.Vector<java.lang.String[]> infiles,
java.util.Vector<java.lang.String[]> outfiles)
Add an operation to the info document, if there is an operation of that name then replace it with this new one. |
boolean |
backupInfo()
|
boolean |
connect()
|
static com.sshtools.j2ssh.SshClient |
connect(ErrorManager em,
javax.swing.JFrame frame,
java.lang.String host,
java.lang.String user,
int port)
Connect the ssh client. |
java.util.Vector<OperationInfo> |
getAllOp()
Get a list of all the operations |
java.lang.String |
getAltEditor()
Get the command for the alternative editor |
com.sshtools.j2ssh.SshClient |
getConn()
get the connection to the remote directory |
java.lang.String |
getGlobalNote(java.lang.String filename)
Get a specific file note |
java.util.Vector<java.lang.String> |
getHomeFiles()
Get a list of files that are in your working directory |
java.lang.String |
getHomeFolder()
Get the home folder that the data is stored in. |
java.io.File |
getLocalFolder()
Get the name of the local file |
int |
getLocalUpdateSec()
Get the local update period for the auto-updater. |
java.lang.String |
getLogExt()
|
OperationInfo |
getOp(java.lang.String opName)
Get the full information on an operation |
java.lang.String |
getP1()
Get the first project name |
java.lang.String |
getP2()
Get the second project name |
java.lang.String |
getP3()
Get the third project name |
java.lang.String |
getP4()
Get the forth project name |
java.lang.String |
getRemoteFolder()
Get the name of the remote file |
int |
getRemoteUpdateSec()
Get the remote update period for the auto-updater. |
boolean |
isRemote()
Is this record tied to a remote directory? |
boolean |
loadData(java.io.File metaFile,
java.lang.String homefile,
boolean remote)
Load the info document from xml file, otherwise set as default. |
private void |
loadGlobalConfig()
Load the config values from a Properties formated file. |
protected abstract void |
loadRemoteConfig()
|
private void |
populateNodes(org.w3c.dom.Document info)
Populate the operations and global file notes from a Document. |
private org.w3c.dom.Document |
processNodes()
Create a Document from the operations and global file notes that we can then write as an xml document easily. |
void |
properClosing()
Close the Record up properly. |
int |
removeOperation(java.lang.String opName)
Remove an operation from the document. |
void |
saveConfig()
Save the config values |
boolean |
saveInfo()
|
boolean |
saveInfo(java.io.File metaFile)
Write the information to the project file of the xml format. |
protected abstract void |
saveRemoteConfig()
|
void |
setAltEditor(java.lang.String editor)
Setter function for the alternative editor. |
abstract void |
setAutoUpdater(AutoUpdater given)
Setter function for the autoUpdater. |
void |
setConnData(com.sshtools.j2ssh.SshClient c,
java.lang.String host,
java.lang.String port,
java.lang.String user)
Setter function for the connection data |
void |
setGlobalFileDisc(java.lang.String fileName,
java.lang.String fileDisc)
Set a global file discriptor |
void |
setLastProject()
This function adds the current project to the head of the list of pervious projects. |
void |
setLocalUpdateSec(int sec)
Setter fuction for the local update period. |
void |
setLog(java.lang.String ext)
Setter function for the log extention |
void |
setP1(java.lang.String name)
Setter for the first project name. |
void |
setP2(java.lang.String name)
Setter for the second project name. |
void |
setP3(java.lang.String name)
Setter for the third project name. |
void |
setP4(java.lang.String name)
Setter for the forth project name. |
void |
setRemoteUpdateSec(int sec)
Setter function for the remote update period. |
java.lang.String |
toString()
Print the home folder of the record. |
Methods inherited from class javax.swing.tree.DefaultTreeModel |
---|
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String DEFAULT_EDITOR
private java.lang.String OP_LOG_EXT
public StartFrame frame
protected java.util.Properties remoteConfig
protected java.util.Properties globalConfig
protected java.util.Properties localConfig
public boolean isNew
private java.util.HashMap<java.lang.String,java.lang.String> globalFileNotes
public Lock myLock
private com.sshtools.j2ssh.SshClient conn
public AutoUpdater update
private static org.apache.log4j.Logger logger
Constructor Detail |
---|
public Record()
public Record(StartFrame f)
f
- The StartFrame we are attaching this Record to.public Record(StartFrame f, java.lang.String localName)
f
- The StartFrame w are attaching this Record to.localName
- A String that is the name of the local
project folder for this project.public Record(StartFrame f, java.lang.String localName, java.lang.String remoteFileName, java.lang.String hostname, java.lang.String username, java.lang.String portnum, com.sshtools.j2ssh.SshClient c)
f
- The StartFrame w are attaching this Record to.localName
- A String that is the name of the local
project folder for this project.remoteFileName
- A String that is the name of the remote
project folder for this project.hostname
- A String that is the name of the remote hostusername
- A String that is the name of the user on the
remote host.portnum
- A String that is the port number we wish to
connect to.c
- A SshClient that is used to connect to the remote
host.Method Detail |
---|
public void setLocalUpdateSec(int sec)
sec
- an int that is the number of seconds between
runs of the auto-updater in local projects.public void setRemoteUpdateSec(int sec)
sec
- an int that is the number of seconds between
runs of the auto-updater in remote projects.public abstract void setAutoUpdater(AutoUpdater given)
public void setLog(java.lang.String ext)
ext
- a string discribing the log extentionpublic void setConnData(com.sshtools.j2ssh.SshClient c, java.lang.String host, java.lang.String port, java.lang.String user)
c
- an SshClient that is the actual connectionhost
- a String holding the host nameport
- a String holding the port numberuser
- a String holding the user namepublic void setAltEditor(java.lang.String editor)
editor
- a String that has the command for
the alternate editor.public void setLastProject()
public void setP1(java.lang.String name)
name
- a String that is the name of the projectpublic void setP2(java.lang.String name)
name
- a String that is the name of the projectpublic void setP3(java.lang.String name)
name
- a String that is the name of the projectpublic void setP4(java.lang.String name)
name
- a String that is the name of the projectpublic int getLocalUpdateSec()
public int getRemoteUpdateSec()
public java.lang.String getP1()
public java.lang.String getP2()
public java.lang.String getP3()
public java.lang.String getP4()
public java.lang.String getAltEditor()
public com.sshtools.j2ssh.SshClient getConn()
public java.lang.String getRemoteFolder()
public java.io.File getLocalFolder()
public java.lang.String getHomeFolder()
public java.util.Vector<java.lang.String> getHomeFiles()
public java.lang.String getGlobalNote(java.lang.String filename)
filename
- A string that is the file name
public java.util.Vector<OperationInfo> getAllOp()
public OperationInfo getOp(java.lang.String opName)
opName
- A string that is the name of the operation
public java.lang.String getLogExt()
public boolean loadData(java.io.File metaFile, java.lang.String homefile, boolean remote)
metaFile
- the file that holds the xml documenthomefile
- the string that is our project root
private void populateNodes(org.w3c.dom.Document info)
info
- A document that holds all the global
discriptions and operatoin nodesprivate org.w3c.dom.Document processNodes()
private void loadGlobalConfig()
protected abstract void loadRemoteConfig()
protected abstract void saveRemoteConfig()
public void saveConfig()
public boolean addOperation(java.lang.String opName, java.lang.String opDisc, java.lang.String cline, java.lang.String createTime, java.util.Vector<java.lang.String[]> infiles, java.util.Vector<java.lang.String[]> outfiles)
opName
- The operation name.opDisc
- The discription of the operation.cline
- The command line that is tied to the operaitoninfiles
- A vector of the names of the input files.outfiles
- A vector of the names of the output files.
public int removeOperation(java.lang.String opName)
opName
- the name of the operation we are removing
public void setGlobalFileDisc(java.lang.String fileName, java.lang.String fileDisc)
fileName
- a string identifing the file (absolute path name)fileDisc
- a string for local file discriptionpublic boolean isRemote()
public boolean saveInfo()
public boolean backupInfo()
public boolean saveInfo(java.io.File metaFile)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean connect()
public static com.sshtools.j2ssh.SshClient connect(ErrorManager em, javax.swing.JFrame frame, java.lang.String host, java.lang.String user, int port)
public void properClosing()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |