Friday, August 31, 2007

Status Report for 08/08/2007 -- 08/29/2007

Progress

Draft of prototype architecture for new project

1. Main Frame

2. Requirements

Get data from CIMA instruments/CIMA web services, and show them on an Ajax-based browser.

(Difference between this with Atom Feed for IUMS? any special requirements or restrictions for that?)

3. Work Flow

(1) Users send HTTP requests to register a variable(Bay1Temp, for example) to be shown in the browser(for example, http://shim.addr/register?Name=[cima_service]%Source=[variable_name])

(2) Users get a reply with the user ID(for example, http://shim.addr/UUID). This UUID will be used to identify different users and get data from the web service;

(3) Web service interface will create a thread for that request/user;

(4) Web service interface(or The thread?) then send the register request to CIMA web service (with UUID?)(Socket);

(5) CIMA web service will return stream data() back(Socket);

(6) The parcel will be stored in a ring buffer in SVC(???);

(7) Users send Poll URL to Web service interface(or The thread?) (when will it happen?);

(8) Web service interface(or The thread?) sends the data back to the browser.

4. Problems

(1) It is supposed to be used by multiple users, so is there any limitation for the number of users because we cannot assume the data column is small enough for server to process( The user might request some ccd image and the transfer rate is in the range of 4K to 8M/sec);

(2) Compare the following two cases in how to distinguish clients:

(a) Create one thread for every registration;

(b) One service with IDs to distinguish clients;

- Distinguish which parcel goes to which client

- Overhead matching IDs to parcels(?)

(3) Data format:

The format of return data should be XML or JSON or both. Ajax-based client application can accept JSON much easier then XML.

Discussion

In “Problems” section

Thursday, August 09, 2007

Status Report for 08/01/2007 -- 08/08/2007

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 Feed createDefaultFeed; // Create "feed" part of a feed -- Author, Id, Title, Link

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 {

ArrayList cachedEntryContent; // An In-Memory data structure to store latest parcel;

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;

Class IndividualCachedSensorStorage, Class AllInOneCachedSensorStorage and AbnormalCachedSensorStorage extend their super class and override two methods generateContentString and updateCachedEntryContent based on their different ways to process the In-Memory data.


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.