DIRECTORY BluejaySmarts, IO, NamesRPC USING [ StartConversation ], RPC USING [ AuthenticateFailed, EncryptionKey, ImportFailed, VersionRange ], ThParty USING [ CreateParty, Register ], ThPartyRpcControl, Thrush USING [ NetAddress, nullHandle, PartyHandle, ROPE, SmartsHandle, unencrypted ], ThSmarts, ThSmartsRpcControl USING [ ExportInterface, InterfaceName ], ThVersions USING [ GetThrushVR, JayVersion, JayVR ], VoiceUtils USING [ CurrentPasskey, OwnNetAddress, ReportFR ] ; BluejayRegisterImpl: CEDAR PROGRAM IMPORTS BluejaySmarts, IO, NamesRPC, RPC, ThParty, ThPartyRpcControl, ThSmartsRpcControl, ThVersions, VoiceUtils EXPORTS BluejaySmarts = { OPEN IO; BluejayRegister: PUBLIC PROC [bluejayInstance, thrushInstance, serverPassword: Thrush.ROPE] RETURNS [partyID: Thrush.PartyHandle_Thrush.nullHandle, smartsID: Thrush.SmartsHandle_Thrush.nullHandle] = { myName: ThSmartsRpcControl.InterfaceName _ [ type: "ThSmarts.Lark", instance: bluejayInstance, version: ThVersions.JayVR]; serverPasskey: RPC.EncryptionKey _ VoiceUtils.CurrentPasskey[serverPassword]; thVR: RPC.VersionRange = ThVersions.GetThrushVR; netAddress: Thrush.NetAddress = VoiceUtils.OwnNetAddress[]; myName _ [ type: "ThSmarts.Lark", instance: bluejayInstance, version: ThVersions.JayVR]; ThSmartsRpcControl.ExportInterface[ interfaceName: myName, user: bluejayInstance, password: serverPasskey]; BluejaySmarts.jayShh _ IF NOT BluejaySmarts.encryptionRequested THEN Thrush.unencrypted ELSE NamesRPC.StartConversation [ caller: bluejayInstance, callee: thrushInstance --rName--, key: serverPasskey, level: --<>--CBCCheck ! RPC.AuthenticateFailed=>GOTO InitFailed]; ThPartyRpcControl.ImportInterface[ interfaceName: [type: "ThParty.Lark", instance: thrushInstance, version: thVR] ! RPC.ImportFailed=> IF why=wrongVersion THEN { VoiceUtils.ReportFR["Bluejay version %d too old; import failed", $Bluejay, NIL, card[ThVersions.JayVersion]]; GOTO InitFailed; }]; BluejaySmarts.interfaceIsImported_TRUE; partyID_ThParty.CreateParty[type: service, rName: "Recording"]; IF partyID=Thrush.nullHandle THEN ERROR; smartsID _ ThParty.Register[ shh: BluejaySmarts.jayShh, partyID: partyID, interface: NEW[ThSmartsRpcControl.InterfaceName_myName], properties: [x: voiceTerminal[netAddress: [netAddress.net, netAddress.host]]]]; IF smartsID=Thrush.nullHandle THEN GOTO InitFailed; EXITS InitFailed => IF BluejaySmarts.interfaceIsImported THEN BluejaySmarts.interfaceIsImported_FALSE; }; }. BluejayRegisterImpl.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. Last modified by D. Swinehart, May 19, 1986 10:07:02 am PDT Export ThSmarts Interface Import ThParty Interface Register First Jay Party. Swinehart, May 15, 1985 10:28:41 am PDT Cedar 6.0 changes to: BluejayRegisterImpl Swinehart, May 22, 1985 12:05:46 pm PDT recording => service, Jay => Recording changes to: BluejayRegisterImpl Swinehart, May 17, 1986 3:30:10 pm PDT Cedar 6.1 changes to: DIRECTORY, BluejayRegisterImpl ΚΦ˜šœ™Icodešœ Οmœ7™BJšœ;™;—J™šΟk ˜ J˜Jšžœ˜Jšœ žœ˜&JšžœžœC˜NJšœ žœ˜)Jšœ˜Jšœžœ(žœ˜WJ˜ Jšœžœ$˜