C# 클래스 GSF.ServiceProcess.ServiceHelper

상속: System.ComponentModel.Component, ISupportLifecycle, ISupportInitialize, IProvideStatus, IPersistSettings
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AbortProcess void
BeginInit void
CurtailMessageLength string
EndInit void
ErrorLogger_LoggingException void
LoadSchedules void
LogicalThread_ProcessException void
ManageFiles void
OnPause void
OnResume void
OnShutdown void
OnStart void
OnStop void
PrioritizeStatusUpdate void
ProcessStatusUpdates void
Process_StateChanged void
QueueStatusUpdate void
ReloadCryptoCache void
ReloadSettings void
RemoteCommandProcess_ErrorDataReceived void
RemoteCommandProcess_OutputDataReceived void
RemoteTelnetSession void
RemotingServer_ClientConnectingException void
RemotingServer_ClientDisconnected void
RemotingServer_ReceiveClientDataComplete void
RescheduleProcess void
ResetHealthMonitor void
SaveSchedules void
Scheduler_ScheduleDue void
SendAuthenticationFailureResponse void
SendAuthenticationSuccessResponse void
SendProcessStateChangedResponse void
SendServiceStateChangedResponse void
SendUpdateClientStatusResponse void
ShowClients void
ShowHealthReport void
ShowProcesses void
ShowRequestHelp void
ShowRequestHistory void
ShowSchedules void
ShowServiceStatus void
ShowSettings void
ShowTime void
ShowUser void
ShowVersion void
StartProcess void
StatusLog_LogException void
TransferFile void
TrySetCurrentThreadPrincipal bool
UnscheduleProcess void
UpdateClientFilter void
UpdateSettings void
UpdateStatus void
UpdateStatus void
UpdateStatus void
UpdateStatus void
UpdateStatusAppendLine void
UpdateStatusAppendLine void
VerifySecurity bool

공개 메소드들

메소드 설명
AddProcess ( object[]>.Action processExecutionMethod, string processName ) : bool

Adds a new ServiceProcess to the ServiceHelper.

AddProcess ( object[]>.Action processExecutionMethod, string processName, object processArguments ) : bool

Adds a new ServiceProcess to the ServiceHelper.

AddScheduledProcess ( object[]>.Action processExecutionMethod, string processName, object processArguments, string processSchedule ) : bool

Adds a new ServiceProcess to the ServiceHelper that executes on a schedule.

AddScheduledProcess ( object[]>.Action processExecutionMethod, string processName, string processSchedule ) : bool

Adds a new ServiceProcess to the ServiceHelper that executes on a schedule.

DisconnectClient ( System.Guid clientID ) : void

Disconnects the client from the service.

FindClientRequestHandler ( string handlerCommand ) : GSF.ServiceProcess.ClientRequestHandler

Returns the ClientRequestHandler object for the specified handlerCommand.

FindConnectedClient ( System.Guid clientID ) : ClientInfo

Returns the ClientInfo object for the specified clientID.

FindProcess ( string processName ) : ServiceProcess

Returns the ServiceProcess for the specified processName.

Initialize ( ) : void

Initializes the ServiceHelper.

Initialize() is to be called by user-code directly only if the ServiceHelper object is not consumed through the designer surface of the IDE.

LoadSettings ( ) : void

Loads saved settings of the ServiceHelper from the config file if the PersistSettings property is set to true.

LoadSettings ( bool includeServiceComponents ) : void

Loads saved settings of the ServiceHelper from the config file if the PersistSettings property is set to true.

LogException ( Exception ex ) : void

Log exception to ErrorLogger.

RemoveProcess ( string processName ) : bool

Removes an existing ServiceProcess from the ServiceHelper.

RemoveScheduledProcess ( string processName ) : bool

Removes an existing ServiceProcess from the ServiceHelper that is scheduled for automatic execution.

SaveSettings ( ) : void

Saves settings of the ServiceHelper to the config file if the PersistSettings property is set to true.

SaveSettings ( bool includeServiceComponents ) : void

Saves settings of the ServiceHelper to the config file if the PersistSettings property is set to true.

ScheduleProcess ( string processName, string scheduleRule ) : bool

Schedules an existing ServiceProcess for automatic execution.

ScheduleProcess ( string processName, string scheduleRule, bool updateExistingSchedule ) : bool

Schedules an existing ServiceProcess for automatic execution.

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

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

This method is used to send an actionable client response that can be used for responding to an event after a command has been issued.

SendResponse ( System.Guid client, ServiceResponse response ) : void

Sends the specified response to the specified client only.

SendResponse ( System.Guid client, ServiceResponse response, bool async ) : void

Sends the specified response to the specified client only.

SendResponse ( ServiceResponse response ) : void

Sends the specified response to all RemoteClients.

ServiceHelper ( ) : GSF.Annotations

Initializes a new instance of the ServiceHelper class.

ServiceHelper ( IContainer container ) : GSF.Annotations

Initializes a new instance of the ServiceHelper class.

UnscheduleProcess ( string processName ) : bool

Unschedules an existing ServiceProcess scheduled for automatic execution.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

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

OnLoggedException ( Exception ex ) : void

Raises LoggedException event with logged exception.

OnProcessStateChanged ( string processName, ServiceProcessState processState ) : void

Raises the ProcessStateChanged event.

OnReceivedClientRequest ( ClientRequest request, ClientInfo requestSender ) : void

Raises the ReceivedClientRequest event.

OnServicePaused ( ) : void

Raises the ServicePaused event.

OnServicePausing ( ) : void

Raises the ServicePausing event.

OnServiceResumed ( ) : void

Raises the ServiceResumed event.

OnServiceResuming ( ) : void

Raises the ServiceResuming event.

OnServiceStarted ( ) : void

Raises the ServiceStarted event.

OnServiceStarting ( string args ) : void

Raises the ServiceStarting event.

OnServiceStopped ( ) : void

Raises the ServiceStopped event.

OnServiceStopping ( ) : void

Raises the ServiceStopping event.

OnSystemShutdown ( ) : void

Raises the SystemShutdown event.

OnUpdatedStatus ( System.Guid clientID, string status, UpdateType type ) : void

Raises the UpdatedStatus event with the updated status message.

This overload combines string.Format and SendStatusMessage for convenience.

비공개 메소드들

메소드 설명
AbortProcess ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
BeginInit ( ) : void
CurtailMessageLength ( string message ) : string
EndInit ( ) : void
ErrorLogger_LoggingException ( object sender, EventArgs e ) : void
LoadSchedules ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
LogicalThread_ProcessException ( object sender, EventArgs e ) : void
ManageFiles ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
OnPause ( ) : void
OnResume ( ) : void
OnShutdown ( ) : void
OnStart ( string args ) : void
OnStop ( ) : void
PrioritizeStatusUpdate ( StatusUpdate update ) : void
ProcessStatusUpdates ( ) : void
Process_StateChanged ( object sender, EventArgs e ) : void
QueueStatusUpdate ( StatusUpdate update ) : void
ReloadCryptoCache ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ReloadSettings ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
RemoteCommandProcess_ErrorDataReceived ( object sender, DataReceivedEventArgs e ) : void
RemoteCommandProcess_OutputDataReceived ( object sender, DataReceivedEventArgs e ) : void
RemoteTelnetSession ( GSF.ServiceProcess.ClientRequestInfo requestinfo ) : void
RemotingServer_ClientConnectingException ( object sender, EventArgs e ) : void
RemotingServer_ClientDisconnected ( object sender, EventArgs e ) : void
RemotingServer_ReceiveClientDataComplete ( object sender, EventArgs e ) : void
RescheduleProcess ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ResetHealthMonitor ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
SaveSchedules ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
Scheduler_ScheduleDue ( object sender, EventArgs e ) : void
SendAuthenticationFailureResponse ( System.Guid clientID ) : void
SendAuthenticationSuccessResponse ( System.Guid clientID ) : void
SendProcessStateChangedResponse ( string processName, ServiceProcessState currentState ) : void
SendServiceStateChangedResponse ( ServiceState currentState ) : void
SendUpdateClientStatusResponse ( System.Guid clientID, UpdateType type, string responseMessage, bool telnetMessage = false ) : void
ShowClients ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowHealthReport ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowProcesses ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowRequestHelp ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowRequestHistory ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowSchedules ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowServiceStatus ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowSettings ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowTime ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowUser ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
ShowVersion ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
StartProcess ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
StatusLog_LogException ( object sender, EventArgs e ) : void
TransferFile ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
TrySetCurrentThreadPrincipal ( ClientInfo client ) : bool
UnscheduleProcess ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
UpdateClientFilter ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
UpdateSettings ( GSF.ServiceProcess.ClientRequestInfo requestInfo ) : void
UpdateStatus ( System.Guid client, UpdateType type, bool publishToLog, string message ) : void
UpdateStatus ( System.Guid client, UpdateType type, string message ) : void
UpdateStatus ( UpdateType type, bool publishToLog, string message ) : void
UpdateStatus ( UpdateType type, string message ) : void
UpdateStatusAppendLine ( System.Guid client, UpdateType type, string message ) : void
UpdateStatusAppendLine ( UpdateType type, string message ) : void
VerifySecurity ( ClientInfo client ) : bool

메소드 상세

AddProcess() 공개 메소드

Adds a new ServiceProcess to the ServiceHelper.
public AddProcess ( object[]>.Action processExecutionMethod, string processName ) : bool
processExecutionMethod object[]>.Action The to be invoked the is started.
processName string Name of the being added.
리턴 bool

AddProcess() 공개 메소드

Adds a new ServiceProcess to the ServiceHelper.
public AddProcess ( object[]>.Action processExecutionMethod, string processName, object processArguments ) : bool
processExecutionMethod object[]>.Action The to be invoked the is started.
processName string Name of the being added.
processArguments object Arguments to be passed in to the during execution.
리턴 bool

AddScheduledProcess() 공개 메소드

Adds a new ServiceProcess to the ServiceHelper that executes on a schedule.
public AddScheduledProcess ( object[]>.Action processExecutionMethod, string processName, object processArguments, string processSchedule ) : bool
processExecutionMethod object[]>.Action The to be invoked the is started.
processName string Name of the being added.
processArguments object Arguments to be passed in to the during execution.
processSchedule string for the execution of the .
리턴 bool

AddScheduledProcess() 공개 메소드

Adds a new ServiceProcess to the ServiceHelper that executes on a schedule.
public AddScheduledProcess ( object[]>.Action processExecutionMethod, string processName, string processSchedule ) : bool
processExecutionMethod object[]>.Action The to be invoked the is started.
processName string Name of the being added.
processSchedule string for the execution of the .
리턴 bool

DisconnectClient() 공개 메소드

Disconnects the client from the service.
public DisconnectClient ( System.Guid clientID ) : void
clientID System.Guid The ID of the client.
리턴 void

Dispose() 보호된 메소드

Releases the unmanaged resources used by the ServiceHelper 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.
리턴 void

FindClientRequestHandler() 공개 메소드

Returns the ClientRequestHandler object for the specified handlerCommand.
public FindClientRequestHandler ( string handlerCommand ) : GSF.ServiceProcess.ClientRequestHandler
handlerCommand string Request type whose object is to be retrieved.
리턴 GSF.ServiceProcess.ClientRequestHandler

FindConnectedClient() 공개 메소드

Returns the ClientInfo object for the specified clientID.
public FindConnectedClient ( System.Guid clientID ) : ClientInfo
clientID System.Guid ID of the client whose object is to be retrieved.
리턴 ClientInfo

FindProcess() 공개 메소드

Returns the ServiceProcess for the specified processName.
public FindProcess ( string processName ) : ServiceProcess
processName string Name of the to be retrieved.
리턴 ServiceProcess

Initialize() 공개 메소드

Initializes the ServiceHelper.
Initialize() is to be called by user-code directly only if the ServiceHelper object is not consumed through the designer surface of the IDE.
public Initialize ( ) : void
리턴 void

LoadSettings() 공개 메소드

Loads saved settings of the ServiceHelper from the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public LoadSettings ( ) : void
리턴 void

LoadSettings() 공개 메소드

Loads saved settings of the ServiceHelper from the config file if the PersistSettings property is set to true.
public LoadSettings ( bool includeServiceComponents ) : void
includeServiceComponents bool A boolean value that indicates whether the settings of are to be loaded.
리턴 void

LogException() 공개 메소드

Log exception to ErrorLogger.
public LogException ( Exception ex ) : void
ex System.Exception Exception to log.
리턴 void

OnLoggedException() 보호된 메소드

Raises LoggedException event with logged exception.
protected OnLoggedException ( Exception ex ) : void
ex System.Exception Logged .
리턴 void

OnProcessStateChanged() 보호된 메소드

Raises the ProcessStateChanged event.
protected OnProcessStateChanged ( string processName, ServiceProcessState processState ) : void
processName string Name of the whose state changed.
processState ServiceProcessState New of the .
리턴 void

OnReceivedClientRequest() 보호된 메소드

Raises the ReceivedClientRequest event.
protected OnReceivedClientRequest ( ClientRequest request, ClientInfo requestSender ) : void
request ClientRequest The that was received.
requestSender ClientInfo The object of the sender.
리턴 void

OnServicePaused() 보호된 메소드

Raises the ServicePaused event.
protected OnServicePaused ( ) : void
리턴 void

OnServicePausing() 보호된 메소드

Raises the ServicePausing event.
protected OnServicePausing ( ) : void
리턴 void

OnServiceResumed() 보호된 메소드

Raises the ServiceResumed event.
protected OnServiceResumed ( ) : void
리턴 void

OnServiceResuming() 보호된 메소드

Raises the ServiceResuming event.
protected OnServiceResuming ( ) : void
리턴 void

OnServiceStarted() 보호된 메소드

Raises the ServiceStarted event.
protected OnServiceStarted ( ) : void
리턴 void

OnServiceStarting() 보호된 메소드

Raises the ServiceStarting event.
protected OnServiceStarting ( string args ) : void
args string Arguments to be sent to event.
리턴 void

OnServiceStopped() 보호된 메소드

Raises the ServiceStopped event.
protected OnServiceStopped ( ) : void
리턴 void

OnServiceStopping() 보호된 메소드

Raises the ServiceStopping event.
protected OnServiceStopping ( ) : void
리턴 void

OnSystemShutdown() 보호된 메소드

Raises the SystemShutdown event.
protected OnSystemShutdown ( ) : void
리턴 void

OnUpdatedStatus() 보호된 메소드

Raises the UpdatedStatus event with the updated status message.
This overload combines string.Format and SendStatusMessage for convenience.
protected OnUpdatedStatus ( System.Guid clientID, string status, UpdateType type ) : void
clientID System.Guid ID of the client receiving the message.
status string Updated status message.
type UpdateType of status message.
리턴 void

RemoveProcess() 공개 메소드

Removes an existing ServiceProcess from the ServiceHelper.
public RemoveProcess ( string processName ) : bool
processName string Name of the to be removed.
리턴 bool

RemoveScheduledProcess() 공개 메소드

Removes an existing ServiceProcess from the ServiceHelper that is scheduled for automatic execution.
public RemoveScheduledProcess ( string processName ) : bool
processName string Name of the scheduled to be removed.
리턴 bool

SaveSettings() 공개 메소드

Saves settings of the ServiceHelper to the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public SaveSettings ( ) : void
리턴 void

SaveSettings() 공개 메소드

Saves settings of the ServiceHelper to the config file if the PersistSettings property is set to true.
has a value of null or empty string.
public SaveSettings ( bool includeServiceComponents ) : void
includeServiceComponents bool A boolean value that indicates whether the settings of are to be saved.
리턴 void

ScheduleProcess() 공개 메소드

Schedules an existing ServiceProcess for automatic execution.
public ScheduleProcess ( string processName, string scheduleRule ) : bool
processName string Name of the to be scheduled.
scheduleRule string Rule that defines the execution pattern of the .
리턴 bool

ScheduleProcess() 공개 메소드

Schedules an existing ServiceProcess for automatic execution.
public ScheduleProcess ( string processName, string scheduleRule, bool updateExistingSchedule ) : bool
processName string Name of the to be scheduled.
scheduleRule string Rule that defines the execution pattern of the .
updateExistingSchedule bool true if the is to be re-scheduled; otherwise false.
리턴 bool

SendActionableResponse() 공개 메소드

Sends an actionable response to client along with an optional formatted message and attachment.
This method is used to send an actionable client response that can be used for responding to an event after a command has been issued.
public SendActionableResponse ( GSF.ServiceProcess.ClientRequestInfo requestInfo, bool success, object attachment = null, string status = null ) : 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.
리턴 void

SendResponse() 공개 메소드

Sends the specified response to the specified client only.
public SendResponse ( System.Guid client, ServiceResponse response ) : void
client System.Guid ID of the client to whom the is to be sent.
response ServiceResponse The to be sent to the .
리턴 void

SendResponse() 공개 메소드

Sends the specified response to the specified client only.
public SendResponse ( System.Guid client, ServiceResponse response, bool async ) : void
client System.Guid ID of the client to whom the is to be sent.
response ServiceResponse The to be sent to the .
async bool Flag to determine whether to wait for the send operations to complete.
리턴 void

SendResponse() 공개 메소드

Sends the specified response to all RemoteClients.
public SendResponse ( ServiceResponse response ) : void
response ServiceResponse The to be sent to all .
리턴 void

ServiceHelper() 공개 메소드

Initializes a new instance of the ServiceHelper class.
public ServiceHelper ( ) : GSF.Annotations
리턴 GSF.Annotations

ServiceHelper() 공개 메소드

Initializes a new instance of the ServiceHelper class.
public ServiceHelper ( IContainer container ) : GSF.Annotations
container IContainer object that contains the .
리턴 GSF.Annotations

UnscheduleProcess() 공개 메소드

Unschedules an existing ServiceProcess scheduled for automatic execution.
public UnscheduleProcess ( string processName ) : bool
processName string Name of the to be unscheduled.
리턴 bool