DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦3982ee926⟧ Ada Source

    Length: 14336 (0x3800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Orb, seg_058371

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Communication;
with Message;
with General_Data_Base;
with Agent_Nb;
with Text_Io;
with Var_String;
with Com_Chanel;  
with Trame_Registration;
with Trame_Publication;
with Trame_Request;
with Method_Defs;

procedure Orb is
    V : Var_String.V_String;
    S : Communication.Status_Code;
    M : Message.Object;
    Data_Base : General_Data_Base.T_General_Data_Base;
    use Communication;  
    use Method_Defs;

begin  
    Text_Io.Put_Line ("Orb Avant  Communication.Init");
    Communication.Init (Chanel => Com_Chanel.Get_Orb_Chanel, Status => S);
    Text_Io.Put_Line ("Status:" & Communication.Status_Code'Image (S));
    Text_Io.Put_Line ("chanel:" &
                      Var_String.Image (Com_Chanel.Image
                                           (Communication.Get_Chanel)));

    if S /= Communication.Ok then
        return;
    end if;

    General_Data_Base.Create_General_Data_Base (Data_Base);

    loop
        delay (100);

        Communication.Receive (Message => V, Status => S);
        Text_Io.Put_Line ("resultat:" & Var_String.Image (V) & " status :" &
                          Communication.Status_Code'Image (S));
        if S = Communication.Ok then
            M := Message.Value (Message => V);
            case Message.Get_Class (M) is

----------------------------------------------
                when Message.Registration =>
                    declare
                        Trame : Trame_Registration.Object;
                        Agent : Agent_Nb.T_Agent_Nb;
                    begin
                        Trame := Trame_Registration.Value
                                    (Message.Get_Donnees (M));
                        General_Data_Base.Registration
                           (The_Data_Base => Data_Base,
                            The_Object =>
                               Trame_Registration.Get_Com_Chanel (Trame),
                            The_Agent_Nb => Agent,
                            The_Class => Trame_Registration.Get_Class (Trame));

                        Communication.Send
                           (Message =>
                               Message.Image
                                  (Message =>
                                      Message.Create
                                         (Class => Message.Replay,
                                          Source => Agent,
                                          Destination => Agent_Nb.Null_Agent_Nb,
                                          Donnees => Var_String.Null_V_String)),
                            Remote_Host =>
                               Com_Chanel.Get_Host_Id
                                  (Trame_Registration.Get_Com_Chanel (Trame)),
                            Remote_Socket =>
                               Com_Chanel.Get_Socket_Id
                                  (Trame_Registration.Get_Com_Chanel (Trame)),
                            Status => S);

                        if S = Communication.Ok then
                            Text_Io.Put_Line
                               ("Registration agent " &
                                Var_String.Image (Agent_Nb.Image (Agent)) &
                                " Ok : " &
                                Var_String.Image
                                   (Com_Chanel.Image
                                       (Trame_Registration.Get_Com_Chanel
                                           (Trame))));
                        else
                            Text_Io.Put_Line
                               ("Erreur registration agent " &
                                Var_String.Image
                                   (Com_Chanel.Image
                                       (Trame_Registration.Get_Com_Chanel
                                           (Trame))));
                        end if;
                    end;

----------------------------------------------
                when Message.Unregistration =>
                    Text_Io.Put ("Unregistration");
                    General_Data_Base.Unregistration
                       (Data_Base, Message.Get_Source (M));
                    Text_Io.Put_Line
                       (" agent " & Var_String.Image
                                       (Agent_Nb.Image
                                           (Message.Get_Source (M))));

----------------------------------------------
                when Message.Publication =>
                    declare
                        Trame : Trame_Publication.Object;
                    begin
                        Trame := Trame_Publication.Value
                                    (Message.Get_Donnees (M));
                        General_Data_Base.Publication
                           (The_Data_Base => Data_Base,
                            The_Agent_Nb => Message.Get_Source (M),
                            The_Method_Name =>
                               Trame_Publication.Get_Methode (Trame),
                            The_Parameter =>
                               Trame_Publication.Get_Parameter (Trame));

                        Text_Io.Put_Line
                           ("Publication agent " &
                            Var_String.Image
                               (Agent_Nb.Image (Message.Get_Source (M))) &
                            " Ok : " &
                            Var_String.Image
                               (Trame_Publication.Get_Methode (Trame)));
                    end;

----------------------------------------------
                when Message.Unpublication =>
                    declare
                        Trame : Trame_Publication.Object;
                    begin  
                        Text_Io.Put ("Unpublication");

                        Trame := Trame_Publication.Value
                                    (Message.Get_Donnees (M));

                        General_Data_Base.Unpublication
                           (The_Data_Base => Data_Base,
                            The_Agent_Nb => Message.Get_Source (Message => M),
                            The_Method_Name =>
                               Trame_Publication.Get_Methode (Trame => Trame));

                        Text_Io.Put_Line
                           (" agent " &
                            Var_String.Image
                               (Agent_Nb.Image (Message.Get_Source (M))) &
                            " Ok : " &
                            Var_String.Image
                               (Trame_Publication.Get_Methode (Trame)));

                    end;

----------------------------------------------
                when Message.Request =>
                    declare
                        C : Com_Chanel.Object;
                        Trame : Trame_Request.Object;
                        A_Agent_Nb_Set : Agent_Nb_Set.Set;
                        Request_Result : Boolean;
                        Iter : Agent_Nb_Set.Iterator;
                        Parameter : Var_String.V_String;

                    begin  
                        Trame := Trame_Request.Value (Message.Get_Donnees (M));

                        Agent_Nb_Set.Initialize (A_Agent_Nb_Set);
                        General_Data_Base.Request
                           (Data_Base, Trame_Request.Get_Methode (Trame),
                            A_Agent_Nb_Set, Parameter, Request_Result);

                        if Request_Result then
                            Agent_Nb_Set.Init (Iter, A_Agent_Nb_Set);
                            General_Data_Base.Get_Com_Chanel
                               (Data_Base, Agent_Nb_Set.Value (Iter), C);  
                            Message.Set_Destination (M,
                                                     Agent_Nb_Set.Value (Iter));
                            Communication.Send
                               (Message => Message.Image (Message => M),
                                Remote_Host => Com_Chanel.Get_Host_Id (C),
                                Remote_Socket => Com_Chanel.Get_Socket_Id (C),
                                Status => S);

                        else  
                            General_Data_Base.Get_Com_Chanel
                               (Data_Base, Message.Get_Source (M), C);
                            Message.Set_Class (M, Message.Error);
                            Communication.Send
                               (Message => Message.Image (Message => M),
                                Remote_Host => Com_Chanel.Get_Host_Id (C),
                                Remote_Socket => Com_Chanel.Get_Socket_Id (C),
                                Status => S);

                        end if;
                    end;

----------------------------------------------
                when Message.Replay =>
                    declare
                        C : Com_Chanel.Object;
                    begin
                        General_Data_Base.Get_Com_Chanel
                           (Data_Base, Message.Get_Destination (M), C);
                        Communication.Send
                           (Message => Message.Image (Message => M),
                            Remote_Host => Com_Chanel.Get_Host_Id (C),
                            Remote_Socket => Com_Chanel.Get_Socket_Id (C),
                            Status => S);

                    end;


----------------------------------------------
                when others =>
                    null;
            end case;
        end if;

    end loop;
end Orb;

E3 Meta Data

    nblk1=d
    nid=0
    hdr6=1a
        [0x00] rec0=25 rec1=00 rec2=01 rec3=022
        [0x01] rec0=00 rec1=00 rec2=0c rec3=002
        [0x02] rec0=15 rec1=00 rec2=03 rec3=04a
        [0x03] rec0=00 rec1=00 rec2=0b rec3=00c
        [0x04] rec0=12 rec1=00 rec2=02 rec3=02c
        [0x05] rec0=15 rec1=00 rec2=08 rec3=030
        [0x06] rec0=0d rec1=00 rec2=07 rec3=022
        [0x07] rec0=13 rec1=00 rec2=04 rec3=012
        [0x08] rec0=17 rec1=00 rec2=06 rec3=016
        [0x09] rec0=17 rec1=00 rec2=05 rec3=038
        [0x0a] rec0=10 rec1=00 rec2=09 rec3=004
        [0x0b] rec0=14 rec1=00 rec2=0d rec3=034
        [0x0c] rec0=0d rec1=00 rec2=0a rec3=001
    tail 0x21765996887e301e06c3c 0x42a00088462060003