au.edu.jcu.hermes.core.browser
Class BrowserModel

java.lang.Object
  extended by au.edu.jcu.hermes.core.browser.BrowserModel
All Implemented Interfaces:
IBrowserModel

public class BrowserModel
extends java.lang.Object
implements IBrowserModel

Author: Mathew Wyatt. Organisation: James Cook University Date: Jul 31, 2007 Time: 3:03:02 AM Holds the state, and performs functionality of browsing a requested filesystem


Field Summary
 
Fields inherited from interface au.edu.jcu.hermes.core.browser.IBrowserModel
ERROR, IN_ROOT, NO_FILESYSTEM, OBJECT_ENTERED, OBJECT_SELECTED
 
Constructor Summary
BrowserModel(IFileSystemModel fileSystemModel)
          Constructor
 
Method Summary
 void addErrorMessageListener(java.awt.event.ActionListener actionListener)
          Invoked for passing error messages
 void addObjectEnteredListener(java.awt.event.ActionListener objectEnteredListener)
          Add listeners which wil be invoked when an object is entered into in the object browser
 void addObjectSelectedListener(java.awt.event.ActionListener actionListener)
          Listeners which will be invoked when a object is selected in the object browser
 void addRootEnteredListeners(java.awt.event.ActionListener actionListener)
          ActionListener to be invoked when the state of the model is in the root area
 void changePermission(ChangePermissionBean changePermBean)
           
 void createNewFolder(java.lang.String folderName)
          Creates a new folder object in the current directory given a name
 void createNewShortcut(Shortcut newShortcut)
           
 void deleteObject(FileObject fileObject)
           
 void deleteObjects(FileObject[] fileObjects)
          Deletes the given set of objects
 void disconnect(RootObject rootObject)
          Unount the filesystem of a selected root object
 FileObject getEnteredObject()
          Returns the current entered FileObject
 FileObject[] getEnteredObjectChildren()
          Returns the chilren objects of the current entered object
 FilePermissionBean getFilePermission(FileObject curFile)
          Returns a Map of key value pairs of file permission.
 RootObject[] getLocalResources()
          Returns the local drives
 RootObject[] getRemoteConnections()
          Returns remote connections
 FileObject getSelectedObject()
          Returns the selected Object
 java.util.List<Shortcut> getShortcuts()
           
 void goToLocation(java.lang.String uri)
          Attemps to load an objects contents given the URI of the object
 boolean isProcessing()
          If the browser model is processing a request returns true
 void refresh()
          Refreshes the model and updates the view
 void removeShortcut(Shortcut shortcut)
           
 void rename(RenameBean renameBean)
          Renames a given fileObject to a new name given inside the rename bean
 void setLogger(Logger logger)
           
 void setObjectEntered(FileObject file)
          Set the object entered into in the object browser
 void setObjectSelected(FileObject file)
          Sets the object selected in the object browser
 void setRootObjectEntered(RootObject rootObject)
          Enter a root object ie.
 void stepUp(FileObject fileObject)
          Steps up a directory in the directory hierarchy, based on the current parent file which is in view
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrowserModel

public BrowserModel(IFileSystemModel fileSystemModel)
Constructor

Parameters:
fileSystemModel - queried for filesystem conenctions
Method Detail

setLogger

public void setLogger(Logger logger)
Specified by:
setLogger in interface IBrowserModel

addObjectEnteredListener

public void addObjectEnteredListener(java.awt.event.ActionListener objectEnteredListener)
Add listeners which wil be invoked when an object is entered into in the object browser

Specified by:
addObjectEnteredListener in interface IBrowserModel

addObjectSelectedListener

public void addObjectSelectedListener(java.awt.event.ActionListener actionListener)
Listeners which will be invoked when a object is selected in the object browser

Specified by:
addObjectSelectedListener in interface IBrowserModel

addErrorMessageListener

public void addErrorMessageListener(java.awt.event.ActionListener actionListener)
Invoked for passing error messages

Specified by:
addErrorMessageListener in interface IBrowserModel

addRootEnteredListeners

public void addRootEnteredListeners(java.awt.event.ActionListener actionListener)
ActionListener to be invoked when the state of the model is in the root area

Specified by:
addRootEnteredListeners in interface IBrowserModel

setRootObjectEntered

public void setRootObjectEntered(RootObject rootObject)
Enter a root object ie. mounted filesystem

Specified by:
setRootObjectEntered in interface IBrowserModel

setObjectEntered

public void setObjectEntered(FileObject file)
Set the object entered into in the object browser

Specified by:
setObjectEntered in interface IBrowserModel

disconnect

public void disconnect(RootObject rootObject)
Unount the filesystem of a selected root object

Specified by:
disconnect in interface IBrowserModel

setObjectSelected

public void setObjectSelected(FileObject file)
Sets the object selected in the object browser

Specified by:
setObjectSelected in interface IBrowserModel

getSelectedObject

public FileObject getSelectedObject()
Returns the selected Object

Specified by:
getSelectedObject in interface IBrowserModel
Returns:

getLocalResources

public RootObject[] getLocalResources()
Returns the local drives

Specified by:
getLocalResources in interface IBrowserModel
Returns:

getRemoteConnections

public RootObject[] getRemoteConnections()
Description copied from interface: IBrowserModel
Returns remote connections

Specified by:
getRemoteConnections in interface IBrowserModel
Returns:

getEnteredObjectChildren

public FileObject[] getEnteredObjectChildren()
Returns the chilren objects of the current entered object

Specified by:
getEnteredObjectChildren in interface IBrowserModel
Returns:

getEnteredObject

public FileObject getEnteredObject()
Returns the current entered FileObject

Specified by:
getEnteredObject in interface IBrowserModel
Returns:

stepUp

public void stepUp(FileObject fileObject)
Steps up a directory in the directory hierarchy, based on the current parent file which is in view

Specified by:
stepUp in interface IBrowserModel

refresh

public void refresh()
Refreshes the model and updates the view

Specified by:
refresh in interface IBrowserModel

goToLocation

public void goToLocation(java.lang.String uri)
Attemps to load an objects contents given the URI of the object

Specified by:
goToLocation in interface IBrowserModel

createNewFolder

public void createNewFolder(java.lang.String folderName)
Creates a new folder object in the current directory given a name

Specified by:
createNewFolder in interface IBrowserModel

deleteObjects

public void deleteObjects(FileObject[] fileObjects)
Deletes the given set of objects

Specified by:
deleteObjects in interface IBrowserModel

deleteObject

public void deleteObject(FileObject fileObject)

rename

public void rename(RenameBean renameBean)
Renames a given fileObject to a new name given inside the rename bean

Specified by:
rename in interface IBrowserModel

changePermission

public void changePermission(ChangePermissionBean changePermBean)
Specified by:
changePermission in interface IBrowserModel

getFilePermission

public FilePermissionBean getFilePermission(FileObject curFile)
Description copied from interface: IBrowserModel
Returns a Map of key value pairs of file permission. This is based on SRB...

Specified by:
getFilePermission in interface IBrowserModel
Returns:

isProcessing

public boolean isProcessing()
If the browser model is processing a request returns true

Specified by:
isProcessing in interface IBrowserModel
Returns:

createNewShortcut

public void createNewShortcut(Shortcut newShortcut)
Specified by:
createNewShortcut in interface IBrowserModel

getShortcuts

public java.util.List<Shortcut> getShortcuts()
Specified by:
getShortcuts in interface IBrowserModel

removeShortcut

public void removeShortcut(Shortcut shortcut)
Specified by:
removeShortcut in interface IBrowserModel