|
|||||||||
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.SavannahModel
public class SavannahModel
Purpose: Application model for the Savannah application.
Copyright 2004, California Institute of Technology. ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledge. 2004.
============================================================================ Modification History : ---------------------- Date Who What ---------------------------------------------------------------------------- 06/02/2004 Nick Initial Release 08/22/2005 Nick Added shutdown handler to close session and terminate subscription manager. ============================================================================
Field Summary | |
---|---|
protected UserAuthenticator |
_authenticator
user authenticator instance |
protected java.beans.PropertyChangeSupport |
_changes
Enables bean property change event handling |
protected java.lang.String |
_currentFeiGroup
FEI server identifier |
protected java.lang.String |
_currentFeiType
FEI file type |
protected java.lang.String |
_domainFileKey
FEI Domain file property key |
protected java.net.URL |
_domainFileURL
filename of FEI domain file |
protected FileType |
_fileType
reference to FEI filetype connection |
protected SavannahFilterModel |
_filterModel
Regular expression filename filter for local files |
protected boolean |
_isBusy
flag indicating whether application is busy |
protected SavannahLogModel |
_logModel
log history model |
protected LogMessagePublisher |
_logPublisher
Logging publisher, log model is added as a listener |
protected java.lang.String |
_password
FEI password |
protected ReceivalHistoryModel |
_receivalModel
model for maintaining receival history |
protected java.awt.Component |
_relativeComponent
Component used as reference for error messages, can be null |
protected java.util.List |
_serverGroups
list of FEI server groups |
protected Session |
_session
reference to FEI Session object |
protected SavannahSessionModel |
_sessionModel
model for maintaining session settings |
protected java.lang.String |
_statusMessage
status message |
protected MetaSubscriptionManager |
_subscriptionManager
subscription manager field |
protected java.lang.Object |
_syncLock
lock for synchronization |
protected SavannahTransferModel |
_transferModel
transfer history model |
protected java.lang.String |
_username
FEI username |
static java.lang.String |
ABOUT_ICON_PATH
animated icon |
static java.lang.String |
APPLICATION_TITLE
application title |
static java.lang.String |
COPYRIGHT
copyright string |
static java.lang.String |
ICON_PATH
application icon |
static java.lang.String |
KOMODO_VERSION
client version string |
static int |
LOGIN_ATTEMPT_COUNT
Maximum login attempt count |
static int |
TARGET_FEI
|
static int |
TARGET_LOCAL
|
static java.lang.String |
VERSION_ID
application version id |
Constructor Summary | |
---|---|
SavannahModel()
Constructor. |
Method Summary | |
---|---|
protected void |
_addToFei(java.lang.String[] filenames)
Method to add a list of files to the current server |
protected void |
_changePassword(java.lang.String servergroup,
java.lang.String username,
java.lang.String oldPassword,
java.lang.String newPassword)
|
protected void |
_commentInFei(java.lang.String filename,
java.lang.String comment)
Sets or removes comment for an entry in FEI. |
protected void |
_deleteFromFei(java.lang.String[] filenames)
This method deletes files from current file type. |
protected void |
_getFromFei(java.lang.String[] filenames,
java.io.File dest)
This method gets files from the server to local directory This is the synchronous version of copyFromFei. |
protected void |
_renameInFei(java.lang.String origName,
java.lang.String newName)
Renames an entry in FEI to a new name. |
protected void |
_replaceToFei(java.lang.String[] filenames)
Method to replace a list of files to the current server. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds listener for property change of model. |
void |
addToFei(java.lang.String[] filenames)
Method to add a list of files to the current server |
boolean |
canUserConnect(java.lang.String username,
java.lang.String password,
java.lang.String servergroup,
java.lang.String filetype)
|
boolean |
canUserConnectNoEx(java.lang.String username,
java.lang.String password,
java.lang.String servergroup,
java.lang.String filetype)
|
protected void |
changeDirectory(java.io.File dir)
Change the local directory reference by Client object. |
boolean |
changePassword(java.lang.String servergroup,
java.lang.String username,
java.lang.String oldPassword,
java.lang.String newPassword)
|
protected void |
closeFileType(FileType filetype)
Attempts to close filetype with parameter name. |
void |
commentInFei(java.lang.String filename,
java.lang.String comment)
Sets or removes comment for an entry in FEI. |
protected boolean |
connectToFileType(java.lang.String type)
Attempts to connect to filetype after closing current filetype if necessary. |
void |
deleteFromFei(java.lang.String[] filenames)
This method deletes files from current file type. |
void |
destroy()
Closes all sessions and resets all references for sub-components. |
java.lang.String[] |
getAllFiletypes()
Returns array of all filetypes defined in the domain file of the current session instance. |
java.util.List |
getAvailableFeiServers()
Returns list of available FEI server groups. |
java.lang.String |
getCurrentFeiServer()
Returns the name of the current fei server group |
java.lang.String |
getCurrentFeiType()
Returns current FEI file type, null if none |
java.net.URL |
getDomainFile()
Returns current FEI domain filename used for this session. |
java.util.List |
getFeiTypes()
Returns a List of FEI types from the current FEI server |
SavannahFilterModel |
getFilterModel()
Returns reference to the file filter model. |
void |
getFromFei(java.lang.String[] filenames)
This method gets files from the server to local directory |
void |
getFromFei(java.lang.String[] filenames,
java.io.File destination)
This method gets files from the server to local directory |
java.io.File |
getLocalDirectory()
Returns current status to be displayed as part of GUI. |
SavannahLogModel |
getLoggingModel()
Returns reference to the logging model used by this object |
boolean |
getLoginInfo()
Displays dialog for user to enter username and password |
java.lang.String |
getPassword(java.lang.String username)
|
ReceivalHistoryModel |
getReceivalModel()
Returns reference to the receival model. |
java.awt.Component |
getRelativeComponent()
Returns reference to the relative component. |
SavannahSessionModel |
getSessionModel()
Returns reference to the session model used to maintain session state between session instances. |
java.lang.String |
getStatusMessage()
Returns current status to be displayed as part of GUI. |
MetaSubscriptionManager |
getSubscriptionManager()
Returns reference to the subscription manager used by this object |
SavannahTransferModel |
getTransferModel()
Returns reference to the transfer model used to track file transaction history. |
java.lang.String |
getUsername()
Returns current username for session |
protected void |
init()
Initializes model, loads properties, establishes server list |
protected void |
initSession()
Initializes client information including SSL keystore and FEI domain lookup service. |
boolean |
isBusy()
Returns model busy flag. |
protected boolean |
loadAuthenticator()
|
protected boolean |
loadFeiServerGroups()
Retrieves a list of server group names from the session object |
protected boolean |
loadSession(java.net.URL domainFileURL)
Loads new session object and replaces old session object if necessarry. |
protected void |
login()
Attempts to login to Client using username, password fields. |
void |
printDebug(java.lang.String msg)
Prints debug message to standard out if debug enabled. |
void |
propertyChange(java.beans.PropertyChangeEvent pce)
Implementation of the PropertyChangeListener interface. |
void |
refreshFeiServerGroups()
Requests refresh of FEI server group listing |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes listener for property change of model. |
void |
renameInFei(java.lang.String origName,
java.lang.String newName)
Renames an entry in FEI to a new name. |
void |
replaceToFei(java.lang.String[] filenames)
This method replaces a list of files to the current filetype |
void |
requestRefresh(int target)
Convenience method that requests a refresh for a file list based on parameter. |
void |
setAvailableFeiServers(java.util.List serverGroups)
Sets list of available FEI server groups. |
void |
setBusyFlag(boolean isBusy)
Sets model busy flag. |
void |
setCurrentFeiGroup(java.lang.String groupName)
Sets the current FEI server group according to the paraemeter |
void |
setCurrentFeiType(java.lang.String type)
Set current FEI file type |
void |
setDomainFile(java.net.URL domainFileURL,
boolean override)
Sets the domain filename according to non-null parameter. |
void |
setLocalDirectory(java.io.File localDir)
Set current local directory |
void |
setPassword(java.lang.String password)
Sets password for connection to FEI server groups |
void |
setRelativeComponent(java.awt.Component c)
Assign a relative component used for placement of error/warning messages. |
void |
setStatusMessage(java.lang.String statMsg)
Set current status message. |
void |
setUsername(java.lang.String username)
Sets username. |
java.util.List |
showFromFei()
Returns a list fo the files present in the current file type. |
protected boolean |
tryAuthenticating(java.lang.String groupName)
|
void |
unsetCurrentFeiGroup()
Unsets the current FEI server group by assigning null to it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TARGET_FEI
public static final int TARGET_LOCAL
public static final java.lang.String VERSION_ID
public static final java.lang.String APPLICATION_TITLE
public static final java.lang.String KOMODO_VERSION
public static final java.lang.String COPYRIGHT
public static final java.lang.String ICON_PATH
public static final java.lang.String ABOUT_ICON_PATH
public static final int LOGIN_ATTEMPT_COUNT
protected java.lang.String _domainFileKey
protected Session _session
protected FileType _fileType
protected final java.lang.Object _syncLock
protected java.lang.String _username
protected java.lang.String _password
protected java.lang.String _currentFeiGroup
protected java.lang.String _currentFeiType
protected java.lang.String _statusMessage
protected java.util.List _serverGroups
protected java.net.URL _domainFileURL
protected boolean _isBusy
protected java.beans.PropertyChangeSupport _changes
protected java.awt.Component _relativeComponent
protected SavannahTransferModel _transferModel
protected SavannahFilterModel _filterModel
protected LogMessagePublisher _logPublisher
protected SavannahLogModel _logModel
protected MetaSubscriptionManager _subscriptionManager
protected ReceivalHistoryModel _receivalModel
protected SavannahSessionModel _sessionModel
protected UserAuthenticator _authenticator
Constructor Detail |
---|
public SavannahModel()
Method Detail |
---|
protected void init()
protected void initSession()
protected boolean loadAuthenticator()
public SavannahTransferModel getTransferModel()
public SavannahSessionModel getSessionModel()
public SavannahFilterModel getFilterModel()
public ReceivalHistoryModel getReceivalModel()
public SavannahLogModel getLoggingModel()
public MetaSubscriptionManager getSubscriptionManager()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
l
- Object implementing the PropertyChangeListener interface to be
addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
l
- Object implementing the PropertyChangeListener interface to be
removedpublic void destroy()
protected boolean loadFeiServerGroups()
public void refreshFeiServerGroups()
public void setUsername(java.lang.String username)
username
- New usernamepublic java.lang.String getUsername()
public void setPassword(java.lang.String password)
password
- New password string, or null to resetprotected void login()
public java.lang.String getCurrentFeiServer()
public void unsetCurrentFeiGroup()
public void setCurrentFeiGroup(java.lang.String groupName) throws java.lang.IllegalArgumentException
groupName
- The name of the new FEI server group, or null to reset
java.lang.IllegalArgumentException
protected boolean tryAuthenticating(java.lang.String groupName)
protected boolean loadSession(java.net.URL domainFileURL)
domainFileURL
- URL of the FEI domain file
public boolean getLoginInfo()
public void setAvailableFeiServers(java.util.List serverGroups)
serverGroups
- List of FEI server groupspublic java.util.List getAvailableFeiServers()
public java.util.List getFeiTypes()
public void addToFei(java.lang.String[] filenames)
filenames
- String array of filenames to be addedprotected void _addToFei(java.lang.String[] filenames)
filenames
- String array of filenames to be addedpublic void replaceToFei(java.lang.String[] filenames)
filenames
- Array of filenames to copy to FEIprotected void _replaceToFei(java.lang.String[] filenames)
filenames
- Array of filenames to copy to FEIpublic void getFromFei(java.lang.String[] filenames, java.io.File destination)
filenames
- Array of filenames to be retreiveddestination
- Absolute path to destination directorypublic void getFromFei(java.lang.String[] filenames)
filenames
- Array of filenames to be retreivedprotected void _getFromFei(java.lang.String[] filenames, java.io.File dest)
filenames
- Array of filenames to be retreiveddest
- Destination directory of files. If null, then local
directory will be used. If different from local dir,
session will use parameter to copy files, then reset
to local directory before exiting.public void deleteFromFei(java.lang.String[] filenames)
filenames
- Array of filenames to be deletedprotected void _deleteFromFei(java.lang.String[] filenames)
filenames
- Array of filenames to be deletedpublic java.util.List showFromFei()
public void renameInFei(java.lang.String origName, java.lang.String newName)
origName
- Original name of the entrynewName
- New name of the entryprotected void _renameInFei(java.lang.String origName, java.lang.String newName)
origName
- Original name of the entrynewName
- New name of the entrypublic void commentInFei(java.lang.String filename, java.lang.String comment)
filename
- Filename of the entrycomment
- New comment of the entry, null resets comment.protected void _commentInFei(java.lang.String filename, java.lang.String comment)
fileame
- Filename of the entryComment
- New comment of the entry, null resets comment.protected void _changePassword(java.lang.String servergroup, java.lang.String username, java.lang.String oldPassword, java.lang.String newPassword)
protected void changeDirectory(java.io.File dir) throws SessionException
dir
- The updated local directory
SessionException
protected void closeFileType(FileType filetype)
protected boolean connectToFileType(java.lang.String type) throws SessionException
Filetype
- name, or null to reset filetype to nothing.
SessionException
public void setStatusMessage(java.lang.String statMsg)
statMsg
- Current status message.public java.lang.String getStatusMessage()
public void setLocalDirectory(java.io.File localDir)
localDir
- File pointing to new local directorypublic java.io.File getLocalDirectory()
public void setCurrentFeiType(java.lang.String type) throws SessionException
type
- new fiel type, null to reset
SessionException
public java.lang.String getCurrentFeiType()
public void setBusyFlag(boolean isBusy)
isBusy
- True if busy, false otherwise.public boolean isBusy()
public void setRelativeComponent(java.awt.Component c)
c
- Relative component to use, can be null.public java.awt.Component getRelativeComponent()
public void printDebug(java.lang.String msg)
msg
- Message to print.public void propertyChange(java.beans.PropertyChangeEvent pce)
propertyChange
in interface java.beans.PropertyChangeListener
public java.net.URL getDomainFile()
public void setDomainFile(java.net.URL domainFileURL, boolean override)
domainFilename
- New FEI domain fileoverride
- If domain filename is unchanged, override as true reloads
current file.
java.lang.IllegalArgumentException
- if domainFilename is null or refers to a
non-exising file.public void requestRefresh(int target)
target
- Refresh taret, one of TARGET_FEI or TARGET_LOCAL.public boolean canUserConnect(java.lang.String username, java.lang.String password, java.lang.String servergroup, java.lang.String filetype) throws SessionException
SessionException
public boolean canUserConnectNoEx(java.lang.String username, java.lang.String password, java.lang.String servergroup, java.lang.String filetype)
public boolean changePassword(java.lang.String servergroup, java.lang.String username, java.lang.String oldPassword, java.lang.String newPassword)
public java.lang.String[] getAllFiletypes()
public java.lang.String getPassword(java.lang.String username)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |