agentland.help
Interface HelpFileManager

All Superinterfaces:
Agent, Good, Managed, Remote, Spy
All Known Implementing Classes:
HelpFileManagerAgent

public interface HelpFileManager
extends Managed

The interface for HelpFileManagerAgent. The HelpFileManagerAgent is the central HelpFile repository. This agent handles the loading of HelpFiles.

See Also:
Agent

Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Method Summary
 boolean add(Collection cHelpFileFullFileNames)
          Add a bunch of help files into the HelpFileManager's database.
 boolean add(String sHelpFileFullFileName)
          Add an XML help file to the database.
 void clear()
          Clears all the HelpFiles from this database.
 boolean contains(HelpFile hFile)
          Returns true if this has the HelpFile hFile.
 boolean contains(String sKeyword)
          Returns true if there exists a loaded HelpFile that has the given keyword.
 boolean contains(String sKeyword, HelpFile hFile)
          Returns true if this contains a HelpFile with a given keyword.
 void createInitialHelpFiles()
          Load the help files specified in the startup file.
 Vector get()
          Returns all the HelpFiles in this agent as a Vector.
 ArrayList get(String sKeyword)
          Returns the HelpFile with the given keyword.
 String getBasePath()
          Gets the directory where all the files are.
 String getHelpSetName()
          Gets the name of the helpset specified in the startup file.
 ArrayList getKeywords()
          Returns a Vector of all the keywords that exist in the loaded HelpFiles.
 HelpFile getLast()
          Returns the last accessed HelpFile.
 HelpFile getMost()
          Returns the most accessed HelpFile (the most popular).
 Vector getSorted()
          Returns in sorted order all the HelpFiles in this agent as a Vector.
 ArrayList getSubtopicNames()
          Gets a Vector of all the subtopic names.
 int size()
          Returns the number of HelpFiles loaded.
 boolean touch(HelpFile hFile)
          Update the internal container's counters relating to a given HelpFile.
 
Methods inherited from interface agentland.resource.Managed
getNeed, replace, replace, resources, yank, yank
 
Methods inherited from interface agentland.util.Good
getHistory, getHistoryElement, resetHistory
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, shutdown, startup, whereAreYou
 
Methods inherited from interface agentland.util.Spy
tell
 

Method Detail

get

public ArrayList get(String sKeyword)
              throws RemoteException
Returns the HelpFile with the given keyword. If the keyword is not found, then returns null.
Parameters:
sKeyword - a String value
Returns:
a Vector value
Throws:
RemoteException - if an error occurs

getLast

public HelpFile getLast()
                 throws RemoteException
Returns the last accessed HelpFile.
Returns:
a HelpFile value
Throws:
RemoteException - if an error occurs

getMost

public HelpFile getMost()
                 throws RemoteException
Returns the most accessed HelpFile (the most popular).
Returns:
a HelpFile value
Throws:
RemoteException - if an error occurs

getKeywords

public ArrayList getKeywords()
                      throws RemoteException
Returns a Vector of all the keywords that exist in the loaded HelpFiles. This is used by HelpSpeech to dynamically update the rule grammar.
Returns:
a Vector value
Throws:
RemoteException - if an error occurs

getSubtopicNames

public ArrayList getSubtopicNames()
                           throws RemoteException
Gets a Vector of all the subtopic names. This is used by HelpSpeech to dynamically set a grammar rule.
Returns:
a Vector value
Throws:
RemoteException - if an error occurs

contains

public boolean contains(HelpFile hFile)
                 throws RemoteException
Returns true if this has the HelpFile hFile. Otherwise returns false.
Parameters:
hFile - a HelpFile value
Returns:
a boolean value
Throws:
RemoteException - if an error occurs

contains

public boolean contains(String sKeyword)
                 throws RemoteException
Returns true if there exists a loaded HelpFile that has the given keyword. Otherwise returns false.
Parameters:
sKeyword - a String value
Returns:
a boolean value
Throws:
RemoteException - if an error occurs

contains

public boolean contains(String sKeyword,
                        HelpFile hFile)
                 throws RemoteException
Returns true if this contains a HelpFile with a given keyword. Otherwise returns false.
Parameters:
sKeyword - a String value
hFile - a HelpFile value
Returns:
a boolean value
Throws:
RemoteException - if an error occurs

size

public int size()
         throws RemoteException
Returns the number of HelpFiles loaded.
Returns:
an int value
Throws:
RemoteException - if an error occurs

touch

public boolean touch(HelpFile hFile)
              throws RemoteException
Update the internal container's counters relating to a given HelpFile. The counter is used to keep track of the number of accesses of each HelpFile.
Parameters:
hFile - a HelpFile value
Returns:
a boolean value
Throws:
RemoteException - if an error occurs

add

public boolean add(String sHelpFileFullFileName)
            throws RemoteException
Add an XML help file to the database.
Parameters:
sHelpFileFullFileName - a String value
Returns:
a boolean value
Throws:
RemoteException - if an error occurs

add

public boolean add(Collection cHelpFileFullFileNames)
            throws RemoteException
Add a bunch of help files into the HelpFileManager's database. The input Vector contains a list of the file names of the XML help files to be added, relative to the base directory (which is usually /hal/source/help/).
Parameters:
vHelpFileFullFileNames - a Vector value
Returns:
a boolean value
Throws:
RemoteException - if an error occurs

getBasePath

public String getBasePath()
                   throws RemoteException
Gets the directory where all the files are.
Returns:
a String value
Throws:
RemoteException - if an error occurs

getHelpSetName

public String getHelpSetName()
                      throws RemoteException
Gets the name of the helpset specified in the startup file.
Returns:
a String value
Throws:
RemoteException - if an error occurs

createInitialHelpFiles

public void createInitialHelpFiles()
                            throws RemoteException
Load the help files specified in the startup file.
Throws:
RemoteException - if an error occurs

get

public Vector get()
           throws RemoteException
Returns all the HelpFiles in this agent as a Vector. The HelpFiles in the Vector are sorted in order of their addition to the HelpFileManagerAgent.
Returns:
a Vector value
Throws:
RemoteException - if an error occurs

getSorted

public Vector getSorted()
                 throws RemoteException
Returns in sorted order all the HelpFiles in this agent as a Vector. The HelpFiles in the Vector are sorted based on the Comparable interface.
Returns:
a Vector value
Throws:
RemoteException - if an error occurs

clear

public void clear()
           throws RemoteException
Clears all the HelpFiles from this database.
Throws:
RemoteException - if an error occurs