FingerLog.mesa
Last edited by: Donahue, April 22, 1985 9:00:28 am PST
Last edited by: Gifford, July 26, 1985 12:00:27 pm PDT
(The interface to read and write the log file used to record actions to be performed. The log file is used solely to recover from crashes of the server or the workstation -- if the server is unavailable when an operation is attempted it will persist in the log file over crashes of the workstation)
Carl Hauser, September 13, 1986 12:09:55 pm PDT
DIRECTORY
BasicTime USING [GMT],
FingerOps,
Rope USING [ROPE];
FingerLog: CEDAR DEFINITIONS =
BEGIN
LogEntry: TYPE = REF LogEntryObject;
LogEntryObject: TYPE = RECORD[SELECT type: * FROM
StateChange => [event: FingerOps.StateChange, user: Rope.ROPE, time: BasicTime.GMT, machine: Rope.ROPE],
UserPropChange => [user, name, val: Rope.ROPE, time: BasicTime.GMT],
user property changes are actually recorded in the database only if they occurred after the time of the last update recorded (ie., they aren't stale)
MachinePropChange => [machine, name, val: Rope.ROPE],
machine property changes are always performed
AddMachineProp => [name: Rope.ROPE, version: INT],
for property changes, we record the version number of the properties for a machine or person; if the version number of the change is not consistent with the current version number in the database, then the change is not performed
AddUserProp => [name: Rope.ROPE, version: INT],
DeleteUserProp => [name: Rope.ROPE, version: INT],
DeleteMachineProp => [name: Rope.ROPE, version: INT],
Nothing => []
ENDCASE ] ← [Nothing[]]; -- to keep Lupine happy
FlushLog: PROC[];
Throw away the contents of the current log file
Log: PROC[ logEntry: LogEntry ];
Write the entry on the current log file (recording it for posterity in case the machine crashes)
ParseLog: PROC[] RETURNS[ stateLog: LIST OF LogEntry ];
Read the finger log file for this machine and build the list of log entries corresponding to the contents of the file
END.