FingerOps.mesa
Last Edited by: Khall, August 13, 1984 10:17:23 am PDT
Last edited by: Donahue, October 22, 1984 9:27:36 am PDT
DIRECTORY
BasicTime USING [GMT],
Rope USING [ROPE];
FingerOps: CEDAR DEFINITIONS =
BEGIN
FingerList: TYPE = LIST OF FingerObject;
The name of all of the fingerable objects matching a finger pattern
FingerObject: TYPE = RECORD[name: Rope.ROPE, type: FingerObjectType];
FingerObjectType: TYPE = {person, machine};
Reason: TYPE = {Error, Aborted, Failure};
These are the possible reasons why a Get or Put may fail. We try hard to avoid aborts; errors are programming problems; failures are problems with the server used to store the database
FingerError: ERROR[reason: Reason];
The procedure below that records information about the state of the machine and user (login, logout and new mail) logs its input so that if the server is unavailable at the time of the change of state it will still subsequently be recorded in the database (other users may find the database inconsistent with reality for short intervals, but we'll try hard to keep things as accurate as possible).
machineNameRope: Rope.ROPE;
StateChange: TYPE = ATOM;
The legal values for state changes include {$login, $logout, $mailRead}
PutStateChange: PROC [change: StateChange, time: BasicTime.GMT];
Record the specified state change in the finger database
SaveNewProps: PROC[object: FingerObject, actualName, plan, pictureFile: Rope.ROPENIL];
Save all of the properties for the specified fingerable object. The information here is not logged -- if the database is inaccessible, then the changes will not be made.
GetMatchingObjects: PROC [pattern: Rope.ROPE] RETURNS [result: FingerList];
Find all of the fingerable objects with names matching the given pattern
LoginLogout: TYPE = {login, logout};
ObjectData: TYPE = REF ObjectRecord;
ObjectRecord: TYPE = RECORD[ data: SELECT type: FingerObjectType FROM
person => [ mailRead: BasicTime.GMT, used: LIST OF MachineData ],
machine => [lastUser: Rope.ROPE, operation: LoginLogout, time: BasicTime.GMT]
ENDCASE ];
MachineData: TYPE = RECORD[machine: Rope.ROPE, operation: LoginLogout, time: BasicTime.GMT];
GetProps: PROC[object: FingerObject] RETURNS[actualName, plan, pictureFile: Rope.ROPENIL, data: ObjectData];
Get all of the stored information for this object.
END.