Saturday, April 29, 2017

Weather Monitoring System using java RMI and Sockets

[ Storm | StormServer | StormPI ]

Screen Shots

StormPI(Sends weather data via sockets)
Storm Server(Has a socket interface and a RMI interface)

StormServer(RMI/Sockets server) and StormPI( The sensor module)
Client Module


Introduction

“Storm” is a fully distributed weather monitoring system. It consists of mainly 3 main applications
  1. Strom Server - Server which provides services to monitoring stations and sensors
    1. Socket interface - Provides communication with the sensor devices.
    2. Java RMI interface - Exposes methods which can be used by Monitoring Stations.
  2. StormPI - A sensor emulator which contains
    1. Temperature sensor
    2. Pressure Sensor(Barometer)
    3. Rainfall Sensor(Rain Gauge)
    4. Humidity Sensor
3. StormApp - Client for weather monitoring,. Live weather data can be visualized in given time.
Features
  • StormApp Monitoring Stations receives live weather data and alerts on separated views.
  • StormApp Supports on demand weather.
    • Monitoring Stations receives an available list of sensor locations when connected to the server.
    • User can select a location and subscribe to the weather.

Non Functional Requirements

  1. Storm uses the Distributed Computing principles in the architecture and the design.
    1. Architecture - Client Server
    2. Server Communicates with the Monitoring stations through the RMI interface
    3. Sensors sends weather data to Storm server through sockets.
  2. Adoption of appropriate security/authentication mechanisms
    1. Sensors has to be registered with the server.
    2. Registered Data is stored in  a file which is present inside the server.
    3. Monitoring Stations can log into the server only using a secured key.
  3. Thread Safety
    1. Use of ConcurrentMaps to store data
    2. Use of CopyOnWriteArrayLists
    3. Object null checks before accessing the object.
    4. Synchronized file access methods
  4. Performance
    1. Use of multithreaded programming in order to utilize the maximum performance in sensors client and the server.

High Level Architectural Diagram (Physical Diagram[2]).


Requirements

Storm can be deployed on any hardware device which supports the following software requirements.

  1. Mac OSX
  2. Windows 10
  3. Java 1.8
  4. Ubuntu 16.4

Assumptions

  • StormPI  which used to simulate a real world sensor is nearly identical to a real system.
  • On demand weather data of the StormAPP client(monitor) outputs the latest weather update of that particular location, not the history of weather data.
  • Using a file to store registration won’t affect the efficiency of the server.
  • Garbage collector will automatically destroy all daemon threads, if exist any.

Known Issues.

  • Client throws null pointer exceptions when running on fedora linux and ubuntu 16.4

References

[1] ”Object Exportation”, http://www.fitc.unc.edu.ar/javadev/rmi/sequence_diagrams.html#callExec
[2] “Deployment Diagrams Overview”, “http://www.uml-diagrams.org/deployment-diagrams-overview.html

2 comments: