AP&C API Reference
Classes | Public Member Functions | Protected Member Functions | Properties | Events | List of all members
Apac.Data.XmlFileStore Class Reference

Implements a measurement store on a set of XML files in a directory structure. The main goal of this implementation is to provide a working prototype store that can be used to analyze issues related to storing measurements. More...

Inheritance diagram for Apac.Data.XmlFileStore:
Apac.Data.ThreadedMeasurementStore Apac.Data.ISettingsStore Apac.Supervisable Apac.Data.IDataStore Apac.Data.IMeasurementStore Apac.ISupervisable Apac.Data.IMeasurementQuery Apac.Data.IDataStore

Classes

class  StoreFileException
 

Public Member Functions

List< ThresholdGetThresholds (uint elementId)
 Gets the thresholds. More...
 
bool PersistThreshold (Threshold threshold)
 Perists the threshold. More...
 
EventDef GetEventDef (uint eventId)
 Gets the event def. More...
 
List< EventDefGetEventDefs ()
 Gets all event defs. More...
 
bool PersistEventDef (EventDef eventDef)
 Persistes the event def. More...
 
void DeleteEventDef (EventDef eventDef)
 Deletes the event def. More...
 
List< ActionDefGetActions (uint elementId, uint eventId)
 Gets the actions. More...
 
List< ActionDefGetActions ()
 Gets all actions. More...
 
bool PersistAction (ActionDef action)
 Persists the action. More...
 
void DeleteAction (ActionDef action)
 Deletes the action. More...
 
void DeleteActions (EventDef eventDef)
 Deletes the actions associated with the event def. More...
 
void ActivateCurrentConfiguration ()
 Should promote configuration changes that have been persisted to the runtime environment. This allows simple edits by the user to result in atomic commits of each change without reloading the entire system before all edits are complete. More...
 
void SaveConfiguration (Apac.Settings.Configuration config, bool activate)
 Should save the given configuration to the data store. More...
 
bool PersistMeasurementMapping (MeasurementMapping mapping, MeasurementMapping oldmapping)
 Should write the given mapping to the store. More...
 
List< ManagedElementGetManagedElements ()
 Should return a list of all managed elements in the system. More...
 
object GetClientSettings (string userid)
 Gets the client settings. More...
 
void DeleteSensor (Sensor sensor)
 Deletes the sensor. More...
 
void PersistSensor (Sensor sensor)
 Persists the sensor. More...
 
List< SensorGetSensors (short configId, bool activeOnly)
 Gets all sensors. More...
 
Sensor GetSensor (uint id)
 Gets the sensor with the specified ID. More...
 
List< Monitoring.MeasurementMappingLookupMappings (uint elementId)
 Should perform a store-specific lookup for a mapping (regardless of state) for the given element identifier. More...
 
List< Apac.Monitoring.MeasurementMappingLookupMappings (MeasurementSource source)
 Looks up the mapping by sensor source. More...
 
bool PersistManagedElement (Apac.Monitoring.ManagedElement element)
 Creates or updates the given element in the datastore for use in setting up mappings to incoming data. More...
 
void DeleteManagedElement (Apac.Monitoring.ManagedElement element)
 Should remove the given element from the datastore. More...
 
Apac.Monitoring.ManagedElement GetManagedElement (uint id)
 Retrieves the managed element specified by id . More...
 
bool PersistMeasurementMappings (MeasurementMappingCollection mappings)
 Writes the given mappings to the appropriate file. More...
 
void DeleteMeasurementMapping (MeasurementMapping mapping)
 Should delete the given mapping from the store. More...
 
void DeleteConfiguration (string name)
 Should delete the specified mappings unless they are the active mappings. Then an InvalidOperationException is thrown. More...
 
MeasurementMappingCollection CloneMeasurementMappings (string origName, string copyName)
 Should make a copy of the mappings with origName giving the copy the name of copyName . More...
 
bool ChangeActiveConfiguration (string name)
 Makes the mappings with the given name become the active mappings. More...
 
MeasurementMappingCollection GetMeasurementMappings (string name)
 Finds and returns the requested set of mappings. More...
 
Apac.Settings.Configuration GetConfiguration (string name)
 Gets the configuration. More...
 
Apac.Settings.Configuration GetConfiguration (short id)
 Gets the configuration. More...
 
- Public Member Functions inherited from Apac.Data.ThreadedMeasurementStore
 ThreadedMeasurementStore ()
 Default constructor. More...
 
override object InitializeLifetimeService ()
 Obtains a lifetime service object to control the lifetime policy for this instance. More...
 
void RecordAlerts (Alerts alerts)
 Should records the alerts. More...
 
void RecordAlerts (Alerts alerts, StoreAccessCompleteHandler callout)
 Should records the alerts, will call back on callout . More...
 
void RetrieveAlerts (bool activeOnly, StoreAccessCompleteHandler callout)
 Should retrieve the alerts. More...
 
void RecordMeasurements (Measurements measurements)
 Enqueues the given averages for the raw data thread to record. More...
 
void RecordMeasurements (Measurements measurements, StoreAccessCompleteHandler callout)
 Enqueues the given averages for the raw data thread to record. More...
 
void RecordFiveMinAverages (WeightedMeasurementAvgs averages)
 Enqueues the given averages for the 5-minute thread to record. More...
 
void RecordFiveMinAverages (WeightedMeasurementAvgs averages, StoreAccessCompleteHandler callout)
 Enqueues the given averages for the 5-minute thread to record. More...
 
void RecordHourlyAverages (WeightedMeasurementAvgs averages)
 Enqueues the given averages for the hourly thread to record. More...
 
void RecordHourlyAverages (WeightedMeasurementAvgs averages, StoreAccessCompleteHandler callout)
 Enqueues the given averages for the hourly thread to record. More...
 
void RecordDailyAverages (WeightedMeasurementAvgs averages)
 Enqueues the given averages for the daily thread to record. More...
 
void RecordDailyAverages (WeightedMeasurementAvgs averages, StoreAccessCompleteHandler callout)
 Enqueues the given averages for the daily thread to record. More...
 
void RecordMonthlyAverages (WeightedMeasurementAvgs averages)
 Enqueues the given averages for the monthly thread to record. More...
 
void RecordMonthlyAverages (WeightedMeasurementAvgs averages, StoreAccessCompleteHandler callout)
 Enqueues the given averages for the monthly thread to record. More...
 
TimeTrackingList< MeasurementsFetchMeasurements (MeasurementQueryCriteria criteria)
 Retrieves measurements according to the given criteria. More...
 
TimeTrackingList< Monitoring.WeightedMeasurementAvgsFetchFiveMinuteAverages (MeasurementQueryCriteria criteria)
 Retrieves five minute averages according to the given criteria. More...
 
TimeTrackingList< Monitoring.WeightedMeasurementAvgsFetchHourlyAverages (MeasurementQueryCriteria criteria)
 Retrieves hourly averages according to the given criteria. More...
 
TimeTrackingList< Monitoring.WeightedMeasurementAvgsFetchDailyAverages (MeasurementQueryCriteria criteria)
 Retrieves daily averages according to the given criteria. More...
 
TimeTrackingList< Monitoring.WeightedMeasurementAvgsFetchMonthlyAverages (MeasurementQueryCriteria criteria)
 Retrieves monthly averages according to the given criteria. More...
 
void Initialize (Apac.Configuration.DataStoreConfig config)
 Starts the inheritance call chain for initializing the data store. More...
 
void Open ()
 Prompts the store to prepare for recording and fetching data. More...
 
void Close ()
 Prompts the store to clean up its resources used for recording and fetching data. More...
 
void Dispose ()
 
- Public Member Functions inherited from Apac.Supervisable
void Initialize (Apac.Configuration.SupervisableConfig config, Supervisors.ISupervisor supervisor)
 Initializes the controller from configuration. More...
 
void ResolveReferences ()
 Resolves any references this component might hold to other supervisable components. More...
 
void CheckReferencesStates ()
 Checks the states of referenced components to be sure they are satisfactory for this component's operation. More...
 
void Starting ()
 Signals that the component will be starting on its own thread. This implementation uses this opportunity to CheckReferencesStates, change state to Starting, and signal subclasses with OnStarting. More...
 
void Start ()
 Starts the component. More...
 
void Stop ()
 Stops the component. More...
 
- Public Member Functions inherited from Apac.ISupervisable
void Initialize (Apac.Configuration.SupervisableConfig config, Supervisors.ISupervisor exec)
 Initializes the component with the given SupervisableConfig (or derivative) and ISupervisor. More...
 
- Public Member Functions inherited from Apac.Data.IDataStore
void Initialize (Configuration.DataStoreConfig config)
 
- Public Member Functions inherited from Apac.Data.IMeasurementStore
void RecordAlerts (Monitoring.Alerts alerts)
 Should records the alerts. More...
 
void RecordAlerts (Monitoring.Alerts alerts, StoreAccessCompleteHandler callout)
 Should records the alerts, will call back on callout . More...
 
void RecordMeasurements (Monitoring.Measurements measurements)
 Should record raw measurements in the given bucket. More...
 
void RecordFiveMinAverages (Monitoring.WeightedMeasurementAvgs averages)
 Should record the given averages to the given 5-minute store. More...
 
void RecordHourlyAverages (Monitoring.WeightedMeasurementAvgs averages)
 Should record the given averages to the given 5-minute store. More...
 
void RecordDailyAverages (Monitoring.WeightedMeasurementAvgs averages)
 Should record the given averages to the given daily store. More...
 
void RecordMonthlyAverages (Monitoring.WeightedMeasurementAvgs averages)
 Should record the given averages to the given monthy store. More...
 
void RecordMeasurements (Monitoring.Measurements measurements, StoreAccessCompleteHandler callout)
 Should record raw measurements in the given bucket and call out to the delegate when complete. More...
 
void RecordFiveMinAverages (Monitoring.WeightedMeasurementAvgs averages, StoreAccessCompleteHandler callout)
 Should record the given averages to the given 5-minute store and call out to the delegate when complete. More...
 
void RecordHourlyAverages (Monitoring.WeightedMeasurementAvgs averages, StoreAccessCompleteHandler callout)
 Should record the given averages to the given 5-minute store and call out to the delegate when complete. More...
 
void RecordDailyAverages (Monitoring.WeightedMeasurementAvgs averages, StoreAccessCompleteHandler callout)
 Should record the given averages to the given daily store and call out to the delegate when complete. More...
 
void RecordMonthlyAverages (Monitoring.WeightedMeasurementAvgs averages, StoreAccessCompleteHandler callout)
 Should record the given averages to the given monthy store and call out to the delegate when complete. More...
 
- Public Member Functions inherited from Apac.Data.ISettingsStore
bool PersistManagedElement (Apac.Monitoring.ManagedElement element)
 Should create or update the given element in the datastore for use in setting up mappings to incoming data. More...
 
void DeleteManagedElement (Apac.Monitoring.ManagedElement element)
 Should remove the given element from the datastore. More...
 
void SaveConfiguration (Settings.Configuration config, bool activate)
 Should save the given configuration to the data store. More...
 
bool PersistThreshold (Monitoring.Threshold threshold)
 Perists the threshold. More...
 
bool PersistEventDef (Monitoring.EventDef eventDef)
 Persistes the event def. More...
 
void DeleteEventDef (Monitoring.EventDef eventDef)
 Deletes the event def. More...
 
bool PersistAction (Monitoring.ActionDef action)
 Persists the action. More...
 
void DeleteAction (Monitoring.ActionDef action)
 Deletes the action. More...
 
void DeleteActions (Monitoring.EventDef eventDef)
 Deletes the actions associated with the event def. More...
 
void PersistSensor (Monitoring.Sensor sensor)
 Persists the sensor. More...
 
void DeleteSensor (Monitoring.Sensor sensor)
 Deletes the sensor. More...
 

Protected Member Functions

override void OnInitializeDataStore (Apac.Configuration.DataStoreConfig config)
 Performs initialization for this data store by ensuring the given location exists and that it contains a valid mapping file. More...
 
override void OnOpen ()
 Opens the store. More...
 
override void OnClose ()
 Close all files we've tracked. More...
 
override TimeTrackingList< MeasurementsOnFetchMeasurements (MeasurementQueryCriteria criteria)
 Returns the latest batch of measurements that have come in from the compiler, or null if no measurements have come in. More...
 
override TimeTrackingList< WeightedMeasurementAvgsOnFetchFiveMinuteAverages (MeasurementQueryCriteria criteria)
 Here we're dealing with a file that has five-minute averages stored by element. The result we want is a list of lists, where the inner lists are the averages by element. More...
 
override TimeTrackingList< WeightedMeasurementAvgsOnFetchHourlyAverages (MeasurementQueryCriteria criteria)
 
override TimeTrackingList< WeightedMeasurementAvgsOnFetchDailyAverages (MeasurementQueryCriteria criteria)
 
override TimeTrackingList< WeightedMeasurementAvgsOnFetchMonthlyAverages (MeasurementQueryCriteria criteria)
 
override void OnWriteMeasurements (Apac.Monitoring.Measurements measurements)
 Writes the measurements out to the current bucket. More...
 
override void OnWriteFiveMinuteAvgs (Apac.Monitoring.WeightedMeasurementAvgs averages)
 Averages are tracked for each five minute bucket in one file for each day. Each file will have 288 averages recorded in it. More...
 
override void OnWriteHourlyAvgs (Apac.Monitoring.WeightedMeasurementAvgs averages)
 
override void OnWriteDailyAvgs (Apac.Monitoring.WeightedMeasurementAvgs averages)
 
override void OnWriteMonthlyAvgs (Apac.Monitoring.WeightedMeasurementAvgs averages)
 
override void OnWriteAlerts (Alerts alerts)
 
override Alerts OnRetrieveAlerts (bool activeOnly)
 
override void OnPruneRawMeasurements (DateTime cutoffDay)
 
override void Dispose (bool disposing)
 
virtual void OnSettingsChanged ()
 Called when [settings changed]. More...
 
- Protected Member Functions inherited from Apac.Data.ThreadedMeasurementStore
override void OnInitialize (Apac.Configuration.SupervisableConfig config)
 Prompts the supervisable component to initialize itself. More...
 
override void OnResolveReferences ()
 Called when the supervisable component needs to resolve its runtime references to other components. More...
 
override void OnCheckReferencesStates ()
 Called when the supervisable component needs to check the state of its runtime reference components. More...
 
override void OnStart ()
 Prompts the supervisable component to start functioning. More...
 
override void OnStop ()
 Prompts the supervisable component to stop functioning. More...
 
abstract void OnWriteMeasurements (Measurements measurements)
 
abstract void OnWriteFiveMinuteAvgs (WeightedMeasurementAvgs averages)
 
abstract void OnWriteHourlyAvgs (WeightedMeasurementAvgs averages)
 
abstract void OnWriteDailyAvgs (WeightedMeasurementAvgs averages)
 
abstract void OnWriteMonthlyAvgs (WeightedMeasurementAvgs averages)
 
abstract void OnInitializeDataStore (Configuration.DataStoreConfig config)
 
- Protected Member Functions inherited from Apac.Supervisable
abstract void OnInitialize (Apac.Configuration.SupervisableConfig config)
 Called when the supervisable component is intitialized. More...
 
virtual void OnStarting ()
 Called when the supervisable component is about to start. This differs from handling OnStart in that this method is called on the supervisor's thread, whereas Start is called on a new thread. Subclasses may override this to do work that is considered initialization work that should be done before all component threads are started. More...
 
virtual void OnStateChanging (SupervisableState currentState, SupervisableState newState)
 Call chain for state changing notification. More...
 
virtual void OnStateChanged (SupervisableState previousState, SupervisableState newState)
 Call chain for state changed notification. More...
 
virtual void OnException (Exception ex)
 Call chain for exception notification. More...
 
void SetState (SupervisableState newState)
 Changes the state of the controller to the new state. More...
 
virtual void OnStateChangeStarting ()
 
virtual void OnStateChangeRunning ()
 
virtual void OnStateChangeStopping ()
 
virtual void OnStateChangeStopped ()
 
virtual void OnStateChangeInitializing ()
 
virtual void OnStateChangeInitialized ()
 
virtual void OnStateChangeErrored ()
 
virtual void OnStateChangeImpaired ()
 
void HandleException (string message, Exception e)
 Deals with the details of handling exceptions captured by the controller. More...
 
void ResetException ()
 Allows subclasses to reset the last exception to an empty state. More...
 
void HandleImpairment (string message, Exception e)
 Deals with the details of handling non-critical problems captured by the controller. More...
 

Properties

Settings.EcopSettings Settings [get]
 Gets the settings. More...
 
Settings.Configuration CurrentConfiguration [get]
 Should get the currently held settings. More...
 
- Properties inherited from Apac.Data.ThreadedMeasurementStore
AlertCache AlertCache [get]
 Gets the alert cache. More...
 
string? Location [get]
 In this store implementation this property indicates the directory for the data file(s). The name of the data files is determined internally. This path also indicates where the mappings file can be located. More...
 
- Properties inherited from Apac.Supervisable
string Name [get]
 Gets the name of the controller, as specified by configuration. Note that if the name is not specified, then an index will be used. More...
 
string Description [get]
 Gets the description of the controller, as specified by configuration. More...
 
bool Prioritized [get]
 Indicates if the supervisable component should be executed on a higher thread priority. More...
 
DateTime LastHeartbeat [get]
 The time of the last heartbeat. More...
 
Supervisors.ISupervisor ExecutiveSupervisor [get]
 Walks the tree to find the top level supervisor. More...
 
bool IsRunning [get]
 Gets a value indicating whether this instance is running. More...
 
SupervisableState CurrentState [get]
 Gets the current overall state of the controller. More...
 
SupervisableState PreviousState [get]
 Gets the previous overall state of the controller. More...
 
Exception LastException [get]
 Gets the last exception encountered within the controller. More...
 
DateTime StartTime [get]
 Gets the time this supervisable component was started. More...
 
DateTime StopTime [get]
 Gets the time this supervisable component was stopped. More...
 
TimeSpan UpTime [get]
 Gets the amount of time this supervisable component has been running, or did run before it was stopped (if IsRunning is false). More...
 
Supervisors.ISupervisor Supervisor [get]
 Gets the supervisor. More...
 
SupervisableConfig Config [get]
 The configuration object used by the supervisable component. More...
 
log4net.ILog Log [get]
 Lazy-initialized logger for subclass usage. More...
 
- Properties inherited from Apac.ISupervisable
string Name [get]
 The name of the component, for unique identification purposes. More...
 
string Description [get]
 The description of the component, for human consumption. More...
 
bool Prioritized [get]
 Indicates if the component should be high priority. More...
 
Supervisors.ISupervisor ExecutiveSupervisor [get]
 Walks the tree to find the top level supervisor. More...
 
bool IsRunning [get]
 Indicates that the component is running. More...
 
DateTime LastHeartbeat [get]
 
DateTime StartTime [get]
 Gets the time this supervisable component was started. More...
 
DateTime StopTime [get]
 Gets the time this supervisable component was stopped. More...
 
TimeSpan UpTime [get]
 Gets the amount of time this supervisable component has been running, or did run before it was stopped (if IsRunning is false). More...
 
SupervisableState CurrentState [get]
 Gets the current SupervisableState of this component. More...
 
SupervisableState PreviousState [get]
 Gets the previous SupervisableState of this component. More...
 
Exception LastException [get]
 Gets the last exception to have occurred and been trapped by this component. More...
 
- Properties inherited from Apac.Data.IDataStore
string Location [get]
 
- Properties inherited from Apac.Data.IMeasurementStore
Monitoring.AlertCache AlertCache [get]
 Gets the alert cache. More...
 
- Properties inherited from Apac.Data.ISettingsStore
Settings.Configuration CurrentConfiguration [get]
 Should get the currently held settings. More...
 

Events

SettingsChangedHandler SettingsChanged
 Occurs when any settings have changed. More...
 
- Events inherited from Apac.Supervisable
SupervisableStateChangingHandler SupervisableStateChanging
 Notifies listeners that the state is about to change. More...
 
SupervisableStateChangedHandler SupervisableStateChanged
 Notifies listeners that the state has changed. More...
 
SupervisableErroredHandler SupervisableErrored
 Notifies listeners that an error occured within the controller. More...
 
SupervisableHeartbeatHandler SupervisableHeartbeat
 Notifies listeners that the component is still active. More...
 
- Events inherited from Apac.ISupervisable
SupervisableStateChangingHandler SupervisableStateChanging
 Notifies listeners that the state is about to change. More...
 
SupervisableStateChangedHandler SupervisableStateChanged
 Notifies listeners that the state has changed. More...
 
SupervisableErroredHandler SupervisableErrored
 Notifies listeners that an error occured within the controller. More...
 
SupervisableHeartbeatHandler SupervisableHeartbeat
 Notifies listeners that the component is still active. More...
 
- Events inherited from Apac.Data.ISettingsStore
SettingsChangedHandler SettingsChanged
 Occurs when any settings have changed. More...
 

Additional Inherited Members

- Protected Attributes inherited from Apac.Data.ThreadedMeasurementStore
volatile Configuration.DataStoreConfig _config = null
 

Detailed Description

Implements a measurement store on a set of XML files in a directory structure. The main goal of this implementation is to provide a working prototype store that can be used to analyze issues related to storing measurements.

Member Function Documentation

◆ ActivateCurrentConfiguration()

void Apac.Data.XmlFileStore.ActivateCurrentConfiguration ( )
inline

Should promote configuration changes that have been persisted to the runtime environment. This allows simple edits by the user to result in atomic commits of each change without reloading the entire system before all edits are complete.

Implements Apac.Data.ISettingsStore.

◆ ChangeActiveConfiguration()

bool Apac.Data.XmlFileStore.ChangeActiveConfiguration ( string  name)
inline

Makes the mappings with the given name become the active mappings.

Returns
true if successful, false otherwise.

Implements Apac.Data.ISettingsStore.

◆ CloneMeasurementMappings()

MeasurementMappingCollection Apac.Data.XmlFileStore.CloneMeasurementMappings ( string  origName,
string  copyName 
)
inline

Should make a copy of the mappings with origName giving the copy the name of copyName .

Parameters
origName
copyName
Returns

Implements Apac.Data.ISettingsStore.

◆ DeleteAction()

void Apac.Data.XmlFileStore.DeleteAction ( ActionDef  action)
inline

Deletes the action.

Parameters
actionThe action.

◆ DeleteActions()

void Apac.Data.XmlFileStore.DeleteActions ( EventDef  eventDef)
inline

Deletes the actions associated with the event def.

Parameters
eventDefThe event def.

◆ DeleteConfiguration()

void Apac.Data.XmlFileStore.DeleteConfiguration ( string  name)
inline

Should delete the specified mappings unless they are the active mappings. Then an InvalidOperationException is thrown.

Parameters
name

Implements Apac.Data.ISettingsStore.

◆ DeleteEventDef()

void Apac.Data.XmlFileStore.DeleteEventDef ( EventDef  eventDef)
inline

Deletes the event def.

Parameters
eventDefThe event def.

◆ DeleteManagedElement()

void Apac.Data.XmlFileStore.DeleteManagedElement ( Apac.Monitoring.ManagedElement  element)
inline

Should remove the given element from the datastore.

Parameters
elementThe Apac.Monitoring.ManagedElement to be removed.

◆ DeleteMeasurementMapping()

void Apac.Data.XmlFileStore.DeleteMeasurementMapping ( MeasurementMapping  mapping)
inline

Should delete the given mapping from the store.

Parameters
mappingThe MeasurementMapping to be deleted.

Implements Apac.Data.ISettingsStore.

◆ DeleteSensor()

void Apac.Data.XmlFileStore.DeleteSensor ( Sensor  sensor)
inline

Deletes the sensor.

Parameters
sensorThe sensor.

◆ GetActions() [1/2]

List<ActionDef> Apac.Data.XmlFileStore.GetActions ( )
inline

Gets all actions.

Returns
Returns a List<Monitoring.Action> .

Implements Apac.Data.ISettingsStore.

◆ GetActions() [2/2]

List<ActionDef> Apac.Data.XmlFileStore.GetActions ( uint  elementId,
uint  eventId 
)
inline

Gets the actions.

Parameters
elementIdThe element id.
eventIdThe event id.
Returns
Returns a List<Monitoring.Action> for the requested element and event def.

Implements Apac.Data.ISettingsStore.

◆ GetClientSettings()

object Apac.Data.XmlFileStore.GetClientSettings ( string  userid)
inline

Gets the client settings.

Parameters
useridThe userid.
Returns

◆ GetConfiguration() [1/2]

Apac.Settings.Configuration Apac.Data.XmlFileStore.GetConfiguration ( short  id)
inline

Gets the configuration.

Parameters
idThe id.
Returns

Implements Apac.Data.ISettingsStore.

◆ GetConfiguration() [2/2]

Apac.Settings.Configuration Apac.Data.XmlFileStore.GetConfiguration ( string  name)
inline

Gets the configuration.

Parameters
nameThe name.
Returns

Implements Apac.Data.ISettingsStore.

◆ GetEventDef()

EventDef Apac.Data.XmlFileStore.GetEventDef ( uint  eventId)
inline

Gets the event def.

Parameters
eventIdThe event id.
Returns
Returns the Monitoring.EventDef with the requested ID.

Implements Apac.Data.ISettingsStore.

◆ GetEventDefs()

List<EventDef> Apac.Data.XmlFileStore.GetEventDefs ( )
inline

Gets all event defs.

Returns
Returns a List<Monitoring.EventDef>.

Implements Apac.Data.ISettingsStore.

◆ GetManagedElement()

Apac.Monitoring.ManagedElement Apac.Data.XmlFileStore.GetManagedElement ( uint  id)
inline

Retrieves the managed element specified by id .

Parameters
idThe datastore identifier for the required Apac.Monitoring.ManagedElement.
Returns
Returns the Apac.Monitoring.ManagedElement or null.

Implements Apac.Data.ISettingsStore.

◆ GetManagedElements()

List<ManagedElement> Apac.Data.XmlFileStore.GetManagedElements ( )
inline

Should return a list of all managed elements in the system.

Returns
Returns the List<Apac.Monitoring.ManagedElement>.

Implements Apac.Data.ISettingsStore.

◆ GetMeasurementMappings()

MeasurementMappingCollection Apac.Data.XmlFileStore.GetMeasurementMappings ( string  name)
inline

Finds and returns the requested set of mappings.

Parameters
nameThe name of the mappings to return.
Returns
The set of requested mappings, or null.

Implements Apac.Data.ISettingsStore.

◆ GetSensor()

Sensor Apac.Data.XmlFileStore.GetSensor ( uint  id)
inline

Gets the sensor with the specified ID.

Parameters
idThe sensor id.
Returns
Returns the requested Monitoring.Sensor or null.

Implements Apac.Data.ISettingsStore.

◆ GetSensors()

List<Sensor> Apac.Data.XmlFileStore.GetSensors ( short  configId,
bool  activeOnly 
)
inline

Gets all sensors.

Parameters
configIdThe config id.
activeOnlyif set to true only active sensors are returned.
Returns
Returns a T:List<Sensor> with all existing sensors.

Implements Apac.Data.ISettingsStore.

◆ GetThresholds()

List<Threshold> Apac.Data.XmlFileStore.GetThresholds ( uint  elementId)
inline

Gets the thresholds.

Parameters
elementIdThe element id.
Returns
Returns a List<Monitoring.Threshold> for the requested element.

Implements Apac.Data.ISettingsStore.

◆ LookupMappings() [1/2]

List<Apac.Monitoring.MeasurementMapping> Apac.Data.XmlFileStore.LookupMappings ( MeasurementSource  source)
inline

Looks up the mapping by sensor source.

Parameters
sourceThe name of the supervisable that is reading the sensor.
sensorIdThe sensor id.
Returns
Returns a List<Monitoring.MeasurementMapping> which may be empty.

Implements Apac.Data.ISettingsStore.

◆ LookupMappings() [2/2]

List<Monitoring.MeasurementMapping> Apac.Data.XmlFileStore.LookupMappings ( uint  elementId)
inline

Should perform a store-specific lookup for a mapping (regardless of state) for the given element identifier.

Parameters
elementIdThe element for which the mapping is to be found.
Returns
Returns a List<Monitoring.MeasurementMapping> which may be empty.

Implements Apac.Data.ISettingsStore.

◆ OnClose()

override void Apac.Data.XmlFileStore.OnClose ( )
inlineprotectedvirtual

Close all files we've tracked.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnFetchFiveMinuteAverages()

override TimeTrackingList<WeightedMeasurementAvgs> Apac.Data.XmlFileStore.OnFetchFiveMinuteAverages ( MeasurementQueryCriteria  criteria)
inlineprotectedvirtual

Here we're dealing with a file that has five-minute averages stored by element. The result we want is a list of lists, where the inner lists are the averages by element.

Parameters
criteria
Returns

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnFetchMeasurements()

override TimeTrackingList<Measurements> Apac.Data.XmlFileStore.OnFetchMeasurements ( MeasurementQueryCriteria  criteria)
inlineprotectedvirtual

Returns the latest batch of measurements that have come in from the compiler, or null if no measurements have come in.

Parameters
criteriaThe criteria for matching measurements, if null then the latest batch will be returned, otherwise the criteria will determine the returned data set.
Returns
Currently returns the latest batch of measurements.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnInitializeDataStore()

override void Apac.Data.XmlFileStore.OnInitializeDataStore ( Apac.Configuration.DataStoreConfig  config)
inlineprotected

Performs initialization for this data store by ensuring the given location exists and that it contains a valid mapping file.

Parameters
configThe configuration parameters for use during component operations.

◆ OnOpen()

override void Apac.Data.XmlFileStore.OnOpen ( )
inlineprotectedvirtual

Opens the store.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnSettingsChanged()

virtual void Apac.Data.XmlFileStore.OnSettingsChanged ( )
inlineprotectedvirtual

Called when [settings changed].

◆ OnWriteFiveMinuteAvgs()

override void Apac.Data.XmlFileStore.OnWriteFiveMinuteAvgs ( Apac.Monitoring.WeightedMeasurementAvgs  averages)
inlineprotected

Averages are tracked for each five minute bucket in one file for each day. Each file will have 288 averages recorded in it.

Parameters
averagesThe averages to record.

◆ OnWriteMeasurements()

override void Apac.Data.XmlFileStore.OnWriteMeasurements ( Apac.Monitoring.Measurements  measurements)
inlineprotected

Writes the measurements out to the current bucket.

Parameters
measurementsThe measurements to be written.

◆ PersistAction()

bool Apac.Data.XmlFileStore.PersistAction ( ActionDef  action)
inline

Persists the action.

Parameters
actionThe action.
Returns
Returns true if the write was successfull.

◆ PersistEventDef()

bool Apac.Data.XmlFileStore.PersistEventDef ( EventDef  eventDef)
inline

Persistes the event def.

Parameters
eventDefThe event def.
Returns
Returns true if the write was successfull.

◆ PersistManagedElement()

bool Apac.Data.XmlFileStore.PersistManagedElement ( Apac.Monitoring.ManagedElement  element)
inline

Creates or updates the given element in the datastore for use in setting up mappings to incoming data.

Parameters
elementThe Apac.Monitoring.ManagedElement to be persisted.
Returns
Returns true if successful, false otherwise.

◆ PersistMeasurementMapping()

bool Apac.Data.XmlFileStore.PersistMeasurementMapping ( MeasurementMapping  mapping,
MeasurementMapping  oldmapping 
)
inline

Should write the given mapping to the store.

Parameters
mappingThe mapping to be written.
oldmappingThe old mapping used to determine what row to update.
Returns
Returns true if the write was successfull.

Implements Apac.Data.ISettingsStore.

◆ PersistMeasurementMappings()

bool Apac.Data.XmlFileStore.PersistMeasurementMappings ( MeasurementMappingCollection  mappings)
inline

Writes the given mappings to the appropriate file.

Parameters
mappingsThe mappings to be written.
Returns
true if succesful, false otherwise.

Implements Apac.Data.ISettingsStore.

◆ PersistSensor()

void Apac.Data.XmlFileStore.PersistSensor ( Sensor  sensor)
inline

Persists the sensor.

Parameters
sensorThe sensor.

◆ PersistThreshold()

bool Apac.Data.XmlFileStore.PersistThreshold ( Threshold  threshold)
inline

Perists the threshold.

Parameters
thresholdThe threshold.
Returns
Returns true if the write was successfull.

◆ SaveConfiguration()

void Apac.Data.XmlFileStore.SaveConfiguration ( Apac.Settings.Configuration  config,
bool  activate 
)
inline

Should save the given configuration to the data store.

Parameters
configThe Settings.Configuration to be saved.
activateIndicates if the configuration should be promoted to the runtime system.

Property Documentation

◆ CurrentConfiguration

Settings.Configuration Apac.Data.XmlFileStore.CurrentConfiguration
get

Should get the currently held settings.

◆ Settings

Settings.EcopSettings Apac.Data.XmlFileStore.Settings
get

Gets the settings.

Event Documentation

◆ SettingsChanged

SettingsChangedHandler Apac.Data.XmlFileStore.SettingsChanged

Occurs when any settings have changed.


The documentation for this class was generated from the following file: