| 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 | 
 | 
|---|
| 10 | unit 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. 
 | 
|---|
| 47 | interface
 | 
|---|
| 48 | 
 | 
|---|
| 49 | uses 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 | // *********************************************************************//
 | 
|---|
| 58 | const
 | 
|---|
| 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
 | 
|---|
| 73 | type
 | 
|---|
| 74 |   ISharedBrokerErrorCode = TOleEnum;
 | 
|---|
| 75 | const
 | 
|---|
| 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
 | 
|---|
| 89 | type
 | 
|---|
| 90 |   IRegistryRootEnum = TOleEnum;
 | 
|---|
| 91 | const
 | 
|---|
| 92 |   HKCR = $00000000;
 | 
|---|
| 93 |   HKCU = $00000001;
 | 
|---|
| 94 |   HKLM = $00000002;
 | 
|---|
| 95 |   HKU = $00000003;
 | 
|---|
| 96 |   HKCC = $00000004;
 | 
|---|
| 97 |   HKDD = $00000005;
 | 
|---|
| 98 | 
 | 
|---|
| 99 | // Constants for enum ISharedBrokerConnection
 | 
|---|
| 100 | type
 | 
|---|
| 101 |   ISharedBrokerConnection = TOleEnum;
 | 
|---|
| 102 | const
 | 
|---|
| 103 |   Failed = $00000000;
 | 
|---|
| 104 |   New = $00000001;
 | 
|---|
| 105 |   Shared = $00000002;
 | 
|---|
| 106 |   Debug = $00000003;
 | 
|---|
| 107 | 
 | 
|---|
| 108 | // Constants for enum ISharedBrokerClient
 | 
|---|
| 109 | type
 | 
|---|
| 110 |   ISharedBrokerClient = TOleEnum;
 | 
|---|
| 111 | const
 | 
|---|
| 112 |   BrokerClient = $00000000;
 | 
|---|
| 113 |   DebuggerClient = $00000001;
 | 
|---|
| 114 | 
 | 
|---|
| 115 | // Constants for enum ISharedBrokerShowErrorMsgs
 | 
|---|
| 116 | type
 | 
|---|
| 117 |   ISharedBrokerShowErrorMsgs = TOleEnum;
 | 
|---|
| 118 | const
 | 
|---|
| 119 |   isemRaise = $00000000;
 | 
|---|
| 120 |   isemQuiet = $00000001;
 | 
|---|
| 121 | 
 | 
|---|
| 122 | type
 | 
|---|
| 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 | 
 | 
|---|
| 469 | implementation
 | 
|---|
| 470 | 
 | 
|---|
| 471 | uses ComObj;
 | 
|---|
| 472 | 
 | 
|---|
| 473 | class function CoSharedBroker.Create: ISharedBroker;
 | 
|---|
| 474 | begin
 | 
|---|
| 475 |   Result := CreateComObject(CLASS_SharedBroker) as ISharedBroker;
 | 
|---|
| 476 | end;
 | 
|---|
| 477 | 
 | 
|---|
| 478 | class function CoSharedBroker.CreateRemote(const MachineName: string): ISharedBroker;
 | 
|---|
| 479 | begin
 | 
|---|
| 480 |   Result := CreateRemoteComObject(MachineName, CLASS_SharedBroker) as ISharedBroker;
 | 
|---|
| 481 | end;
 | 
|---|
| 482 | 
 | 
|---|
| 483 | procedure TSharedBroker.InitServerData;
 | 
|---|
| 484 | const
 | 
|---|
| 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);
 | 
|---|
| 491 | begin
 | 
|---|
| 492 |   ServerData := @CServerData;
 | 
|---|
| 493 | end;
 | 
|---|
| 494 | 
 | 
|---|
| 495 | procedure TSharedBroker.Connect;
 | 
|---|
| 496 | var
 | 
|---|
| 497 |   punk: IUnknown;
 | 
|---|
| 498 | begin
 | 
|---|
| 499 |   if FIntf = nil then
 | 
|---|
| 500 |   begin
 | 
|---|
| 501 |     punk := GetServer;
 | 
|---|
| 502 |     ConnectEvents(punk);
 | 
|---|
| 503 |     Fintf:= punk as ISharedBroker;
 | 
|---|
| 504 |   end;
 | 
|---|
| 505 | end;
 | 
|---|
| 506 | 
 | 
|---|
| 507 | procedure TSharedBroker.ConnectTo(svrIntf: ISharedBroker);
 | 
|---|
| 508 | begin
 | 
|---|
| 509 |   Disconnect;
 | 
|---|
| 510 |   FIntf := svrIntf;
 | 
|---|
| 511 |   ConnectEvents(FIntf);
 | 
|---|
| 512 | end;
 | 
|---|
| 513 | 
 | 
|---|
| 514 | procedure TSharedBroker.DisConnect;
 | 
|---|
| 515 | begin
 | 
|---|
| 516 |   if Fintf <> nil then
 | 
|---|
| 517 |   begin
 | 
|---|
| 518 |     DisconnectEvents(FIntf);
 | 
|---|
| 519 |     FIntf := nil;
 | 
|---|
| 520 |   end;
 | 
|---|
| 521 | end;
 | 
|---|
| 522 | 
 | 
|---|
| 523 | function TSharedBroker.GetDefaultInterface: ISharedBroker;
 | 
|---|
| 524 | begin
 | 
|---|
| 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;
 | 
|---|
| 529 | end;
 | 
|---|
| 530 | 
 | 
|---|
| 531 | constructor TSharedBroker.Create(AOwner: TComponent);
 | 
|---|
| 532 | begin
 | 
|---|
| 533 |   inherited Create(AOwner);
 | 
|---|
| 534 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 535 |   FProps := TSharedBrokerProperties.Create(Self);
 | 
|---|
| 536 | {$ENDIF}
 | 
|---|
| 537 | end;
 | 
|---|
| 538 | 
 | 
|---|
| 539 | destructor TSharedBroker.Destroy;
 | 
|---|
| 540 | begin
 | 
|---|
| 541 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 542 |   FProps.Free;
 | 
|---|
| 543 | {$ENDIF}
 | 
|---|
| 544 |   inherited Destroy;
 | 
|---|
| 545 | end;
 | 
|---|
| 546 | 
 | 
|---|
| 547 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 548 | function TSharedBroker.GetServerProperties: TSharedBrokerProperties;
 | 
|---|
| 549 | begin
 | 
|---|
| 550 |   Result := FProps;
 | 
|---|
| 551 | end;
 | 
|---|
| 552 | {$ENDIF}
 | 
|---|
| 553 | 
 | 
|---|
| 554 | procedure TSharedBroker.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
 | 
|---|
| 555 | begin
 | 
|---|
| 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}
 | 
|---|
| 575 | end;
 | 
|---|
| 576 | 
 | 
|---|
| 577 | function  TSharedBroker.Get_RpcVersion: WideString;
 | 
|---|
| 578 | begin
 | 
|---|
| 579 |   Result := DefaultInterface.Get_RpcVersion;
 | 
|---|
| 580 | end;
 | 
|---|
| 581 | 
 | 
|---|
| 582 | procedure TSharedBroker.Set_RpcVersion(const version: WideString);
 | 
|---|
| 583 | begin
 | 
|---|
| 584 |   DefaultInterface.Set_RpcVersion(version);
 | 
|---|
| 585 | end;
 | 
|---|
| 586 | 
 | 
|---|
| 587 | function  TSharedBroker.Get_RpcHistoryEnabled: WordBool;
 | 
|---|
| 588 | begin
 | 
|---|
| 589 |   Result := DefaultInterface.Get_RpcHistoryEnabled;
 | 
|---|
| 590 | end;
 | 
|---|
| 591 | 
 | 
|---|
| 592 | procedure TSharedBroker.Set_RpcHistoryEnabled(enabled: WordBool);
 | 
|---|
| 593 | begin
 | 
|---|
| 594 |   DefaultInterface.Set_RpcHistoryEnabled(enabled);
 | 
|---|
| 595 | end;
 | 
|---|
| 596 | 
 | 
|---|
| 597 | function  TSharedBroker.Get_PerClientRpcHistoryLimit: Integer;
 | 
|---|
| 598 | begin
 | 
|---|
| 599 |   Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
 | 
|---|
| 600 | end;
 | 
|---|
| 601 | 
 | 
|---|
| 602 | procedure TSharedBroker.Set_PerClientRpcHistoryLimit(limit: Integer);
 | 
|---|
| 603 | begin
 | 
|---|
| 604 |   DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
 | 
|---|
| 605 | end;
 | 
|---|
| 606 | 
 | 
|---|
| 607 | function  TSharedBroker.Get_CurrentContext: WideString;
 | 
|---|
| 608 | begin
 | 
|---|
| 609 |   Result := DefaultInterface.Get_CurrentContext;
 | 
|---|
| 610 | end;
 | 
|---|
| 611 | 
 | 
|---|
| 612 | function  TSharedBroker.Get_User: WideString;
 | 
|---|
| 613 | begin
 | 
|---|
| 614 |   Result := DefaultInterface.Get_User;
 | 
|---|
| 615 | end;
 | 
|---|
| 616 | 
 | 
|---|
| 617 | function  TSharedBroker.Get_Login: WideString;
 | 
|---|
| 618 | begin
 | 
|---|
| 619 |   Result := DefaultInterface.Get_Login;
 | 
|---|
| 620 | end;
 | 
|---|
| 621 | 
 | 
|---|
| 622 | procedure TSharedBroker.Set_Login(const Value: WideString);
 | 
|---|
| 623 | begin
 | 
|---|
| 624 |   DefaultInterface.Set_Login(Value);
 | 
|---|
| 625 | end;
 | 
|---|
| 626 | 
 | 
|---|
| 627 | function  TSharedBroker.Get_RpcbError: WideString;
 | 
|---|
| 628 | begin
 | 
|---|
| 629 |   Result := DefaultInterface.Get_RpcbError;
 | 
|---|
| 630 | end;
 | 
|---|
| 631 | 
 | 
|---|
| 632 | function  TSharedBroker.Get_Socket: Integer;
 | 
|---|
| 633 | begin
 | 
|---|
| 634 |   Result := DefaultInterface.Get_Socket;
 | 
|---|
| 635 | end;
 | 
|---|
| 636 | 
 | 
|---|
| 637 | function  TSharedBroker.Get_KernelLogin: WordBool;
 | 
|---|
| 638 | begin
 | 
|---|
| 639 |   Result := DefaultInterface.Get_KernelLogin;
 | 
|---|
| 640 | end;
 | 
|---|
| 641 | 
 | 
|---|
| 642 | procedure TSharedBroker.Set_KernelLogin(Value: WordBool);
 | 
|---|
| 643 | begin
 | 
|---|
| 644 |   DefaultInterface.Set_KernelLogin(Value);
 | 
|---|
| 645 | end;
 | 
|---|
| 646 | 
 | 
|---|
| 647 | function  TSharedBroker.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
 | 
|---|
| 648 | begin
 | 
|---|
| 649 |   Result := DefaultInterface.Get_ShowErrorMsgs;
 | 
|---|
| 650 | end;
 | 
|---|
| 651 | 
 | 
|---|
| 652 | procedure TSharedBroker.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
 | 
|---|
| 653 | begin
 | 
|---|
| 654 |   DefaultInterface.Set_ShowErrorMsgs(Value);
 | 
|---|
| 655 | end;
 | 
|---|
| 656 | 
 | 
|---|
| 657 | function  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;
 | 
|---|
| 664 | begin
 | 
|---|
| 665 |   Result := DefaultInterface.BrokerConnect(ClientName, ConnectionType, ServerPort, WantDebug, 
 | 
|---|
| 666 |                                            AllowShared, KernelLogin, ShowErrMsgs, RpcTimeLim, 
 | 
|---|
| 667 |                                            LoginStr, UniqueClientIId, ErrorMsg);
 | 
|---|
| 668 | end;
 | 
|---|
| 669 | 
 | 
|---|
| 670 | function  TSharedBroker.BrokerDisconnect: ISharedBrokerErrorCode;
 | 
|---|
| 671 | begin
 | 
|---|
| 672 |   Result := DefaultInterface.BrokerDisconnect;
 | 
|---|
| 673 | end;
 | 
|---|
| 674 | 
 | 
|---|
| 675 | function  TSharedBroker.BrokerSetContext(const OptionName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 676 | begin
 | 
|---|
| 677 |   Result := DefaultInterface.BrokerSetContext(OptionName);
 | 
|---|
| 678 | end;
 | 
|---|
| 679 | 
 | 
|---|
| 680 | function  TSharedBroker.BrokerCall(const RpcName: WideString; const RpcParams: WideString; 
 | 
|---|
| 681 |                                    RpcTimeLimit: Integer; out RpcResults: WideString; 
 | 
|---|
| 682 |                                    out UniqueRpcCallId: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 683 | begin
 | 
|---|
| 684 |   Result := DefaultInterface.BrokerCall(RpcName, RpcParams, RpcTimeLimit, RpcResults, 
 | 
|---|
| 685 |                                         UniqueRpcCallId);
 | 
|---|
| 686 | end;
 | 
|---|
| 687 | 
 | 
|---|
| 688 | function  TSharedBroker.ReadRegDataDefault(Root: IRegistryRootEnum; const Key: WideString; 
 | 
|---|
| 689 |                                            const Name: WideString; const Default: WideString; 
 | 
|---|
| 690 |                                            out RegResult: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 691 | begin
 | 
|---|
| 692 |   Result := DefaultInterface.ReadRegDataDefault(Root, Key, Name, Default, RegResult);
 | 
|---|
| 693 | end;
 | 
|---|
| 694 | 
 | 
|---|
| 695 | function  TSharedBroker.GetRpcHistoryCountForClient(UniqueClientId: Integer; 
 | 
|---|
| 696 |                                                     out rpcHistoryCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 697 | begin
 | 
|---|
| 698 |   Result := DefaultInterface.GetRpcHistoryCountForClient(UniqueClientId, rpcHistoryCount);
 | 
|---|
| 699 | end;
 | 
|---|
| 700 | 
 | 
|---|
| 701 | function  TSharedBroker.GetClientIdAndNameFromIndex(clientIndex: Integer; 
 | 
|---|
| 702 |                                                     out UniqueClientId: Integer; 
 | 
|---|
| 703 |                                                     out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 704 | begin
 | 
|---|
| 705 |   Result := DefaultInterface.GetClientIdAndNameFromIndex(clientIndex, UniqueClientId, ClientName);
 | 
|---|
| 706 | end;
 | 
|---|
| 707 | 
 | 
|---|
| 708 | function  TSharedBroker.LogoutConnectedClients(logoutTimeLimit: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 709 | begin
 | 
|---|
| 710 |   Result := DefaultInterface.LogoutConnectedClients(logoutTimeLimit);
 | 
|---|
| 711 | end;
 | 
|---|
| 712 | 
 | 
|---|
| 713 | function  TSharedBroker.GetClientNameFromUniqueClientId(UniqueClientId: Integer; 
 | 
|---|
| 714 |                                                         out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 715 | begin
 | 
|---|
| 716 |   Result := DefaultInterface.GetClientNameFromUniqueClientId(UniqueClientId, ClientName);
 | 
|---|
| 717 | end;
 | 
|---|
| 718 | 
 | 
|---|
| 719 | function  TSharedBroker.GetActiveBrokerConnectionIndexCount(out connectionIndexCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 720 | begin
 | 
|---|
| 721 |   Result := DefaultInterface.GetActiveBrokerConnectionIndexCount(connectionIndexCount);
 | 
|---|
| 722 | end;
 | 
|---|
| 723 | 
 | 
|---|
| 724 | function  TSharedBroker.GetActiveBrokerConnectionInfo(connectionIndex: Integer; 
 | 
|---|
| 725 |                                                       out connectedServerIp: WideString; 
 | 
|---|
| 726 |                                                       out connectedServerPort: Integer; 
 | 
|---|
| 727 |                                                       out lastContext: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 728 | begin
 | 
|---|
| 729 |   Result := DefaultInterface.GetActiveBrokerConnectionInfo(connectionIndex, connectedServerIp, 
 | 
|---|
| 730 |                                                            connectedServerPort, lastContext);
 | 
|---|
| 731 | end;
 | 
|---|
| 732 | 
 | 
|---|
| 733 | function  TSharedBroker.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId: Integer; 
 | 
|---|
| 734 |                                                                          out connectionIndex: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 735 | begin
 | 
|---|
| 736 |   Result := DefaultInterface.GetActiveBrokerConnectionIndexFromUniqueClientId(UniqueClientId, 
 | 
|---|
| 737 |                                                                               connectionIndex);
 | 
|---|
| 738 | end;
 | 
|---|
| 739 | 
 | 
|---|
| 740 | function  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;
 | 
|---|
| 745 | begin
 | 
|---|
| 746 |   Result := DefaultInterface.GetRpcCallFromHistory(uniqueRpcId, UniqueClientId, brokerContext, 
 | 
|---|
| 747 |                                                    RpcName, RpcParams, rpcResult, rpcStartDateTime, 
 | 
|---|
| 748 |                                                    rpcDuration);
 | 
|---|
| 749 | end;
 | 
|---|
| 750 | 
 | 
|---|
| 751 | function  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;
 | 
|---|
| 759 | begin
 | 
|---|
| 760 |   Result := DefaultInterface.GetRpcCallFromHistoryIndex(UniqueClientId, rpcCallIndex, uniqueRpcId, 
 | 
|---|
| 761 |                                                         brokerContext, RpcName, RpcParams, 
 | 
|---|
| 762 |                                                         rpcResult, rpcStartDateTime, rpcDuration);
 | 
|---|
| 763 | end;
 | 
|---|
| 764 | 
 | 
|---|
| 765 | function  TSharedBroker.GetRpcClientIdFromHistory(uniqueRpcId: Integer; 
 | 
|---|
| 766 |                                                   out UniqueClientId: Integer; 
 | 
|---|
| 767 |                                                   out ClientName: WideString): ISharedBrokerErrorCode;
 | 
|---|
| 768 | begin
 | 
|---|
| 769 |   Result := DefaultInterface.GetRpcClientIdFromHistory(uniqueRpcId, UniqueClientId, ClientName);
 | 
|---|
| 770 | end;
 | 
|---|
| 771 | 
 | 
|---|
| 772 | function  TSharedBroker.GetConnectedClientCount(out connectedClientCount: Integer): ISharedBrokerErrorCode;
 | 
|---|
| 773 | begin
 | 
|---|
| 774 |   Result := DefaultInterface.GetConnectedClientCount(connectedClientCount);
 | 
|---|
| 775 | end;
 | 
|---|
| 776 | 
 | 
|---|
| 777 | {$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
 | 
|---|
| 778 | constructor TSharedBrokerProperties.Create(AServer: TSharedBroker);
 | 
|---|
| 779 | begin
 | 
|---|
| 780 |   inherited Create;
 | 
|---|
| 781 |   FServer := AServer;
 | 
|---|
| 782 | end;
 | 
|---|
| 783 | 
 | 
|---|
| 784 | function TSharedBrokerProperties.GetDefaultInterface: ISharedBroker;
 | 
|---|
| 785 | begin
 | 
|---|
| 786 |   Result := FServer.DefaultInterface;
 | 
|---|
| 787 | end;
 | 
|---|
| 788 | 
 | 
|---|
| 789 | function  TSharedBrokerProperties.Get_RpcVersion: WideString;
 | 
|---|
| 790 | begin
 | 
|---|
| 791 |   Result := DefaultInterface.Get_RpcVersion;
 | 
|---|
| 792 | end;
 | 
|---|
| 793 | 
 | 
|---|
| 794 | procedure TSharedBrokerProperties.Set_RpcVersion(const version: WideString);
 | 
|---|
| 795 | begin
 | 
|---|
| 796 |   DefaultInterface.Set_RpcVersion(version);
 | 
|---|
| 797 | end;
 | 
|---|
| 798 | 
 | 
|---|
| 799 | function  TSharedBrokerProperties.Get_RpcHistoryEnabled: WordBool;
 | 
|---|
| 800 | begin
 | 
|---|
| 801 |   Result := DefaultInterface.Get_RpcHistoryEnabled;
 | 
|---|
| 802 | end;
 | 
|---|
| 803 | 
 | 
|---|
| 804 | procedure TSharedBrokerProperties.Set_RpcHistoryEnabled(enabled: WordBool);
 | 
|---|
| 805 | begin
 | 
|---|
| 806 |   DefaultInterface.Set_RpcHistoryEnabled(enabled);
 | 
|---|
| 807 | end;
 | 
|---|
| 808 | 
 | 
|---|
| 809 | function  TSharedBrokerProperties.Get_PerClientRpcHistoryLimit: Integer;
 | 
|---|
| 810 | begin
 | 
|---|
| 811 |   Result := DefaultInterface.Get_PerClientRpcHistoryLimit;
 | 
|---|
| 812 | end;
 | 
|---|
| 813 | 
 | 
|---|
| 814 | procedure TSharedBrokerProperties.Set_PerClientRpcHistoryLimit(limit: Integer);
 | 
|---|
| 815 | begin
 | 
|---|
| 816 |   DefaultInterface.Set_PerClientRpcHistoryLimit(limit);
 | 
|---|
| 817 | end;
 | 
|---|
| 818 | 
 | 
|---|
| 819 | function  TSharedBrokerProperties.Get_CurrentContext: WideString;
 | 
|---|
| 820 | begin
 | 
|---|
| 821 |   Result := DefaultInterface.Get_CurrentContext;
 | 
|---|
| 822 | end;
 | 
|---|
| 823 | 
 | 
|---|
| 824 | function  TSharedBrokerProperties.Get_User: WideString;
 | 
|---|
| 825 | begin
 | 
|---|
| 826 |   Result := DefaultInterface.Get_User;
 | 
|---|
| 827 | end;
 | 
|---|
| 828 | 
 | 
|---|
| 829 | function  TSharedBrokerProperties.Get_Login: WideString;
 | 
|---|
| 830 | begin
 | 
|---|
| 831 |   Result := DefaultInterface.Get_Login;
 | 
|---|
| 832 | end;
 | 
|---|
| 833 | 
 | 
|---|
| 834 | procedure TSharedBrokerProperties.Set_Login(const Value: WideString);
 | 
|---|
| 835 | begin
 | 
|---|
| 836 |   DefaultInterface.Set_Login(Value);
 | 
|---|
| 837 | end;
 | 
|---|
| 838 | 
 | 
|---|
| 839 | function  TSharedBrokerProperties.Get_RpcbError: WideString;
 | 
|---|
| 840 | begin
 | 
|---|
| 841 |   Result := DefaultInterface.Get_RpcbError;
 | 
|---|
| 842 | end;
 | 
|---|
| 843 | 
 | 
|---|
| 844 | function  TSharedBrokerProperties.Get_Socket: Integer;
 | 
|---|
| 845 | begin
 | 
|---|
| 846 |   Result := DefaultInterface.Get_Socket;
 | 
|---|
| 847 | end;
 | 
|---|
| 848 | 
 | 
|---|
| 849 | function  TSharedBrokerProperties.Get_KernelLogin: WordBool;
 | 
|---|
| 850 | begin
 | 
|---|
| 851 |   Result := DefaultInterface.Get_KernelLogin;
 | 
|---|
| 852 | end;
 | 
|---|
| 853 | 
 | 
|---|
| 854 | procedure TSharedBrokerProperties.Set_KernelLogin(Value: WordBool);
 | 
|---|
| 855 | begin
 | 
|---|
| 856 |   DefaultInterface.Set_KernelLogin(Value);
 | 
|---|
| 857 | end;
 | 
|---|
| 858 | 
 | 
|---|
| 859 | function  TSharedBrokerProperties.Get_ShowErrorMsgs: ISharedBrokerShowErrorMsgs;
 | 
|---|
| 860 | begin
 | 
|---|
| 861 |   Result := DefaultInterface.Get_ShowErrorMsgs;
 | 
|---|
| 862 | end;
 | 
|---|
| 863 | 
 | 
|---|
| 864 | procedure TSharedBrokerProperties.Set_ShowErrorMsgs(Value: ISharedBrokerShowErrorMsgs);
 | 
|---|
| 865 | begin
 | 
|---|
| 866 |   DefaultInterface.Set_ShowErrorMsgs(Value);
 | 
|---|
| 867 | end;
 | 
|---|
| 868 | 
 | 
|---|
| 869 | {$ENDIF}
 | 
|---|
| 870 | {
 | 
|---|
| 871 | procedure Register;
 | 
|---|
| 872 | begin
 | 
|---|
| 873 |   RegisterComponents('Kernel',[TSharedBroker]);
 | 
|---|
| 874 | end;
 | 
|---|
| 875 | }
 | 
|---|
| 876 | end.
 | 
|---|