C# Class SiteStatus.SiteStatusRepository

This class is responsible for generating a complete XML status report on a site.
Show file Open project: iinteractive/site-status Class Usage Examples

Public Methods

Method Description
GetConfiguration ( ) : Report

Uses the application settings to pull up the configuration file and deserialize.

GetServices ( ) : List

Returns a list of services and their statuses. Pulls up the configuration file and checks the status of the services.

ReadComponents ( ) : List

Reads in all the component files from the components folder. File extensions are of .ver. Using the read/write share option, so the file can be overwritten and not lock up a deploy.

ResolveServiceStatus ( Service service ) : void

Sets the Status of the given service using the service monitor returned from a call to ResolveStatusMonitor.

ResolveStatusMonitor ( Service service ) : IStatusMonitor

Resolves a usable IStatusMonitor to determine for use to determine if the service is up or down. It does this using the supplied factories.

SiteStatusRepository ( string root ) : System

Instantiates a new SiteStatusRepository object with the default factories from SiteStatusHandler, and the given root.

SiteStatusRepository ( string root, BaseStatusMonitorFactory factories ) : System

Instantiates a new SiteStatusRepository object with the given factories, and the given root.

Write ( TextWriter writer ) : void

Writes a complete XML status report to the given writer.

WriteErrors ( TextWriter writer ) : void

This writes the issues that are detected during the retrieval of the site's status.

Private Methods

Method Description
CheckForCtorErrors ( ) : void

Checks for errors with the initial configuration of the SiteStatusRepository's properties.

Method Details

GetConfiguration() public method

Uses the application settings to pull up the configuration file and deserialize.
public GetConfiguration ( ) : Report
return Report

GetServices() public method

Returns a list of services and their statuses. Pulls up the configuration file and checks the status of the services.
public GetServices ( ) : List
return List

ReadComponents() public method

Reads in all the component files from the components folder. File extensions are of .ver. Using the read/write share option, so the file can be overwritten and not lock up a deploy.
public ReadComponents ( ) : List
return List

ResolveServiceStatus() public method

Sets the Status of the given service using the service monitor returned from a call to ResolveStatusMonitor.
public ResolveServiceStatus ( Service service ) : void
service Service The service that needs to be queried.
return void

ResolveStatusMonitor() public method

Resolves a usable IStatusMonitor to determine for use to determine if the service is up or down. It does this using the supplied factories.
public ResolveStatusMonitor ( Service service ) : IStatusMonitor
service Service The service that needs to be evaluated.
return IStatusMonitor

SiteStatusRepository() public method

Instantiates a new SiteStatusRepository object with the default factories from SiteStatusHandler, and the given root.
public SiteStatusRepository ( string root ) : System
root string The root of the site.
return System

SiteStatusRepository() public method

Instantiates a new SiteStatusRepository object with the given factories, and the given root.
public SiteStatusRepository ( string root, BaseStatusMonitorFactory factories ) : System
root string The root of the site.
factories SiteStatus.Factories.BaseStatusMonitorFactory The factories used in the ResolveStatusMonitor
return System

Write() public method

Writes a complete XML status report to the given writer.
public Write ( TextWriter writer ) : void
writer System.IO.TextWriter The writer to place the complete status report /// to.
return void

WriteErrors() public method

This writes the issues that are detected during the retrieval of the site's status.
public WriteErrors ( TextWriter writer ) : void
writer System.IO.TextWriter The writer to place the complete issues /// report.
return void