//------------------------------------------------------------------
// Proxy Unit Generated by Delphi Microservices Container 4.3.20
// Do not modify this unit!
// Generated at: 2025-04-26 18.19.15
//------------------------------------------------------------------
unit SupervisorServerRPCProxy;
interface
uses
System.SysUtils,
System.Classes,
MVCFramework.JSONRPC,
MVCFramework.JSONRPC.Client,
MVCFramework.Serializer.Commons,
System.Net.URLClient,
JsonDataObjects;
type
ISupervisorServerRPCProxy = interface
['{9932DC07-93DD-4549-B4AF-4F98E45CA8D9}']
function RPCExecutor: IMVCJSONRPCExecutor;
procedure IgnoreInvalidCert;
///
/// Invokes [function KeepAlive(const Customer: string; const Email: string; const ExpireDate: string; const LicenseLevel: string; const LicenseHash: string; const MachineFingerPrint: string; const Data: TJsonObject): TJsonObject]
/// Makes DMSContainer shining
///
function KeepAlive(const Customer: string; const Email: string; const ExpireDate: string; const LicenseLevel: string; const LicenseHash: string; const MachineFingerPrint: string; const Data: TJsonObject): TJDOJsonObject;
end;
TSupervisorServerRPCProxy = class(TInterfacedObject, ISupervisorServerRPCProxy)
protected
fRPCExecutor: IMVCJSONRPCExecutor;
function NewReqID: Int64;
procedure IgnoreInvalidServerCertificate(const Sender: TObject;
const ARequest: TURLRequest; const Certificate: TCertificate; var Accepted: Boolean);
public
function RPCExecutor: IMVCJSONRPCExecutor;
procedure IgnoreInvalidCert;
constructor Create(const EndpointURL: String); virtual;
///
/// Invokes [function KeepAlive(const Customer: string; const Email: string; const ExpireDate: string; const LicenseLevel: string; const LicenseHash: string; const MachineFingerPrint: string; const Data: TJsonObject): TJsonObject]
/// Makes DMSContainer shining
///
function KeepAlive(const Customer: string; const Email: string; const ExpireDate: string; const LicenseLevel: string; const LicenseHash: string; const MachineFingerPrint: string; const Data: TJsonObject): TJDOJsonObject;
end;
implementation
constructor TSupervisorServerRPCProxy.Create(const EndpointURL: String);
begin
inherited Create;
fRPCExecutor := TMVCJSONRPCExecutor.Create(EndpointURL);
fRPCExecutor.AddHTTPHeader(TNetHeader.Create('Accept-Encoding', 'gzip,deflate'));
fRPCExecutor.AddHTTPHeader(TNetHeader.Create('User-Agent', 'dmscontainer-delphi-proxy'));
end;
function TSupervisorServerRPCProxy.NewReqID: Int64;
begin
Result := 10000 + Random(10000000);
end;
function TSupervisorServerRPCProxy.RPCExecutor: IMVCJSONRPCExecutor;
begin
Result := fRPCExecutor;
end;
procedure TSupervisorServerRPCProxy.IgnoreInvalidCert;
begin
fRPCExecutor.SetOnValidateServerCertificate(IgnoreInvalidServerCertificate);
end;
procedure TSupervisorServerRPCProxy.IgnoreInvalidServerCertificate(
const Sender: TObject; const ARequest: TURLRequest;
const Certificate: TCertificate; var Accepted: Boolean);
begin
Accepted := True;
end;
function TSupervisorServerRPCProxy.KeepAlive(const Customer: string; const Email: string; const ExpireDate: string; const LicenseLevel: string; const LicenseHash: string; const MachineFingerPrint: string; const Data: TJsonObject): TJDOJsonObject;
var
lReq: IJSONRPCRequest;
lResp: IJSONRPCResponse;
begin
lReq := TJSONRPCRequest.Create(NewReqID, 'KeepAlive');
lReq.Params.Add(Customer);
lReq.Params.Add(Email);
lReq.Params.Add(ExpireDate);
lReq.Params.Add(LicenseLevel);
lReq.Params.Add(LicenseHash);
lReq.Params.Add(MachineFingerPrint);
lReq.Params.Add(Data);
lResp := fRPCExecutor.ExecuteRequest(lReq);
Result := lResp.ResultAsJSONObject.Clone as TJDOJsonObject; //TJsonObject
end;
end.