C# Class GSF.TimeSeries.Adapters.AdapterBase

Represents the base class for any adapter.
Inheritance: IAdapter
Afficher le fichier Open project: GridProtectionAlliance/gsf

Private Properties

Свойство Type Description
GenHashCode void
GetStatusWithMessageLevelPrefix string
IncrementProcessedMeasurements void
OnProcessException void
OnStatusMessage void
SetInitializedState void
SetTemporalConstraint void
Start void
Stop void

Méthodes publiques

Méthode Description
Dispose ( ) : void

Releases all the resources used by the AdapterBase object.

GetHashCode ( ) : int

Serves as a hash function for the current AdapterBase.

GetShortStatus ( int maxLength ) : string

Gets a short one-line status of this AdapterBase.

Initialize ( ) : void

Initializes AdapterBase.

LoadInputSourceIDs ( IAdapter adapter, string measurementTable = "ActiveMeasurements" ) : void

Loads an IOutputAdapter or IActionAdapter instance's input measurement keys from a specific set of source ID's.

Any existing input measurement keys will be distinctly merged with those associated with specified source ID's.

LoadOutputSourceIDs ( IAdapter adapter, string measurementTable = "ActiveMeasurements" ) : void

Loads an IInputAdapter or IActionAdapter instance's output measurements from a specific set of source ID's.

Any existing output measurements will be distinctly merged with those associated with specified source ID's.

ParseFilterExpression ( string filterExpression, string &tableName, string &whereExpression, string &sortField, int &takeCount ) : bool

Parses a standard FILTER styles expression into its constituent parts.

This method can be safely called from multiple threads.

ParseInputMeasurementKeys ( DataSet dataSource, bool allowSelect, string value, string measurementTable = "ActiveMeasurements" ) : MeasurementKey[]

Parses input measurement keys from connection string setting.

Security warning: allowing SELECT statements, i.e., setting allowSelect to true, should only be allowed in cases where SQL injection would not be an issue (e.g., in places where a user can already access the database and would have nothing to gain via an injection attack).

ParseOutputMeasurementKeys ( DataSet dataSource, bool allowSelect, string value, string measurementTable = "ActiveMeasurements" ) : MeasurementKey[]

Parses output measurement keys from connection string setting.

Security warning: allowing SELECT statements, i.e., setting allowSelect to true, should only be allowed in cases where SQL injection would not be an issue (e.g., in places where a user can already access the database and would have nothing to gain via an injection attack).

ParseOutputMeasurements ( DataSet dataSource, bool allowSelect, string value, string measurementTable = "ActiveMeasurements" ) : IMeasurement[]

Parses output measurements from connection string setting.

Security warning: allowing SELECT statements, i.e., setting allowSelect to true, should only be allowed in cases where SQL injection would not be an issue (e.g., in places where a user can already access the database and would have nothing to gain via an injection attack).

ParseTimeTag ( string timetag ) : System.DateTime

Parses a string formatted as an absolute or relative time tag.

Relative times are parsed based on an offset to current time (UTC) specified by "*".

The timetag parameter can be specified in one of the following formats: Time Format Format Description 12-30-2000 23:59:59.033 Absolute date and time. * Evaluates to DateTime.UtcNow. *-20s Evaluates to 20 seconds before DateTime.UtcNow. *-10m Evaluates to 10 minutes before DateTime.UtcNow. *-1h Evaluates to 1 hour before DateTime.UtcNow. *-1d Evaluates to 1 day before DateTime.UtcNow. *+2d Evaluates to 2 days from DateTime.UtcNow.

Méthodes protégées

Méthode Description
AdapterBase ( ) : System

Constructs a new instance of the AdapterBase.

Dispose ( bool disposing ) : void

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

OnConfigurationChanged ( ) : void

Raises ConfigurationChanged event.

OnInputMeasurementKeysUpdated ( ) : void

Raises InputMeasurementKeysUpdated event.

OnOutputMeasurementsUpdated ( ) : void

Raises OutputMeasurementsUpdated event.

OnProcessException ( MessageLevel level, Exception exception, string eventName = null, MessageFlags flags = MessageFlags.None ) : void

Raises the ProcessException event.

should be a constant string value associated with what type of message is being generated. In general, there should only be a few dozen distinct event names per class. Exceeding this threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.

OnStatusMessage ( MessageLevel level, string status, string eventName = null, MessageFlags flags = MessageFlags.None ) : void

Raises the StatusMessage event and sends this data to the Logger.

should be a constant string value associated with what type of message is being generated. In general, there should only be a few dozen distinct event names per class. Exceeding this threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.

Private Methods

Méthode Description
GenHashCode ( ) : void
GetStatusWithMessageLevelPrefix ( string status, MessageLevel level ) : string
IncrementProcessedMeasurements ( long totalAdded ) : void
OnProcessException ( Exception ex ) : void
OnStatusMessage ( string status ) : void
SetInitializedState ( bool initialized ) : void
SetTemporalConstraint ( string startTime, string stopTime, string constraintParameters ) : void
Start ( ) : void
Stop ( ) : void

Method Details

AdapterBase() protected méthode

Constructs a new instance of the AdapterBase.
protected AdapterBase ( ) : System
Résultat System

Dispose() public méthode

Releases all the resources used by the AdapterBase object.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Releases the unmanaged resources used by the AdapterBase 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.
Résultat void

GetHashCode() public méthode

Serves as a hash function for the current AdapterBase.
public GetHashCode ( ) : int
Résultat int

GetShortStatus() public abstract méthode

Gets a short one-line status of this AdapterBase.
public abstract GetShortStatus ( int maxLength ) : string
maxLength int Maximum number of available characters for display.
Résultat string

Initialize() public méthode

Initializes AdapterBase.
public Initialize ( ) : void
Résultat void

LoadInputSourceIDs() public static méthode

Loads an IOutputAdapter or IActionAdapter instance's input measurement keys from a specific set of source ID's.
Any existing input measurement keys will be distinctly merged with those associated with specified source ID's.
public static LoadInputSourceIDs ( IAdapter adapter, string measurementTable = "ActiveMeasurements" ) : void
adapter IAdapter to load input measurement keys for.
measurementTable string Measurement table name used to load input source ID's.
Résultat void

LoadOutputSourceIDs() public static méthode

Loads an IInputAdapter or IActionAdapter instance's output measurements from a specific set of source ID's.
Any existing output measurements will be distinctly merged with those associated with specified source ID's.
public static LoadOutputSourceIDs ( IAdapter adapter, string measurementTable = "ActiveMeasurements" ) : void
adapter IAdapter to load output measurements for.
measurementTable string Measurement table name used to load output source ID's.
Résultat void

OnConfigurationChanged() protected méthode

Raises ConfigurationChanged event.
protected OnConfigurationChanged ( ) : void
Résultat void

OnInputMeasurementKeysUpdated() protected méthode

Raises InputMeasurementKeysUpdated event.
protected OnInputMeasurementKeysUpdated ( ) : void
Résultat void

OnOutputMeasurementsUpdated() protected méthode

Raises OutputMeasurementsUpdated event.
protected OnOutputMeasurementsUpdated ( ) : void
Résultat void

OnProcessException() protected méthode

Raises the ProcessException event.
should be a constant string value associated with what type of message is being generated. In general, there should only be a few dozen distinct event names per class. Exceeding this threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.
protected OnProcessException ( MessageLevel level, Exception exception, string eventName = null, MessageFlags flags = MessageFlags.None ) : void
level MessageLevel The to assign to this message
exception System.Exception Processing .
eventName string A fixed string to classify this event; defaults to null.
flags MessageFlags to use, if any; defaults to .
Résultat void

OnStatusMessage() protected méthode

Raises the StatusMessage event and sends this data to the Logger.
should be a constant string value associated with what type of message is being generated. In general, there should only be a few dozen distinct event names per class. Exceeding this threshold will cause the EventName to be replaced with a general warning that a usage issue has occurred.
protected OnStatusMessage ( MessageLevel level, string status, string eventName = null, MessageFlags flags = MessageFlags.None ) : void
level MessageLevel The to assign to this message
status string New status message.
eventName string A fixed string to classify this event; defaults to null.
flags MessageFlags to use, if any; defaults to .
Résultat void

ParseFilterExpression() public static méthode

Parses a standard FILTER styles expression into its constituent parts.
This method can be safely called from multiple threads.
public static ParseFilterExpression ( string filterExpression, string &tableName, string &whereExpression, string &sortField, int &takeCount ) : bool
filterExpression string Filter expression to parse.
tableName string Name of table in filter expression.
whereExpression string Where expression in filter expression.
sortField string Sort field, if any, in filter expression.
takeCount int Total row restriction, if any, in filter expression.
Résultat bool

ParseInputMeasurementKeys() public static méthode

Parses input measurement keys from connection string setting.
Security warning: allowing SELECT statements, i.e., setting allowSelect to true, should only be allowed in cases where SQL injection would not be an issue (e.g., in places where a user can already access the database and would have nothing to gain via an injection attack).
public static ParseInputMeasurementKeys ( DataSet dataSource, bool allowSelect, string value, string measurementTable = "ActiveMeasurements" ) : MeasurementKey[]
dataSource System.Data.DataSet The used to define input measurement keys.
allowSelect bool Determines if database access via "SELECT" statement should be allowed for defining input measurement keys (see remarks about security).
value string Value of setting used to define input measurement keys, typically "inputMeasurementKeys".
measurementTable string Measurement table name used to load additional meta-data; this is not used when specifying a FILTER expression.
Résultat MeasurementKey[]

ParseOutputMeasurementKeys() public static méthode

Parses output measurement keys from connection string setting.
Security warning: allowing SELECT statements, i.e., setting allowSelect to true, should only be allowed in cases where SQL injection would not be an issue (e.g., in places where a user can already access the database and would have nothing to gain via an injection attack).
public static ParseOutputMeasurementKeys ( DataSet dataSource, bool allowSelect, string value, string measurementTable = "ActiveMeasurements" ) : MeasurementKey[]
dataSource System.Data.DataSet The used to define output measurements.
allowSelect bool Determines if database access via "SELECT" statement should be allowed for defining output measurement keys (see remarks about security).
value string Value of setting used to define output measurements, typically "outputMeasurements".
measurementTable string Measurement table name used to load additional meta-data; this is not used when specifying a FILTER expression.
Résultat MeasurementKey[]

ParseOutputMeasurements() public static méthode

Parses output measurements from connection string setting.
Security warning: allowing SELECT statements, i.e., setting allowSelect to true, should only be allowed in cases where SQL injection would not be an issue (e.g., in places where a user can already access the database and would have nothing to gain via an injection attack).
public static ParseOutputMeasurements ( DataSet dataSource, bool allowSelect, string value, string measurementTable = "ActiveMeasurements" ) : IMeasurement[]
dataSource System.Data.DataSet The used to define output measurements.
allowSelect bool Determines if database access via "SELECT" statement should be allowed for defining output measurements (see remarks about security).
value string Value of setting used to define output measurements, typically "outputMeasurements".
measurementTable string Measurement table name used to load additional meta-data; this is not used when specifying a FILTER expression.
Résultat IMeasurement[]

ParseTimeTag() public static méthode

Parses a string formatted as an absolute or relative time tag.

Relative times are parsed based on an offset to current time (UTC) specified by "*".

The timetag parameter can be specified in one of the following formats: Time Format Format Description 12-30-2000 23:59:59.033 Absolute date and time. * Evaluates to DateTime.UtcNow. *-20s Evaluates to 20 seconds before DateTime.UtcNow. *-10m Evaluates to 10 minutes before DateTime.UtcNow. *-1h Evaluates to 1 hour before DateTime.UtcNow. *-1d Evaluates to 1 day before DateTime.UtcNow. *+2d Evaluates to 2 days from DateTime.UtcNow.

parameter cannot be null or empty. does not contain a valid string representation of a date and time.
public static ParseTimeTag ( string timetag ) : System.DateTime
timetag string String formatted as an absolute or relative time tag.
Résultat System.DateTime