|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 15360 (0x3c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Orb, seg_057d43
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Abonnement_Storage;
with Bounded_String;
with Byte_Defs;
with Contrat_Storage;
with Filter_Storage;
with Observator_Storage;
with Orb_Communication;
with Std_Types;
use Std_Types;
with Text_Io;
with Utils;
package body Orb is
procedure Type_Supervisor (Message : in out Messages.Obj_Msg) is
Id : Natural := 0;
Number : Natural := 1;
Place : Natural := 1;
Success : Boolean := False;
begin
case Messages.Get_Type_Msg (Message) is
when Registration =>
Text_Io.Put_Line ("demande d'enregistrement d'un objet");
Id := Abonnement_Storage.Add
(Messages.Get_Client_Host (Message),
Messages.Get_Client_Socket (Message));
Messages.Put_Source_Id (Message, Id);
Success := Orb_Communication.Send
(Message, Abonnement_Storage.See_Name
(Messages.Get_Source_Id (Message)),
Abonnement_Storage.See_Socket
(Messages.Get_Source_Id (Message)));
if Success then
Text_Io.Put_Line ("enregistrement realise : numero Id = " &
Natural'Image (Id));
else
Text_Io.Put_Line
("enregistrement non realise car la connexion a echoue");
Abonnement_Storage.Delete (Id);
end if;
when Unregistration =>
Text_Io.Put_Line ("demande de retrait d'un objet ");
Messages.Put_Content
(Message, "confirmation : ordre d'unregistration recu");
Id := Messages.Get_Source_Id (Message);
Success := Orb_Communication.Send
(Message, Abonnement_Storage.See_Name (Id),
Abonnement_Storage.See_Socket (Id));
if Success then
Abonnement_Storage.Delete (Id);
Contrat_Storage.Delete (Id);
Observator_Storage.Delete (Id);
Filter_Storage.Delete (Id);
Text_Io.Put_Line ("enregistrement resilie ");
else
Text_Io.Put_Line
("enregistrement non resilie car la connexion de confirmation a echoue");
end if;
when Query =>
Text_Io.Put_Line ("demande de maintenance");
Id := Messages.Get_Source_Id (Message);
while Abonnement_Storage.Is_Member (Number) loop
Success :=
Orb_Communication.Send
(Messages.Create
(Typ => Forward,
Msg => String_To_String_Var
(" N.Identification : " &
Natural'Image (Number) & Ascii.Lf &
" " & "N.Socket: " &
Utils.Byte_String_To_String
(Byte_Defs.Byte_String
(Abonnement_Storage.See_Socket
(Number))) &
Ascii.Lf & " " &
" Adr. IP machine: " &
Utils.Byte_String_To_String
(Byte_Defs.Byte_String
(Abonnement_Storage.See_Name
(Number)))),
Source => Messages.Get_Source_Id (Message),
Target => Messages.Get_Source_Id (Message),
Order => Messages.Get_Order_Msg (Message)),
Abonnement_Storage.See_Name (Id),
Abonnement_Storage.See_Socket (Id));
Text_Io.Put_Line ("envoie info de maintenance : " &
Natural'Image (Number));
Number := Number + 1;
end loop;
Success :=
Orb_Communication.Send
(Messages.Create
(Typ => Forward,
Msg =>
String_To_String_Var
("---------- Fin de la liste des abonnes ----------"),
Source => Messages.Get_Source_Id (Message),
Target => Messages.Get_Source_Id (Message),
Order => 0),
Abonnement_Storage.See_Name (Id),
Abonnement_Storage.See_Socket (Id));
when Request =>
Text_Io.Put_Line ("demande de travail");
Id := Contrat_Storage.Search
(Messages.Get_Content (Message), Place);
loop
if Abonnement_Storage.Is_Member (Id) then
Success :=
Orb_Communication.Send
(Message, Abonnement_Storage.See_Name (Id),
Abonnement_Storage.See_Socket (Id));
if Success then
Text_Io.Put_Line ("message envoye pour la requete");
exit when Success;
else
Text_Io.Put_Line
("le serveur concerne n'est plus enregistre, recherche d'un autre");
Place := Place + 1;
Id := Contrat_Storage.Search
(Messages.Get_Content (Message), Place);
if Id = 0 then
Text_Io.Put_Line
("Il n'y a plus de serveur concerne, la connexion a echouee");
exit;
end if;
end if;
end if;
end loop;
when Notification =>
Text_Io.Put_Line ("demande d'information");
-- a faire;
Text_Io.Put_Line (" non realise");
when Forward =>
Text_Io.Put_Line ("demande de propagation de message");
Filter_Storage.Init_Iterator;
if (not Filter_Storage.Is_Finish and
Messages.Get_Order_Msg (Message) /= 0) then
while not Filter_Storage.Is_Finish loop
Id := Filter_Storage.Get_Id;
Success :=
Orb_Communication.Send
(Message, Abonnement_Storage.See_Name (Id),
Abonnement_Storage.See_Socket (Id));
end loop;
else
Id := Messages.Get_Target_Id (Message);
Success := Orb_Communication.Send
(Message, Abonnement_Storage.See_Name (Id),
Abonnement_Storage.See_Socket (Id));
if Success then
Text_Io.Put_Line ("envoi realise");
else
Text_Io.Put_Line
("l'envoi n'a pu etre realise car la cible est absente");
end if;
Observator_Storage.Init_Iterator;
while not Observator_Storage.Is_Finish loop
Id := Observator_Storage.Get_Id;
Success :=
Orb_Communication.Send
(Message, Abonnement_Storage.See_Name (Id),
Abonnement_Storage.See_Socket (Id));
end loop;
end if;
when Publication =>
Text_Io.Put_Line ("demande d'enregistrement de contrat");
Contrat_Storage.Add (Messages.Get_Content (Message),
Messages.Get_Source_Id (Message));
Text_Io.Put_Line ("stockage du contrat realise");
when Unpublication =>
Text_Io.Put_Line ("demande de retrait de contrat");
Contrat_Storage.Delete (Messages.Get_Content (Message),
Messages.Get_Source_Id (Message));
Text_Io.Put_Line (" retrait de contrat realise");
when Subscription =>
Text_Io.Put_Line ("demande d'abonnement espion");
if Abonnement_Storage.Is_Member
(Messages.Get_Source_Id (Message)) then
Observator_Storage.Add (Messages.Get_Source_Id (Message));
Text_Io.Put_Line (" abonnement espion realise");
end if;
when Unsubscription =>
Text_Io.Put_Line ("demande de retrait d'abonnement espion");
Observator_Storage.Delete (Messages.Get_Source_Id (Message));
Text_Io.Put_Line ("abonnement espion resilie ");
when Filtration =>
Text_Io.Put_Line ("demande d'enregistrement de filtre");
if Abonnement_Storage.Is_Member
(Messages.Get_Source_Id (Message)) then
Filter_Storage.Add (Messages.Get_Source_Id (Message));
Text_Io.Put_Line (" abonnement filtre realise");
end if;
when Unfiltration =>
Text_Io.Put_Line ("demande de retrait de filtre");
Filter_Storage.Delete (Messages.Get_Source_Id (Message));
Text_Io.Put_Line ("abonnement filtre resilie");
when others =>
Text_Io.Put_Line ("Le type de requete ne convient pas");
--envoyer message a la source
end case;
end Type_Supervisor;
end Orb;
nblk1=e
nid=a
hdr6=1a
[0x00] rec0=1f rec1=00 rec2=01 rec3=026
[0x01] rec0=00 rec1=00 rec2=0d rec3=04a
[0x02] rec0=13 rec1=00 rec2=07 rec3=050
[0x03] rec0=15 rec1=00 rec2=09 rec3=038
[0x04] rec0=0e rec1=00 rec2=0b rec3=022
[0x05] rec0=12 rec1=00 rec2=0e rec3=018
[0x06] rec0=09 rec1=00 rec2=0c rec3=020
[0x07] rec0=11 rec1=00 rec2=04 rec3=024
[0x08] rec0=19 rec1=00 rec2=08 rec3=03a
[0x09] rec0=15 rec1=00 rec2=02 rec3=008
[0x0a] rec0=0e rec1=00 rec2=03 rec3=028
[0x0b] rec0=14 rec1=00 rec2=06 rec3=054
[0x0c] rec0=0b rec1=00 rec2=05 rec3=000
[0x0d] rec0=00 rec1=00 rec2=00 rec3=000
tail 0x21765177e87d19ad5b3d4 0x42a00088462060003
Free Block Chain:
0xa: 0000 00 00 01 60 80 24 41 62 6f 6e 6e 65 6d 65 6e 74 ┆ ` $Abonnement┆