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

⟦c0f835637⟧ 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_01b20e

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 RCI.

    -- Depending on what is specified in the customization registered for
    -- a particular target key remote communicatiom may be carried out using
    -- DTIA (Rational's RPC) or using TELNET/FTP.
    --
    -- The suggested sequence for acquiring connections  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
    --   end;
    --
    -- Acquire causes a connection to be built between the host and the
    -- Remote_Machine, with the given  Username and Password.
    -- Acquire always will fetch teh connections from the cache
    -- if they are available there.
    --
    -- For DTIA connections are cached on a per job and on a per
    -- session basis. TELNET connections are cached on a per
    -- job basis and on a per system basis. FTP connections
    -- are not cached.
    --
    -- Release causes the connection to be removed from the JOB
    -- cache. The connection will still be available in
    -- the session cache in the case of DTIA or the system
    -- cache in case of TELNET connections. FTP connections
    -- are freed during released.
    --
    -- Set_Remote_Directory sets the context on the target from
    -- 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 executes the specified command on the target system
    -- specified command.The parameters error_pattern,parse_error_output
    -- parse_standard_output,show_parsed_output are for
    -- DTIA connections only (the target_key decides whether DTIA or
    -- TELNET is used). For TELNET connections the customization
    -- for the given target key specifies whether status checking
    -- of remote comamnds is done thru FTP or TELNET
    --
    -- Unit_Update_Time returns the time at which a remote file was last
    -- updated. This call is not supported for TELNET connections
    --
    -- 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.The set_library parameter
    -- is currently unsupported.


    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 the remote connection .

    procedure Release_Unused_Connections
                 (Unused_Time : Duration;
                  Status : in out Simple_Status.Condition);
    -- Release connections cached by the RCI that have been unused for the
    -- duration specified by "Unused_time"


    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=1d rec1=00 rec2=01 rec3=01e
        [0x01] rec0=16 rec1=00 rec2=02 rec3=052
        [0x02] rec0=18 rec1=00 rec2=03 rec3=02e
        [0x03] rec0=11 rec1=00 rec2=04 rec3=054
        [0x04] rec0=14 rec1=00 rec2=05 rec3=01a
        [0x05] rec0=16 rec1=00 rec2=06 rec3=016
        [0x06] rec0=11 rec1=00 rec2=07 rec3=00e
        [0x07] rec0=0f rec1=00 rec2=08 rec3=056
        [0x08] rec0=14 rec1=00 rec2=09 rec3=03c
        [0x09] rec0=13 rec1=00 rec2=0a rec3=012
        [0x0a] rec0=11 rec1=00 rec2=0b rec3=03c
        [0x0b] rec0=11 rec1=00 rec2=0c rec3=080
        [0x0c] rec0=11 rec1=00 rec2=0d rec3=000
    tail 0x21517d67e83637b2bac48 0x42a00088462060003