<> <> <> <> <> <> <> DIRECTORY OldAlpineEnvironment, AlpineOwner, OldAlpineOwner; OldOwnerActionsImpl: PROGRAM IMPORTS AlpineOwner, AO: OldAlpineOwner EXPORTS OldAlpineOwner = BEGIN OPEN AE: OldAlpineEnvironment; Create: PUBLIC PROCEDURE[conversation: AE.Conversation, transID: AE.TransID, volumeGroupID: AE.VolumeGroupID, owner: AE.OwnerName, properties: LIST OF AE.OwnerPropertyValuePair, enforceTotalQuota: BOOLEAN] RETURNS[spaceLeftOnVolumeGroup: AE.PageCount] = BEGIN Work: PROC ~ { [spaceLeftOnVolumeGroup] _ AlpineOwner.Create [conversation, transID, volumeGroupID, owner, properties, enforceTotalQuota]; }; DoWork[Work]; END; Destroy: PUBLIC PROCEDURE[conversation: AE.Conversation, transID: AE.TransID, volumeGroupID: AE.VolumeGroupID, owner: AE.OwnerName] = BEGIN -- non system-fatal errors: AccessFailed[alpineWheel], LockFailed[timeout], OperationFailed[ownerRecordInUse, spaceInUseByThisOwner], StaticallyInvalid, Unknown[owner, transID, volumeGroupID]. Work: PROC ~ { AlpineOwner.Destroy [conversation, transID, volumeGroupID, owner]; }; DoWork[Work]; END; ReadProperties: PUBLIC PROCEDURE[conversation: AE.Conversation, transID: AE.TransID, volumeGroupID: AE.VolumeGroupID, owner: AE.OwnerName, desiredProperties: AE.OwnerPropertySet] RETURNS [properties: LIST OF AE.OwnerPropertyValuePair] = BEGIN Work: PROC ~ { properties _ AlpineOwner.ReadProperties [conversation, transID, volumeGroupID, owner, desiredProperties]; }; DoWork[Work]; END; WriteProperties: PUBLIC PROCEDURE[conversation: AE.Conversation, transID: AE.TransID, volumeGroupID: AE.VolumeGroupID, owner: AE.OwnerName, properties: LIST OF AE.OwnerPropertyValuePair, enforceTotalQuota: BOOLEAN] = BEGIN Work: PROC ~ { AlpineOwner.WriteProperties [conversation, transID, volumeGroupID, owner, properties, enforceTotalQuota]; }; DoWork[Work]; END; ReadDBProperties: PUBLIC PROCEDURE[conversation: AE.Conversation, transID: AE.TransID, volumeGroupID: AE.VolumeGroupID] RETURNS [nOwners, nEntriesUsed, nEntries: NAT, totalQuota, totalSpaceInUse, volumeGroupSize: AE.PageCount] = BEGIN Work: PROC ~ { [nOwners, nEntriesUsed, nEntries, totalQuota, totalSpaceInUse, volumeGroupSize] _ AlpineOwner.ReadDBProperties [conversation, transID, volumeGroupID]; }; DoWork[Work]; END; ReadNext: PUBLIC PROCEDURE[conversation: AE.Conversation, transID: AE.TransID, volumeGroupID: AE.VolumeGroupID, previousOwner: AE.OwnerName, desiredProperties: AE.OwnerPropertySet] RETURNS [owner: AE.OwnerName, properties: LIST OF AE.OwnerPropertyValuePair] = BEGIN Work: PROC ~ { [owner, properties] _ AlpineOwner.ReadNext [conversation, transID, volumeGroupID, previousOwner, desiredProperties]; }; DoWork[Work]; END; ReorganizeDB: PUBLIC PROCEDURE [conversation: AE.Conversation, transID: AE.TransID, volumeGroupID: AE.VolumeGroupID, nEntries: NAT] = BEGIN Work: PROC ~ { AlpineOwner.ReorganizeDB [conversation, transID, volumeGroupID, nEntries]; }; DoWork[Work]; END; Unlock: PUBLIC PROCEDURE[conversation: AE.Conversation, transID: AE.TransID, volumeGroupID: AE.VolumeGroupID] = BEGIN Work: PROC ~ { AlpineOwner.Unlock [conversation, transID, volumeGroupID]; }; DoWork[Work]; END; DoWork: PROC [work: PROC] RETURNS [] ~ { accessReason: OldAlpineEnvironment.NeededAccess; lockReason: OldAlpineEnvironment.LockFailure; operationReason: OldAlpineEnvironment.OperationFailure; unknownWhat: OldAlpineEnvironment.UnknownType; { ENABLE { AlpineOwner.AccessFailed => {accessReason _ missingAccess; GOTO accessFailed}; AlpineOwner.LockFailed => { lockReason _ SELECT why FROM conflict, cantConvert => conflict, timeout => timeout, ENDCASE => ERROR; GOTO lockFailed}; AlpineOwner.OperationFailed => {operationReason _ why; GOTO operationFailed}; AlpineOwner.StaticallyInvalid => {GOTO staticallyInvalid}; AlpineOwner.Unknown => {unknownWhat _ what; GOTO unknown}; }; work[]; EXITS accessFailed => ERROR AO.AccessFailed[accessReason]; lockFailed => ERROR AO.LockFailed[lockReason]; operationFailed => ERROR AO.OperationFailed[operationReason]; staticallyInvalid => ERROR AO.StaticallyInvalid; unknown => ERROR AO.Unknown[unknownWhat]; }; }; END. CHANGE LOG <> <> <<>>