one.box distributed home service interface. core components pop3 client router storage pop3 server
Post on 20-Dec-2015
231 views
TRANSCRIPT
![Page 1: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/1.jpg)
one.box
Distributed home service interface
![Page 2: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/2.jpg)
Core Components
• Pop3 client
• Router
• Storage
• Pop3 Server
![Page 3: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/3.jpg)
Pop3 Client and Server
• Client pulls email off Pop3 servers (yahoo.com, sumatra, etc)
• Server allows outside (of one.box network) access to email
![Page 4: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/4.jpg)
Router
• Directs email from the Pop3 client or any other internal client.
• Human readable message is stored in user’s inbox.
• Control message is sent to the recipient service or is left in the service’s undelivered tuple.
![Page 5: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/5.jpg)
Storage
• Configuration
• State
![Page 6: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/6.jpg)
Jini
• Java framework for distributed applications
• rmi (synchronous)
• Provides lookup, discovery, join, activation, lease management, remote events, javaspaces, etc
![Page 7: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/7.jpg)
Services (Fridge)
• Fridge is the only service
• Keeps track of contents
• Calculates grocery list
• Sends and receives email
![Page 8: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/8.jpg)
Setup
• Register new users
• Allow users to add, delete, or update email accounts
• Setup once
![Page 9: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/9.jpg)
Setup Features
• Remote events.
• Simple GUI, allows for easy account management.
![Page 10: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/10.jpg)
Pop3 Client Features
• Separate thread for each email account.
• Reconnects to server whenever time interval has elapsed.
• Email notifications in case of error.
![Page 11: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/11.jpg)
Storage Features
• Tuples (TSpaces by IBM)
• Hierarchal naming structure
• Leasing
• Locks
• Automatic lease management
![Page 12: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/12.jpg)
Normal Operation
• Pop3 client polls Pop3 server for new email
• Sends email to Router
• Router directs email accordingly
![Page 13: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/13.jpg)
![Page 14: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/14.jpg)
Router Down
• Pop3 client will store undelivered email in storage
![Page 15: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/15.jpg)
![Page 16: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/16.jpg)
Router Back Up
• Router looks in storage for undelivered messages
• Delivers email accordingly
![Page 17: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/17.jpg)
![Page 18: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/18.jpg)
Activation
• Activation makes things more resilient.
• Makes restarts simpler.
• …in theory…
![Page 19: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/19.jpg)
Bad Things
• Activation (rmid)
• Why’s that service still up (lease, log)
• Tough to debug and test (inherent with distributed application paradigm?)
• Synchronous
![Page 20: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/20.jpg)
Good Things
• Develop components normally, then jinify
• A lot of services already provided (lookup, discovery, etc.)
• Once a jini service is working, it’s very easy to use
![Page 21: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/21.jpg)
One.world
• More distributed components
• Printer service
• Scheme configurable service components
• We have cooler stuff– But Jini team stuff works better (for now)
![Page 22: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/22.jpg)
pop3 server(yahoo.com)
fiji
dc's monitor awong's monitor kde's monitor kt's monitor
rosenritter
Router
Filter
Fridge
dc's inboxawong's inboxkde's inbox
Printer
kt's inbox
Pop3 Server
Email ClientEmail Client
one.world
Auth
![Page 23: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/23.jpg)
Auth
• Keeps track of users in the system
• Keeps track of the various authentication information– Data for contacting external pop3 servers
• Centralized place to store this data– Not a secure solution
![Page 24: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/24.jpg)
Monitor(Pop3 Client)
• Collects email from external Pop3 servers
• Each monitor serves a different user in the system
![Page 25: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/25.jpg)
Filter
• Directs email from the Monitor
• Human readable or control message?
![Page 26: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/26.jpg)
Router
• Gets control message from filter
• Finds the service control message is intended for
![Page 27: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/27.jpg)
Inbox
• Holds all the users email data
• Uses checkpoint– Movable too (but not implemented)
• Data is never deleted
![Page 28: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/28.jpg)
Pop3Server
• Used to communicate with email clients
• Hardest component to implement– Delete messages here– Distributed state– Mixture of messaging style
• Asynchronous with rest of one.box
• Synchronous with email clients
![Page 29: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/29.jpg)
ServiceComponent
• External services implement this interface
• Scheme configurable
• Printer is a ServiceComponent
![Page 30: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/30.jpg)
Normal Operation
• Monitor To Filter
• Filter Checks Message– If Control Message Send to Router
• Router sends To Appropriate Service
– If Email Send to Inbox• Inbox Stores the Email
![Page 31: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/31.jpg)
Normal Operation (2)
• Service Processes Control Message– Printer
• Pop3Server polls the Inboxes– Downloaded to itself– Serves it to connecting email clients
![Page 32: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/32.jpg)
Good & Bad Things
• Asynchronous events – Pop3Server– Everything else
• Discovery
• Transparency
![Page 33: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/33.jpg)
Bad Things
• Synchronization/Threading complexities
• Interaction with Swing
• Harder to one.worldize – ServiceComponent is our solution for one.box
![Page 34: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/34.jpg)
Good Things
• Integrated System
• Structured IO
• Code and Data is shared
![Page 35: One.box Distributed home service interface. Core Components Pop3 client Router Storage Pop3 Server](https://reader036.vdocument.in/reader036/viewer/2022062320/56649d415503460f94a1c4f5/html5/thumbnails/35.jpg)
Future Work
• Stability
• OneBox/Mover/WatchDog
• New Patterns/Refactoring
• Better Setup Tools
• Integration with Other Systems