-- AlpInstance.mesa
-- Last edited by
-- Kolling on May 2, 1983 12:29 pm


DIRECTORY

AlpineEnvironment
USING[Conversation, FileStore, LockFailure, NeededAccess, OperationFailure,
Principal, UnknownType],
AlpineFileRpcControl
USING[InterfaceRecord],
AlpineOwnerRpcControl
USING[InterfaceRecord],
AlpineTransactionRpcControl
USING[InterfaceRecord],
AlpineVolumeRpcControl
USING[InterfaceRecord],
RPC
USING[EncryptionKey];


AlpInstance: DEFINITIONS =

BEGIN

FileStore: TYPE = AlpineEnvironment.FileStore;
Principal: TYPE = AlpineEnvironment.Principal;
EncryptionKey: TYPE = RPC.EncryptionKey;

AccessFailed: ERROR [missingAccess: AlpineEnvironment.NeededAccess];
LockFailed: ERROR [why: AlpineEnvironment.LockFailure];
OperationFailed: ERROR [why: AlpineEnvironment.OperationFailure];
StaticallyInvalid: ERROR;
Unknown: ERROR [what: AlpineEnvironment.UnknownType];
PossiblyDamaged: SIGNAL;


Handle: TYPE = REF Object;

Object: TYPE = RECORD[
trans: AlpineTransactionRpcControl.InterfaceRecord,
file: AlpineFileRpcControl.InterfaceRecord,
owner: AlpineOwnerRpcControl.InterfaceRecord,
volume: AlpineVolumeRpcControl.InterfaceRecord,
otherInterfaces: LIST OF REF ANY,
conversation: AlpineEnvironment.Conversation,
fileStore: FileStore];


Create: PROCEDURE[fileStore: FileStore, caller: Principal ← NIL, key: EncryptionKey ← ALL[0],
zone: ZONENIL] RETURNS [Handle];
-- non system-fatal errors:
-- Failed{authenticateFailed, other, unbound}.
-- principal = NIL means caller is the logged-in user and derives the key from the password
.
-- note: if a call using a Handle fails via RPC.CallFailed[unbound], this generally means that the server has crashed and restarted since the handle was created; discard the handle (and any handles derived from it) and create a new handle.



Failed
: ERROR [why: Failure];
Failure: TYPE = {authenticateFailed, other, unbound};
-- authenticateFailed means bad caller name or key, unbound means no exported version in the required range, other is everything else.



END.


Edit Log

Initial: Kolling: February 14, 1983 2:45 pm: package to aid clients, in conjunction with AlpTransaction and AlpFile.