|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ T V ┃
Length: 12339 (0x3033) Types: TextFile Names: »V«
└─⟦5829e5ed5⟧ Bits:30000534 8mm tape, Rational 1000, RCI 2_0_5 └─ ⟦c9a165082⟧ »DATA« └─⟦c3895f76e⟧ └─⟦this⟧
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;