source: cprs/branches/tmg-cprs/BDK32/Source/RPCSharedBrokerSessionMgr1_TLB.pas@ 1099

Last change on this file since 1099 was 453, checked in by Kevin Toppenberg, 16 years ago

Initial upload of TMG-CPRS 1.0.26.69

File size: 41.9 KB
RevLine 
[453]1{ **************************************************************
2 Package: XWB - Kernel RPCBroker
3 Date Created: Sept 18, 1997 (Version 1.1)
4 Site Name: Oakland, OI Field Office, Dept of Veteran Affairs
5 Developers: Joel Ivey
6 Description: Type library for use with SharedRPCBroker.
7 Current Release: Version 1.1 Patch 40 (January 7, 2005))
8*************************************************************** }
9
10unit RPCSharedBrokerSessionMgr1_TLB;
11
12// ************************************************************************ //
13// WARNING
14// -------
15// The types declared in this file were generated from data read from a
16// Type Library. If this type library is explicitly or indirectly (via
17// another type library referring to this type library) re-imported, or the
18// 'Refresh' command of the Type Library Editor activated while editing the
19// Type Library, the contents of this file will be regenerated and all
20// manual modifications will be lost.
21// ************************************************************************ //
22
23// PASTLWTR : $Revision: 1.88.1.0.1.0 $
24// File generated on 1/25/2002 11:58:49 AM from Type Library described below.
25
26// *************************************************************************//
27// NOTE:
28// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
29// which return objects that may need to be explicitly created via a function
30// call prior to any access via the property. These items have been disabled
31// in order to prevent accidental use from within the object inspector. You
32// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
33// removing them from the $IFDEF blocks. However, such items must still be
34// programmatically created via a method of the appropriate CoClass before
35// they can be used.
36// ************************************************************************ //
37// Type Lib: D:\Development\RPCSharedBroker\Exe1\RPCSharedBrokerSessionMgr1.exe (1)
38// IID\LCID: {1F7D1EB0-E54F-46F0-B485-2D56743EBB70}\0
39// Helpfile:
40// DepndLst:
41// (1) v2.0 stdole, (C:\WINNT\System32\stdole2.tlb)
42// (2) v4.0 StdVCL, (C:\WINNT\System32\STDVCL40.DLL)
43// Errors:
44// Error creating palette bitmap of (TSharedBroker) : Invalid GUID format
45// ************************************************************************ //
46{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
47interface
48
49uses Windows, ActiveX, Classes, Graphics, OleServer, OleCtrls, StdVCL;
50
51// *********************************************************************//
52// GUIDS declared in the TypeLibrary. Following prefixes are used:
53// Type Libraries : LIBID_xxxx
54// CoClasses : CLASS_xxxx
55// DISPInterfaces : DIID_xxxx
56// Non-DISP interfaces: IID_xxxx
57// *********************************************************************//
58const
59 // TypeLibrary Major and minor versions
60 RPCSharedBrokerSessionMgr1MajorVersion = 1;
61 RPCSharedBrokerSessionMgr1MinorVersion = 0;
62
63 LIBID_RPCSharedBrokerSessionMgr1: TGUID = '{1F7D1EB0-E54F-46F0-B485-2D56743EBB70}';
64
65 IID_ISharedBroker: TGUID = '{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}';
66 DIID_ISharedBrokerEvents: TGUID = '{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}';
67 CLASS_SharedBroker: TGUID = '{EB44A5CD-1871-429F-A5BC-19C71B722182}';
68
69// *********************************************************************//
70// Declaration of Enumerations defined in Type Library
71// *********************************************************************//
72// Constants for enum ISharedBrokerErrorCode
73type
74 ISharedBrokerErrorCode = TOleEnum;
75const
76 GeneralFailure = $00000000;
77 Success = $00000001;
78 UniqueRpcIdDoesNotExist = $00000002;
79 UniqueClientIdDoesNotExist = $00000003;
80 RpcHistoryIndexOutOfRange = $00000004;
81 RpcHistoryNotEnabled = $00000005;
82 CouldNotSetContext = $00000006;
83 CouldNotConnect = $00000007;
84 ClientIndexOutOfRange = $00000008;
85 NilClientPointer = $00000009;
86 ConnectionIndexOutOfRange = $0000000A;
87
88// Constants for enum IRegistryRootEnum
89type
90 IRegistryRootEnum = TOleEnum;
91const
92 HKCR = $00000000;
93 HKCU = $00000001;
94 HKLM = $00000002;
95 HKU = $00000003;
96 HKCC = $00000004;
97 HKDD = $00000005;
98
99// Constants for enum ISharedBrokerConnection
100type
101 ISharedBrokerConnection = TOleEnum;
102const
103 Failed = $00000000;
104 New = $00000001;
105 Shared = $00000002;
106 Debug = $00000003;
107
108// Constants for enum ISharedBrokerClient
109type
110 ISharedBrokerClient = TOleEnum;
111const
112 BrokerClient = $00000000;
113 DebuggerClient = $00000001;
114
115// Constants for enum ISharedBrokerShowErrorMsgs
116type
117 ISharedBrokerShowErrorMsgs = TOleEnum;
118const
119 isemRaise = $00000000;
120 isemQuiet = $00000001;
121
122type
123
124// *********************************************************************//
125// Forward declaration of types defined in TypeLibrary
126// *********************************************************************//
127 ISharedBroker = interface;
128 ISharedBrokerDisp = dispinterface;
129 ISharedBrokerEvents = dispinterface;
130
131// *********************************************************************//
132// Declaration of CoClasses defined in Type Library
133// (NOTE: Here we map each CoClass to its Default Interface)
134// *********************************************************************//
135 SharedBroker = ISharedBroker;
136
137
138// *********************************************************************//
139// Interface: ISharedBroker
140// Flags: (4416) Dual OleAutomation Dispatchable
141// GUID: {E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}
142// *********************************************************************//
143 ISharedBroker = interface(IDispatch)
144 ['{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}']
145 function BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient;
146 const ServerPort: WideString; WantDebug: WordBool;
147 AllowShared: WordBool; KernelLogin: WordBool;
148 ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT;
149 var LoginStr: WideString; out UniqueClientIId: SYSINT;
150 out ErrorMsg: WideString): ISharedBrokerErrorCode; safecall;
151 function BrokerDisconnect: ISharedBrokerErrorCode; safecall;
152 function BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode; safecall;
153 function BrokerCall(const RpcName: WideString; const RpcParams: WideString;
154 RpcTimeLimit: Integer; out RpcResults: WideString;
155 out UniqueRpcCallId: Integer): ISharedBrokerErrorCode; safecall;
156 function ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
157 const Name: WideString; const Default: WideString;
158 out RegResult: WideString): ISharedBrokerErrorCode; safecall;
159 function Get_RpcVersion: WideString; safecall;
160 procedure Set_RpcVersion(const version: WideString); safecall;
161 function Get_RpcHistoryEnabled: WordBool; safecall;
162 procedure Set_RpcHistoryEnabled(enabled: WordBool); safecall;
163 function Get_PerClientRpcHistoryLimit: Integer; safecall;
164 procedure Set_PerClientRpcHistoryLimit(limit: Integer); safecall;
165 function GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode; safecall;
166 function GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer;
167 out ClientName: WideString): ISharedBrokerErrorCode; safecall;
168 function LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode; safecall;
169 function GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode; safecall;
170 function GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode; safecall;
171 function GetActiveBrokerConnectionInfo(connectionIndex: Integer;
172 out connectedServerIp: WideString;
173 out connectedServerPort: Integer;
174 out lastContext: WideString): ISharedBrokerErrorCode; safecall;
175 function GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
176 out connectionIndex: Integer): ISharedBrokerErrorCode; safecall;
177 function GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
178 out brokerContext: WideString; out RpcName: WideString;
179 out RpcParams: WideString; out rpcResult: WideString;
180 out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode; safecall;
181 function GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer;
182 out uniqueRpcId: Integer; out brokerContext: WideString;
183 out RpcName: WideString; out RpcParams: WideString;
184 out rpcResult: WideString; out rpcStartDateTime: Double;
185 out rpcDuration: Integer): ISharedBrokerErrorCode; safecall;
186 function GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
187 out ClientName: WideString): ISharedBrokerErrorCode; safecall;
188 function GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode; safecall;
189 function Get_CurrentContext: WideString; safecall;
190 function Get_User: WideString; safecall;
191 function Get_Login: WideString; safecall;
192 procedure Set_Login(const Value: WideString); safecall;
193 function Get_RpcbError: WideString; safecall;
194 function Get_Socket: Integer; safecall;
195 function Get_KernelLogin: WordBool; safecall;
196 procedure Set_KernelLogin(Value: WordBool); safecall;
197 function Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs; safecall;
198 procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs); safecall;
199 property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
200 property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
201 property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
202 property CurrentContext: WideString read Get_CurrentContext;
203 property User: WideString read Get_User;
204 property Login: WideString read Get_Login write Set_Login;
205 property RpcbError: WideString read Get_RpcbError;
206 property Socket: Integer read Get_Socket;
207 property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
208 property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
209 end;
210
211// *********************************************************************//
212// DispIntf: ISharedBrokerDisp
213// Flags: (4416) Dual OleAutomation Dispatchable
214// GUID: {E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}
215// *********************************************************************//
216 ISharedBrokerDisp = dispinterface
217 ['{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}']
218 function BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient;
219 const ServerPort: WideString; WantDebug: WordBool;
220 AllowShared: WordBool; KernelLogin: WordBool;
221 ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT;
222 var LoginStr: WideString; out UniqueClientIId: SYSINT;
223 out ErrorMsg: WideString): ISharedBrokerErrorCode; dispid 1;
224 function BrokerDisconnect: ISharedBrokerErrorCode; dispid 2;
225 function BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode; dispid 3;
226 function BrokerCall(const RpcName: WideString; const RpcParams: WideString;
227 RpcTimeLimit: Integer; out RpcResults: WideString;
228 out UniqueRpcCallId: Integer): ISharedBrokerErrorCode; dispid 4;
229 function ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
230 const Name: WideString; const Default: WideString;
231 out RegResult: WideString): ISharedBrokerErrorCode; dispid 5;
232 property RpcVersion: WideString dispid 7;
233 property RpcHistoryEnabled: WordBool dispid 6;
234 property PerClientRpcHistoryLimit: Integer dispid 8;
235 function GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode; dispid 10;
236 function GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer;
237 out ClientName: WideString): ISharedBrokerErrorCode; dispid 11;
238 function LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode; dispid 12;
239 function GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode; dispid 13;
240 function GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode; dispid 14;
241 function GetActiveBrokerConnectionInfo(connectionIndex: Integer;
242 out connectedServerIp: WideString;
243 out connectedServerPort: Integer;
244 out lastContext: WideString): ISharedBrokerErrorCode; dispid 15;
245 function GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
246 out connectionIndex: Integer): ISharedBrokerErrorCode; dispid 16;
247 function GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
248 out brokerContext: WideString; out RpcName: WideString;
249 out RpcParams: WideString; out rpcResult: WideString;
250 out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode; dispid 17;
251 function GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer;
252 out uniqueRpcId: Integer; out brokerContext: WideString;
253 out RpcName: WideString; out RpcParams: WideString;
254 out rpcResult: WideString; out rpcStartDateTime: Double;
255 out rpcDuration: Integer): ISharedBrokerErrorCode; dispid 18;
256 function GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
257 out ClientName: WideString): ISharedBrokerErrorCode; dispid 19;
258 function GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode; dispid 20;
259 property CurrentContext: WideString readonly dispid 9;
260 property User: WideString readonly dispid 22;
261 property Login: WideString dispid 23;
262 property RpcbError: WideString readonly dispid 24;
263 property Socket: Integer readonly dispid 25;
264 property KernelLogin: WordBool dispid 26;
265 property ShowErrorMsgs: ISharedBrokerShowErrorMsgs dispid 27;
266 end;
267
268// *********************************************************************//
269// DispIntf: ISharedBrokerEvents
270// Flags: (4096) Dispatchable
271// GUID: {CBEA7167-4F9B-465A-B82E-4CEBDF933C35}
272// *********************************************************************//
273 ISharedBrokerEvents = dispinterface
274 ['{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}']
275 procedure OnLogout; dispid 1;
276 procedure OnRpcCallRecorded(uniqueRpcId: SYSINT); dispid 2;
277 procedure OnClientConnect(UniqueClientId: SYSINT; Connection: ISharedBrokerConnection); dispid 3;
278 procedure OnClientDisconnect(UniqueClientId: SYSINT); dispid 4;
279 procedure OnContextChanged(connectionIndex: SYSINT; const NewContext: WideString); dispid 5;
280 procedure OnRPCBFailure(const ErrorText: WideString); dispid 6;
281 procedure OnLoginError(const ErrorText: WideString); dispid 7;
282 procedure OnConnectionDropped(connectionIndex: SYSINT; const ErrorText: WideString); dispid 8;
283 end;
284
285// *********************************************************************//
286// The Class CoSharedBroker provides a Create and CreateRemote method to
287// create instances of the default interface ISharedBroker exposed by
288// the CoClass SharedBroker. The functions are intended to be used by
289// clients wishing to automate the CoClass objects exposed by the
290// server of this typelibrary.
291// *********************************************************************//
292 CoSharedBroker = class
293 class function Create: ISharedBroker;
294 class function CreateRemote(const MachineName: string): ISharedBroker;
295 end;
296
297 TSharedBrokerOnRpcCallRecorded = procedure(Sender: TObject; uniqueRpcId: SYSINT) of object;
298 TSharedBrokerOnClientConnect = procedure(Sender: TObject; UniqueClientId: SYSINT;
299 Connection: ISharedBrokerConnection) of object;
300 TSharedBrokerOnClientDisconnect = procedure(Sender: TObject; UniqueClientId: SYSINT) of object;
301 TSharedBrokerOnContextChanged = procedure(Sender: TObject; connectionIndex: SYSINT;
302 var NewContext: OleVariant) of object;
303 TSharedBrokerOnRPCBFailure = procedure(Sender: TObject; var ErrorText: OleVariant) of object;
304 TSharedBrokerOnLoginError = procedure(Sender: TObject; var ErrorText: OleVariant) of object;
305 TSharedBrokerOnConnectionDropped = procedure(Sender: TObject; connectionIndex: SYSINT;
306 var ErrorText: OleVariant) of object;
307
308
309// *********************************************************************//
310// OLE Server Proxy class declaration
311// Server Object : TSharedBroker
312// Help String : SharedBroker Object
313// Default Interface: ISharedBroker
314// Def. Intf. DISP? : No
315// Event Interface: ISharedBrokerEvents
316// TypeFlags : (2) CanCreate
317// *********************************************************************//
318{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
319 TSharedBrokerProperties= class;
320{$ENDIF}
321 TSharedBroker = class(TOleServer)
322 private
323 FOnLogout: TNotifyEvent;
324 FOnRpcCallRecorded: TSharedBrokerOnRpcCallRecorded;
325 FOnClientConnect: TSharedBrokerOnClientConnect;
326 FOnClientDisconnect: TSharedBrokerOnClientDisconnect;
327 FOnContextChanged: TSharedBrokerOnContextChanged;
328 FOnRPCBFailure: TSharedBrokerOnRPCBFailure;
329 FOnLoginError: TSharedBrokerOnLoginError;
330 FOnConnectionDropped: TSharedBrokerOnConnectionDropped;
331 FIntf: ISharedBroker;
332{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
333 FProps: TSharedBrokerProperties;
334 function GetServerProperties: TSharedBrokerProperties;
335{$ENDIF}
336 function GetDefaultInterface: ISharedBroker;
337 protected
338 procedure InitServerData; override;
339 procedure InvokeEvent(DispID: TDispID; var Params: TVariantArray); override;
340 function Get_RpcVersion: WideString;
341 procedure Set_RpcVersion(const version: WideString);
342 function Get_RpcHistoryEnabled: WordBool;
343 procedure Set_RpcHistoryEnabled(enabled: WordBool);
344 function Get_PerClientRpcHistoryLimit: Integer;
345 procedure Set_PerClientRpcHistoryLimit(limit: Integer);
346 function Get_CurrentContext: WideString;
347 function Get_User: WideString;
348 function Get_Login: WideString;
349 procedure Set_Login(const Value: WideString);
350 function Get_RpcbError: WideString;
351 function Get_Socket: Integer;
352 function Get_KernelLogin: WordBool;
353 procedure Set_KernelLogin(Value: WordBool);
354 function Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
355 procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
356 public
357 constructor Create(AOwner: TComponent); override;
358 destructor Destroy; override;
359 procedure Connect; override;
360 procedure ConnectTo(svrIntf: ISharedBroker);
361 procedure Disconnect; override;
362 function BrokerConnect(const ClientName: WideString; ConnectionType: ISharedBrokerClient;
363 const ServerPort: WideString; WantDebug: WordBool;
364 AllowShared: WordBool; KernelLogin: WordBool;
365 ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT;
366 var LoginStr: WideString; out UniqueClientIId: SYSINT;
367 out ErrorMsg: WideString): ISharedBrokerErrorCode;
368 function BrokerDisconnect: ISharedBrokerErrorCode;
369 function BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode;
370 function BrokerCall(const RpcName: WideString; const RpcParams: WideString;
371 RpcTimeLimit: Integer; out RpcResults: WideString;
372 out UniqueRpcCallId: Integer): ISharedBrokerErrorCode;
373 function ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
374 const Name: WideString; const Default: WideString;
375 out RegResult: WideString): ISharedBrokerErrorCode;
376 function GetRpcHistoryCountForClient(UniqueClientId: Integer; out rpcHistoryCount: Integer): ISharedBrokerErrorCode;
377 function GetClientIdAndNameFromIndex(clientIndex: Integer; out UniqueClientId: Integer;
378 out ClientName: WideString): ISharedBrokerErrorCode;
379 function LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode;
380 function GetClientNameFromUniqueClientId(UniqueClientId: Integer; out ClientName: WideString): ISharedBrokerErrorCode;
381 function GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode;
382 function GetActiveBrokerConnectionInfo(connectionIndex: Integer;
383 out connectedServerIp: WideString;
384 out connectedServerPort: Integer;
385 out lastContext: WideString): ISharedBrokerErrorCode;
386 function GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
387 out connectionIndex: Integer): ISharedBrokerErrorCode;
388 function GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
389 out brokerContext: WideString; out RpcName: WideString;
390 out RpcParams: WideString; out rpcResult: WideString;
391 out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode;
392 function GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer;
393 out uniqueRpcId: Integer; out brokerContext: WideString;
394 out RpcName: WideString; out RpcParams: WideString;
395 out rpcResult: WideString; out rpcStartDateTime: Double;
396 out rpcDuration: Integer): ISharedBrokerErrorCode;
397 function GetRpcClientIdFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
398 out ClientName: WideString): ISharedBrokerErrorCode;
399 function GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode;
400 property DefaultInterface: ISharedBroker read GetDefaultInterface;
401 property CurrentContext: WideString read Get_CurrentContext;
402 property User: WideString read Get_User;
403 property RpcbError: WideString read Get_RpcbError;
404 property Socket: Integer read Get_Socket;
405 property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
406 property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
407 property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
408 property Login: WideString read Get_Login write Set_Login;
409 property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
410 property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
411 published
412{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
413 property Server: TSharedBrokerProperties read GetServerProperties;
414{$ENDIF}
415 property OnLogout: TNotifyEvent read FOnLogout write FOnLogout;
416 property OnRpcCallRecorded: TSharedBrokerOnRpcCallRecorded read FOnRpcCallRecorded write FOnRpcCallRecorded;
417 property OnClientConnect: TSharedBrokerOnClientConnect read FOnClientConnect write FOnClientConnect;
418 property OnClientDisconnect: TSharedBrokerOnClientDisconnect read FOnClientDisconnect write FOnClientDisconnect;
419 property OnContextChanged: TSharedBrokerOnContextChanged read FOnContextChanged write FOnContextChanged;
420 property OnRPCBFailure: TSharedBrokerOnRPCBFailure read FOnRPCBFailure write FOnRPCBFailure;
421 property OnLoginError: TSharedBrokerOnLoginError read FOnLoginError write FOnLoginError;
422 property OnConnectionDropped: TSharedBrokerOnConnectionDropped read FOnConnectionDropped write FOnConnectionDropped;
423 end;
424
425{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
426// *********************************************************************//
427// OLE Server Properties Proxy Class
428// Server Object : TSharedBroker
429// (This object is used by the IDE's Property Inspector to allow editing
430// of the properties of this server)
431// *********************************************************************//
432 TSharedBrokerProperties = class(TPersistent)
433 private
434 FServer: TSharedBroker;
435 function GetDefaultInterface: ISharedBroker;
436 constructor Create(AServer: TSharedBroker);
437 protected
438 function Get_RpcVersion: WideString;
439 procedure Set_RpcVersion(const version: WideString);
440 function Get_RpcHistoryEnabled: WordBool;
441 procedure Set_RpcHistoryEnabled(enabled: WordBool);
442 function Get_PerClientRpcHistoryLimit: Integer;
443 procedure Set_PerClientRpcHistoryLimit(limit: Integer);
444 function Get_CurrentContext: WideString;
445 function Get_User: WideString;
446 function Get_Login: WideString;
447 procedure Set_Login(const Value: WideString);
448 function Get_RpcbError: WideString;
449 function Get_Socket: Integer;
450 function Get_KernelLogin: WordBool;
451 procedure Set_KernelLogin(Value: WordBool);
452 function Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
453 procedure Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
454 public
455 property DefaultInterface: ISharedBroker read GetDefaultInterface;
456 published
457 property RpcVersion: WideString read Get_RpcVersion write Set_RpcVersion;
458 property RpcHistoryEnabled: WordBool read Get_RpcHistoryEnabled write Set_RpcHistoryEnabled;
459 property PerClientRpcHistoryLimit: Integer read Get_PerClientRpcHistoryLimit write Set_PerClientRpcHistoryLimit;
460 property Login: WideString read Get_Login write Set_Login;
461 property KernelLogin: WordBool read Get_KernelLogin write Set_KernelLogin;
462 property ShowErrorMsgs: ISharedBrokerShowErrorMsgs read Get_ShowErrorMsgs write Set_ShowErrorMsgs;
463 end;
464{$ENDIF}
465
466
467// procedure Register;
468
469implementation
470
471uses ComObj;
472
473class function CoSharedBroker.Create: ISharedBroker;
474begin
475 Result := CreateComObject(CLASS_SharedBroker) as ISharedBroker;
476end;
477
478class function CoSharedBroker.CreateRemote(const MachineName: string): ISharedBroker;
479begin
480 Result := CreateRemoteComObject(MachineName, CLASS_SharedBroker) as ISharedBroker;
481end;
482
483procedure TSharedBroker.InitServerData;
484const
485 CServerData: TServerData = (
486 ClassID: '{EB44A5CD-1871-429F-A5BC-19C71B722182}';
487 IntfIID: '{E1D9A5E6-B7C6-40AD-AC34-6A3E12BDC328}';
488 EventIID: '{CBEA7167-4F9B-465A-B82E-4CEBDF933C35}';
489 LicenseKey: nil;
490 Version: 500);
491begin
492 ServerData := @CServerData;
493end;
494
495procedure TSharedBroker.Connect;
496var
497 punk: IUnknown;
498begin
499 if FIntf = nil then
500 begin
501 punk := GetServer;
502 ConnectEvents(punk);
503 Fintf:= punk as ISharedBroker;
504 end;
505end;
506
507procedure TSharedBroker.ConnectTo(svrIntf: ISharedBroker);
508begin
509 Disconnect;
510 FIntf := svrIntf;
511 ConnectEvents(FIntf);
512end;
513
514procedure TSharedBroker.DisConnect;
515begin
516 if Fintf <> nil then
517 begin
518 DisconnectEvents(FIntf);
519 FIntf := nil;
520 end;
521end;
522
523function TSharedBroker.GetDefaultInterface: ISharedBroker;
524begin
525 if FIntf = nil then
526 Connect;
527 Assert(FIntf <> nil, 'DefaultInterface is NULL. Component is not connected to Server. You must call ''Connect'' or ''ConnectTo'' before this operation');
528 Result := FIntf;
529end;
530
531constructor TSharedBroker.Create(AOwner: TComponent);
532begin
533 inherited Create(AOwner);
534{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
535 FProps := TSharedBrokerProperties.Create(Self);
536{$ENDIF}
537end;
538
539destructor TSharedBroker.Destroy;
540begin
541{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
542 FProps.Free;
543{$ENDIF}
544 inherited Destroy;
545end;
546
547{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
548function TSharedBroker.GetServerProperties: TSharedBrokerProperties;
549begin
550 Result := FProps;
551end;
552{$ENDIF}
553
554procedure TSharedBroker.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
555begin
556 case DispID of
557 -1: Exit; // DISPID_UNKNOWN
558 1: if Assigned(FOnLogout) then
559 FOnLogout(Self);
560 2: if Assigned(FOnRpcCallRecorded) then
561 FOnRpcCallRecorded(Self, Params[0] {SYSINT});
562 3: if Assigned(FOnClientConnect) then
563 FOnClientConnect(Self, Params[0] {SYSINT}, Params[1] {ISharedBrokerConnection});
564 4: if Assigned(FOnClientDisconnect) then
565 FOnClientDisconnect(Self, Params[0] {SYSINT});
566 5: if Assigned(FOnContextChanged) then
567 FOnContextChanged(Self, Params[0] {SYSINT}, Params[1] {const WideString});
568 6: if Assigned(FOnRPCBFailure) then
569 FOnRPCBFailure(Self, Params[0] {const WideString});
570 7: if Assigned(FOnLoginError) then
571 FOnLoginError(Self, Params[0] {const WideString});
572 8: if Assigned(FOnConnectionDropped) then
573 FOnConnectionDropped(Self, Params[0] {SYSINT}, Params[1] {const WideString});
574 end; {case DispID}
575end;
576
577function TSharedBroker.Get_RpcVersion: WideString;
578begin
579 Result := DefaultInterface.Get_RpcVersion;
580end;
581
582procedure TSharedBroker.Set_RpcVersion(const version: WideString);
583begin
584 DefaultInterface.Set_RpcVersion(version);
585end;
586
587function TSharedBroker.Get_RpcHistoryEnabled: WordBool;
588begin
589 Result := DefaultInterface.Get_RpcHistoryEnabled;
590end;
591
592procedure TSharedBroker.Set_RpcHistoryEnabled(enabled: WordBool);
593begin
594 DefaultInterface.Set_RpcHistoryEnabled(enabled);
595end;
596
597function TSharedBroker.Get_PerClientRpcHistoryLimit: Integer;
598begin
599 Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
600end;
601
602procedure TSharedBroker.Set_PerClientRpcHistoryLimit(limit: Integer);
603begin
604 DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
605end;
606
607function TSharedBroker.Get_CurrentContext: WideString;
608begin
609 Result := DefaultInterface.Get_CurrentContext;
610end;
611
612function TSharedBroker.Get_User: WideString;
613begin
614 Result := DefaultInterface.Get_User;
615end;
616
617function TSharedBroker.Get_Login: WideString;
618begin
619 Result := DefaultInterface.Get_Login;
620end;
621
622procedure TSharedBroker.Set_Login(const Value: WideString);
623begin
624 DefaultInterface.Set_Login(Value);
625end;
626
627function TSharedBroker.Get_RpcbError: WideString;
628begin
629 Result := DefaultInterface.Get_RpcbError;
630end;
631
632function TSharedBroker.Get_Socket: Integer;
633begin
634 Result := DefaultInterface.Get_Socket;
635end;
636
637function TSharedBroker.Get_KernelLogin: WordBool;
638begin
639 Result := DefaultInterface.Get_KernelLogin;
640end;
641
642procedure TSharedBroker.Set_KernelLogin(Value: WordBool);
643begin
644 DefaultInterface.Set_KernelLogin(Value);
645end;
646
647function TSharedBroker.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
648begin
649 Result := DefaultInterface.Get_ShowErrorMsgs;
650end;
651
652procedure TSharedBroker.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
653begin
654 DefaultInterface.Set_ShowErrorMsgs(Value);
655end;
656
657function TSharedBroker.BrokerConnect(const ClientName: WideString;
658 ConnectionType: ISharedBrokerClient;
659 const ServerPort: WideString; WantDebug: WordBool;
660 AllowShared: WordBool; KernelLogin: WordBool;
661 ShowErrMsgs: ISharedBrokerShowErrorMsgs; RpcTimeLim: SYSINT;
662 var LoginStr: WideString; out UniqueClientIId: SYSINT;
663 out ErrorMsg: WideString): ISharedBrokerErrorCode;
664begin
665 Result := DefaultInterface.BrokerConnect(ClientName, ConnectionType, ServerPort, WantDebug,
666 AllowShared, KernelLogin, ShowErrMsgs, RpcTimeLim,
667 LoginStr, UniqueClientIId, ErrorMsg);
668end;
669
670function TSharedBroker.BrokerDisconnect: ISharedBrokerErrorCode;
671begin
672 Result := DefaultInterface.BrokerDisconnect;
673end;
674
675function TSharedBroker.BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode;
676begin
677 Result := DefaultInterface.BrokerSetContext(OptionName);
678end;
679
680function TSharedBroker.BrokerCall(const RpcName: WideString; const RpcParams: WideString;
681 RpcTimeLimit: Integer; out RpcResults: WideString;
682 out UniqueRpcCallId: Integer): ISharedBrokerErrorCode;
683begin
684 Result := DefaultInterface.BrokerCall(RpcName, RpcParams, RpcTimeLimit, RpcResults,
685 UniqueRpcCallId);
686end;
687
688function TSharedBroker.ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString;
689 const Name: WideString; const Default: WideString;
690 out RegResult: WideString): ISharedBrokerErrorCode;
691begin
692 Result := DefaultInterface.ReadRegDataDefault(Root, Key, Name, Default, RegResult);
693end;
694
695function TSharedBroker.GetRpcHistoryCountForClient(UniqueClientId: Integer;
696 out rpcHistoryCount: Integer): ISharedBrokerErrorCode;
697begin
698 Result := DefaultInterface.GetRpcHistoryCountForClient(UniqueClientId, rpcHistoryCount);
699end;
700
701function TSharedBroker.GetClientIdAndNameFromIndex(clientIndex: Integer;
702 out UniqueClientId: Integer;
703 out ClientName: WideString): ISharedBrokerErrorCode;
704begin
705 Result := DefaultInterface.GetClientIdAndNameFromIndex(clientIndex, UniqueClientId, ClientName);
706end;
707
708function TSharedBroker.LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode;
709begin
710 Result := DefaultInterface.LogoutConnectedClients(logoutTimeLimit);
711end;
712
713function TSharedBroker.GetClientNameFromUniqueClientId(UniqueClientId: Integer;
714 out ClientName: WideString): ISharedBrokerErrorCode;
715begin
716 Result := DefaultInterface.GetClientNameFromUniqueClientId(UniqueClientId, ClientName);
717end;
718
719function TSharedBroker.GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode;
720begin
721 Result := DefaultInterface.GetActiveBrokerConnectionIndexCount(connectionIndexCount);
722end;
723
724function TSharedBroker.GetActiveBrokerConnectionInfo(connectionIndex: Integer;
725 out connectedServerIp: WideString;
726 out connectedServerPort: Integer;
727 out lastContext: WideString): ISharedBrokerErrorCode;
728begin
729 Result := DefaultInterface.GetActiveBrokerConnectionInfo(connectionIndex, connectedServerIp,
730 connectedServerPort, lastContext);
731end;
732
733function TSharedBroker.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer;
734 out connectionIndex: Integer): ISharedBrokerErrorCode;
735begin
736 Result := DefaultInterface.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId,
737 connectionIndex);
738end;
739
740function TSharedBroker.GetRpcCallFromHistory(uniqueRpcId: Integer; out UniqueClientId: Integer;
741 out brokerContext: WideString;
742 out RpcName: WideString; out RpcParams: WideString;
743 out rpcResult: WideString;
744 out rpcStartDateTime: Double; out rpcDuration: Integer): ISharedBrokerErrorCode;
745begin
746 Result := DefaultInterface.GetRpcCallFromHistory(uniqueRpcId, UniqueClientId, brokerContext,
747 RpcName, RpcParams, rpcResult, rpcStartDateTime,
748 rpcDuration);
749end;
750
751function TSharedBroker.GetRpcCallFromHistoryIndex(UniqueClientId: Integer; rpcCallIndex: Integer;
752 out uniqueRpcId: Integer;
753 out brokerContext: WideString;
754 out RpcName: WideString;
755 out RpcParams: WideString;
756 out rpcResult: WideString;
757 out rpcStartDateTime: Double;
758 out rpcDuration: Integer): ISharedBrokerErrorCode;
759begin
760 Result := DefaultInterface.GetRpcCallFromHistoryIndex(UniqueClientId, rpcCallIndex, uniqueRpcId,
761 brokerContext, RpcName, RpcParams,
762 rpcResult, rpcStartDateTime, rpcDuration);
763end;
764
765function TSharedBroker.GetRpcClientIdFromHistory(uniqueRpcId: Integer;
766 out UniqueClientId: Integer;
767 out ClientName: WideString): ISharedBrokerErrorCode;
768begin
769 Result := DefaultInterface.GetRpcClientIdFromHistory(uniqueRpcId, UniqueClientId, ClientName);
770end;
771
772function TSharedBroker.GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode;
773begin
774 Result := DefaultInterface.GetConnectedClientCount(connectedClientCount);
775end;
776
777{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
778constructor TSharedBrokerProperties.Create(AServer: TSharedBroker);
779begin
780 inherited Create;
781 FServer := AServer;
782end;
783
784function TSharedBrokerProperties.GetDefaultInterface: ISharedBroker;
785begin
786 Result := FServer.DefaultInterface;
787end;
788
789function TSharedBrokerProperties.Get_RpcVersion: WideString;
790begin
791 Result := DefaultInterface.Get_RpcVersion;
792end;
793
794procedure TSharedBrokerProperties.Set_RpcVersion(const version: WideString);
795begin
796 DefaultInterface.Set_RpcVersion(version);
797end;
798
799function TSharedBrokerProperties.Get_RpcHistoryEnabled: WordBool;
800begin
801 Result := DefaultInterface.Get_RpcHistoryEnabled;
802end;
803
804procedure TSharedBrokerProperties.Set_RpcHistoryEnabled(enabled: WordBool);
805begin
806 DefaultInterface.Set_RpcHistoryEnabled(enabled);
807end;
808
809function TSharedBrokerProperties.Get_PerClientRpcHistoryLimit: Integer;
810begin
811 Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
812end;
813
814procedure TSharedBrokerProperties.Set_PerClientRpcHistoryLimit(limit: Integer);
815begin
816 DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
817end;
818
819function TSharedBrokerProperties.Get_CurrentContext: WideString;
820begin
821 Result := DefaultInterface.Get_CurrentContext;
822end;
823
824function TSharedBrokerProperties.Get_User: WideString;
825begin
826 Result := DefaultInterface.Get_User;
827end;
828
829function TSharedBrokerProperties.Get_Login: WideString;
830begin
831 Result := DefaultInterface.Get_Login;
832end;
833
834procedure TSharedBrokerProperties.Set_Login(const Value: WideString);
835begin
836 DefaultInterface.Set_Login(Value);
837end;
838
839function TSharedBrokerProperties.Get_RpcbError: WideString;
840begin
841 Result := DefaultInterface.Get_RpcbError;
842end;
843
844function TSharedBrokerProperties.Get_Socket: Integer;
845begin
846 Result := DefaultInterface.Get_Socket;
847end;
848
849function TSharedBrokerProperties.Get_KernelLogin: WordBool;
850begin
851 Result := DefaultInterface.Get_KernelLogin;
852end;
853
854procedure TSharedBrokerProperties.Set_KernelLogin(Value: WordBool);
855begin
856 DefaultInterface.Set_KernelLogin(Value);
857end;
858
859function TSharedBrokerProperties.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
860begin
861 Result := DefaultInterface.Get_ShowErrorMsgs;
862end;
863
864procedure TSharedBrokerProperties.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
865begin
866 DefaultInterface.Set_ShowErrorMsgs(Value);
867end;
868
869{$ENDIF}
870{
871procedure Register;
872begin
873 RegisterComponents('Kernel',[TSharedBroker]);
874end;
875}
876end.
Note: See TracBrowser for help on using the repository browser.