-- Copyright (C) 1986 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on May 9, 1986 7:49:23 am PDT by Lupine of May 23, 1985 8:38:08 am PDT
-- Source interface ComputeServerController came from file ComputeServerController.bcd, which was created on May 9, 1986 7:48:13 am PDT with version stamp 337#276#17756447420 from source of May 9, 1986 7:47:01 am PDT.

-- The RPC stub modules for ComputeServerController are:
--   ComputeServerControllerRpcControl.mesa;
--   ComputeServerControllerRpcClientImpl.mesa;
--   ComputeServerControllerRpcBinderImpl.mesa;
--   ComputeServerControllerRpcServerImpl.mesa.

-- The parameters for this translation are:
--   Target language = Cedar
--   Default parameter passing = VALUE
--   Deallocate server heap arguments = TRUE
--   Inline RpcServerImpl dispatcher stubs = FALSE
--   Declare signals = FALSE
--   Warn about short POINTER ("MDS") allocations = TRUE
--   Maximum number of dynamic heap NEWs = 50, MDS NEWs = 50
--   Acceptable parameter protocols = VersionRange[1..1].


DIRECTORY
  BasicTime,
  ComputeServer,
  PrincOps,
  Pup,
  Rope,
  RPC,
  ComputeServerController,
  RPCLupine USING [ImportHandle];


ComputeServerControllerRpcControl: DEFINITIONS
  SHARES  ComputeServerController
  = BEGIN OPEN ComputeServerController, RpcPublic: RPC, RpcPrivate:
      RPCLupine;


-- Public RPC types and constants.

  InterfaceName: TYPE = RpcPublic.InterfaceName;
  VersionRange: TYPE = RpcPublic.VersionRange;
  Principal: TYPE = RpcPublic.Principal;
  EncryptionKey: TYPE = RpcPublic.EncryptionKey;
  Zones: TYPE = RpcPublic.Zones;
  
  defaultInterfaceName: InterfaceName = RpcPublic.defaultInterfaceName;
  standardZones: Zones = RpcPublic.standardZones;


-- Standard remote binding routines.

  ImportInterface: SAFE PROCEDURE [
        interface: InterfaceRecord,
        interfaceName: InterfaceName ← defaultInterfaceName,
        parameterStorage: Zones ← standardZones ];


  ExportInterface: SAFE PROCEDURE [
        interfaceName: InterfaceName ← defaultInterfaceName,
        user: Principal,
        password: EncryptionKey,
        parameterStorage: Zones ← standardZones ];

  UnexportInterface: SAFE PROCEDURE;


-- Dynamic instantiation and binding.

  ImportNewInterface: SAFE PROCEDURE [
        interfaceName: InterfaceName ← defaultInterfaceName,
        parameterStorage: Zones ← standardZones ]
    RETURNS [interfaceRecord: InterfaceRecord];

  -- NewInterfaceRecord is necessary for Cedar clients who want to
  -- manufacture a private interface instance, because
  -- RpcBindingImpl has finalization on type InterfaceRecord.
  NewInterfaceRecord: SAFE PROCEDURE
    RETURNS [interfaceRecord: InterfaceRecord];

  InterfaceRecord: TYPE = REF InterfaceRecordObject;

  InterfaceRecordObject: TYPE = RECORD [
          myInterface: RpcPrivate.ImportHandle ← NIL,
      paramZones: RpcPublic.Zones ← RpcPublic.standardZones,
      clientStubFindService: SAFE PROCEDURE [interface: InterfaceRecord,
          service: Rope.ROPE, userName: RPC.ShortROPE] RETURNS [found:
          BOOL, instance: RPC.ShortROPE],
      clientStubFindServiceWithQueueing: SAFE PROCEDURE [interface:
          InterfaceRecord, service: Rope.ROPE, userName: RPC.ShortROPE,
          version: RPC.ShortROPE, timeToWait: INT, clientMachineName: RPC.ShortROPE,
          streamPupAddress: Pup.Address, needListener: BOOL] RETURNS [found:
          ATOM, instance: RPC.ShortROPE, serverPupAddress: Pup.Address,
          errMsg: Rope.ROPE],
      clientStubNewStats: SAFE PROCEDURE [interface: InterfaceRecord,
          serverMachineName: RPC.ShortROPE, serverMachinePupAddress: RPC.ShortROPE,
          serverUP: BOOL, firstCall: BOOL, machineType: PrincOps.MachineType,
          mainMemory: CARDINAL, numberCPUs: CARDINAL, diskPartionSize:
          INT, freePagesOnDisk: INT, freeboard: INT, freeGFI: CARDINAL,
          freeMDS: CARDINAL, freeVM: CARDINAL, oldestLRUFileDate: BasicTime.GMT,
          CPULoad: REAL, nonBackgroundCPULoad: REAL, reclamationRate: REAL,
          freeProcesses: CARDINAL, userName: RPC.ShortROPE, currentRequests:
          LIST OF ComputeServer.Request, aveBackgroundLoad: REAL] RETURNS
          [terminateService: BOOL, newPackage: BOOL, queueingCommands:
          LIST OF Rope.ROPE],
      clientStubBestServerStats: SAFE PROCEDURE[interface: InterfaceRecord]
          RETURNS [instance: RPC.ShortROPE, FOM: REAL],
      clientStubNoticeNewPackage: SAFE PROCEDURE [interface: InterfaceRecord,
          package: RPC.ShortROPE] RETURNS [error: BOOL, tryDifferentController:
          BOOL, msg: Rope.ROPE],
      clientStubRemoveOldPackage: SAFE PROCEDURE [interface: InterfaceRecord,
          package: RPC.ShortROPE] RETURNS [error: BOOL, tryDifferentController:
          BOOL, msg: Rope.ROPE],
      clientStubGetSomeInfo: SAFE PROCEDURE[interface: InterfaceRecord]
          RETURNS [error: BOOL, tryDifferentController: BOOL, msg: Rope.ROPE,
          serverList: LIST OF Rope.ROPE, bestFOM: REAL],
      clientStubCommandUnavailable: SAFE PROCEDURE [interface: InterfaceRecord,
          serverMachineName: RPC.ShortROPE, commandName: Rope.ROPE, version:
          RPC.ShortROPE],
      clientStubExtraCommandAvailable: SAFE PROCEDURE [interface: InterfaceRecord,
          serverMachineName: RPC.ShortROPE, commandName: Rope.ROPE, version:
          RPC.ShortROPE],
      clientStubMightAcceptQueuedCommand: SAFE PROCEDURE [interface:
          InterfaceRecord, serverMachineAddress: RPC.ShortROPE, commandName:
          Rope.ROPE],
      clientStubGenericToController: SAFE PROCEDURE [interface: InterfaceRecord,
          requestCode: ATOM, requestString: Rope.ROPE] RETURNS [resultCode:
          ATOM, resultString: Rope.ROPE],
      bound: BOOL ← FALSE];

  FindService: SAFE PROCEDURE [interface: InterfaceRecord, service:
      Rope.ROPE, userName: RPC.ShortROPE] RETURNS [found: BOOL, instance:
      RPC.ShortROPE] = CHECKED INLINE  { RETURN interface.clientStubFindService[interface,
      service, userName]};
   FindServiceWithQueueing: SAFE PROCEDURE [interface: InterfaceRecord,
      service: Rope.ROPE, userName: RPC.ShortROPE, version: RPC.ShortROPE,
      timeToWait: INT, clientMachineName: RPC.ShortROPE, streamPupAddress:
      Pup.Address, needListener: BOOL] RETURNS [found: ATOM, instance:
      RPC.ShortROPE, serverPupAddress: Pup.Address, errMsg: Rope.ROPE]
      = CHECKED INLINE  { RETURN interface.clientStubFindServiceWithQueueing[interface,
      service, userName, version, timeToWait, clientMachineName, streamPupAddress,
      needListener]};
   NewStats: SAFE PROCEDURE [interface: InterfaceRecord, serverMachineName:
      RPC.ShortROPE, serverMachinePupAddress: RPC.ShortROPE, serverUP:
      BOOL, firstCall: BOOL, machineType: PrincOps.MachineType, mainMemory:
      CARDINAL, numberCPUs: CARDINAL, diskPartionSize: INT, freePagesOnDisk:
      INT, freeboard: INT, freeGFI: CARDINAL, freeMDS: CARDINAL, freeVM:
      CARDINAL, oldestLRUFileDate: BasicTime.GMT, CPULoad: REAL, nonBackgroundCPULoad:
      REAL, reclamationRate: REAL, freeProcesses: CARDINAL, userName:
      RPC.ShortROPE, currentRequests: LIST OF ComputeServer.Request, aveBackgroundLoad:
      REAL] RETURNS [terminateService: BOOL, newPackage: BOOL, queueingCommands:
      LIST OF Rope.ROPE] = CHECKED INLINE  { RETURN interface.clientStubNewStats[interface,
      serverMachineName, serverMachinePupAddress, serverUP, firstCall,
      machineType, mainMemory, numberCPUs, diskPartionSize, freePagesOnDisk,
      freeboard, freeGFI, freeMDS, freeVM, oldestLRUFileDate, CPULoad,
      nonBackgroundCPULoad, reclamationRate, freeProcesses, userName,
      currentRequests, aveBackgroundLoad]};
   BestServerStats: SAFE PROCEDURE[interface: InterfaceRecord] RETURNS
      [instance: RPC.ShortROPE, FOM: REAL] = CHECKED INLINE  { RETURN
      interface.clientStubBestServerStats[interface]};
   NoticeNewPackage: SAFE PROCEDURE [interface: InterfaceRecord, package:
      RPC.ShortROPE] RETURNS [error: BOOL, tryDifferentController: BOOL,
      msg: Rope.ROPE] = CHECKED INLINE  { RETURN interface.clientStubNoticeNewPackage[interface,
      package]};
   RemoveOldPackage: SAFE PROCEDURE [interface: InterfaceRecord, package:
      RPC.ShortROPE] RETURNS [error: BOOL, tryDifferentController: BOOL,
      msg: Rope.ROPE] = CHECKED INLINE  { RETURN interface.clientStubRemoveOldPackage[interface,
      package]};
   GetSomeInfo: SAFE PROCEDURE[interface: InterfaceRecord] RETURNS
      [error: BOOL, tryDifferentController: BOOL, msg: Rope.ROPE, serverList:
      LIST OF Rope.ROPE, bestFOM: REAL] = CHECKED INLINE  { RETURN interface.clientStubGetSomeInfo[interface]};
   CommandUnavailable: SAFE PROCEDURE [interface: InterfaceRecord,
      serverMachineName: RPC.ShortROPE, commandName: Rope.ROPE, version:
      RPC.ShortROPE] = CHECKED INLINE  { interface.clientStubCommandUnavailable[interface,
      serverMachineName, commandName, version]};
   ExtraCommandAvailable: SAFE PROCEDURE [interface: InterfaceRecord,
      serverMachineName: RPC.ShortROPE, commandName: Rope.ROPE, version:
      RPC.ShortROPE] = CHECKED INLINE  { interface.clientStubExtraCommandAvailable[interface,
      serverMachineName, commandName, version]};
   MightAcceptQueuedCommand: SAFE PROCEDURE [interface: InterfaceRecord,
      serverMachineAddress: RPC.ShortROPE, commandName: Rope.ROPE] = CHECKED
      INLINE  { interface.clientStubMightAcceptQueuedCommand[interface,
      serverMachineAddress, commandName]};
   GenericToController: SAFE PROCEDURE [interface: InterfaceRecord,
      requestCode: ATOM, requestString: Rope.ROPE] RETURNS [resultCode:
      ATOM, resultString: Rope.ROPE] = CHECKED INLINE  { RETURN interface.clientStubGenericToController[interface,
      requestCode, requestString]};
 
 -- Definitions for the stubs.
 
 LupineProtocolVersion: PUBLIC VersionRange = [first: 1, last: 1];
 
 InterMdsCallsOnly: PUBLIC BOOLEAN = FALSE;

  ProcedureIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3),
      FindService (4), FindServiceWithQueueing (5), NewStats (6), BestServerStats
      (7), NoticeNewPackage (8), RemoveOldPackage (9), GetSomeInfo (10),
      CommandUnavailable (11), ExtraCommandAvailable (12), MightAcceptQueuedCommand
      (13), GenericToController (14)};

  SignalIndex: PRIVATE TYPE = MACHINE DEPENDENT {
      LupineUnusedIndex (0), LupineLastIndex (3)};


END.  -- ComputeServerControllerRpcControl.