next up previous contents
Next: Conclusions Up: Haystack and Lore Integration Previous: The HsOEMGenerator Class

The HsLore Class

  The HsLore class is a simple event listener class that expresses interest in ObjectEvents. This implies that any change in the HDM trigers an event. Once HsLore is notified of an event, it will invoke the generateLorel() method of the Straw that caused the event. The generated string corresponds to the Lorel query that will update the database to the new state of the object.

Upon initialization HsLore opens a stream connection to the Lore process executing either locally on a remote machinegif. Once the Lorel update code has been generated by the Straw, HsLore will pass the query into Lore.

Unfortunately, at the time of this writing the Lorel update language has not been completely defined. The following is the Lorel syntax for updating the Lore database for Straws, Ties, and Needlesgif.

Lore allows us to refer to the globally named pointer directed at the current Straw by means of the Global!Identifier argument. For example, if a Straw with the HaystackID 253 is loaded into Lore, the Lore OEM object corresponding to that Straw can be accessed by Global!ID253. The Lorel to update a generic Straw with HaystackID x and type y is of the form:

Global!IDx := oem(HID:``x'', HTYPE:``y'',
FPOINTERS:oem(IDf1,IDf2,...,IDfn),
BPOINTERS:oem(IDb1,IDb2,...,IDbn));

The values of IDf1 - IDfn are simply the names of the global Lore pointers to the the forward objects of the Straw. For example, if the Straw has a forward pointer to some object with the HaystackID 494, then one of the IDfi values would be replaced with the string ID494.

For a Tie, the form of the Lorel query is very similar:

Global!IDx := oem(HID:``x'', HTYPE:``y'',
FPOINTERS:oem(IDf1,IDf2,...,IDfn),
BPOINTERS:oem(IDb1,IDb2,...,IDbn),
TIEFPOINTER:IDtfp, TIEBPOINTER:IDtbp);

Where IDtfp and IDtbp are the global OEM identifiers for the forward and backward pointers of the Tie respectively. Finally, an update for a Needle object is of the form:

Global!IDx := oem(HID:``x'', HTYPE:``y'',
FPOINTERS:oem(IDf1,IDf2,...,IDfn),
BPOINTERS:oem(IDb1,IDb2,...,IDbn),DATA:''data'');

Currently, we do not provide a simple method for the deletion of objects as Lore does not provide a mechanism to delete a global name. However, it is possible to disconnect the Straw from the total OEM graph. If we desire, for example, to remove the Straw with ID 4565, the following query would work: Haystack =- ID4656.


next up previous contents
Next: Conclusions Up: Haystack and Lore Integration Previous: The HsOEMGenerator Class

Copyright 1998, Eytan Adar (eytan@alum.mit.edu)