AlpineV2ServerBImpl.mesa
Carl Hauser, November 13, 1987 1:33:18 pm PST
DIRECTORY
CrAEToAE,
AEToCrAE,
AlpineP2202V2,
AlpineV2ServerInternal,
AlpineEnvironment,
AlpineEnvironmentP2201V1,
AlpineFile,
AlpineOwner,
AlpineTransaction,
AlpineVolume;
AlpineV2ServerBImpl: CEDAR PROGRAM
IMPORTS CrAEToAE, AEToCrAE, AlpineV2ServerInternal, AlpineOwner, AlpineVolume
EXPORTS AlpineP2202V2
~ BEGIN
OPEN CTA: CrAEToAE, ATC: AEToCrAE, AE: AlpineEnvironment;
DoWork: PROC [work: PROC] ~ AlpineV2ServerInternal.DoWork;
Conversation: PROC [ session: AlpineP2202V2.Session ]
RETURNS
[ conv: AlpineEnvironment.Conversation] ~ AlpineV2ServerInternal.Conversation;
Owner DB Manipulations
ReadOwnerProperties: PUBLIC AlpineP2202V2.ReadOwnerPropertiesType ~ {
Work: PROC ~ TRUSTED {
properties ← ATC.OwnerProperties[AlpineOwner.ReadProperties [Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID], CTA.OwnerName[owner], CTA.OwnerPropertySet[desiredProperties]]];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
WriteOwnerProperties: PUBLIC AlpineP2202V2.WriteOwnerPropertiesType ~ {
Work: PROC ~ TRUSTED {
AlpineOwner.WriteProperties [Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID], CTA.OwnerName[owner], CTA.OwnerProperties[properties], enforceTotalQuota];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
CreateOwner: PUBLIC AlpineP2202V2.CreateOwnerType ~ {
Work: PROC ~ TRUSTED {
spaceLeftOnVolumeGroup ← ATC.PageCount[AlpineOwner.Create [Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID], CTA.OwnerName[owner], CTA.OwnerProperties[properties], enforceTotalQuota]];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
DestroyOwner: PUBLIC AlpineP2202V2.DestroyOwnerType ~ {
Work: PROC ~ TRUSTED {
AlpineOwner.Destroy[Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID], CTA.OwnerName[owner]];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
NextOwner: PUBLIC AlpineP2202V2.NextOwnerType ~ {
Work: PROC ~ TRUSTED {
aowner: AE.OwnerName;
aproperties: LIST OF AE.OwnerPropertyValuePair;
[aowner, aproperties] ← AlpineOwner.ReadNext[Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID], CTA.OwnerName[previousOwner], CTA.OwnerPropertySet[desiredProperties]];
owner ← ATC.OwnerName[aowner];
properties ← ATC.OwnerProperties[aproperties];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
ReadOwnerDBProperties: PUBLIC AlpineP2202V2.ReadOwnerDBPropertiesType ~ {
Work: PROC ~ TRUSTED {
atotalQuota, atotalSpaceInUse, avolumeGroupSize: AE.PageCount;
[nOwners, nEntriesUsed, nEntries, atotalQuota, atotalSpaceInUse, avolumeGroupSize] ← AlpineOwner.ReadDBProperties[Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID]];
totalQuota ← ATC.PageCount[atotalQuota];
totalSpaceInUse ← ATC.PageCount[atotalSpaceInUse];
volumeGroupSize ← ATC.PageCount[avolumeGroupSize];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
ReorganizeOwnerDB: PUBLIC AlpineP2202V2.ReorganizeOwnerDBType ~ {
Work: PROC ~ TRUSTED {
AlpineOwner.ReorganizeDB[Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID], nEntries];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
UnlockOwnerDB: PUBLIC AlpineP2202V2.UnlockOwnerDBType ~ {
Work: PROC ~ TRUSTED {
AlpineOwner.Unlock[Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID]];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
Volume Manipulations
GetNextGroup: PUBLIC AlpineP2202V2.GetNextGroupType ~ {
Work: PROC ~ TRUSTED {
volumeGroupID ← ATC.VolumeGroupID[AlpineVolume.GetNextGroup[Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[previousGroup], CTA.LockOption[lock]]];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
GetGroup: PUBLIC AlpineP2202V2.GetGroupType ~ {
Work: PROC ~ TRUSTED {
volumes ← ATC.VolumeIDs[AlpineVolume.GetGroup[Conversation[session], CTA.TransID[transID], CTA.VolumeGroupID[volumeGroupID], CTA.LockOption[lock]]];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
GetEnclosingGroup: PUBLIC AlpineP2202V2.GetEnclosingGroupType ~ {
Work: PROC ~ TRUSTED {
volumeGroupID ← ATC.VolumeGroupID[AlpineVolume.GetEnclosingGroup[Conversation[session], CTA.TransID[transID], CTA.VolumeID[volumeID], CTA.LockOption[lock]]];
};
DoWork[Work];
replyVerifier ← session.verifier;
};
AccessFailed: PUBLIC AlpineP2202V2.AccessFailedType ~ CODE;
AuthenticationError: PUBLIC AlpineP2202V2.AuthenticationErrorType ~ CODE;
LockFailed: PUBLIC AlpineP2202V2.LockFailedType ~ CODE;
ConnectionError: PUBLIC AlpineP2202V2.ConnectionErrorType ~ CODE;
StaticallyInvalid: PUBLIC AlpineP2202V2.StaticallyInvalidType ~ CODE;
PossiblyDamaged: PUBLIC AlpineP2202V2.PossiblyDamagedType ~ CODE;
OperationFailed: PUBLIC AlpineP2202V2.OperationFailedType ~ CODE;
Unknown: PUBLIC AlpineP2202V2.UnknownType ~ CODE;
END.