OpenPetra
Free Administration Software for Non-Profits
|
Main class for Server startup and shutdown and Server interaction via a Server Admin application. More...
Public Member Functions | |
TServerManager () | |
Initialises Logging and parses Server settings from different sources. More... | |
override bool | UpgradeDatabase () |
upgrade the database More... | |
override string | BackupDatabaseToYmlGZ () |
Returns a string with yml.gz data. More... | |
override bool | RestoreDatabaseFromYmlGZ (string AYmlGzData) |
Restore the database from a string with yml.gz data. More... | |
override 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... | |
override bool | SetPassword (string AUserID, string APassword) |
SetPassword More... | |
override bool | LockSysadmin () |
LockSysadmin More... | |
override bool | AddUser (string AUserID, string APassword="") |
AddUser More... | |
override void | PerformTimedProcessingNow (string AProcessName) |
Allows the server or admin console to run a timed processing job now 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 int | ClearConnectionPoolAndGetNumberOfDBConnections () |
Clears (flushes) all RDMBS Connection Pools and returns the new number of DB Connections after clearing all RDMBS Connection Pools. 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 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 | |
static TServerManager | TheCastedServerManager [get] |
get a casted version of the static variable More... | |
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... | |
Main class for Server startup and shutdown and Server interaction via a Server Admin application.
It is designed in a way that the Server .exe file can be either a Command line application or any other form of .NET application (eg. WinForms) to provide Petra Server functionality. (The Server .exe file contains almost no logic because the logic is centralised in this class.)
TServerManager gets remoted and can be accessed via an Interface from a Server Admin application such as PetraServerAdminConsole.exe
|
inline |
Initialises Logging and parses Server settings from different sources.
|
inlinevirtual |
AddUser
Reimplemented from Ict.Common.Remoting.Server.TServerManagerBase.
|
inlinevirtual |
Returns a string with yml.gz data.
Reimplemented from Ict.Common.Remoting.Server.TServerManagerBase.
|
inlinestaticinherited |
check if a file with this security token exists
|
inlinevirtualinherited |
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.
|
inlineinherited |
Requests disconnection of a certain Client from the Petra Server.
AClientID | Server-assigned ID of the Client |
ACantDisconnectReason | Reason why the Client cannot be disconnected |
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
inlineinherited |
Formats the client list array for output in a fixed-width font (eg. to the Console)
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
inlineinherited |
Formats the client list array for output in the sysadm dialog for selection of a client id
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
inlineinherited |
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').
|
inlinevirtualinherited |
Imports the GPG encryption keys for the Intranet server.
List | Return the output of the gpg command. |
|
inlinevirtualinherited |
|
inlinevirtual |
LockSysadmin
Reimplemented from Ict.Common.Remoting.Server.TServerManagerBase.
|
inlineinherited |
Performs a GarbageCollection on the Server.
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
inlinevirtual |
Allows the server or admin console to run a timed processing job now
Reimplemented from Ict.Common.Remoting.Server.TServerManagerBase.
|
inlineinherited |
Queues a ClientTask for a certain Client.
AClientID | Server-assigned ID of the Client |
ATaskGroup | Group of the Task |
ATaskCode | Code of the Task |
ATaskParameter1 | Parameter #1 for the Task (depending on the TaskGroup this can be left empty) |
ATaskParameter2 | Parameter #2 for the Task (depending on the TaskGroup this can be left empty) |
ATaskParameter3 | Parameter #3 for the Task (depending on the TaskGroup this can be left empty) |
ATaskParameter4 | Parameter #4 for the Task (depending on the TaskGroup this can be left empty) |
ATaskPriority | Priority of the Task |
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
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).
Reimplemented from Ict.Common.Remoting.Server.TServerManagerBase.
|
inlinestaticinherited |
reset the static variables for each Web Request call.
|
inlinevirtual |
Restore the database from a string with yml.gz data.
Reimplemented from Ict.Common.Remoting.Server.TServerManagerBase.
|
inlinevirtual |
SetPassword
Reimplemented from Ict.Common.Remoting.Server.TServerManagerBase.
|
inlineinherited |
Stops the Petra Server. A GC is invoked and waits for pending tasks before the application ends.
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
inlineinherited |
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).
AForceAutomaticClosing | Set 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). |
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
inlinevirtualinherited |
Is the process job enabled?
|
inlinevirtual |
upgrade the database
Reimplemented from Ict.Common.Remoting.Server.TServerManagerBase.
|
staticprotectedinherited |
DB Reconnection attempts (-1 = no connection established yet at all; 0 = none are being made).
|
staticprotectedinherited |
Whether the Timed Processing has been set up already.
|
staticinherited |
static: only initialised once for the whole server
|
getinherited |
Array that contains information about the Clients that are currently connected to the Petra Server.
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
getinherited |
|
getinherited |
Number of Clients that are currently connected to the Petra Server.
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
getinherited |
Total number of Clients that connected to the Petra Server since the start of the Petra Server
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
getinherited |
Server setting: Name of the Server configuration file
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
getsetinherited |
DB Reconnection attempts (-1 = no connection established yet at all; 0 = none are being made).
|
getinherited |
Server setting: IP Port that the Server listens for .NET Remoting calls
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
getinherited |
Result of a call to GC.GetTotalMemory
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
getinherited |
State of the Server
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
getinherited |
Version of the Petra Server and operating system on which the Server runs
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
getinherited |
Whether the 'Server Timed Processing' has been set up.
|
getinherited |
SiteKey of the OpenPetra DB that the Server is connected to.
Implements Ict.Common.Remoting.Shared.IServerAdminInterface.
|
staticget |
get a casted version of the static variable
|
getinherited |
the daily start time for the timed processing