DIRECTORY BasicTime USING [GMT], Rope USING [ROPE]; FingerOps: CEDAR DEFINITIONS = BEGIN FingerList: TYPE = LIST OF Rope.ROPE; Reason: TYPE = {Error, Aborted, Failure}; FingerError: ERROR[reason: Reason]; PropPair: TYPE = REF PropPairObject; PropPairObject: TYPE = RECORD[prop: ATOM, val: Rope.ROPE]; StateChange: TYPE = {login, logout}; PutStateChange: PROC [change: StateChange, time: BasicTime.GMT]; ListUserProps: PROC[] RETURNS[propList: LIST OF ATOM]; ListMachineProps: PROC[] RETURNS[propList: LIST OF ATOM]; AddUserProp: PROC[name: Rope.ROPE]; AddMachineProp: PROC[name: Rope.ROPE]; DeleteUserProp: PROC[name: Rope.ROPE]; DeleteMachineProp: PROC[name: Rope.ROPE]; SetUserProps: PROC[user: Rope.ROPE, props: LIST OF PropPair]; SetMachineProps: PROC[machine: Rope.ROPE, props: LIST OF PropPair]; GetUserProps: PROC[userPattern: Rope.ROPE] RETURNS [propsList: LIST OF PropPair]; GetMachineProps: PROC[machinePattern: Rope.ROPE] RETURNS [propsList: LIST OF PropPair]; GetMatchingPersons: PROC [pattern: Rope.ROPE] RETURNS [result: LIST OF Rope.ROPE]; GetMatchingMachines: PROC [pattern: Rope.ROPE] RETURNS [result: LIST OF Rope.ROPE]; MatchUserProperty: PROC[propVal: PropPair] RETURNS[result: LIST OF Rope.ROPE]; MatchMachineProperty: PROC[propVal: PropPair] RETURNS[result: LIST OF Rope.ROPE]; CurrentUsers: PROC[] RETURNS[userList: LIST OF Rope.ROPE]; FreeMachines: PROC[] RETURNS[machineList: LIST OF Rope.ROPE]; PersonExists: PROC [name: Rope.ROPE] RETURNS [result: BOOLEAN]; MachineExists: PROC [name: Rope.ROPE] RETURNS [result: BOOLEAN]; GetMachineData: PROC [name: Rope.ROPE] RETURNS[lastChange: StateChange, time: BasicTime.GMT, user: Rope.ROPE]; GetUserData: PROC [name: Rope.ROPE] RETURNS[machineList: LIST OF Rope.ROPE]; ReadMachineMap: PROC [file: Rope.ROPE, resetProperties: BOOLEAN _ FALSE]; WriteMachineMap: PROC [file: Rope.ROPE]; ReadUserMap: PROC [file: Rope.ROPE, resetProperties: BOOLEAN _ FALSE]; WriteUserMap: PROC [file: Rope.ROPE]; END. nFingerOps.mesa Last Edited by: Khall, August 13, 1984 10:17:23 am PDT Last edited by: Donahue, April 9, 1986 3:31:59 pm PST (Added notion of properties to Finger database; removed notion of "fingerable objects" and made clear separation between machines/users. Added procedures to dump and build maps of the available machines) Last Edited by: Gifford, July 26, 1985 3:52:40 pm PDT (Removed references to Pup Net addresses of machines) Ewan Tempero September 6, 1986 6:37:23 pm PDT The name of all of the objects matching a finger pattern These are the possible reasons why a Get or Put may fail. We try hard to avoid aborts, but they may be caused by changes in the collection of properties in the database; errors are programming problems; failures are problems with the server used to store the database The procedure below that records information about the state of the machine and user 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). A property pair consists of an atom describing the property and value currently assigned to the property in the database (or the value to be assigned to it) The basic procedure for updating the state of the database. PutStateChange is not intended to be used by users of Finger; it is called when going into/out of the Idle state. Record the specified state change in the finger database A Finger database can have an arbitrary collection of properties attached to either machines or users. The collection of procedures below allows extension of the properties in the database and provides the means of changing the value of the properties of database entities Produce the list of properties for entities of the given type Produce the list of properties for entities of the given type Add a new property for entities of the given type (the value associated with all Finger properties are of type Rope.ROPE) Add a new property for entities of the given type (the value associated with all Finger properties are of type Rope.ROPE) Remove this property from the database. If the property does not exist, then the operation has no effect Remove this property from the database. If the property does not exist, then the operation has no effect Changes made by the set properties operations are logged on the local machine (with the time at which the log entry is made). When recovering from a crash or a down server, the logged entries are replayed if they were made later than the last update made in the database (each update in the database also records the time it was made). It is possible that a log entry cannot be replayed because the associated property has been removed from the database in the interim. Save all of the properties for a user. Save all of the properties for a machine. Get all of the stored information for these objects. Get all of the stored information for these objects. The basic query operations of Finger allow matching by name, by property value or listing all of the currently free machines or logged on users Find all of the fingerable objects with names matching the given pattern Find all of the fingerable objects with names matching the given pattern Return all of the users having the given value for the specified property Return all of the machines having the given value for the specified property Return a list of all of the current users on the system Return the list of currently available machines Two procedures to see if a user or a machine exists See if a given person exists See if a machine exists Finally, two procedures to get login/logout information for a user or a machine Get the information on the last recorded operation for this machine Get the current information for the user, ie., the list of machines for which he was the last (perhaps the current user) And, we add procedures to read and write a "machine map" (the contents of the map are dependent on the structure of the database when the map is written or read). The dump contains the name of each machine property and the value of each property for each machine. Set the data for every machine from the data in the file. If resetProperties is T, then then reset the possible properties from the file. If resetProperties is F, then properties in the first line of the file are added. Dump the information on each machine and store as the contents of the specified file. Set the data for every user from the data in the file. If resetProperties is T, then then reset the possible properties from the file. If resetProperties is F, then properties in the first line of the file are added. Dump the information on each user and store as the contents of the specified file. Ewan Tempero August 8, 1986 4:49:46 pm PDT Added WriteUserMap and ReadUserMap. Êؘcodešœ™Kšœ6™6K™5K™ÌK™5K™5K™-—K™šÏk ˜ Kšœ œœ˜Kšœœœ˜—K™šœ œ œ˜K˜š˜K˜š œ œœœœ˜%Kšœ8™8—K˜šœœ˜)KšœŒ™Œ—K˜Kšœ œ˜#K˜K™ðK™Kšœ œœ˜$š œœœœ œ˜:Kšœœ™œ—K˜Jšœ®™®˜Jšœ œ˜$J˜šÏnœœ'œ˜@K™8——K˜J™‘™š ž œœœ œœœ˜6Kšœ=™=—K˜š žœœœ œœœ˜9Kšœ=™=—K˜šž œœ œ˜#Kšœy™y—K˜šžœœ œ˜&Kšœy™y—K˜šžœœ œ˜&K™i—K˜šžœœ œ˜)K™i——K˜Kšœ×™×˜šž œœœœ ˜=šœ&™&K˜——šžœœœœ ˜Cšœ)™)K˜——š ž œœœœ œœ ˜QKšœ4™4—K˜š žœœœœ œœ ˜WKšœ4™4——K˜J™™šžœœœœ œœœ˜RKšœH™H—K˜šžœœœœ œœœ˜SKšœH™H—K˜š žœœœ œœœ˜NKšœI™I—K˜š žœœœ œœœ˜QKšœL™L—K˜š ž œœœ œœœ˜:Kšœ7™7—K˜š ž œœœœœœ˜=Kšœ/™/——K˜J™3™š ž œœ œœ œ˜?K™—K˜š ž œœ œœ œ˜@K™—K™—KšœO™O™š žœœ œœ*œ œ˜nKšœC™C—K˜šž œœ œœœœœ˜LKšœx™x—J™—J™ˆ™š žœœ œœœ˜IK™Þ—K˜šžœœ œ˜(K™UK™—š ž œœ œœœ˜FKšœÚ™Ú—K™šž œœ œ˜%K™R———K˜Kšœ˜—™*K™#K™—K™—…—Î