FSPseudoServers.mesa
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Russ Atkinson, February 4, 1985 4:55:18 pm PST
These definitions allow access to the pseudo-server facility of FS. Simply stated, this facility allows a given server name to be turned into a list of server names, thereby allowing a simple, but effective, form of file replication for read-only files. This facility is especially intended to be used for the Cedar release, although it is not limited to that function.
DIRECTORY Rope USING [ROPE];
FSPseudoServers:
CEDAR
DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
PseudoServerList: TYPE = LIST OF PseudoServerRep;
PseudoServerRep:
TYPE =
RECORD [
server: ROPE,
avoidCheck: BOOL,
write: ROPE,
read: LIST OF ROPE];
Note: all server names must be given without brackets both as arguments and as elements of a PseudoServerList.
GetPseudoServers: PROC RETURNS [PseudoServerList];
SetPseudoServers: PROC [list: PseudoServerList];
TranslateForWrite:
PROC [server:
ROPE]
RETURNS [
ROPE];
Translates the server name into the server name specified for writing. If no such translation is present, returns the original server name.
TranslateForRead:
PROC [server:
ROPE]
RETURNS [
LIST
OF
ROPE];
Translates the server name into the server names specified for reading. If no such translation is present, returns a list containing the original server name.
AvoidRemoteCheck:
PROC [server:
ROPE]
RETURNS [
BOOL];
Determines if the server name implies not checking for remote versions. This is useful to reduce server traffic in cases where the files are known to be frozen.
Lookup:
PROC [server:
ROPE]
RETURNS [PseudoServerList];
... returns the PseudoServerList for the given name (NIL if no such translation).
DeletePseudoServer:
PROC [server:
ROPE]
RETURNS [PseudoServerList];
... deletes the given pseudo server (if any) from the root PseudoServerList, and returns the deleted element from the list (NIL if no such element).
InsertPseudoServer:
PROC [new: PseudoServerList];
... inserts the first item in the PseudoServerList into the root PseudoServerList.
PseudoServerFromRope:
PROC [rope:
ROPE]
RETURNS [error:
ROPE, new: PseudoServerList];
... parses the given line into a new single element PseudoServerList. If error = NIL, then new # NIL, and is the new pseudo server entry. If error # NIL, then new = NIL.
RopeFromPseudoServer:
PROC [list: PseudoServerList]
RETURNS [
ROPE];
... turns the first entry in the PseudoServerList into a rope parsable by PseudoServerFromRope. If list = NIL, NIL is returned.
END.