C# Class openXDA.ServiceHost

Show file Open project: GridProtectionAlliance/openXDA Class Usage Examples

Public Methods

Method Description
DisconnectClient ( Guid clientID ) : void
LogStatusMessage ( string message, UpdateType type = UpdateType.Information ) : void

Logs a status message to connected clients.

SendRequest ( Guid clientID, string userInput ) : void

Sends a command request to the service.

ServiceHost ( ) : System
ServiceHost ( IContainer container ) : System

Protected Methods

Method Description
DisplayResponseMessage ( ClientRequestInfo requestInfo, string status ) : void

Displays a response message to client requestor.

DisplayStatusMessage ( string status, UpdateType type ) : void

Displays a broadcast message to all subscribed clients.

Dispose ( bool disposing ) : void

Clean up any resources being used.

OnContinue ( ) : void
OnPause ( ) : void
OnShutdown ( ) : void
OnStart ( string args ) : void
OnStop ( ) : void
SendResponse ( ClientRequestInfo requestInfo, bool success ) : void

Sends an actionable response to client.

SendResponseWithAttachment ( ClientRequestInfo requestInfo, bool success, object attachment, string status ) : void

Sends an actionable response to client with a formatted message and attachment.

Private Methods

Method Description
EngineStatusHandler ( ClientRequestInfo requestInfo ) : void
HandleException ( Exception ex ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

MsgServiceMonitorsRequestHandler ( ClientRequestInfo requestInfo ) : void
ReloadConfigurationHandler ( string s, object args ) : void
ReloadSystemSettingsRequestHandler ( ClientRequestInfo requestInfo ) : void
ServiceHeartbeatHandler ( string s, object args ) : void
ServiceHelper_ServiceStarted ( object sender, EventArgs e ) : void
ServiceHelper_ServiceStopping ( object sender, EventArgs e ) : void
ServiceMonitors_AdapterCreated ( object sender, EventArgs e ) : void
ServiceMonitors_AdapterLoaded ( object sender, EventArgs e ) : void
ServiceMonitors_AdapterUnloaded ( object sender, EventArgs e ) : void
StartDebugging ( string args ) : void
StopDebugging ( ) : void
TryStartEngine ( ) : bool
TryStartWebUI ( ) : bool
TweakFileProcessorHandler ( ClientRequestInfo requestInfo ) : void
ValidateAccountsAndGroups ( AdoDataConnection database ) : void

Validate accounts and groups to ensure that account names and group names are converted to SIDs.

WebServer_StatusMessage ( object sender, EventArgs e ) : void

Method Details

DisconnectClient() public method

public DisconnectClient ( Guid clientID ) : void
clientID Guid
return void

DisplayResponseMessage() protected method

Displays a response message to client requestor.
protected DisplayResponseMessage ( ClientRequestInfo requestInfo, string status ) : void
requestInfo ClientRequestInfo instance containing the client request.
status string Formatted status message to send to client.
return void

DisplayStatusMessage() protected method

Displays a broadcast message to all subscribed clients.
protected DisplayStatusMessage ( string status, UpdateType type ) : void
status string Status message to send to all clients.
type UpdateType of message to send.
return void

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

LogStatusMessage() public method

Logs a status message to connected clients.
public LogStatusMessage ( string message, UpdateType type = UpdateType.Information ) : void
message string Message to log.
type UpdateType Type of message to log.
return void

OnContinue() protected method

protected OnContinue ( ) : void
return void

OnPause() protected method

protected OnPause ( ) : void
return void

OnShutdown() protected method

protected OnShutdown ( ) : void
return void

OnStart() protected method

protected OnStart ( string args ) : void
args string
return void

OnStop() protected method

protected OnStop ( ) : void
return void

SendRequest() public method

Sends a command request to the service.
public SendRequest ( Guid clientID, string userInput ) : void
clientID Guid Client ID of sender.
userInput string Request string.
return void

SendResponse() protected method

Sends an actionable response to client.
protected SendResponse ( ClientRequestInfo requestInfo, bool success ) : void
requestInfo ClientRequestInfo instance containing the client request.
success bool Flag that determines if this response to client request was a success.
return void

SendResponseWithAttachment() protected method

Sends an actionable response to client with a formatted message and attachment.
protected SendResponseWithAttachment ( ClientRequestInfo requestInfo, bool success, object attachment, string status ) : void
requestInfo ClientRequestInfo instance containing the client request.
success bool Flag that determines if this response to client request was a success.
attachment object Attachment to send with response.
status string Formatted status message to send with response.
return void

ServiceHost() public method

public ServiceHost ( ) : System
return System

ServiceHost() public method

public ServiceHost ( IContainer container ) : System
container IContainer
return System