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

Implements a (hopefully) data provider agnostic store for keeping ECOP data in an RDBMS. The goal here is to provide a data store implementation that can be used to scale ECOP from its current scope to an enterprise scope by altering the RDBMS underneath. The nirvana is a one-class-for-all-RDBMS-systems but that is not practical due to the different SQL syntax details, so the basic framework exists in this class and the formulation of the SQL exists in a class for each specific RDMBS system. This should at least reduce the amount of code and the behavioral differences between the different types of systems. More...

Inheritance diagram for Apac.Data.DatabaseStore:
Apac.Data.ThreadedMeasurementStore Apac.Data.ISettingsStore Apac.Data.IAuthStore Apac.Supervisable Apac.Data.IDataStore Apac.Data.IMeasurementStore Apac.ISupervisable Apac.Data.IMeasurementQuery Apac.Data.IDataStore Apac.Data.FirebirdStore

Public Member Functions

List< ThresholdGetThresholds (uint elementId)
 Gets the thresholds. More...
 
bool PersistThreshold (Threshold threshold)
 Persists the threshold. More...
 
EventDef GetEventDef (uint eventId)
 Gets the event def. More...
 
List< EventDefGetEventDefs ()
 Gets all event defs. More...
 
bool PersistEventDef (EventDef eventDef)
 Persists 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 DeleteSensor (Sensor sensor)
 Deletes the sensor. More...
 
void PersistSensor (Sensor sensor)
 Perists the sensor. More...
 
void ActivateCurrentConfiguration ()
 Promotes 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 newConfig, bool activate)
 Saves the given configuration to the data store. 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)
 Removes the given element from the datastore. More...
 
List< ManagedElementGetManagedElements ()
 Retrieves the managed elements in the system. More...
 
Apac.Monitoring.ManagedElement GetManagedElement (uint id)
 Retrieves the managed element specified by id . More...
 
bool PersistMeasurementMapping (MeasurementMapping mapping, MeasurementMapping oldmapping)
 Should write the given mapping to the store. More...
 
bool PersistMeasurementMappings (Apac.Collections.MeasurementMappingCollection mappings)
 Writes the given mappings to the data store. More...
 
bool ChangeActiveConfiguration (string name)
 Changes the active set of mappings to be the one with the name name . More...
 
Apac.Settings.Configuration GetConfiguration (string name)
 Gets the configuration. More...
 
Apac.Settings.Configuration GetConfiguration (short id)
 Gets the configuration. More...
 
Apac.Collections.MeasurementMappingCollection GetMeasurementMappings (short configid)
 Gets the mappings for configuration with ID of configid . More...
 
Apac.Collections.MeasurementMappingCollection GetMeasurementMappings (string name)
 Gets the mappings for configuration named name . More...
 
List< Apac.Monitoring.MeasurementMappingLookupMappings (uint elementId)
 Gets a mapping for the requested element from the active mapping set. More...
 
List< Apac.Monitoring.MeasurementMappingLookupMappings (MeasurementSource source)
 Looks up the mapping by sensor source. More...
 
void DeleteConfiguration (string name)
 Deletes the configuration with name . More...
 
void DeleteMeasurementMapping (MeasurementMapping mapping)
 Deletes the given mapping from the store. More...
 
Apac.Collections.MeasurementMappingCollection CloneMeasurementMappings (string origName, string copyName)
 Creates a copy of the mappings named origName in a configuration named copyName . More...
 
Sensor GetSensor (uint id)
 Gets the sensor with the specified ID. More...
 
List< SensorGetSensors (short configId, bool activeOnly)
 Gets all sensors. More...
 
List< Auth.UserGetUsers (Logic.PredicateSet filter)
 Gets the users that match filter . More...
 
Logic.WhyBool CreateUser (Auth.User user)
 Creates the user in the data store. This routine assumes the the data is valid and the password has already been hashed and salted and applied to the user object. More...
 
Logic.WhyBool DeleteUser (int id)
 Deletes the user with id . More...
 
Logic.WhyBool UpdateUser (Auth.User user)
 Updates the user and associations to look like user . More...
 
List< Auth.NotificationGroupGetNotificationGroups ()
 Gets all notification groups. More...
 
Logic.WhyBool CreateNotificationGroup (string name, ref Auth.NotificationGroup group)
 Creates a notification group with name . More...
 
WhyBool UpdateNotificationGroup (NotificationGroup ng)
 Updates the notificaton group. More...
 
Logic.WhyBool DeleteNotificationGroup (short id)
 Deletes the notification group with id . 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...
 
bool PersistMeasurementMappings (Apac.Collections.MeasurementMappingCollection mappings)
 Should write the given mappings to a location where they will remain pending until they are promoted. 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...
 
- Public Member Functions inherited from Apac.Data.IAuthStore
List< UserGetUsers (PredicateSet filter)
 Gets the users that match filter . More...
 
WhyBool CreateUser (User user)
 Validates the inputs and creates the user. This routine assumes the password has already been hashed and salted and applied to the user object. More...
 
WhyBool UpdateUser (User user)
 Updates the user and associations to look like user . More...
 
WhyBool CreateNotificationGroup (string name, ref NotificationGroup group)
 Creates a notification group with name . More...
 

Protected Member Functions

override void OnInitializeDataStore (DataStoreConfig config)
 Called when [initialize data store]. More...
 
override TimeTrackingList< WeightedMeasurementAvgsOnFetchDailyAverages (MeasurementQueryCriteria criteria)
 Called when [fetch daily averages]. More...
 
override TimeTrackingList< WeightedMeasurementAvgsOnFetchFiveMinuteAverages (MeasurementQueryCriteria criteria)
 Called when [fetch five minute averages]. More...
 
override TimeTrackingList< WeightedMeasurementAvgsOnFetchHourlyAverages (MeasurementQueryCriteria criteria)
 Called when [fetch hourly averages]. More...
 
override TimeTrackingList< MeasurementsOnFetchMeasurements (MeasurementQueryCriteria criteria)
 Called when [fetch measurements]. More...
 
override TimeTrackingList< WeightedMeasurementAvgsOnFetchMonthlyAverages (MeasurementQueryCriteria criteria)
 Called when [fetch monthly averages]. More...
 
override void OnWriteDailyAvgs (WeightedMeasurementAvgs averages)
 Called when [write daily avgs]. More...
 
override void OnWriteFiveMinuteAvgs (WeightedMeasurementAvgs averages)
 Called when [write five minute avgs]. More...
 
override void OnWriteHourlyAvgs (WeightedMeasurementAvgs averages)
 Called when [write hourly avgs]. More...
 
override void OnWriteMeasurements (Measurements measurements)
 Called when [write measurements]. More...
 
override void OnWriteMonthlyAvgs (WeightedMeasurementAvgs averages)
 Called when [write monthly avgs]. More...
 
override void OnPruneRawMeasurements (DateTime cutoffDay)
 Called when [prune raw measurements]. More...
 
override void OnOpen ()
 Called when [open]. More...
 
override void OnClose ()
 Called when [close]. More...
 
override void OnWriteAlerts (Alerts alerts)
 Called when [write alerts]. More...
 
override Alerts OnRetrieveAlerts (bool activeOnly)
 Called when [retrieve alerts]. More...
 
virtual void updateMeasurementCache (Measurements measurements)
 Updates the measurement cache. More...
 
virtual void OnSettingsChanged ()
 Called when [settings changed]. More...
 
abstract DbCommand OnFormulateInsertMeasurementMappings (DbConnection connection, MeasurementMappingCollection mappings)
 Should build a command that insert the set of mappings. More...
 
abstract DbCommand OnFormulateUpdateMeasurementMappings (DbConnection connection, MeasurementMappingCollection mappings)
 Should build a command that updates the set of mappings. More...
 
abstract DbCommand OnFormulateMergeSetting (DbConnection connection, string name, string value, short configid)
 Should build a command that updates the settings. More...
 
abstract DbCommand OnFormulateInsertManagedElement (DbConnection connection, ManagedElement element)
 Should build a command that insert the managed element. More...
 
abstract DbCommand OnFormulateUpdateManagedElement (DbConnection connection, ManagedElement element)
 Should build a command that update the managed element. More...
 
abstract DbCommand OnFormulateGetConfigId (DbConnection connection, string name)
 Should build a command that returns the identifier for the configuration with name . More...
 
abstract DbCommand OnFormulateCheckForManagedElement (DbConnection connection, uint id)
 Should build a command that returns the count of elements with id . More...
 
abstract DbCommand OnFormulateFetchMeasurementMappings (DbConnection connection, short configid)
 Should build a command that returns the data set containing all mappings in configuration 'configid ', and the associated managed element data (using a JOIN). More...
 
abstract DbCommand OnFormulateCheckForMeasurementMapping (DbConnection connection, short configid, uint elementid, ulong sensorid, uint sourceElementId, decimal constantValue, string inputTag)
 Should build a command that returns the count of mappings matching configid , elementid , sensorid , sourceElementId , constantValue , and inputTag ,. More...
 
abstract DbCommand OnFormulateInsertMeasurementMapping (DbConnection connection, MeasurementMapping mapping)
 Should build a command that creates the mapping specified. More...
 
abstract DbCommand OnFormulateUpdateMeasurementMapping (DbConnection connection, MeasurementMapping oldmapping, MeasurementMapping newmapping)
 Should build a command that updates the mapping specified. More...
 
abstract DbCommand OnFormulateUpdateMeasurementMapping (DbConnection connection, MeasurementMapping mapping)
 Should build a command that updates the mapping specified, using the ID. More...
 
abstract DbCommand OnFormulateFetchManagedElement (DbConnection connection, uint id)
 Should build a command that returns the data set containing all columns for the requested managed element. More...
 
abstract DbCommand OnFormulateFetchManagedElements (DbConnection connection)
 Should build a command that returns the data set containing all columns for all managed elements in the data store. More...
 
abstract DbCommand OnFormulateFetchMappedManagedElements (DbConnection connection, short configid)
 Should build a command that returns the data set containing all columns for all managed elements in the data store that are mapping within the given configuration. More...
 
abstract DbCommand OnFormulateDeleteManagedElement (DbConnection connection, ManagedElement element)
 Should build a command that removes element from the data store. More...
 
abstract DbCommand OnFormulateDeleteMeasurements (DbConnection connection, ManagedElement element)
 Should build a command that removes measurements for element from the data store. More...
 
abstract DbCommand OnFormulateDeleteWeightedAverages (DbConnection connection, ManagedElement element)
 Should build a command that removes averages for element from the data store. More...
 
abstract DbCommand OnFormulateDeleteMapping (DbConnection connection, MeasurementMapping mapping)
 Should build a a command that removes mapping from the data store. More...
 
abstract DbCommand OnFormulateDeleteMappings (DbConnection connection, ManagedElement element)
 Should build a command that removes all MeasurementMappings associated with element . More...
 
abstract DbCommand OnFormulateCreateConfig (DbConnection connection, string name)
 Should build a command that creates a new configuration instance with name . More...
 
abstract DbCommand OnFormulateDeleteConfig (DbConnection connection, short id)
 Should build a command that deletes the configuration instance with id . More...
 
abstract DbCommand OnFormulateSetActiveConfig (DbConnection connection, short id)
 Should 'flip the active bit' to the configuration named id . More...
 
abstract DbCommand OnFormulateGetEcopConfigs (DbConnection connection)
 Should build a command that returns all configuration instances (shallow). More...
 
abstract DbCommand OnFormulateGetEcopConfig (DbConnection connection, string name)
 Should build a command that returns the requested configuration instance (shallow). More...
 
abstract DbCommand OnFormulateGetActiveEcopConfig (DbConnection connection)
 Should build a command that returns the active configuration instance (shallow). More...
 
abstract DbCommand OnFormulateGetEcopConfig (DbConnection connection, short id)
 Should build a command that returns the requested configuration instance (shallow). More...
 
abstract DbCommand OnFormulateGetEcopSettings (DbConnection connection, short configId)
 Should build a command that returns all settings for the configuration instance with configId . More...
 
abstract DbCommand OnFormulateFetchMeasurements (DbConnection connection, MeasurementQueryCriteria criteria)
 Should build a command that returns all measurements matching the conditions in criteria . More...
 
abstract DbCommand OnFormulateFetchFiveMinAvgs (DbConnection connection, MeasurementQueryCriteria criteria)
 Should build a command that returns all five-minute averages matching the conditions in criteria . More...
 
abstract DbCommand OnFormulateFetchHourlyAvgs (DbConnection connection, MeasurementQueryCriteria criteria)
 Should build a command that returns all hourly averages matching the conditions in criteria . More...
 
abstract DbCommand OnFormulateFetchDailyAvgs (DbConnection connection, MeasurementQueryCriteria criteria)
 Should build a command that returns all daily averages matching the conditions in criteria . More...
 
abstract DbCommand OnFormulateFetchMonthlyAvgs (DbConnection connection, MeasurementQueryCriteria criteria)
 Should build a command that returns all monthly averages matching the conditions in criteria . More...
 
abstract DbCommand OnFormulateWriteMeasurements (DbConnection connection, Measurements measurements)
 Should build a command that writes the measurements in measurements . More...
 
abstract DbCommand OnFormulateHasMeasurements (DbConnection connection, uint elementid)
 Should build a ccmmand that returns at least one row if the given element has measurements in the data store. More...
 
abstract DbCommand OnFormulateHasAverages (DbConnection connection, uint elementid)
 Should build a ccmmand that returns at least one row if the given element has averages in the data store. More...
 
abstract DbCommand OnFormulateWriteFiveMinAvgs (DbConnection connection, WeightedMeasurementAvgs avgs)
 Should build a command that writes the averages in avgs . More...
 
abstract DbCommand OnFormulateWriteHourlyAvgs (DbConnection connection, WeightedMeasurementAvgs avgs)
 Should build a command that writes the averages in avgs . More...
 
abstract DbCommand OnFormulateWriteDailyAvgs (DbConnection connection, WeightedMeasurementAvgs avgs)
 Should build a command that writes the averages in avgs . More...
 
abstract DbCommand OnFormulateWriteMonthlyAvgs (DbConnection connection, WeightedMeasurementAvgs avgs)
 Should build a command that writes the averages in avgs . More...
 
abstract DbCommand OnFormulateCheckForThreshold (DbConnection connection, uint elementId)
 Should build a command that returns the count of thresholds with the element id. More...
 
abstract DbCommand OnFormulateFetchThresholds (DbConnection connection, uint elementId)
 Should build a command that returns all thresholds with the element id. More...
 
abstract DbCommand OnFormulateUpdateThreshold (DbConnection connection, Threshold threshold)
 Should build a command that updates the threshold. More...
 
abstract DbCommand OnFormulateInsertThreshold (DbConnection connection, Threshold threshold)
 Should build a command that inserts the threshold. More...
 
abstract DbCommand OnFormulateDeleteThresholds (DbConnection connection, ManagedElement element)
 Should build a command that deletes all thresholds associated to the element. More...
 
abstract DbCommand OnFormulateCheckForEventDef (DbConnection connection, uint eventDefId)
 Should build a command that returns the count of event defs with the id. More...
 
abstract DbCommand OnFormulateFetchEventDef (DbConnection connection, uint eventDefId)
 Should build a command that returns the event def with the id. More...
 
abstract DbCommand OnFormulateUpdateEventDef (DbConnection connection, EventDef eventDef)
 Should build a command that updates the event def. More...
 
abstract DbCommand OnFormulateInsertEventDef (DbConnection connection, EventDef eventDef)
 Should build a command that inserts the event def. More...
 
abstract DbCommand OnFormulateDeleteEventDef (DbConnection connection, EventDef eventDef)
 Should build a command the deletes the event def. More...
 
abstract DbCommand OnFormulateFetchEventDefs (DbConnection connection)
 Should build a command that returns all event defs. More...
 
abstract DbCommand OnFormulateHasActions (DbConnection connection, EventDef eventDef)
 Should build a command that returns at least one action for the event def, if it exists. More...
 
abstract DbCommand OnFormulateHasThresholds (DbConnection connection, EventDef eventDef)
 Should build a command that returns at least one threshold fo the event def, if it exists. More...
 
abstract DbCommand OnFormulateFetchActions (DbConnection connection, uint elementId, uint eventId)
 Should build a command that returns all actions for the given element and event. More...
 
abstract DbCommand OnFormulateInsertAction (DbConnection connection, ActionDef action)
 Should build a command that inserts the action. More...
 
abstract DbCommand OnFormulateUpdateAction (DbConnection connection, ActionDef action)
 Should build a command that updates the action. More...
 
abstract DbCommand OnFormulateCheckForAction (DbConnection connection, uint elementId, uint eventId)
 Should build a command that returns the count of actions with the element and event def ids. More...
 
abstract DbCommand OnFormulateDeleteAction (DbConnection connection, ActionDef action)
 Should build a command the deletes the action. More...
 
abstract DbCommand OnFormulateDeleteActions (DbConnection connection, EventDef eventDef)
 Should build a command the deletes the actions associated to the event def. More...
 
abstract DbCommand OnFormulateDeleteActions (DbConnection connection, ManagedElement element)
 Should build a command that deletes the actions associated to the element. More...
 
abstract DbCommand OnFormulateInsertOrUpdateAlert (DbConnection connection, Alert alert)
 Should build a command that inserts the alert. More...
 
abstract DbCommand OnFormulateClearAlert (DbConnection connection, Alert alert)
 Should build a command that updates the cleared time of the alert. More...
 
abstract DbCommand OnFormulateFetchAlerts (DbConnection connection, bool activeOnly)
 Should build a command that returns all active alerts. More...
 
abstract DbCommand OnFormulateFetchSensor (DbConnection connection, uint id)
 Should build a command that returns the requested sensor. More...
 
abstract DbCommand OnFormulateFetchSensors (DbConnection connection, short configId, bool activeOnly)
 Should build a command that returns all sensor definitions in the specified configuration. More...
 
abstract DbCommand OnFormulateUpdateSensor (DbConnection connection, Sensor sensor)
 Should build a command that updates the given sensor definition. More...
 
abstract DbCommand OnFormulateInsertSensor (DbConnection connection, Sensor sensor)
 Should build a command that inserts the given sensor definition. More...
 
abstract DbCommand OnFormulateCheckForSensor (DbConnection connection, uint id)
 Should build a command that returns the count of sensors with the given id. More...
 
abstract DbCommand OnFormulateDeleteSensor (DbConnection connection, uint id)
 Should build a command that deletes the sensor with the given id. More...
 
abstract DbCommand OnFormulatePruneMeasurements (DbConnection connection, DateTime cutoff)
 Should build a command that deletes measurements, for all elements, that are older than cutoff . More...
 
abstract DbCommand OnFormulateInsertUser (DbConnection connection, User user)
 Should build a command the inserts the given user definition. More...
 
abstract DbCommand OnFormulateUpdateUser (DbConnection connection, User user)
 Should build a command the updates the given user definition. More...
 
abstract DbCommand OnFormulateDeleteUser (DbConnection connection, int id)
 Should build a command the deletes the given user definition. More...
 
abstract DbCommand OnFormulateGetUsers (DbConnection connection, PredicateSet filter)
 Should build a command the retrieves all users. More...
 
abstract DbCommand OnFormulatePersistUserNotifGroupXrefs (DbConnection connection, User user)
 Should build a command the persists the notification groups (xrefs) for the given user definition. More...
 
abstract DbCommand OnFormulatePersistUserRoleXrefs (DbConnection connection, User user)
 Should build a command the persists the roles (xrefs) for the given user definition. More...
 
abstract DbCommand OnFormulateInsertNotifGrp (DbConnection connection, NotificationGroup ng)
 Should build a command the inserts the given notification group definition. More...
 
abstract DbCommand OnFormulateUpdateNotifGrp (DbConnection connection, NotificationGroup ng)
 Should build a command the updates the given notification group definition. More...
 
abstract DbCommand OnFormulateDeleteNotifGrp (DbConnection connection, short id)
 Should build a command the deletes the given notification group definition. More...
 
abstract DbCommand OnFormulateGetNotifGrpXrefs (DbConnection connection, Auth.User user)
 Should build a command that retrieves notification groups for the given user. More...
 
abstract DbCommand OnFormulateGetNotifGrps (DbConnection connection, PredicateSet filter)
 Should build a command the retrieves notification groups that match filter . More...
 
abstract DbCommand OnFormulateGetRoles (DbConnection connection, User user)
 Should build a command that retrieves roles for the given user. More...
 
void addParam (DbCommand cmd, string name, System.Data.DbType type, object value)
 Adds the parameter. More...
 
void addParam (DbCommand cmd, string name, System.Data.DbType type, object value, System.Data.ParameterDirection direction)
 Adds the parameter. 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 OnInitializeDataStore (Configuration.DataStoreConfig config)
 
virtual void Dispose (bool disposing)
 
- 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

Apac.Settings.Configuration CurrentConfiguration [get]
 Returns the system setting as they are cached at initialization. More...
 
List< string > Roles [get]
 Gets the roles currently configured in the system. More...
 
List< Auth.NotificationGroupNotificationGroups [get]
 Gets the notification groups currently configured in the system. 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...
 
- Properties inherited from Apac.Data.IAuthStore
List< string > Roles [get]
 Gets the currently configured roles, possibly from cache. More...
 
List< NotificationGroupNotificationGroups [get]
 Gets the currently configured notification groups, possibly from cache. 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 (hopefully) data provider agnostic store for keeping ECOP data in an RDBMS. The goal here is to provide a data store implementation that can be used to scale ECOP from its current scope to an enterprise scope by altering the RDBMS underneath. The nirvana is a one-class-for-all-RDBMS-systems but that is not practical due to the different SQL syntax details, so the basic framework exists in this class and the formulation of the SQL exists in a class for each specific RDMBS system. This should at least reduce the amount of code and the behavioral differences between the different types of systems.

Member Function Documentation

◆ ActivateCurrentConfiguration()

void Apac.Data.DatabaseStore.ActivateCurrentConfiguration ( )
inline

Promotes 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.

◆ addParam() [1/2]

void Apac.Data.DatabaseStore.addParam ( DbCommand  cmd,
string  name,
System.Data.DbType  type,
object  value 
)
inlineprotected

Adds the parameter.

Parameters
cmdThe command.
nameThe name.
typeThe type.
valueThe value.

◆ addParam() [2/2]

void Apac.Data.DatabaseStore.addParam ( DbCommand  cmd,
string  name,
System.Data.DbType  type,
object  value,
System.Data.ParameterDirection  direction 
)
inlineprotected

Adds the parameter.

Parameters
cmdThe command.
nameThe name.
typeThe type.
valueThe value.
directionThe direction.

◆ ChangeActiveConfiguration()

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

Changes the active set of mappings to be the one with the name name .

Parameters
nameThe name of the configuration that will now be active.
Returns
Returns true if successful, false otherwise.

Implements Apac.Data.ISettingsStore.

◆ CloneMeasurementMappings()

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

Creates a copy of the mappings named origName in a configuration named copyName .

Parameters
origNameThe name of source for the copy.
copyNameThe name of the destination for the copy.
Returns
Returns the copied collection of mappings.

Implements Apac.Data.ISettingsStore.

◆ CreateNotificationGroup()

Logic.WhyBool Apac.Data.DatabaseStore.CreateNotificationGroup ( string  name,
ref Auth.NotificationGroup  group 
)
inline

Creates a notification group with name .

Parameters
nameThe name.
groupThe group.
Returns
Returns a WhyBool containing status of the operation and a reference to the new NotificationGroup.

◆ CreateUser()

Logic.WhyBool Apac.Data.DatabaseStore.CreateUser ( Auth.User  user)
inline

Creates the user in the data store. This routine assumes the the data is valid and the password has already been hashed and salted and applied to the user object.

Parameters
userThe user.
Returns
Returns a WhyBool containing status of the operation and updates the user object to be complete after creation.

◆ DeleteAction()

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

Deletes the action.

Parameters
actionThe action.

◆ DeleteActions()

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

Deletes the actions associated with the event def.

Parameters
eventDefThe event def.

◆ DeleteConfiguration()

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

Deletes the configuration with name .

Parameters
nameThe name of the configuration to be deleted.

Implements Apac.Data.ISettingsStore.

◆ DeleteEventDef()

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

Deletes the event def.

Parameters
eventDefThe event def.

◆ DeleteManagedElement()

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

Removes the given element from the datastore.

Parameters
elementThe Apac.Monitoring.ManagedElement to be removed.

◆ DeleteMeasurementMapping()

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

Deletes the given mapping from the store.

Parameters
mappingThe MeasurementMapping to be deleted.

Implements Apac.Data.ISettingsStore.

◆ DeleteNotificationGroup()

Logic.WhyBool Apac.Data.DatabaseStore.DeleteNotificationGroup ( short  id)
inline

Deletes the notification group with id .

Parameters
idThe identifier.
Returns
Returns a WhyBool containing status of the operation.

Implements Apac.Data.IAuthStore.

◆ DeleteSensor()

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

Deletes the sensor.

Parameters
sensorThe sensor.

◆ DeleteUser()

Logic.WhyBool Apac.Data.DatabaseStore.DeleteUser ( int  id)
inline

Deletes the user with id .

Parameters
idThe identifier.
Returns
Returns a WhyBool containing status of the operation.

Implements Apac.Data.IAuthStore.

◆ GetActions() [1/2]

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

Gets all actions.

Returns
Returns a T:List<Monitoring.Action> .

Implements Apac.Data.ISettingsStore.

◆ GetActions() [2/2]

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

Gets the actions.

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

Implements Apac.Data.ISettingsStore.

◆ GetConfiguration() [1/2]

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

Gets the configuration.

Parameters
idThe id.
Returns
Returns the Apac.Settings.Configuration that matches id .

Implements Apac.Data.ISettingsStore.

◆ GetConfiguration() [2/2]

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

Gets the configuration.

Parameters
nameThe name.
Returns
Returns the Apac.Settings.Configuration that matches name .

Implements Apac.Data.ISettingsStore.

◆ GetEventDef()

EventDef Apac.Data.DatabaseStore.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.DatabaseStore.GetEventDefs ( )
inline

Gets all event defs.

Returns
Returns a T:List<Monitoring.EventDef>.

Implements Apac.Data.ISettingsStore.

◆ GetManagedElement()

Apac.Monitoring.ManagedElement Apac.Data.DatabaseStore.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.DatabaseStore.GetManagedElements ( )
inline

Retrieves the managed elements in the system.

Returns
Returns a List{Apac.Monitoring.ManagedElement}.

Implements Apac.Data.ISettingsStore.

◆ GetMeasurementMappings() [1/2]

Apac.Collections.MeasurementMappingCollection Apac.Data.DatabaseStore.GetMeasurementMappings ( short  configid)
inline

Gets the mappings for configuration with ID of configid .

Parameters
configidThe configid.
Returns
Returns the Apac.Collections.MeasurementMappingCollection for the requested configuration or null.

◆ GetMeasurementMappings() [2/2]

Apac.Collections.MeasurementMappingCollection Apac.Data.DatabaseStore.GetMeasurementMappings ( string  name)
inline

Gets the mappings for configuration named name .

Parameters
nameThe name of the configuration to load.
Returns
Returns the Apac.Collections.MeasurementMappingCollection for the requested configuration or null.

Implements Apac.Data.ISettingsStore.

◆ GetNotificationGroups()

List<Auth.NotificationGroup> Apac.Data.DatabaseStore.GetNotificationGroups ( )
inline

Gets all notification groups.

Returns
Returns a T:List<NotificationGroup> containing the NotificationGroup.

Implements Apac.Data.IAuthStore.

◆ GetSensor()

Sensor Apac.Data.DatabaseStore.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.DatabaseStore.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.DatabaseStore.GetThresholds ( uint  elementId)
inline

Gets the thresholds.

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

Implements Apac.Data.ISettingsStore.

◆ GetUsers()

List<Auth.User> Apac.Data.DatabaseStore.GetUsers ( Logic.PredicateSet  filter)
inline

Gets the users that match filter .

Parameters
filterThe filter.
Returns
Returns a T:List<User> containing the users.

◆ LookupMappings() [1/2]

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

Looks up the mapping by sensor source.

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

Implements Apac.Data.ISettingsStore.

◆ LookupMappings() [2/2]

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

Gets a mapping for the requested element from the active mapping set.

Parameters
elementIdThe identifier of the element for which the mapping is needed.
Returns
Returns a T:List<Monitoring.MeasurementMapping> which may be empty.

Implements Apac.Data.ISettingsStore.

◆ OnClose()

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

Called when [close].

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnFetchDailyAverages()

override TimeTrackingList<WeightedMeasurementAvgs> Apac.Data.DatabaseStore.OnFetchDailyAverages ( MeasurementQueryCriteria  criteria)
inlineprotectedvirtual

Called when [fetch daily averages].

Parameters
criteriaThe criteria.
Returns

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnFetchFiveMinuteAverages()

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

Called when [fetch five minute averages].

Parameters
criteriaThe criteria.
Returns

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnFetchHourlyAverages()

override TimeTrackingList<WeightedMeasurementAvgs> Apac.Data.DatabaseStore.OnFetchHourlyAverages ( MeasurementQueryCriteria  criteria)
inlineprotectedvirtual

Called when [fetch hourly averages].

Parameters
criteriaThe criteria.
Returns

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnFetchMeasurements()

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

Called when [fetch measurements].

Parameters
criteriaThe criteria.
Returns

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnFetchMonthlyAverages()

override TimeTrackingList<WeightedMeasurementAvgs> Apac.Data.DatabaseStore.OnFetchMonthlyAverages ( MeasurementQueryCriteria  criteria)
inlineprotectedvirtual

Called when [fetch monthly averages].

Parameters
criteriaThe criteria.
Returns

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnFormulateCheckForAction()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateCheckForAction ( DbConnection  connection,
uint  elementId,
uint  eventId 
)
protectedpure virtual

Should build a command that returns the count of actions with the element and event def ids.

Parameters
connectionThe DbConnection used for the work.
elementIdThe element id.
eventIdThe event def id.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateCheckForEventDef()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateCheckForEventDef ( DbConnection  connection,
uint  eventDefId 
)
protectedpure virtual

Should build a command that returns the count of event defs with the id.

Parameters
connectionThe DbConnection used for the work.
eventDefIdThe event definition identifier.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateCheckForManagedElement()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateCheckForManagedElement ( DbConnection  connection,
uint  id 
)
protectedpure virtual

Should build a command that returns the count of elements with id .

Parameters
connectionThe DbConnection used for the work.
idThe identifier.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateCheckForMeasurementMapping()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateCheckForMeasurementMapping ( DbConnection  connection,
short  configid,
uint  elementid,
ulong  sensorid,
uint  sourceElementId,
decimal  constantValue,
string  inputTag 
)
protectedpure virtual

Should build a command that returns the count of mappings matching configid , elementid , sensorid , sourceElementId , constantValue , and inputTag ,.

Parameters
connectionThe DbConnection used for the work.
configidThe datastore identifier for the configuration being searched.
elementidThe datastore identifier for the managed element being searched.
sensoridThe identifier for the sensor being searched.
sourceElementIdThe identifier for the source element.
constantValueThe constant value used for this mapping.
inputTagThe input tag value used for this mapping.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateCheckForSensor()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateCheckForSensor ( DbConnection  connection,
uint  id 
)
protectedpure virtual

Should build a command that returns the count of sensors with the given id.

Parameters
connectionThe DbConnection used for the work.
idThe data store identifier for the sensor.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateCheckForThreshold()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateCheckForThreshold ( DbConnection  connection,
uint  elementId 
)
protectedpure virtual

Should build a command that returns the count of thresholds with the element id.

Parameters
connectionThe DbConnection used for the work.
elementIdThe element id.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateClearAlert()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateClearAlert ( DbConnection  connection,
Alert  alert 
)
protectedpure virtual

Should build a command that updates the cleared time of the alert.

Parameters
connectionThe DbConnection used for the work.
alertThe alert.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateCreateConfig()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateCreateConfig ( DbConnection  connection,
string  name 
)
protectedpure virtual

Should build a command that creates a new configuration instance with name .

Parameters
connectionThe DbConnection used for the work.
nameThe name for the new configuration.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteAction()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteAction ( DbConnection  connection,
ActionDef  action 
)
protectedpure virtual

Should build a command the deletes the action.

Parameters
connectionThe DbConnection used for the work.
actionThe action.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteActions() [1/2]

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteActions ( DbConnection  connection,
EventDef  eventDef 
)
protectedpure virtual

Should build a command the deletes the actions associated to the event def.

Parameters
connectionThe DbConnection used for the work.
eventDefThe event def.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteActions() [2/2]

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteActions ( DbConnection  connection,
ManagedElement  element 
)
protectedpure virtual

Should build a command that deletes the actions associated to the element.

Parameters
connectionThe DbConnection used for the work.
elementThe element.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteConfig()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteConfig ( DbConnection  connection,
short  id 
)
protectedpure virtual

Should build a command that deletes the configuration instance with id .

Parameters
connectionThe DbConnection used for the work.
idThe data store identifier for the configuration to be deleted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteEventDef()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteEventDef ( DbConnection  connection,
EventDef  eventDef 
)
protectedpure virtual

Should build a command the deletes the event def.

Parameters
connectionThe DbConnection used for the work.
eventDefThe event def.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteManagedElement()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteManagedElement ( DbConnection  connection,
ManagedElement  element 
)
protectedpure virtual

Should build a command that removes element from the data store.

Parameters
connectionThe DbConnection used for the work.
elementThe ManagedElement to be removed.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteMapping()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteMapping ( DbConnection  connection,
MeasurementMapping  mapping 
)
protectedpure virtual

Should build a a command that removes mapping from the data store.

Parameters
connectionThe DbConnection used for the work.
mappingThe MeasurementMapping to be removed.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteMappings()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteMappings ( DbConnection  connection,
ManagedElement  element 
)
protectedpure virtual

Should build a command that removes all MeasurementMappings associated with element .

Parameters
connectionThe DbConnection used for the work.
elementThe ManagedElement for which mappings are to be removed.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteMeasurements()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteMeasurements ( DbConnection  connection,
ManagedElement  element 
)
protectedpure virtual

Should build a command that removes measurements for element from the data store.

Parameters
connectionThe DbConnection used for the work.
elementThe ManagedElement to be removed.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateDeleteNotifGrp()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteNotifGrp ( DbConnection  connection,
short  id 
)
protectedpure virtual

Should build a command the deletes the given notification group definition.

Parameters
connectionThe connection.
idThe notification group id.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteSensor()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteSensor ( DbConnection  connection,
uint  id 
)
protectedpure virtual

Should build a command that deletes the sensor with the given id.

Parameters
connectionThe DbConnection used for the work.
idThe data store identifier of the sensor to delete.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteThresholds()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteThresholds ( DbConnection  connection,
ManagedElement  element 
)
protectedpure virtual

Should build a command that deletes all thresholds associated to the element.

Parameters
connectionThe DbConnection used for the work.
elementThe element.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteUser()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteUser ( DbConnection  connection,
int  id 
)
protectedpure virtual

Should build a command the deletes the given user definition.

Parameters
connectionThe connection.
idThe user id.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateDeleteWeightedAverages()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateDeleteWeightedAverages ( DbConnection  connection,
ManagedElement  element 
)
protectedpure virtual

Should build a command that removes averages for element from the data store.

Parameters
connectionThe DbConnection used for the work.
elementThe ManagedElement to be removed.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateFetchActions()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchActions ( DbConnection  connection,
uint  elementId,
uint  eventId 
)
protectedpure virtual

Should build a command that returns all actions for the given element and event.

Parameters
connectionThe DbConnection used for the work.
elementIdThe element id.
eventIdThe event id.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchAlerts()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchAlerts ( DbConnection  connection,
bool  activeOnly 
)
protectedpure virtual

Should build a command that returns all active alerts.

Parameters
connectionThe DbConnection used for the work.
activeOnlyInstructs the query to only return alerts that are not cleared.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchDailyAvgs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchDailyAvgs ( DbConnection  connection,
MeasurementQueryCriteria  criteria 
)
protectedpure virtual

Should build a command that returns all daily averages matching the conditions in criteria .

Parameters
connectionThe DbConnection used for the work.
criteriaThe query conditions requested by the caller.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchEventDef()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchEventDef ( DbConnection  connection,
uint  eventDefId 
)
protectedpure virtual

Should build a command that returns the event def with the id.

Parameters
connectionThe DbConnection used for the work.
eventDefIdThe event def id.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchEventDefs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchEventDefs ( DbConnection  connection)
protectedpure virtual

Should build a command that returns all event defs.

Parameters
connectionThe DbConnection used for the work.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchFiveMinAvgs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchFiveMinAvgs ( DbConnection  connection,
MeasurementQueryCriteria  criteria 
)
protectedpure virtual

Should build a command that returns all five-minute averages matching the conditions in criteria .

Parameters
connectionThe DbConnection used for the work.
criteriaThe query conditions requested by the caller.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchHourlyAvgs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchHourlyAvgs ( DbConnection  connection,
MeasurementQueryCriteria  criteria 
)
protectedpure virtual

Should build a command that returns all hourly averages matching the conditions in criteria .

Parameters
connectionThe DbConnection used for the work.
criteriaThe query conditions requested by the caller.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchManagedElement()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchManagedElement ( DbConnection  connection,
uint  id 
)
protectedpure virtual

Should build a command that returns the data set containing all columns for the requested managed element.

Parameters
connectionThe DbConnection used for the work.
idThe id of the element needed.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchManagedElements()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchManagedElements ( DbConnection  connection)
protectedpure virtual

Should build a command that returns the data set containing all columns for all managed elements in the data store.

Parameters
connectionThe DbConnection used for the work.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchMappedManagedElements()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchMappedManagedElements ( DbConnection  connection,
short  configid 
)
protectedpure virtual

Should build a command that returns the data set containing all columns for all managed elements in the data store that are mapping within the given configuration.

Parameters
connectionThe DbConnection used for the work.
configidThe datastore identifier of the configuration used to match the managed elements.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchMeasurementMappings()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchMeasurementMappings ( DbConnection  connection,
short  configid 
)
protectedpure virtual

Should build a command that returns the data set containing all mappings in configuration 'configid ', and the associated managed element data (using a JOIN).

Parameters
connectionThe DbConnection used for the work.
configidThe id of the configuration needed.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchMeasurements()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchMeasurements ( DbConnection  connection,
MeasurementQueryCriteria  criteria 
)
protectedpure virtual

Should build a command that returns all measurements matching the conditions in criteria .

Parameters
connectionThe DbConnection used for the work.
criteriaThe query conditions requested by the caller.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchMonthlyAvgs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchMonthlyAvgs ( DbConnection  connection,
MeasurementQueryCriteria  criteria 
)
protectedpure virtual

Should build a command that returns all monthly averages matching the conditions in criteria .

Parameters
connectionThe DbConnection used for the work.
criteriaThe query conditions requested by the caller.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchSensor()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchSensor ( DbConnection  connection,
uint  id 
)
protectedpure virtual

Should build a command that returns the requested sensor.

Parameters
connectionThe connection.
idThe id.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchSensors()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchSensors ( DbConnection  connection,
short  configId,
bool  activeOnly 
)
protectedpure virtual

Should build a command that returns all sensor definitions in the specified configuration.

Parameters
connectionThe connection.
configIdThe config id.
activeOnlyif set to true then only active sensors are returned.
Returns
Return a DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateFetchThresholds()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateFetchThresholds ( DbConnection  connection,
uint  elementId 
)
protectedpure virtual

Should build a command that returns all thresholds with the element id.

Parameters
connectionThe DbConnection used for the work.
elementIdThe element id.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateGetActiveEcopConfig()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetActiveEcopConfig ( DbConnection  connection)
protectedpure virtual

Should build a command that returns the active configuration instance (shallow).

Parameters
connectionThe DbConnection used for the work.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateGetConfigId()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetConfigId ( DbConnection  connection,
string  name 
)
protectedpure virtual

Should build a command that returns the identifier for the configuration with name .

Parameters
connectionThe DbConnection used for the work.
nameThe name of the configuration instance to be queried.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateGetEcopConfig() [1/2]

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetEcopConfig ( DbConnection  connection,
short  id 
)
protectedpure virtual

Should build a command that returns the requested configuration instance (shallow).

Parameters
connectionThe DbConnection used for the work.
idThe data store identifier for the configuration
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateGetEcopConfig() [2/2]

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetEcopConfig ( DbConnection  connection,
string  name 
)
protectedpure virtual

Should build a command that returns the requested configuration instance (shallow).

Parameters
connectionThe DbConnection used for the work.
namethe name of the configuration to get.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateGetEcopConfigs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetEcopConfigs ( DbConnection  connection)
protectedpure virtual

Should build a command that returns all configuration instances (shallow).

Parameters
connectionThe DbConnection used for the work.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateGetEcopSettings()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetEcopSettings ( DbConnection  connection,
short  configId 
)
protectedpure virtual

Should build a command that returns all settings for the configuration instance with configId .

Parameters
connectionThe DbConnection used for the work.
configIdThe datastore identifier for the configuration needed.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateGetNotifGrps()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetNotifGrps ( DbConnection  connection,
PredicateSet  filter 
)
protectedpure virtual

Should build a command the retrieves notification groups that match filter .

Parameters
connectionThe connection.
filterThe filter.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateGetNotifGrpXrefs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetNotifGrpXrefs ( DbConnection  connection,
Auth.User  user 
)
protectedpure virtual

Should build a command that retrieves notification groups for the given user.

Parameters
connectionThe connection.
userThe User used to filter the results.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateGetRoles()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetRoles ( DbConnection  connection,
User  user 
)
protectedpure virtual

Should build a command that retrieves roles for the given user.

Parameters
connectionThe connection.
userThe User used to filter the results.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateGetUsers()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateGetUsers ( DbConnection  connection,
PredicateSet  filter 
)
protectedpure virtual

Should build a command the retrieves all users.

Parameters
connectionThe connection.
filterThe filter.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateHasActions()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateHasActions ( DbConnection  connection,
EventDef  eventDef 
)
protectedpure virtual

Should build a command that returns at least one action for the event def, if it exists.

Parameters
connectionThe DbConnection used for the work.
eventDefThe event def.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateHasAverages()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateHasAverages ( DbConnection  connection,
uint  elementid 
)
protectedpure virtual

Should build a ccmmand that returns at least one row if the given element has averages in the data store.

Parameters
connectionThe DbConnection used for the work.
elementidThe element to be searched.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateHasMeasurements()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateHasMeasurements ( DbConnection  connection,
uint  elementid 
)
protectedpure virtual

Should build a ccmmand that returns at least one row if the given element has measurements in the data store.

Parameters
connectionThe DbConnection used for the work.
elementidThe element to be searched.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateHasThresholds()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateHasThresholds ( DbConnection  connection,
EventDef  eventDef 
)
protectedpure virtual

Should build a command that returns at least one threshold fo the event def, if it exists.

Parameters
connectionThe DbConnection used for the work.
eventDefThe event def.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateInsertAction()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertAction ( DbConnection  connection,
ActionDef  action 
)
protectedpure virtual

Should build a command that inserts the action.

Parameters
connectionThe DbConnection used for the work.
actionThe action to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateInsertEventDef()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertEventDef ( DbConnection  connection,
EventDef  eventDef 
)
protectedpure virtual

Should build a command that inserts the event def.

Parameters
connectionThe DbConnection used for the work.
eventDefThe event def to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateInsertManagedElement()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertManagedElement ( DbConnection  connection,
ManagedElement  element 
)
protectedpure virtual

Should build a command that insert the managed element.

Parameters
connectionThe DbConnection used for the work.
elementThe ManagedElementto be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateInsertMeasurementMapping()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertMeasurementMapping ( DbConnection  connection,
MeasurementMapping  mapping 
)
protectedpure virtual

Should build a command that creates the mapping specified.

Parameters
connectionThe DbConnection used for the work.
mappingThe the new mapping to be inserted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateInsertMeasurementMappings()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertMeasurementMappings ( DbConnection  connection,
MeasurementMappingCollection  mappings 
)
protectedpure virtual

Should build a command that insert the set of mappings.

Parameters
connectionThe DbConnection used for the work.
mappingsThe mappings to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateInsertNotifGrp()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertNotifGrp ( DbConnection  connection,
NotificationGroup  ng 
)
protectedpure virtual

Should build a command the inserts the given notification group definition.

Parameters
connectionThe connection.
ngThe notification group.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateInsertOrUpdateAlert()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertOrUpdateAlert ( DbConnection  connection,
Alert  alert 
)
protectedpure virtual

Should build a command that inserts the alert.

Parameters
connectionThe DbConnection used for the work.
alertThe alert.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateInsertSensor()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertSensor ( DbConnection  connection,
Sensor  sensor 
)
protectedpure virtual

Should build a command that inserts the given sensor definition.

Parameters
connectionThe DbConnection used for the work.
sensorThe Sensor to update.
Returns
Return a DbCommand instance set up to perform the operation.

◆ OnFormulateInsertThreshold()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertThreshold ( DbConnection  connection,
Threshold  threshold 
)
protectedpure virtual

Should build a command that inserts the threshold.

Parameters
connectionThe DbConnection used for the work.
thresholdThe threshold to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateInsertUser()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateInsertUser ( DbConnection  connection,
User  user 
)
protectedpure virtual

Should build a command the inserts the given user definition.

Parameters
connectionThe connection.
userThe user.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateMergeSetting()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateMergeSetting ( DbConnection  connection,
string  name,
string  value,
short  configid 
)
protectedpure virtual

Should build a command that updates the settings.

Parameters
connectionThe DbConnection used for the work.
nameThe name.
valueThe value.
configidThe configid.
Returns

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulatePersistUserNotifGroupXrefs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulatePersistUserNotifGroupXrefs ( DbConnection  connection,
User  user 
)
protectedpure virtual

Should build a command the persists the notification groups (xrefs) for the given user definition.

Parameters
connectionThe connection.
userThe user.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulatePersistUserRoleXrefs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulatePersistUserRoleXrefs ( DbConnection  connection,
User  user 
)
protectedpure virtual

Should build a command the persists the roles (xrefs) for the given user definition.

Parameters
connectionThe connection.
userThe user.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulatePruneMeasurements()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulatePruneMeasurements ( DbConnection  connection,
DateTime  cutoff 
)
protectedpure virtual

Should build a command that deletes measurements, for all elements, that are older than cutoff .

Parameters
connectionThe DbConnection used for the work.
cutoffThe oldest date to keep in the data store.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateSetActiveConfig()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateSetActiveConfig ( DbConnection  connection,
short  id 
)
protectedpure virtual

Should 'flip the active bit' to the configuration named id .

Parameters
connectionThe DbConnection used for the work.
idThe data store identifier of the configuration to become active.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateUpdateAction()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateAction ( DbConnection  connection,
ActionDef  action 
)
protectedpure virtual

Should build a command that updates the action.

Parameters
connectionThe DbConnection used for the work.
actionThe action to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateUpdateEventDef()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateEventDef ( DbConnection  connection,
EventDef  eventDef 
)
protectedpure virtual

Should build a command that updates the event def.

Parameters
connectionThe DbConnection used for the work.
eventDefThe event def to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateUpdateManagedElement()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateManagedElement ( DbConnection  connection,
ManagedElement  element 
)
protectedpure virtual

Should build a command that update the managed element.

Parameters
connectionThe DbConnection used for the work.
elementThe ManagedElementto be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateUpdateMeasurementMapping() [1/2]

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateMeasurementMapping ( DbConnection  connection,
MeasurementMapping  mapping 
)
protectedpure virtual

Should build a command that updates the mapping specified, using the ID.

Parameters
connectionThe DbConnection used for the work.
mappingThe MeasurementMapping to be updated.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateUpdateMeasurementMapping() [2/2]

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateMeasurementMapping ( DbConnection  connection,
MeasurementMapping  oldmapping,
MeasurementMapping  newmapping 
)
protectedpure virtual

Should build a command that updates the mapping specified.

Parameters
connectionThe DbConnection used for the work.
oldmappingThe the mapping object with the old data.
newmappingThe the mapping object with the new data.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateUpdateMeasurementMappings()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateMeasurementMappings ( DbConnection  connection,
MeasurementMappingCollection  mappings 
)
protectedpure virtual

Should build a command that updates the set of mappings.

Parameters
connectionThe DbConnection used for the work.
mappingsThe mappings to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateUpdateNotifGrp()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateNotifGrp ( DbConnection  connection,
NotificationGroup  ng 
)
protectedpure virtual

Should build a command the updates the given notification group definition.

Parameters
connectionThe connection.
ngThe notification group.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateUpdateSensor()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateSensor ( DbConnection  connection,
Sensor  sensor 
)
protectedpure virtual

Should build a command that updates the given sensor definition.

Parameters
connectionThe DbConnection used for the work.
sensorThe Sensor to update.
Returns
Return a DbCommand instance set up to perform the operation.

◆ OnFormulateUpdateThreshold()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateThreshold ( DbConnection  connection,
Threshold  threshold 
)
protectedpure virtual

Should build a command that updates the threshold.

Parameters
connectionThe DbConnection used for the work.
thresholdThe threshold to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateUpdateUser()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateUpdateUser ( DbConnection  connection,
User  user 
)
protectedpure virtual

Should build a command the updates the given user definition.

Parameters
connectionThe connection.
userThe user.
Returns
A DbCommand instance set up to perform the operation.

◆ OnFormulateWriteDailyAvgs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateWriteDailyAvgs ( DbConnection  connection,
WeightedMeasurementAvgs  avgs 
)
protectedpure virtual

Should build a command that writes the averages in avgs .

Parameters
connectionThe DbConnection used for the work.
avgsThe WeightedMeasurementAvgs to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateWriteFiveMinAvgs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateWriteFiveMinAvgs ( DbConnection  connection,
WeightedMeasurementAvgs  avgs 
)
protectedpure virtual

Should build a command that writes the averages in avgs .

Parameters
connectionThe DbConnection used for the work.
avgsThe WeightedMeasurementAvgs to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateWriteHourlyAvgs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateWriteHourlyAvgs ( DbConnection  connection,
WeightedMeasurementAvgs  avgs 
)
protectedpure virtual

Should build a command that writes the averages in avgs .

Parameters
connectionThe DbConnection used for the work.
avgsThe WeightedMeasurementAvgs to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateWriteMeasurements()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateWriteMeasurements ( DbConnection  connection,
Measurements  measurements 
)
protectedpure virtual

Should build a command that writes the measurements in measurements .

Parameters
connectionThe DbConnection used for the work.
measurementsThe T:Measurements<ushort> to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnFormulateWriteMonthlyAvgs()

abstract DbCommand Apac.Data.DatabaseStore.OnFormulateWriteMonthlyAvgs ( DbConnection  connection,
WeightedMeasurementAvgs  avgs 
)
protectedpure virtual

Should build a command that writes the averages in avgs .

Parameters
connectionThe DbConnection used for the work.
avgsThe WeightedMeasurementAvgs to be persisted.
Returns
A DbCommand instance set up to perform the operation.

Implemented in Apac.Data.FirebirdStore.

◆ OnInitializeDataStore()

override void Apac.Data.DatabaseStore.OnInitializeDataStore ( DataStoreConfig  config)
inlineprotected

Called when [initialize data store].

Parameters
configThe config.

◆ OnOpen()

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

Called when [open].

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnPruneRawMeasurements()

override void Apac.Data.DatabaseStore.OnPruneRawMeasurements ( DateTime  cutoffDay)
inlineprotectedvirtual

Called when [prune raw measurements].

Parameters
cutoffDayThe cutoff day.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnRetrieveAlerts()

override Alerts Apac.Data.DatabaseStore.OnRetrieveAlerts ( bool  activeOnly)
inlineprotectedvirtual

Called when [retrieve alerts].

Parameters
activeOnlyif set to true [active only].
Returns

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnSettingsChanged()

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

Called when [settings changed].

◆ OnWriteAlerts()

override void Apac.Data.DatabaseStore.OnWriteAlerts ( Alerts  alerts)
inlineprotectedvirtual

Called when [write alerts].

Parameters
alertsThe alerts.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnWriteDailyAvgs()

override void Apac.Data.DatabaseStore.OnWriteDailyAvgs ( WeightedMeasurementAvgs  averages)
inlineprotectedvirtual

Called when [write daily avgs].

Parameters
averagesThe averages.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnWriteFiveMinuteAvgs()

override void Apac.Data.DatabaseStore.OnWriteFiveMinuteAvgs ( WeightedMeasurementAvgs  averages)
inlineprotectedvirtual

Called when [write five minute avgs].

Parameters
averagesThe averages.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnWriteHourlyAvgs()

override void Apac.Data.DatabaseStore.OnWriteHourlyAvgs ( WeightedMeasurementAvgs  averages)
inlineprotectedvirtual

Called when [write hourly avgs].

Parameters
averagesThe averages.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnWriteMeasurements()

override void Apac.Data.DatabaseStore.OnWriteMeasurements ( Measurements  measurements)
inlineprotectedvirtual

Called when [write measurements].

Parameters
measurementsThe measurements.

Implements Apac.Data.ThreadedMeasurementStore.

◆ OnWriteMonthlyAvgs()

override void Apac.Data.DatabaseStore.OnWriteMonthlyAvgs ( WeightedMeasurementAvgs  averages)
inlineprotectedvirtual

Called when [write monthly avgs].

Parameters
averagesThe averages.

Implements Apac.Data.ThreadedMeasurementStore.

◆ PersistAction()

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

Persists the action.

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

◆ PersistEventDef()

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

Persists the event def.

Parameters
eventDefThe event def.

◆ PersistManagedElement()

bool Apac.Data.DatabaseStore.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.DatabaseStore.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.DatabaseStore.PersistMeasurementMappings ( Apac.Collections.MeasurementMappingCollection  mappings)
inline

Writes the given mappings to the data store.

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

◆ PersistSensor()

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

Perists the sensor.

Parameters
sensorThe sensor.

◆ PersistThreshold()

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

Persists the threshold.

Parameters
thresholdThe threshold.

◆ SaveConfiguration()

void Apac.Data.DatabaseStore.SaveConfiguration ( Apac.Settings.Configuration  newConfig,
bool  activate 
)
inline

Saves the given configuration to the data store.

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

◆ updateMeasurementCache()

virtual void Apac.Data.DatabaseStore.updateMeasurementCache ( Measurements  measurements)
inlineprotectedvirtual

Updates the measurement cache.

Parameters
measurementsThe measurements.

◆ UpdateNotificationGroup()

WhyBool Apac.Data.DatabaseStore.UpdateNotificationGroup ( NotificationGroup  ng)
inline

Updates the notificaton group.

Parameters
ngThe ng.
Returns
Returns a WhyBool containing status of the operation.

Implements Apac.Data.IAuthStore.

◆ UpdateUser()

Logic.WhyBool Apac.Data.DatabaseStore.UpdateUser ( Auth.User  user)
inline

Updates the user and associations to look like user .

Parameters
userThe user.
Returns
Returns a WhyBool containing status of the operation.

Property Documentation

◆ CurrentConfiguration

Apac.Settings.Configuration Apac.Data.DatabaseStore.CurrentConfiguration
get

Returns the system setting as they are cached at initialization.

◆ NotificationGroups

List<Auth.NotificationGroup> Apac.Data.DatabaseStore.NotificationGroups
get

Gets the notification groups currently configured in the system.

The notification groups.

◆ Roles

List<string> Apac.Data.DatabaseStore.Roles
get

Gets the roles currently configured in the system.

The roles.

Event Documentation

◆ SettingsChanged

SettingsChangedHandler Apac.Data.DatabaseStore.SettingsChanged

Occurs when any settings have changed.


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