DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦c1983ba45⟧ TextFile

    Length: 3405 (0xd4d)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Text_Io;
with Machine_Name;
with Program;
with String_Utilities;
with Unbounded_String;
package body Broker is

    package Su renames String_Utilities;
    package Us is new Unbounded_String (Default_Maximum_Length => 20);

    type Service is
        record
            Class : Us.Variable_String;
            Operation : Us.Variable_String;
            Profile : Us.Variable_String;  
            Command : Us.Variable_String;
            Host : Us.Variable_String;
        end record;

    Services : array (Natural range 0 .. 9999) of Service;

    procedure Register_Service (Class : String;
                                Operation : String;
                                Profile : String;
                                Command : String;
                                Host : String) is
        I : Integer := Su.Hash_String (S => Class & Operation); --[ambiguous]
    begin
        if Us.Image (Services (I).Class) /= "" then
            Text_Io.Put_Line ("*** Unable to register service " &
                              Class & "." & Operation);
            Text_Io.Put_Line ("*** Service ID " & Integer'Image (I) &
                              " already allocated");
        else
            Services (I) := Service'(Class => Us.Value (Class),
                                     Operation => Us.Value (Operation),
                                     Profile => Us.Value (Profile),
                                     Command => Us.Value (Command),
                                     Host => Us.Value (Host));  
        end if;
    end Register_Service;


    procedure Complete_Service
                 (Class : String; Operation : String; Parameters : String) is
        I : Integer := Su.Hash_String (S => Class & Operation);
        Local_Service : Boolean := Us.Image (Services (I).Host) = Machine_Name;
        Has_Parameter : Boolean := Us.Image (Services (I).Profile) /= "";
    begin
        if Local_Service then
            Program.Run_Job (S => Us.Image (Services (I).Command) &
                                     "(""" & Parameters & """)",
                             Debug => False,
                             Context => "$",
                             After => 0.0,
                             Options => "",
                             Response => "<PROFILE>");
        else
            Text_Io.Put_Line (Item =>
                                 "remote executing " &
                                    Us.Image (Services (I).Command) & " on " &
                                    Us.Image (Services (I).Host));
        end if;
    end Complete_Service;

    procedure Show_Registration is
    begin
        for I in Services'Range loop
            if Us.Image (Services (I).Host) /= "" then
                Text_Io.Put_Line ("---- registered services ----");
                Text_Io.Put_Line ("class = " & Us.Image (Services (I).Class));
                Text_Io.Put_Line ("operation = " &
                                  Us.Image (Services (I).Operation));
                Text_Io.Put_Line ("profile = " &
                                  Us.Image (Services (I).Profile));
                Text_Io.Put_Line ("command = " &
                                  Us.Image (Services (I).Command));
                Text_Io.Put_Line ("host = " & Us.Image (Services (I).Host));
            end if;
        end loop;
    end Show_Registration;


end Broker;