Progress
Summary of data structure design for IUMSC 12 sensors Atom Feed
1. Requirements
Create Atom Feed for IUMSC 12 sensors
- All sensors’ data in one feed
- Each sensor data in one feed
- Out-of-Range data from all sensors in one feed
2. Work Flow
Implementation is in Method void myHandler(String parcel) in Class Channel_sinkImpl in Package edu.indiana.extreme.www.cima.channel.sink.
(1) Read and parse the parcel and get SensorName, TimeStamp and DoubleData for the incoming sensor data;
(2) Find the SensorStorage for this parcel and update the according SensorStorage with the current parcel;
(3) Update the all-in-one SensorStorage with the current parcel;
(4) Update the SensorStorage for out-of-range data with the current parcel;
3. Data Structure Design
- Super Class
abstract class CachedSensorStorage {
private Entry createDefaultEntry // Create "entry" part of a feed -- Author, Title, Id, Updated
protected abstract void updateCachedEntryContent;
protected abstract String generateContentString;
public boolean updateData {
Call Method createDefaultFeed to create basic feed part
Call Method createDefaultEntry to add entry to the feed;
Call Method updateCachedEntryContent which is synchronized to update/append content based on the incoming parcel in cached Entry Content
Call Method FeedDoc.writeFeedDoc provided by AtomSphere to write feed. The method is synchronized too.
}
- Sub Classes
(1) class IndividualCachedSensorStorage extends CachedSensorStorage {
protected String generateContentString; // Generate the parcel content string from the cachedEntryContent. It overrides the method in its superclass.
protected void updateCachedEntryContent // Update data in the In-Memory data structure based on incoming parcel
}
(2) class AllInOneCachedSensorStorage extends CachedSensorStorage;
(3) class AbnormalCachedSensorStorage extends CachedSensorStorage;
4. URLs for all Atom Feeds
For all sensors' data :
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed.xml
For each sensor's data :
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_Bay1Humid.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_Bay1Temp.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_CampCWInTemp.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_CrystalTemp.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_DEHumid.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_DETemp.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_FrameBuffer_D_Usage.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_FrameBuffer_E_Usage.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_FrameBuffer_F_Usage.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_LabCWInTemp.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_LabCWOutTemp.xml
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_LN2Levl.xml
For abnormal data from all sensors:
http://hagar.cs.indiana.edu:8181/IUMSCAtomFeed_Abnormal.xml
Future work
1. SSO;
2. Netvibes Widgets.
No comments:
Post a Comment