<> <> <> DIRECTORY Commander USING [ CommandProc, Register ], CommandTool USING [ NextArgument ], <> LoganBerryRpcControl USING [ ExportInterface ], <> IO, Names USING [ CurrentRName, CurrentPasskey ], Log USING [ Problem, ReportFR ], RPC USING [ ExportFailed, matchAllVersions, ShortROPE ], UserProfile USING [ Token ] ; LoganBerryExportImpl: CEDAR PROGRAM IMPORTS Commander, CommandTool, IO, Names, Log, RPC, LoganBerryRpcControl, UserProfile <> <> = { OPEN IO; <> ROPE: TYPE= RPC.ShortROPE; exported: BOOL_FALSE; <> LBExport: PROC [instance: ROPE_NIL] RETURNS [success: BOOL] = { ENABLE RPC.ExportFailed => { Log.Problem["Couldn't export LoganBerry.Lark"]; CONTINUE; }; IF instance=NIL THEN instance _ UserProfile.Token[key: "ThrushServerInstance", default: "Morley.Lark"]; IF exported THEN { Log.ReportFR[remark: "ExportInterface[LoganBerry.Lark, %s] already done", where: $System, a1: rope[instance]]; RETURN; }; LoganBerryRpcControl.ExportInterface [ interfaceName: [ type: "LoganBerry.Lark", instance: instance ], user: Names.CurrentRName[], password: Names.CurrentPasskey[] ]; <> exported _ TRUE; Log.ReportFR[ remark: "ExportInterface[LoganBerry.Lark, %s]", a1: rope[instance], where: $System]; }; <> CmdLBExport: Commander.CommandProc = { []_LBExport[CommandTool.NextArgument[cmd]]; }; <> <<>> Commander.Register["ExportLoganBerry", CmdLBExport, "ExportLoganBerry [Instance]\nSupply a remote LoganBerry."]; }.