C# Class GSF.TimeSeries.ServiceHostBase

Represents the time-series framework service host.
Inheritance: System.ServiceProcess.ServiceBase
Show file Open project: GridProtectionAlliance/gsf Class Usage Examples

Public Methods

Method Description
InitializeServiceHelper ( ) : void

Initializes the service helper.

ServiceHostBase ( ) : System

Creates a new ServiceHostBase.

ServiceHostBase ( IContainer container ) : System

Creates a new ServiceHostBase from specified parameters.

Protected Methods

Method Description
ActionRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo, Action adapterAction ) : void

Generic adapter request handler.

AuthenticateRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Attempts to authenticate or re-authenticate to network shares.

CacheCurrentConfiguration ( DataSet configuration ) : void

Caches the current system configuration.

This method allows caching of the current system configuration so it can be used if primary configuration source is unavailable.

DisplayResponseMessage ( GSF.ServiceProcess.ClientRequestInfo requestInfo, string status ) : void

Displays a response message to client requester.

DisplayStatusMessage ( string status, UpdateType type ) : void

Displays a broadcast message to all subscribed clients.

DisplayStatusMessage ( string status, UpdateType type, bool publishToLog ) : void

Displays a broadcast message to all subscribed clients.

Dispose ( bool disposing ) : void

Releases the unmanaged resources used by the ServiceHostBase object and optionally releases the managed resources.

GetRequestedAdapter ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : IAdapter

Gets requested IAdapter.

GetRequestedAdapter ( GSF.ServiceProcess.ClientRequestInfo requestInfo, IAdapterCollection &collection ) : IAdapter

Gets requested IAdapter and its containing IAdapterCollection.

GetRequestedCollection ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : IAdapterCollection

Gets requested IAdapterCollection.

HealthMonitorProcessHandler ( string name, object parameters ) : void

Event handler for scheduled health monitor display.

InitializeRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Performs initialization or reinitialization of specified adapter or collection.

InvokeRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Invokes specified adapter command.

ListCommandsRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Lists possible commands of specified adapter.

ListRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Displays status of specified adapter or collection.

LogEventRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Sends remote entry for logging.

LogException ( Exception ex ) : void

Logs an exception to the service helper GSF.ErrorManagement.ErrorLogger.

LogExceptionHandler ( object sender, EventArgs e ) : void

Event handler for processing exceptions encountered while writing entries to a log file.

OnContinue ( ) : void

Handles service continue event.

OnPause ( ) : void

Handles service pause event.

OnShutdown ( ) : void

Handles service shut down event.

OnStart ( string args ) : void

Handles service start event.

OnStop ( ) : void

Handles service stop event.

RefreshRoutesRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Recalculates routing tables.

ReloadConfigRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Manually reloads system configuration.

ReportingProcessHandler ( string name, object parameters ) : void

Event handler for scheduled reporting services.

RestartServiceHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Attempts to restart the hose service.

SendResponse ( GSF.ServiceProcess.ClientRequestInfo requestInfo, bool success ) : void

Sends an actionable response to client.

SendResponse ( GSF.ServiceProcess.ClientRequestInfo requestInfo, bool success, string status ) : void

Sends an actionable response to client with a formatted message.

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

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

ServiceStartedHandler ( object sender, EventArgs e ) : void

Event handler for service started operation.

Time-series framework uses this handler to handle initialization of system objects.

ServiceStartingHandler ( object sender, EventArgs e ) : void

Event handler for service starting operations.

Time-series framework uses this handler to load settings from configuration file as service is starting.

ServiceStoppingHandler ( object sender, EventArgs e ) : void

Event handler for service stopping operation.

Time-series framework uses this handler to un-wire events and dispose of system objects.

StartRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Starts specified adapter.

StatusExportProcessHandler ( string name, object parameters ) : void

Event handler for scheduled adapter status export.

StopRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Stops specified adapter.

TemporalSupportRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Determines support for temporal processing from existing adapters.

UpdateConfigFileRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void

Updates an option in the configuration file.

Private Methods

Method Description
AugmentConfigurationDataSet ( DataSet configuration ) : DataSet
BackupConfiguration ( ConfigurationType configType, string configurationFile ) : void
ConfigurationChangedHandler ( object sender, EventArgs e ) : void

Event handler for processing notifications from adapters that configuration has changed.

The time-series framework IaonSession uses this event to report configuration changes.

ConfigurationLoader_ProcessException ( object sender, EventArgs args ) : void
ExecuteConfigurationCache ( ) : void
ExecuteReloadConfig ( Tuple items ) : void
GenerateLocalCertificate ( ) : void
GenerateReportRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
GetBinaryCachedConfigurationDataSet ( ) : DataSet
GetConfigurationDataSet ( ) : DataSet
GetReloadConfigType ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : string
GetReportRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
GetReportStatusRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
GetXMLCachedConfigurationDataSet ( ) : DataSet
HandleInitializeRequest ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
InitializeSystem ( ) : void
InitializeTcpServer ( ) : GSF.Communication.TcpServer
InitializeTlsServer ( ) : TlsServer
ListReportsRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
LoadStartupConfiguration ( ) : bool
LoadSystemConfiguration ( ) : bool
LoggedExceptionHandler ( object sender, EventArgs e ) : void
ProcessExceptionHandler ( object sender, EventArgs e ) : void

Event handler for processing reported exceptions.

The time-series framework IaonSession uses this event to report exceptions.

PropagateDataSource ( DataSet dataSource ) : bool
ReportingConfigRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
RequestedAdapterExists ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : bool

Determines whether the requested adapter exists.

SendRequest ( System.Guid clientID, string userInput ) : void
StartHostedService ( ) : void
StatusMessageHandler ( object sender, UpdateType>.EventArgs e ) : void

Event handler for reporting status messages.

The time-series framework IaonSession uses this event to report adapter status messages (e.g., to a log file or console window).

StopHostedService ( ) : void
TaskScheduler_UnobservedTaskException ( object sender, System.Threading.Tasks.UnobservedTaskExceptionEventArgs e ) : void
UpdatedStatusHandler ( object sender, EventArgs e ) : void

Method Details

ActionRequestHandler() protected method

Generic adapter request handler.
protected ActionRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo, Action adapterAction ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
adapterAction Action Action to perform on .
return void

AuthenticateRequestHandler() protected method

Attempts to authenticate or re-authenticate to network shares.
protected AuthenticateRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

CacheCurrentConfiguration() protected method

Caches the current system configuration.
This method allows caching of the current system configuration so it can be used if primary configuration source is unavailable.
protected CacheCurrentConfiguration ( DataSet configuration ) : void
configuration System.Data.DataSet Configuration .
return void

DisplayResponseMessage() protected method

Displays a response message to client requester.
protected DisplayResponseMessage ( GSF.ServiceProcess.ClientRequestInfo requestInfo, string status ) : void
requestInfo GSF.ServiceProcess.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

DisplayStatusMessage() protected method

Displays a broadcast message to all subscribed clients.
protected DisplayStatusMessage ( string status, UpdateType type, bool publishToLog ) : void
status string Status message to send to all clients.
type UpdateType of message to send.
publishToLog bool Determines if messages should be sent logging engine.
return void

Dispose() protected method

Releases the unmanaged resources used by the ServiceHostBase object and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

GetRequestedAdapter() protected method

Gets requested IAdapter.
protected GetRequestedAdapter ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : IAdapter
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return IAdapter

GetRequestedAdapter() protected method

Gets requested IAdapter and its containing IAdapterCollection.
protected GetRequestedAdapter ( GSF.ServiceProcess.ClientRequestInfo requestInfo, IAdapterCollection &collection ) : IAdapter
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
collection IAdapterCollection Containing for .
return IAdapter

GetRequestedCollection() protected method

Gets requested IAdapterCollection.
protected GetRequestedCollection ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : IAdapterCollection
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return IAdapterCollection

HealthMonitorProcessHandler() protected method

Event handler for scheduled health monitor display.
protected HealthMonitorProcessHandler ( string name, object parameters ) : void
name string Scheduled event name.
parameters object Scheduled event parameters.
return void

InitializeRequestHandler() protected method

Performs initialization or reinitialization of specified adapter or collection.
protected InitializeRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

InitializeServiceHelper() public method

Initializes the service helper.
public InitializeServiceHelper ( ) : void
return void

InvokeRequestHandler() protected method

Invokes specified adapter command.
protected InvokeRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

ListCommandsRequestHandler() protected method

Lists possible commands of specified adapter.
protected ListCommandsRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

ListRequestHandler() protected method

Displays status of specified adapter or collection.
protected ListRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

LogEventRequestHandler() protected method

Sends remote entry for logging.
protected LogEventRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo
return void

LogException() protected method

Logs an exception to the service helper GSF.ErrorManagement.ErrorLogger.
protected LogException ( Exception ex ) : void
ex System.Exception to log.
return void

LogExceptionHandler() protected method

Event handler for processing exceptions encountered while writing entries to a log file.
protected LogExceptionHandler ( object sender, EventArgs e ) : void
sender object Event source of the exception.
e EventArgs Event arguments containing the exception to report.
return void

OnContinue() protected method

Handles service continue event.
protected OnContinue ( ) : void
return void

OnPause() protected method

Handles service pause event.
protected OnPause ( ) : void
return void

OnShutdown() protected method

Handles service shut down event.
protected OnShutdown ( ) : void
return void

OnStart() protected method

Handles service start event.
protected OnStart ( string args ) : void
args string Service startup arguments, if any.
return void

OnStop() protected method

Handles service stop event.
protected OnStop ( ) : void
return void

RefreshRoutesRequestHandler() protected method

Recalculates routing tables.
protected RefreshRoutesRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

ReloadConfigRequestHandler() protected method

Manually reloads system configuration.
protected ReloadConfigRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

ReportingProcessHandler() protected method

Event handler for scheduled reporting services.
protected ReportingProcessHandler ( string name, object parameters ) : void
name string Scheduled event name.
parameters object Scheduled event parameters.
return void

RestartServiceHandler() protected method

Attempts to restart the hose service.
protected RestartServiceHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

SendResponse() protected method

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

SendResponse() protected method

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

SendResponseWithAttachment() protected method

Sends an actionable response to client with a formatted message and attachment.
protected SendResponseWithAttachment ( GSF.ServiceProcess.ClientRequestInfo requestInfo, bool success, object attachment, string status ) : void
requestInfo GSF.ServiceProcess.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

ServiceHostBase() public method

Creates a new ServiceHostBase.
public ServiceHostBase ( ) : System
return System

ServiceHostBase() public method

Creates a new ServiceHostBase from specified parameters.
public ServiceHostBase ( IContainer container ) : System
container IContainer Service host .
return System

ServiceStartedHandler() protected method

Event handler for service started operation.
Time-series framework uses this handler to handle initialization of system objects.
protected ServiceStartedHandler ( object sender, EventArgs e ) : void
sender object Event source.
e System.EventArgs Event arguments.
return void

ServiceStartingHandler() protected method

Event handler for service starting operations.
Time-series framework uses this handler to load settings from configuration file as service is starting.
protected ServiceStartingHandler ( object sender, EventArgs e ) : void
sender object Event source.
e EventArgs Event arguments containing command line arguments passed into service at startup.
return void

ServiceStoppingHandler() protected method

Event handler for service stopping operation.
Time-series framework uses this handler to un-wire events and dispose of system objects.
protected ServiceStoppingHandler ( object sender, EventArgs e ) : void
sender object Event source.
e System.EventArgs Event arguments.
return void

StartRequestHandler() protected method

Starts specified adapter.
protected StartRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

StatusExportProcessHandler() protected method

Event handler for scheduled adapter status export.
protected StatusExportProcessHandler ( string name, object parameters ) : void
name string Scheduled event name.
parameters object Scheduled event parameters.
return void

StopRequestHandler() protected method

Stops specified adapter.
protected StopRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

TemporalSupportRequestHandler() protected method

Determines support for temporal processing from existing adapters.
protected TemporalSupportRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void

UpdateConfigFileRequestHandler() protected method

Updates an option in the configuration file.
protected UpdateConfigFileRequestHandler ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
requestInfo GSF.ServiceProcess.ClientRequestInfo instance containing the client request.
return void