OpenPetra
Free Administration Software for Non-Profits
Ict.Common.Remoting.Server.TClientManager Class Reference

Main class for Client connection and disconnection and other Client actions. More...

Public Member Functions

void RecordUserLogout (String AUserID, Int32 AProcessID)
 Records the logging-out (=disconnection) of a Client, using ILoginLog More...
 

Static Public Member Functions

static String FormatClientList (Boolean AListDisconnectedClients)
 Formats the client list array for output in a fixed-width font (eg. to the Console) More...
 
static String FormatClientListSysadm (Boolean AListDisconnectedClients)
 Formats the client list array for output in the sysadm dialog for selection of a client id More...
 
static void ResetStaticVariables ()
 reset the static variables for each Web Request call. More...
 
static void InitializeStaticVariables (IUserManager AUserManager, IErrorLog AErrorLog, ILoginLog ALoginLog, IMaintenanceLogonMessage AMaintenanceLogonMessage)
 initialize variables that are initialized from classes specific to the server, eg. with access to OpenPetra database More...
 
static bool PerformLoginChecks (String AUserName, String APassword, String AClientComputerName, String AClientIPAddress, out Boolean ASystemEnabled, TDBTransaction ATransaction)
 public for stateless (webservice) authentication More...
 
static bool ServerDisconnectClient (System.Int32 AClientID, String AReason, out String ACantDisconnectReason)
 Called by TClientManager to request the disconnection of a certain Client from the Petra Server. More...
 
static Int32 QueueClientTask (System.Int32 AClientID, String ATaskGroup, String ATaskCode, System.Object ATaskParameter1, System.Object ATaskParameter2, System.Object ATaskParameter3, System.Object ATaskParameter4, System.Int16 ATaskPriority, System.Int32 AExceptClientID=-1)
 Called by TClientManager to queue a ClientTask for a certain Client. More...
 
static Int32 QueueClientTask (String AUserID, String ATaskGroup, String ATaskCode, System.Object ATaskParameter1, System.Object ATaskParameter2, System.Object ATaskParameter3, System.Object ATaskParameter4, System.Int16 ATaskPriority, System.Int32 AExceptClientID)
 add client task to queue More...
 
static void AddErrorLogEntry (String AErrorCode, String AContext, String AMessageLine1, String AMessageLine2, String AMessageLine3, Int32 AProcessID, String AUserID)
 add error to log, using IErrorLog More...
 
static ArrayList BuildClientList (Boolean AListDisconnectedClients)
 Builds an array that contains information about the Clients that are currently connected to the Petra Server or were connected to the Petra Server at some time in the past. More...
 
static ArrayList ClientList (Boolean AListDisconnectedClients)
 Called by TServerManager to request an array that contains information about the Clients that are currently connected to the Petra Server. More...
 
static TConnectedClient ConnectClient (String AUserName, String APassword, String AClientComputerName, String AClientIPAddress, System.Version AClientExeVersion, TClientServerConnectionType AClientServerConnectionType, out System.Int32 AClientID, out String AWelcomeMessage, out Boolean ASystemEnabled, out System.Int64 ASiteKey, TDataBase ADataBase=null)
 Called by a Client to request connection to the Petra Server. More...
 
static eLoginEnum LoginErrorFromException (Exception e)
 convert exception to error code More...
 
static Boolean DisconnectClient (System.Int32 AClientID, out String ACantDisconnectReason)
 Called by a Client to request disconnection from the Petra Server. More...
 
static Boolean DisconnectClient (System.Int32 AClientID, String AReason, out String ACantDisconnectReason)
 Called by a Client to request disconnection from the Petra Server. More...
 
static System.Int32 GCGetApproxMemory ()
 Can be called by a Client to get memory information from the GarbageCollection on the Server. More...
 
static System.Int32 GCGetGCGeneration (object AObject)
 Can be called by a Client to request information about the GarbageCollection Generation of a certain remoted object. More...
 
static System.Int32 GCPerformGC ()
 Can be called by a Client to perform a GarbageCollection on the Server. More...
 

Properties

static System.Int32 ClientsConnected [get]
 Called by TClientManager to request the number of Clients that are currently connected to the Petra Server. More...
 
static System.Int32 ClientsConnectedTotal [get]
 Called by TClientManager to request the total number of Clients that connected to the Petra Server since the start of the Petra Server. More...
 

Detailed Description

Main class for Client connection and disconnection and other Client actions.

TClientManager is also used by TServerManager to perform actions on connected Clients and to request information about Clients.

Member Function Documentation

◆ AddErrorLogEntry()

static void Ict.Common.Remoting.Server.TClientManager.AddErrorLogEntry ( String  AErrorCode,
String  AContext,
String  AMessageLine1,
String  AMessageLine2,
String  AMessageLine3,
Int32  AProcessID,
String  AUserID 
)
inlinestatic

add error to log, using IErrorLog

◆ BuildClientList()

static ArrayList Ict.Common.Remoting.Server.TClientManager.BuildClientList ( Boolean  AListDisconnectedClients)
inlinestatic

Builds an array that contains information about the Clients that are currently connected to the Petra Server or were connected to the Petra Server at some time in the past.

Parameters
AListDisconnectedClientsLists only connected Clients if false and only disconnected Clients if true.
Returns
A two-dimensional String Array containing the

◆ ClientList()

static ArrayList Ict.Common.Remoting.Server.TClientManager.ClientList ( Boolean  AListDisconnectedClients)
inlinestatic

Called by TServerManager to request an array that contains information about the Clients that are currently connected to the Petra Server.

Parameters
AListDisconnectedClientsLists only connected Clients if false and only disconnected Clients if true.
Returns
void

◆ ConnectClient()

static TConnectedClient Ict.Common.Remoting.Server.TClientManager.ConnectClient ( String  AUserName,
String  APassword,
String  AClientComputerName,
String  AClientIPAddress,
System.Version  AClientExeVersion,
TClientServerConnectionType  AClientServerConnectionType,
out System.Int32  AClientID,
out String  AWelcomeMessage,
out Boolean  ASystemEnabled,
out System.Int64  ASiteKey,
TDataBase  ADataBase = null 
)
inlinestatic

Called by a Client to request connection to the Petra Server.

Authenticate the user and create a sesssion for the user.

Parameters
AUserNameUsername with which the Client connects
APasswordPassword with which the Client connects
AClientComputerNameComputer name of the Client
AClientExeVersion
AClientIPAddressIP Address of the Client
AClientServerConnectionTypeType of the connection (eg. LAN, Remote)
AClientIDServer-assigned ID of the Client
AWelcomeMessage
ASystemEnabled
ASiteKey
ADataBase

◆ DisconnectClient() [1/2]

static Boolean Ict.Common.Remoting.Server.TClientManager.DisconnectClient ( System.Int32  AClientID,
out String  ACantDisconnectReason 
)
inlinestatic

Called by a Client to request disconnection from the Petra Server.

Parameters
AClientIDServer-assigned ID of the Client that should be disconnected
ACantDisconnectReasonIn case the function returns false, this contains the reason why the disconnection cannot take place.
Returns
true if disconnection will take place, otherwise false.

◆ DisconnectClient() [2/2]

static Boolean Ict.Common.Remoting.Server.TClientManager.DisconnectClient ( System.Int32  AClientID,
String  AReason,
out String  ACantDisconnectReason 
)
inlinestatic

Called by a Client to request disconnection from the Petra Server.

Parameters
AClientIDServer-assigned ID of the Client that should be disconnected
AReason
ACantDisconnectReasonIn case the function returns false, this contains the reason why the disconnection cannot take place.
Returns
true if disconnection will take place, otherwise false.

◆ FormatClientList()

static String Ict.Common.Remoting.Server.TClientManager.FormatClientList ( Boolean  AListDisconnectedClients)
inlinestatic

Formats the client list array for output in a fixed-width font (eg. to the Console)

Returns
Formatted client list.

◆ FormatClientListSysadm()

static String Ict.Common.Remoting.Server.TClientManager.FormatClientListSysadm ( Boolean  AListDisconnectedClients)
inlinestatic

Formats the client list array for output in the sysadm dialog for selection of a client id

Returns
Formatted client list for sysadm dialog.

◆ GCGetApproxMemory()

static System.Int32 Ict.Common.Remoting.Server.TClientManager.GCGetApproxMemory ( )
inlinestatic

Can be called by a Client to get memory information from the GarbageCollection on the Server.

@comment For debugging/memory tracking purposes only.

Returns
Result of a call to GC.GetTotalMemory.

◆ GCGetGCGeneration()

static System.Int32 Ict.Common.Remoting.Server.TClientManager.GCGetGCGeneration ( object  AObject)
inlinestatic

Can be called by a Client to request information about the GarbageCollection Generation of a certain remoted object.

@comment For debugging/memory tracking purposes only.

Parameters
AObjectRemoted Object
Returns
GC Generation (or -1 if the object no longer exists)

◆ GCPerformGC()

static System.Int32 Ict.Common.Remoting.Server.TClientManager.GCPerformGC ( )
inlinestatic

Can be called by a Client to perform a GarbageCollection on the Server.

@comment For debugging/memory tracking purposes only.

Returns
Result of a call to GC.GetTotalMemory after the GC was performed.

◆ InitializeStaticVariables()

static void Ict.Common.Remoting.Server.TClientManager.InitializeStaticVariables ( IUserManager  AUserManager,
IErrorLog  AErrorLog,
ILoginLog  ALoginLog,
IMaintenanceLogonMessage  AMaintenanceLogonMessage 
)
inlinestatic

initialize variables that are initialized from classes specific to the server, eg. with access to OpenPetra database

◆ LoginErrorFromException()

static eLoginEnum Ict.Common.Remoting.Server.TClientManager.LoginErrorFromException ( Exception  e)
inlinestatic

convert exception to error code

◆ PerformLoginChecks()

static bool Ict.Common.Remoting.Server.TClientManager.PerformLoginChecks ( String  AUserName,
String  APassword,
String  AClientComputerName,
String  AClientIPAddress,
out Boolean  ASystemEnabled,
TDBTransaction  ATransaction 
)
inlinestatic

public for stateless (webservice) authentication

Parameters
AUserName
APassword
AClientComputerName
AClientIPAddress
ASystemEnabled
ATransactionInstantiated DB Transaction.
Returns

◆ QueueClientTask() [1/2]

static Int32 Ict.Common.Remoting.Server.TClientManager.QueueClientTask ( String  AUserID,
String  ATaskGroup,
String  ATaskCode,
System.Object  ATaskParameter1,
System.Object  ATaskParameter2,
System.Object  ATaskParameter3,
System.Object  ATaskParameter4,
System.Int16  ATaskPriority,
System.Int32  AExceptClientID 
)
inlinestatic

add client task to queue

Parameters
AUserID
ATaskGroup
ATaskCode
ATaskParameter1
ATaskParameter2
ATaskParameter3
ATaskParameter4
ATaskPriority
AExceptClientID
Returns

◆ QueueClientTask() [2/2]

static Int32 Ict.Common.Remoting.Server.TClientManager.QueueClientTask ( System.Int32  AClientID,
String  ATaskGroup,
String  ATaskCode,
System.Object  ATaskParameter1,
System.Object  ATaskParameter2,
System.Object  ATaskParameter3,
System.Object  ATaskParameter4,
System.Int16  ATaskPriority,
System.Int32  AExceptClientID = -1 
)
inlinestatic

Called by TClientManager to queue a ClientTask for a certain Client.

Parameters
AClientIDServer-assigned ID of the Client; use -1 to queue the ClientTask to all Clients
ATaskGroupGroup of the Task
ATaskCodeCode of the Task (depending on the TaskGroup this can be left empty)
ATaskParameter1Parameter #1 for the Task (depending on the TaskGroup this can be left empty)
ATaskParameter2Parameter #2 for the Task (depending on the TaskGroup this can be left empty)
ATaskParameter3Parameter #3 for the Task (depending on the TaskGroup this can be left empty)
ATaskParameter4Parameter #4 for the Task (depending on the TaskGroup this can be left empty)
ATaskPriorityPriority of the Task
AExceptClientIDPass in a Server-assigned ID of the Client that should not get the ClientTask in its queue. Makes sense only if -1 is used for the AClientID parameter. Default is -1, which means no Client is excepted.
Returns
The ClientID for which the ClientTask was queued (the last ClientID in the list of Clients if -1 is submitted for AClientID). Error values are: -1 if AClientID is identical with AExceptClientID, -2 if the Client specified with AClientID is not in the list of Clients or AClientID <> -1

◆ RecordUserLogout()

void Ict.Common.Remoting.Server.TClientManager.RecordUserLogout ( String  AUserID,
Int32  AProcessID 
)
inline

Records the logging-out (=disconnection) of a Client, using ILoginLog

Parameters
AUserIDUserID of the User for which a logout should be recorded.
AProcessIDProcessID of the User for which a logout should be recorded. This will need to be the number that got returned from an earlier call to AddLoginLogEntry(string, bool, string, bool, out int, TDBTransaction)!

◆ ResetStaticVariables()

static void Ict.Common.Remoting.Server.TClientManager.ResetStaticVariables ( )
inlinestatic

reset the static variables for each Web Request call.

◆ ServerDisconnectClient()

static bool Ict.Common.Remoting.Server.TClientManager.ServerDisconnectClient ( System.Int32  AClientID,
String  AReason,
out String  ACantDisconnectReason 
)
inlinestatic

Called by TClientManager to request the disconnection of a certain Client from the Petra Server.

Parameters
AClientIDServer-assigned ID of the Client
AReason
ACantDisconnectReasonIn case the function returns false, this contains the reason why the disconnection cannot take place.
Returns
true if disconnection will take place, otherwise false.

Property Documentation

◆ ClientsConnected

System.Int32 Ict.Common.Remoting.Server.TClientManager.ClientsConnected
staticget

Called by TClientManager to request the number of Clients that are currently connected to the Petra Server.

◆ ClientsConnectedTotal

System.Int32 Ict.Common.Remoting.Server.TClientManager.ClientsConnectedTotal
staticget

Called by TClientManager to request the total number of Clients that connected to the Petra Server since the start of the Petra Server.


The documentation for this class was generated from the following file: