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

some common implementations for IServerAdminInterface More...

Inheritance diagram for Ict.Common.Remoting.Server.TServerManagerBase:
Ict.Common.Remoting.Shared.IServerAdminInterface Ict.Petra.Server.App.Core.TServerManager

Public Member Functions

 TServerManagerBase ()
 Initialises Logging and parses Server settings from different sources. More...
 
void HookupProperShutdownProcessing ()
 Ensures Logging and an 'ordered cooperative shutdown' in case an Unhandled Exception is thrown in Threads, ThreadPool work items or Finalizers anywhere in the PetraServer. More...
 
bool StopServerControlled (bool AForceAutomaticClosing)
 Stops the Petra Server in a more controlled way than the StopServer Method. More...
 
void StopServer ()
 Stops the Petra Server. A GC is invoked and waits for pending tasks before the application ends. More...
 
bool DisconnectClient (System.Int16 AClientID, out String ACantDisconnectReason)
 Requests disconnection of a certain Client from the Petra Server. More...
 
bool QueueClientTask (System.Int16 AClientID, String ATaskGroup, String ATaskCode, object ATaskParameter1, object ATaskParameter2, object ATaskParameter3, object ATaskParameter4, System.Int16 ATaskPriority)
 Queues a ClientTask for a certain Client. More...
 
String FormatClientList (Boolean AListDisconnectedClients)
 Formats the client list array for output in a fixed-width font (eg. to the Console) More...
 
String FormatClientListSysadm (Boolean AListDisconnectedClients)
 Formats the client list array for output in the sysadm dialog for selection of a client id More...
 
System.Int64 PerformGC ()
 Performs a GarbageCollection on the Server. More...
 
virtual bool UpgradeDatabase ()
 upgrade the database More...
 
virtual string BackupDatabaseToYmlGZ ()
 BackupDatabaseToYmlGZ More...
 
virtual bool RestoreDatabaseFromYmlGZ (string AYmlGzData)
 RestoreDatabaseFromYmlGZ More...
 
virtual void RefreshAllCachedTables ()
 Marks all DataTables in the Cache to be no longer up-to-date (=out of sync with the data that was originally placed in the DataTable). More...
 
virtual int ClearConnectionPoolAndGetNumberOfDBConnections ()
 Clears (flushes) all RDMBS Connection Pools and returns the new number of DB Connections after clearing all RDMBS Connection Pools. More...
 
virtual bool SetPassword (string AUserID, string APassword)
 SetPassword More...
 
virtual bool LockSysadmin ()
 LockSysadmin More...
 
virtual bool AddUser (string AUserId, string APassword="")
 AddUser More...
 
virtual int ListGpgKeys (out string List)
 Lists the GPG keys for the Intranet server that are available to the Petra Server. More...
 
virtual int ImportGpgKeys (out string List)
 Imports the GPG encryption keys for the Intranet server. More...
 
virtual void PerformTimedProcessingNow (string AProcessName)
 Allows the server or admin console to run a timed job More...
 
virtual bool TimedProcessingJobEnabled (string AProcessName)
 Is the process job enabled? More...
 

Static Public Member Functions

static void ResetStaticVariables ()
 reset the static variables for each Web Request call. More...
 
static bool CheckServerAdminToken (string AServerAdminToken)
 check if a file with this security token exists More...
 

Static Public Attributes

static IServerAdminInterface TheServerManager = null
 static: only initialised once for the whole server More...
 

Static Protected Attributes

static Int64 FDBReconnectionAttemptsCounter = -1
 DB Reconnection attempts (-1 = no connection established yet at all; 0 = none are being made). More...
 
static bool FServerTimedProcessingSetup = false
 Whether the Timed Processing has been set up already. More...
 

Properties

Int64 DBReconnectionAttemptsCounter [get, set]
 DB Reconnection attempts (-1 = no connection established yet at all; 0 = none are being made). More...
 
Int64 SiteKey [get]
 SiteKey of the OpenPetra DB that the Server is connected to. More...
 
int ClientsConnected [get]
 Number of Clients that are currently connected to the Petra Server. More...
 
bool ServerTimedProcessingSetup [get]
 Whether the 'Server Timed Processing' has been set up. More...
 
int ClientsConnectedTotal [get]
 Total number of Clients that connected to the Petra Server since the start of the Petra Server More...
 
ArrayList ClientList [get]
 Array that contains information about the Clients that are currently connected to the Petra Server. More...
 
ArrayList ClientListDisconnected [get]
 Array that contains information about the Clients that are currently connected to the Petra Server. More...
 
int IPPort [get]
 Server setting: IP Port that the Server listens for .NET Remoting calls More...
 
String ConfigurationFileName [get]
 Server setting: Name of the Server configuration file More...
 
String ServerInfoVersion [get]
 Version of the Petra Server and operating system on which the Server runs More...
 
String ServerInfoState [get]
 State of the Server More...
 
System.Int64 ServerInfoMemory [get]
 Result of a call to GC.GetTotalMemory More...
 
virtual string TimedProcessingDailyStartTime24Hrs [get]
 the daily start time for the timed processing More...
 

Detailed Description

some common implementations for IServerAdminInterface

Constructor & Destructor Documentation

◆ TServerManagerBase()

Ict.Common.Remoting.Server.TServerManagerBase.TServerManagerBase ( )
inline

Initialises Logging and parses Server settings from different sources.

Member Function Documentation

◆ AddUser()

virtual bool Ict.Common.Remoting.Server.TServerManagerBase.AddUser ( string  AUserId,
string  APassword = "" 
)
inlinevirtual

◆ BackupDatabaseToYmlGZ()

virtual string Ict.Common.Remoting.Server.TServerManagerBase.BackupDatabaseToYmlGZ ( )
inlinevirtual

◆ CheckServerAdminToken()

static bool Ict.Common.Remoting.Server.TServerManagerBase.CheckServerAdminToken ( string  AServerAdminToken)
inlinestatic

check if a file with this security token exists

◆ ClearConnectionPoolAndGetNumberOfDBConnections()

virtual int Ict.Common.Remoting.Server.TServerManagerBase.ClearConnectionPoolAndGetNumberOfDBConnections ( )
inlinevirtual

Clears (flushes) all RDMBS Connection Pools and returns the new number of DB Connections after clearing all RDMBS Connection Pools.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ DisconnectClient()

bool Ict.Common.Remoting.Server.TServerManagerBase.DisconnectClient ( System.Int16  AClientID,
out String  ACantDisconnectReason 
)
inline

Requests disconnection of a certain Client from the Petra Server.

Parameters
AClientIDServer-assigned ID of the Client
ACantDisconnectReasonReason why the Client cannot be disconnected
Returns
true if disconnection succeeded, otherwise false.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ FormatClientList()

String Ict.Common.Remoting.Server.TServerManagerBase.FormatClientList ( Boolean  AListDisconnectedClients)
inline

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

Returns
Formatted client list.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ FormatClientListSysadm()

String Ict.Common.Remoting.Server.TServerManagerBase.FormatClientListSysadm ( Boolean  AListDisconnectedClients)
inline

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

Returns
Formatted client list for sysadm dialog.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ HookupProperShutdownProcessing()

void Ict.Common.Remoting.Server.TServerManagerBase.HookupProperShutdownProcessing ( )
inline

Ensures Logging and an 'ordered cooperative shutdown' in case an Unhandled Exception is thrown in Threads, ThreadPool work items or Finalizers anywhere in the PetraServer.

Ensures proper handling of the mentioned situations which were non-fatal to the PetraServer Process in .NET 1.1, but are fatal with .NET 2.0 (also true when running on mono)!

See http://msdn.microsoft.com/en-us/netframework/aa497241.aspx (Text block with Short Desciption 'Unhandled Exceptions will always be fatal to a process').

Returns
void

◆ ImportGpgKeys()

virtual int Ict.Common.Remoting.Server.TServerManagerBase.ImportGpgKeys ( out string  List)
inlinevirtual

Imports the GPG encryption keys for the Intranet server.

Parameters
ListReturn the output of the gpg command.
Returns
Return code of external gpg command.

◆ ListGpgKeys()

virtual int Ict.Common.Remoting.Server.TServerManagerBase.ListGpgKeys ( out string  List)
inlinevirtual

Lists the GPG keys for the Intranet server that are available to the Petra Server.

Parameters
ListReturns the output of the external gpg command.
Returns
Return code of gpg command.

◆ LockSysadmin()

virtual bool Ict.Common.Remoting.Server.TServerManagerBase.LockSysadmin ( )
inlinevirtual

◆ PerformGC()

System.Int64 Ict.Common.Remoting.Server.TServerManagerBase.PerformGC ( )
inline

Performs a GarbageCollection on the Server.

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

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ PerformTimedProcessingNow()

virtual void Ict.Common.Remoting.Server.TServerManagerBase.PerformTimedProcessingNow ( string  AProcessName)
inlinevirtual

Allows the server or admin console to run a timed job

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

Reimplemented in Ict.Petra.Server.App.Core.TServerManager.

◆ QueueClientTask()

bool Ict.Common.Remoting.Server.TServerManagerBase.QueueClientTask ( System.Int16  AClientID,
String  ATaskGroup,
String  ATaskCode,
object  ATaskParameter1,
object  ATaskParameter2,
object  ATaskParameter3,
object  ATaskParameter4,
System.Int16  ATaskPriority 
)
inline

Queues a ClientTask for a certain Client.

Parameters
AClientIDServer-assigned ID of the Client
ATaskGroupGroup of the Task
ATaskCodeCode of the Task
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
Returns
true if ClientTask was queued, otherwise false.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ RefreshAllCachedTables()

virtual void Ict.Common.Remoting.Server.TServerManagerBase.RefreshAllCachedTables ( )
inlinevirtual

Marks all DataTables in the Cache to be no longer up-to-date (=out of sync with the data that was originally placed in the DataTable).

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

Reimplemented in Ict.Petra.Server.App.Core.TServerManager.

◆ ResetStaticVariables()

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

reset the static variables for each Web Request call.

◆ RestoreDatabaseFromYmlGZ()

virtual bool Ict.Common.Remoting.Server.TServerManagerBase.RestoreDatabaseFromYmlGZ ( string  AYmlGzData)
inlinevirtual

◆ SetPassword()

virtual bool Ict.Common.Remoting.Server.TServerManagerBase.SetPassword ( string  AUserID,
string  APassword 
)
inlinevirtual

◆ StopServer()

void Ict.Common.Remoting.Server.TServerManagerBase.StopServer ( )
inline

Stops the Petra Server. A GC is invoked and waits for pending tasks before the application ends.

Returns
void

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ StopServerControlled()

bool Ict.Common.Remoting.Server.TServerManagerBase.StopServerControlled ( bool  AForceAutomaticClosing)
inline

Stops the Petra Server in a more controlled way than the StopServer Method.

A ClientTask is queued for all connected Clients that asks them to save the UserDefaults, to disconnect from the Server and to close. This Method monitors the connected Clients until either all Clients have responded by disconnecting or if at least one Client didn't respond and a timeout was exceeded. If this is the case and the Argument AForceAutomaticClosing is true, a different ClientTask is queued for all Clients that are still connected that asks them to close (no saving of UserDefaults and no disconnection from the server!). This is a fallback in case (1) the client(s) crashed and can't either save the UserDefaults or can't disconnect, (2) the saving of UserDefaults or the disconnecting of Clients doesn't work for some server-side reason (e.g. broken DB connection would prevent saving of UserDefaults).

Parameters
AForceAutomaticClosingSet to true to force closing of non-responding Clients (this is set to true by the ServerAdminConsole as this process is non-interactive in this case).
Returns
False if AForceAutomaticClosing is false and there are still clients logged in.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ TimedProcessingJobEnabled()

virtual bool Ict.Common.Remoting.Server.TServerManagerBase.TimedProcessingJobEnabled ( string  AProcessName)
inlinevirtual

Is the process job enabled?

◆ UpgradeDatabase()

virtual bool Ict.Common.Remoting.Server.TServerManagerBase.UpgradeDatabase ( )
inlinevirtual

upgrade the database

Returns
true if the database was upgraded

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

Reimplemented in Ict.Petra.Server.App.Core.TServerManager.

Member Data Documentation

◆ FDBReconnectionAttemptsCounter

Int64 Ict.Common.Remoting.Server.TServerManagerBase.FDBReconnectionAttemptsCounter = -1
staticprotected

DB Reconnection attempts (-1 = no connection established yet at all; 0 = none are being made).

◆ FServerTimedProcessingSetup

bool Ict.Common.Remoting.Server.TServerManagerBase.FServerTimedProcessingSetup = false
staticprotected

Whether the Timed Processing has been set up already.

◆ TheServerManager

IServerAdminInterface Ict.Common.Remoting.Server.TServerManagerBase.TheServerManager = null
static

static: only initialised once for the whole server

Property Documentation

◆ ClientList

ArrayList Ict.Common.Remoting.Server.TServerManagerBase.ClientList
get

Array that contains information about the Clients that are currently connected to the Petra Server.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ ClientListDisconnected

ArrayList Ict.Common.Remoting.Server.TServerManagerBase.ClientListDisconnected
get

Array that contains information about the Clients that are currently connected to the Petra Server.

◆ ClientsConnected

int Ict.Common.Remoting.Server.TServerManagerBase.ClientsConnected
get

Number of Clients that are currently connected to the Petra Server.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ ClientsConnectedTotal

int Ict.Common.Remoting.Server.TServerManagerBase.ClientsConnectedTotal
get

Total number of Clients that connected to the Petra Server since the start of the Petra Server

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ ConfigurationFileName

String Ict.Common.Remoting.Server.TServerManagerBase.ConfigurationFileName
get

Server setting: Name of the Server configuration file

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ DBReconnectionAttemptsCounter

Int64 Ict.Common.Remoting.Server.TServerManagerBase.DBReconnectionAttemptsCounter
getset

DB Reconnection attempts (-1 = no connection established yet at all; 0 = none are being made).

◆ IPPort

int Ict.Common.Remoting.Server.TServerManagerBase.IPPort
get

Server setting: IP Port that the Server listens for .NET Remoting calls

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ ServerInfoMemory

System.Int64 Ict.Common.Remoting.Server.TServerManagerBase.ServerInfoMemory
get

Result of a call to GC.GetTotalMemory

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ ServerInfoState

String Ict.Common.Remoting.Server.TServerManagerBase.ServerInfoState
get

◆ ServerInfoVersion

String Ict.Common.Remoting.Server.TServerManagerBase.ServerInfoVersion
get

Version of the Petra Server and operating system on which the Server runs

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ ServerTimedProcessingSetup

bool Ict.Common.Remoting.Server.TServerManagerBase.ServerTimedProcessingSetup
get

Whether the 'Server Timed Processing' has been set up.

◆ SiteKey

Int64 Ict.Common.Remoting.Server.TServerManagerBase.SiteKey
get

SiteKey of the OpenPetra DB that the Server is connected to.

Implements Ict.Common.Remoting.Shared.IServerAdminInterface.

◆ TimedProcessingDailyStartTime24Hrs

virtual string Ict.Common.Remoting.Server.TServerManagerBase.TimedProcessingDailyStartTime24Hrs
get

the daily start time for the timed processing


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