<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to BackendClasses</title><link>https://sourceforge.net/p/ecowin/wiki/BackendClasses/</link><description>Recent changes to BackendClasses</description><atom:link href="https://sourceforge.net/p/ecowin/wiki/BackendClasses/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 26 Jun 2011 01:58:50 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ecowin/wiki/BackendClasses/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage BackendClasses modified by Adam Voss</title><link>https://sourceforge.net/p/ecowin/wiki/BackendClasses/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -9,11 +9,11 @@
     * [TestMeter]
     * *bacnetMeter*
 * ecowin.Analyzer
-    * UserLimitAnalyzer
-    * TrendingAnalyzer
-    * *GooglePowerMeter*
+    * [UserLimitAnalyzer]
+    * [TrendingAnalyzer]
+    * *[GooglePowerMeter]*
     * [dbStoreAnalyzer]
-    * *GooglePrediction*
+    * *[GooglePrediction]*
 * ecowin.Notifier
 * ecowin.Event
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Adam Voss</dc:creator><pubDate>Sun, 26 Jun 2011 01:58:50 -0000</pubDate><guid>https://sourceforge.neta84b5245b38e89e3af31e0a1d087375f2e851a7a</guid></item><item><title>WikiPage BackendClasses modified by Adam Voss</title><link>https://sourceforge.net/p/ecowin/wiki/BackendClasses/</link><description>&lt;pre&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Adam Voss</dc:creator><pubDate>Sun, 26 Jun 2011 01:57:02 -0000</pubDate><guid>https://sourceforge.nete22b05ec61db4165f423c34080b342ac4bf6ef03</guid></item><item><title>WikiPage ProjectGoals modified by Adam Voss</title><link>https://sourceforge.net/p/ecowin/wiki/ProjectGoals/</link><description>Class Hierarchy
===

**Names in Italics are examples and not currently planned for implementation**

* ecowin.Meter
    * mySQLMeter
    * [MSSQLMeter]
    * [TestMeter]
    * *bacnetMeter*
* ecowin.Analyzer
    * UserLimitAnalyzer
    * TrendingAnalyzer
    * *GooglePowerMeter*
    * [dbStoreAnalyzer]
    * *GooglePrediction*
* ecowin.Notifier
* ecowin.Event


Main
===

Provides the init for our backend.  It creates the meters, analyzers, and notifiers.

1. Create unique Notifier
2. Build all Meters which run as daemons
    * Obtain list of Meters from DB query or hard coded
3. Build an Analyzer (using the unique Notifier) for each Meter created in Step 2
4. Give each Analyzer to each Meter

Event
===

Knows
Contact info, text/message, timestamp, user_id, analyzer_name, meter_id

* Contact information (enum 0: both, 1: email, 2: SMS)
* Message text
* Timestamp of when data was entered
* Id of the User to receive the notification
* Name of analyzer which built the Event
* Id of the Meter pertinent to the Event

Meter
===

One object for every physical meter, each running as a separate process.  May need to have an [optional] notifier to notify when it detects a problem with meter or database.

Knows:

* Name
* Location
* Type of Meter
* How to get data
* Analyzers interested in its data

Does:

* Gets data from data source
   * Implemented in inheriting classes ONLY
* Sends data on to analyzers
   * Implemented in TOP LEVEL
   * Will not send along duplicate data.
* Repeat

Notifier
===

***Must be thread safe***

Built using two threads.

Receive Thread:  Receives Events, places them in a queue.

Send Thread:     Pulls Events from queue, sends notifiaction (SMS and/or E-MAIL).

Knows:

* Contact info enum (0: both, 1: email, 2: SMS)
* (Not yet) Location of tmp file holding pending additions to ecoSite_notification_history table.

Does:

* Sends something
   * Requires an Event
   * Does query DB for user contact information
   * Sends message text from Event to phone number and/or email depending on contact info enum
   * Adds row to ecoSite_notification_history

Potential look-up stores:
Flat File
Database


Analyzer
===
***Must be thread safe***

Base class of all analyzers.  MUST have a method to receive data from meter.  Constructor does not require a notifier, however, the base class does allow for a notifier to be set.

Does:
* Receive data

Doesn't:

* Have a method to send data to DB. This is implemented within the dbStoreAnalyzer.
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Adam Voss</dc:creator><pubDate>Sun, 26 Jun 2011 01:54:10 -0000</pubDate><guid>https://sourceforge.net29257dd727e25a0c82752d8e15b20f1d58f55eda</guid></item></channel></rss>