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

⟦34223bd40⟧ Ada Source

    Length: 14336 (0x3800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Remote_Command_Interface, pragma Module_Name 4 4141, seg_014155

Derivation

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

E3 Source Code



with Calendar;
with Directory;
with Ftp_Profile;
with Profile;
with Simple_Status;
pragma Private_Eyes_Only;
with Remote_Commands;

package Remote_Command_Interface is

    -- This package handles all file transfer and remote execution functions of
    -- the RCF.

    -- It can be used either with DTIA, Rational's RPC interface, or with FTP.
    -- DTIA provides facilities to efficiently manage RPC connections.  It
    -- caches (or pools) connections on a session basis to reduce the overhead
    -- that is required to build each remote connection.  FTP, the standard
    -- File Transfer Protocol, may be somewhat less efficient, but it can be
    -- chosen to manage the connections when DTIA is not available for a
    -- particular remote machine.
    --
    -- Clients that make repeated calls to this package in a relatively short
    -- period of time should not bracket each Acquire with a Release.

    -- The suggested methodology for use with these routines is as follows:
    --
    --   begin
    --      Acquire              -- Build a remote connection
    --      Set_Remote_Directory -- Set remote directory for upcoming operation
    --      {remote_operation}   -- Execute_Command, Put, Get, Unit_Update_Time
    --      Release              -- Break down the connection
    --   end;
    --
    -- Acquire causes a connection to be built between the host and the
    -- Remote_Machine, under Username and Password.  If a connection already
    -- exists for the current session with these attributes, it will be used.
    --
    -- Release and Destroy break down the remote connection.
    --
    -- Set_Remote_Directory sets the target directory (and optionally the
    -- target program library) in which remote operations will be performed.
    --
    -- Put copies a file from the HOST R1000 to the TARGET system.
    --
    -- Get copies a file from the TARGET system to the HOST R1000.
    --
    -- Execute_Command calls the remote command-line interpreter to execute the
    -- specified command.  Normally, a completion status should be returned in
    -- Status.  In some cases, it may be necessary to parse the output from the
    -- remote machine in order to detect errors.  Parse_... and Error_Pattern
    -- specify whether to parse the output, what output to parse, and what
    -- pattern to look for.
    --
    -- Unit_Update_Time returns the time at which a remote file was last
    -- updated.
    --
    -- File_Exists determines whether or not a particular file exists on a
    -- remote machine.
    --
    -- Confirmation messages which trace the actions of the Remote_Commands
    -- routines will be written if the Trace_Command parameter is set to True.


    type File_Type is (Text, Binary);

    type Context is private;


    procedure Acquire (Remote_Connection : out Context;
                       Status : in out Simple_Status.Condition;
                       Target_Key : String;
                       Remote_Machine : String := Ftp_Profile.Remote_Machine;
                       Username : String := Ftp_Profile.Username;
                       Password : String := Ftp_Profile.Password;
                       Trace_Command : Boolean := False);
    -- Build a connection to Remote_Machine using Username and Password, and
    -- return the handle for that connection in Remote_Connection.  If the
    -- given Username is null, use the user name and password values from the
    -- Profile.Remote_Password file.  If the connection already exists, use it.


    procedure Acquire (Remote_Connection : out Context;
                       Status : in out Simple_Status.Condition;
                       Target_Key : String;
                       Set_Directory : String;
                       Set_Library : String := "";
                       Remote_Machine : String := Ftp_Profile.Remote_Machine;
                       Username : String := Ftp_Profile.Username;
                       Password : String := Ftp_Profile.Password;
                       Trace_Command : Boolean := False);
    -- This combines the actions of building a connection (Acquire) and setting
    -- the target directory (Set_Remote_Directory).


    procedure Release (Remote_Connection : Context;
                       Status : in out Simple_Status.Condition;
                       Trace_Command : Boolean := False);
    -- Release a remote connection.  The connection is not destroyed
    -- immediately, so it will be possible to re-use it if a subsequent Acquire
    -- is executed.


    procedure Set_Remote_Directory (Set_Directory : String;
                                    Remote_Connection : Context;
                                    Status : in out Simple_Status.Condition;
                                    Set_Library : String := "";
                                    Trace_Command : Boolean := False);
    -- Given the already acquired connection specified by Remote_Connection,
    -- execute the command Set_Directory on the remote machine to change its
    -- remote context to a new directory, and, if Set_Library is not null,
    -- execute the command Set_Library to change to a new program library
    -- within that context.


    procedure Put (Host_File_Name : String;
                   Target_File_Name : String;
                   Remote_Connection : Context;
                   Status : in out Simple_Status.Condition;
                   The_Type : File_Type := Text;
                   Trace_Command : Boolean := False);
    -- Copy the file Host_File_Name to Target_File_Name over the connection
    -- specified by Remote_Connection.


    procedure Get (Host_File_Name : String;
                   Target_File_Name : String;
                   Remote_Connection : Context;
                   Status : in out Simple_Status.Condition;
                   The_Type : File_Type := Text;
                   Trace_Command : Boolean := False);
    -- Retrieve Host_File_Name from the file Target_File_Name over the
    -- connection specified by Remote_Connection.


    procedure Execute_Command (Command_Line : String;
                               Remote_Connection : Context;
                               Status : in out Simple_Status.Condition;
                               Error_Pattern : String := "";
                               Parse_Error_Output : Boolean := False;
                               Parse_Standard_Output : Boolean := False;
                               Show_Parsed_Output : Boolean := True;
                               Trace_Command : Boolean := False);
    -- Execute the command specified by Command_Line on the remote machine
    -- whose connection is specified by Remote_Connection.
    -- For DTIA customizations the following hold :-
    -- Error_Pattern is the sequence of characters in the output string which
    -- initiates the reporting of an error, i.e., if Parse_@ is True, the
    -- output will be searched for Error_Pattern to see if there has been a
    -- reported error.  If Parse_Error_Output is True, Error_Output will be
    -- scanned (for Error_Pattern) to determine whether the remote machine
    -- reported any errors during execution of the command.  If
    -- Parse_Standard_Output is True, Standard_Output will be scenned instead
    -- of Error_Output.  If Show_Parsed_Output is True, the output which is to
    -- be parsed will also be sent along to the caller; otherwise it will not
    -- be passed along.

    procedure Unit_Update_Time (Target_File_Name : String;
                                Remote_Connection : Context;
                                Status : in out Simple_Status.Condition;
                                Result : out Calendar.Time;
                                Trace_Command : Boolean := False);
    -- Get the update time for the unit whose target is Target_File_Name on the
    -- remote machine whose connection is specified by Remote_Connection.
    -- This function is implemented fro DTIA customizations only

    procedure Destroy (Remote_Connection : Context;
                       Status : in out Simple_Status.Condition;
                       Trace_Command : Boolean := False);
    -- Destroy a remote connection.

    procedure File_Exists (The_File : String;
                           Remote_Connection : Context;
                           Status : in out Simple_Status.Condition;
                           Exists : out Boolean;
                           Trace_Command : Boolean := False);
    -- Determine whether or not teh file exists on the remote machine whose
    -- connection is specified by Remote_Connection.

    procedure Upload_Ada_Unit (View : Directory.Object;
                               To_Dir : Directory.Object;
                               Target_Key : String;  
                               Remote_Simple_Name : String;
                               Parsed_Unit : out Directory.Object;
                               Remote_Connection : Context;
                               Condition : in out Simple_Status.Condition;
                               Response : Profile.Response_Profile);
    -- Uploads a remote ADA unit into the specified view and
    -- passes back the directory object associated with it.

    procedure Upload_Ada_Unit (View : Directory.Object;
                               To_Dir : Directory.Object;
                               Target_Key : String;
                               Remote_Simple_Name : String;
                               Parsed_Unit : out Directory.Object;
                               Condition : in out Simple_Status.Condition;
                               Response : Profile.Response_Profile);
    -- Uploads a remote ADA unit into the specified view and
    -- passes back the directory object associated with it. Builds
    -- the remote connection by itself.


    procedure Upload_Text_File (View : Directory.Object;
                                To_Dir : Directory.Object;
                                Target_Key : String;
                                Remote_Simple_Name : String;
                                Local_Text_File : String;  
                                Remote_Connection : Context;
                                Overwrite_Local_File : Boolean := False;
                                Condition : in out Simple_Status.Condition;
                                Response : Profile.Response_Profile);
    -- same as Upload_Text_File above, but automatically acquires and releases
    -- the connection

    procedure Upload_Text_File (View : Directory.Object;
                                To_Dir : Directory.Object;
                                Target_Key : String;
                                Remote_Simple_Name : String;
                                Local_Text_File : String;  
                                Overwrite_Local_File : Boolean := False;
                                Condition : in out Simple_Status.Condition;
                                Response : Profile.Response_Profile);
    -- retrieves remote time from the remote machine, then makes the local
    -- unit consistent

    procedure Update_Consistency (View : Directory.Object;
                                  Host_Unit : Directory.Object;
                                  Target_Key : String;
                                  Remote_Connection : Context;
                                  Condition : in out Simple_Status.Condition;
                                  Response : Profile.Response_Profile);
    -- Update the consistency between a host and target unit

    procedure Update_Consistency (View : Directory.Object;
                                  Host_Unit : Directory.Object;
                                  Target_Key : String;
                                  Condition : in out Simple_Status.Condition;
                                  Response : Profile.Response_Profile);
    -- Update the consistency between a host and target unit and
    -- units also acquires and releases the remote connection .

    pragma Module_Name (4, 4141);
    pragma Bias_Key (32);
private
    type Context is new Remote_Commands.Context;
end Remote_Command_Interface;

E3 Meta Data

    nblk1=d
    nid=0
    hdr6=1a
        [0x00] rec0=1a rec1=00 rec2=01 rec3=066
        [0x01] rec0=16 rec1=00 rec2=02 rec3=01a
        [0x02] rec0=18 rec1=00 rec2=03 rec3=00e
        [0x03] rec0=11 rec1=00 rec2=04 rec3=034
        [0x04] rec0=13 rec1=00 rec2=05 rec3=08c
        [0x05] rec0=16 rec1=00 rec2=06 rec3=034
        [0x06] rec0=11 rec1=00 rec2=07 rec3=08e
        [0x07] rec0=10 rec1=00 rec2=08 rec3=042
        [0x08] rec0=13 rec1=00 rec2=09 rec3=06a
        [0x09] rec0=11 rec1=00 rec2=0a rec3=044
        [0x0a] rec0=13 rec1=00 rec2=0b rec3=078
        [0x0b] rec0=12 rec1=00 rec2=0c rec3=03a
        [0x0c] rec0=0b rec1=00 rec2=0d rec3=000
    tail 0x2150eecbe83127dc22efb 0x42a00088462060003