Next: Future Improvements
Up: The HsCommandAPI Service
Previous: The HsCommandAPI Service
The Command interface is fairly straightforward. It contains
a limited set of methods that allow for the basic abstracted
functionality necessary to fulfill teir task. Currently, classes that
implement Command provide:
- A name() method which returns the string name by which the
specific command shoule be invoked.
- A commandSig() method which returns the ``signature''
of the command (i.e. how it should be used.
- A help() method which returns some textual information
on the intent and usage of the command.
- And a fulfill() method which takes the arguments as
parsed by the HsCommandAPI and either processes them or
returns an error.
Haystack currently supports the following commands:
- AttachCommand (usage: attach [forward | back]
HaystackID1 HaystackID2, returns: boolean) Attach allows us to
connect two objects (with IDs HaystackID1 and
HaystackID2 respectively). The forward/back relationship
indicates the direction we want the link to take
(i.e. object1®object2 or object1¬objec2).
- CreateCommand (usage: create
type_of_new_object, returns: HaystackID) This command allows
us to create new objects of type type_of_new_object. On
success it returns the ID for the new object. (Example:
create haystack.object.bale.HaystackDocument).
- SetCommand (usage: set HaystackID
value_to_set, returns: boolean), this command allows you to set
the values of any Needle (indicated by HaystackID)
to some value (specifically, value_to_set). It returns 1
on success, 0 on failure.
- TerminateCommand (usage: terminate, returns:
boolean) This command causes the HaystackRootServer to shut
down. This is a ``clean'' shutdown which calls the close()
function on all services gets called.
- ViewCommand (usage: view HaystackID1, returns:
string) View returns the string representation of the Straw
with the given HaystackID.
Copyright 1998, Eytan Adar (eytan@alum.mit.edu)