Menu

BackendClasses Log in to Edit

Adam Voss

Class Hierarchy

Names in Italics are examples and not currently planned for implementation

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.

Related

Wiki: Home

Discussion

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB