-- Copyright (C) 1985 by Xerox Corporation.  All rights reserved.
-- Stub file  was translated on May 15, 1985 1:01:07 pm PDT by Lupine of March 15, 1985 2:49:13 pm PST
-- Source interface ComputeServerController came from file ComputeServerController.bcd, which was created on May 15, 1985 1:01:03 pm PDT with version stamp 322#313#10673645544 from source of May 7, 1985 2:46:31 pm 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,
  PupDefs,
  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] RETURNS [found: BOOL, instance: RPC.ShortROPE],
      clientStubFindServiceWithQueueing: SAFE PROCEDURE [interface:
          InterfaceRecord, service: Rope.ROPE, version: RPC.ShortROPE,
          timeToWait: INT, clientMachineName: RPC.ShortROPE, streamPupAddress:
          PupDefs.PupAddress, needListener: BOOL] RETURNS [found: ComputeServer.AskResponce,
          instance: RPC.ShortROPE, serverPupAddress: PupDefs.PupAddress,
          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, reclamationRate: REAL, freeProcesses: CARDINAL]
          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],
      bound: BOOL ← FALSE];

  FindService: SAFE PROCEDURE [interface: InterfaceRecord, service:
      Rope.ROPE] RETURNS [found: BOOL, instance: RPC.ShortROPE] = CHECKED
      INLINE  { RETURN interface.clientStubFindService[interface, service]};
   FindServiceWithQueueing: SAFE PROCEDURE [interface: InterfaceRecord,
      service: Rope.ROPE, version: RPC.ShortROPE, timeToWait: INT, clientMachineName:
      RPC.ShortROPE, streamPupAddress: PupDefs.PupAddress, needListener:
      BOOL] RETURNS [found: ComputeServer.AskResponce, instance: RPC.ShortROPE,
      serverPupAddress: PupDefs.PupAddress, errMsg: Rope.ROPE] = CHECKED
      INLINE  { RETURN interface.clientStubFindServiceWithQueueing[interface,
      service, 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, reclamationRate:
      REAL, freeProcesses: CARDINAL] 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, reclamationRate, freeProcesses]};
   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]};
 
 -- 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)};

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


END.  -- ComputeServerControllerRpcControl.