Voicenger - Software Design Document
Upcoming SlideShare
Loading in...5
×
 

Voicenger - Software Design Document

on

  • 1,231 views

 

Statistics

Views

Total Views
1,231
Views on SlideShare
1,231
Embed Views
0

Actions

Likes
0
Downloads
17
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Voicenger - Software Design Document Voicenger - Software Design Document Document Transcript

  • POLITEHNICA University of Bucharest, Romania Computer Science Department Voicenger Software Design Document Final version: 16th May 2010Prepared by: Supervisor:Andreica Cristian Egner AlexandruGoge Oana-AlinaPetre Vlad-StefanSerbanescu Vlad-Nicolae
  • Voicenger - Software Design Document Table of Contents1 Technologies Used ............................................................................................................... 1 1.1 Context ..................................................................................................................................................1 1.2 Requirements .........................................................................................................................................1 1.3 Application Structure ............................................................................................................................1 1.4 Client Component..................................................................................................................................2 1.4.1 UI (User Interface) ........................................................................................................................ 2 1.4.2 Peer Communication Interface (networking) ................................................................................ 3 1.4.3 Server communication Interface (profile storage) ......................................................................... 3 1.5 Server Component .................................................................................................................................3 1.6 Database Storage ...................................................................................................................................3 1.7 External Libraries ..................................................................................................................................3 1.8 Development Environment....................................................................................................................42 High Level Modules .............................................................................................................. 5 2.1 GUI/ GUI Controller .............................................................................................................................5 2.2 File Processor/ File Packager ................................................................................................................5 2.3 Sound .....................................................................................................................................................6 2.4 String Processing ...................................................................................................................................6 2.5 Message Renderer .................................................................................................................................6 2.6 JXTA Peer .............................................................................................................................................6 2.7 JXTA Server ..........................................................................................................................................7 2.8 Database ................................................................................................................................................7 2.9 Twitter/Facebook Server .......................................................................................................................73 Use Cases .............................................................................................................................. 8 3.1 Register..................................................................................................................................................8 3.2 Log In ....................................................................................................................................................8 3.3 Log Out .................................................................................................................................................8 3.4 Add a Friend ..........................................................................................................................................8 3.5 Delete a Friend ......................................................................................................................................9 3.6 Ignore a Friend ......................................................................................................................................9 3.7 Edit Profile ............................................................................................................................................9 3.8 One-on-One Chat ..................................................................................................................................9 3.9 Call a Friend ........................................................................................................................................10 3.10 Initiate a Conference Chat ...................................................................................................................10 3.11 Set a Discussion Topic ........................................................................................................................10 3.12 Create a Poll inside a Conference ........................................................................................................10 3.13 Send a File ...........................................................................................................................................11 3.14 Add a Textual Image ...........................................................................................................................11 3.15 Tagging while in Conference ..............................................................................................................11 3.16 Update Facebook Status ......................................................................................................................11 3.17 Update Twitter Status ..........................................................................................................................114 Appendices .......................................................................................................................... 12 4.1 Data Send ............................................................................................................................................12 4.2 Data Receive........................................................................................................................................13 4.3 Server Communication ........................................................................................................................14 4.4 Message Renderer ...............................................................................................................................15 I
  • Voicenger - Software Design Document1 Technologies Used1.1 ContextVoicenger is a software application which solves the problem of taking decisions inside groups offriends. It wants to offer a structured mean of communication, where the conference is topic-based,focused on planning and delivering results to the whole decision process. The functionality ofVoicenger is split into several components and features, all designed to ensure an accurate,structured and efficient application for discussing and sharing ideas and plans in an organized andeasy to use environment.This application combines the features of websites used for socializing and entertainment with thebenefits of a chat and voice application. This will increase efficiency in a chat environment. It willprovide features based on intuition that will help users to logically structure the discussion whenengaged in a conference window, to easily debate on a subject and quickly take decisions.1.2 RequirementsVoicenger is designed as a communication tool for groups of people. A minimum viable productshould allow the users to chat, both using text messages and voice. The conversation can be easilyenriched if we add features like polling and tagging inside conferences, textual imaging & file sendoperations.Each user has its own profile, that should be persisted between different logins.1.3 Application StructureThe decision for which application structure to opt for, client-server architecture vs peer-to-peerarchitecture was heavily influenced by the performances need of the application. Voicenger must beable to allow its users to talk with each other at a very high quality.A client-server architecture means higher load on the server component. In order to manage highvoice data throughput, the hardware requirements would include an extreme server machine withGigabit Ethernet connection with no traffic restrictions whatsoever.A peer-to-peer architecture eases the server load, by charging the client machines. Nowadays, theusual applications that run on a computer hardly turn its workload to 50% of the capacity, whichmeans an extra 5% is barely visible. The disadvantage of such frameworks is that some computersare not accessible into public networks, due to NAT or proxy situations.For choosing the best option, we couldnt allow either a full client-server architecture, neither a fullpeer-to-peer architecture. The current approach is to use a peer-to-peer architecture for managingfull intensive traffic operations, such as voice data transfer, but to use a centralized authority forstoring user profiles and other persistent data. Page 1 of 15
  • Voicenger - Software Design Document1.4 Client ComponentEach client application is seen as part of the peer-to-peer architecture.Structure:  UI (user interface);  Peer Communication Interface (networking);  Server Communication Interface (profile storage).1.4.1 UI (User Interface)The client application is entirely developed in Java programming language, which benefits from itshigh-level object-oriented approach. For visual components and user interaction, we used Swing,the widget toolkit from SUN which is integrated into the SDK.Documentation on each of the Swing components used or any of the layout managers can be foundat http://java.sun.com/docs/books/tutorial/uiswing/. Page 2 of 15
  • Voicenger - Software Design Document1.4.2 Peer Communication Interface (networking)JXTA (Juxtapose) is an open-source peer-to-peer protocol specification begun by SunMicrosystems in 2001. The JXTA protocols are defined as a set of XML messages which allow anydevice connected to a network to exchange messages and collaborate independently of theunderlying network topology.As JXTA is based upon a set of open XML protocols, it can be implemented in any moderncomputer language. Implementations are currently available for Java SE,C/C++, C# and Java ME.Voicenger uses a Java implementation for the JXTA protocol. This allows the application to easilyresolve network problems such as bypassing NAT or proxy communication.The JXTA implementation and documentation can be found at https://jxta.dev.java.net/.1.4.3 Server communication Interface (profile storage)The server component in Voicenger is also a peer in the peer-to-peer architecture. Thus, thecommunication between client-server is resolved using JXTA protocol.1.5 Server ComponentBesides from being a peer in the JXTA protocol, the server components must handle all the user-profiles. For internal storage, we used MySQL database system, which is open-source, publishedunder the GPL license.1.6 Database StorageMySQL is a relational database management system (RDBMS) that runs as a server providingmulti-user access to a number of databases. Voicenger uses MySQL databases for storinginformation related to user profiles, friends, statuses or any persistent data.1.7 External LibrariesVoicenger uses 2 external libraries:  a MySQL connector, that allows the application to query SQL commands into the database;  the JXTA implementation in Java, so that we solve peer-to-peer network problems (NAT, proxy).The MySQL connector library can be downloadedfrom http://www.mysql.com/products/connector/. Page 3 of 15
  • Voicenger - Software Design Document1.8 Development EnvironmentThe primary IDE we use is Eclipse 3.5. All the members of our team have had many experienceswith this IDE, being proven as the most efficient in collaborative environments. Page 4 of 15
  • Voicenger - Software Design Document2 High Level Modules2.1 GUI/ GUI ControllerRole: The GUI provides the user interface for using the Voicenger application. It contains all thecomponents for voice communication, sending text messages or files of any type.The GUI controller receives data in the form of a Message on its components and determines thetab it displays the message or file send request according to the ArrayList field of the message(there can only be one voice connection at any time so there no need to determine from where avoice message is received).As its role is to provide a user interfaces the GUI solely depends on the actions of the user.The GUI controller depends on the JXTA peer module to deliver data in the form of Messages sendvia the peer-to-peer connection.The following modules depend on GUI:  The File Processor/File Packager module receives the selected file in the GUI when the "SendFileButton" component of the GUI is pressed;  The String Processing module refers to the data introduced in the "TextBox" component of the GUI;  The Sound module depends on the "SoundPanel" component of the GUI.The following modules depend on the GUI controller:  The File Process/File Packager module receives the input file from the GUI controller;  The Sound module receives input sound from the GUI controller.2.2 File Processor/ File PackagerRole: The File Processor/File Packager splits files into chunks of data to form Messages that aresent using the Queue Interface repackages data into the original file and manages multiple filesThis module depends on:  The GUI module that sends files selected by the user;  The GUI controller that sends chunks of data that form a file.The following modules depend on the File Processor/File Packaging module:  The JXTA peer module receives the chunks of data in the form of Messages. Page 5 of 15
  • Voicenger - Software Design Document2.3 SoundRole: This module processes sound into/from a Message and sends it using the Queue Interface.This module depends on:  The "SoundPanel" component of the GUI;  The GUI controller that sends input sound in the form of a Message.The following modules depend on the File Processor/File Packaging module:  The JXTA peer module receives the output sound in the form of a Message.2.4 String ProcessingRole: This module processes normal text into a Message and sends it using the Queue Interface.This module depends on:  The "TextBox" component of the GUI;  The GUI controller that sends text in the form of a Message.The following modules depend on the File Processor/File Packaging module:  The JXTA peer module receives the text in the form of a Message.2.5 Message RendererRole: This module is used to process data in the form of a Message and parse elements such aspictures, HTML text or status updates.This module depends on the JXTA peer module from which it receives data in the form of aMessage.The only module that depend on it is the GUI to which it sends the parsed output.2.6 JXTA PeerRole: The JXTA Peer module has multiple roles such as:  Establishing a peer-to-peer connnection with other peers;  Taking data in the form of a Message using the Queue Interface;  Determining the destination of the Message and sending it via the peer-to-peer connection.  Receiving data from other peers;  Passing data to the GUI controller.The JXTA peer module depends on:  Other JXTA peer modules with which it has established a connection;  The JXTA server module that signal any actions taken by clients that concern it; Page 6 of 15
  • Voicenger - Software Design Document  The File Processor/File Packaging module from which it receives split files as Messages through the Queue Interface;  The Sound Module from which it receives output sound in the form of a Message using the Queue Interface;  The String Processing module that sends processed text through the Queue Interface.The following modules depend on the JXTA peer module:  Other JXTA peer modules that have an established connection;  The JXTA server that is frequently notified of a new connection, a client exit, profile changes, changes to a clients contact list or a "keep alive" acknowledgement signal;  The Message Renderer that receives Messages containing special elements that need to be parsed.2.7 JXTA ServerRole: The JXTA server module notifies clients of new connections, exits and provides a list ofupdated profiles to any client.The JXTA server module depends on:  The Database module from which it gets all the necessary data to fulfil its role.  The JXTA peer modules that notify the server of actions such as connecting, exiting, or status and contact list changes.The following modules depend on the JXTA server module:  The Database module from which undergoes the latest changes made by the server;  The JXTA peer modules that are notified by the server of actions that concern them.2.8 DatabaseRole: The Database stores and provides important data in a fast and secure way.The Database only exchanges data only with the JXTA server, thus it is the only module it dependson, and the only module that depends on it.2.9 Twitter/Facebook ServerRole: The Twitter/Facebook Server post messages that it receives from clients on their respectiveaccounts of either website.This module does not depend on any other module.No other module depends in any way on this module. Page 7 of 15
  • Voicenger - Software Design Document3 Use CasesIn order to better understand the mechanics behind the use cases, we recommend reviewing theAppendices section.3.1 RegisterWhen a user registers (in order to use the application), the information that is filed in the textbox isfrom the GUI component to the String Processing component and then to the Queue Interface(p2p) component. From here, the information is sent over the network from the JXTA Peer entityto the JXTA Server entity. The server does some checkups, and if everything is ok, it adds the datainto the Database and sends back to the JXTA Peer entity a confirmation message. Once theconfirmation message is received by the JXTA Peer entity, the network component inside theJXTA Peer entity sends the confirmation to the GUI Controller component, granting the useraccess to all available functions.3.2 Log InWhen the user logs in to the system, he fills a username and a password in the corresponding textfields in the GUI component. By hitting submit, this information is passed to the String Processingcomponent and then to the Queue Interface (p2p) component. From here, the information leavesthe JXTA Peer entity, and travels over the network infrastructure to the JXTA Server entity. Theserver queries the database, in order to establish whether this is a correct login or just a failedattempt. The JXTA Server sends back to the JXTA Peer a corresponding message. Back in to theJXTA Peer entity, the message is sent to the GUI Controller which displays an error message in aTextbox, whether the login failed; or it displays a success message and grants access to the user toall available functions.3.3 Log OutWhen the user logs out from the system, he must click on the Log Out button. By doing this, theaction is sent from the GUI component of the JXTA Peer entity to the Queue Interface (p2p).From here, the action passes from the JXTA Peer to the JXTA Server over the network. Theserver marks the user as being logged out and sends a message to all other online friends of thisuser, announcing that he has gone offline. These other JXTA Peers receive the message over thenetwork. After receiving the message, each JXTA Peer sends it to their GUI Controllercomponent.3.4 Add a FriendWhen a user wants to add a new friend in his friends list, he inputs the username of the new friendin a textbox field, and clicks on Add New Friend button. After clicking the button, the username issent from the GUI component to the Queue Interface component, and after this it is sent over thenetwork from the JXTA Peer entity to the JXTA Server entity. The server checks wheter theinputted username exists within the Database, and if so, it updates some database informationregarding these two users, and then sends a confirmation message to the JXTA Peer. The JXTAPeer receives the message and sends it to the GUI Controller component. Page 8 of 15
  • Voicenger - Software Design Document3.5 Delete a FriendWhen a user deletes a friend from his friends list, an informational message is sent to the server. Itpasses from the GUI component through the String Processing component to the Queue Interfacecomponent inside the JXTA Peer entity. From here, the message is sent over the network to theJXTA Server entity. Once the server gets the message, it updates the Database, and then sends anacknowledgement message back to the JXTA Peer.3.6 Ignore a FriendWhen a user ignores a friend from his friends list, an informational message is sent to the server. Itpasses from the GUI component through the String Processing component to the Queue Interfacecomponent inside the JXTA Peer entity. From here, the message is sent over the network to theJXTA Server entity. Once the server gets the message, it updates the Database, and then sends anacknowledgement message back to the JXTA Peer.3.7 Edit ProfileWhen a user edits its profile information, several messages are sent the server announcing thechanges. The messages pass from several Textboxes inside the GUI component through the StringProcessing component to the Queue Interface component inside the JXTA Peer entity. Fromhere, the messages are sent over the network to the JXTA Server entity. Once the server gets themessages, it updates the Database, and then sends an acknowledgement message back to the JXTAPeer.3.8 One-on-One ChatWhen a user initiates a one-on-one chat with another user, an action is initiated from inside the GUIcomponent that passes through the String Processing and goes to the Queue Interface. From here,a message is sent to the other JXTA Peer entity. The other JXTA Peer entity receives the messagethrough JXTA and passes the message to the GUI Controller component. If everything is ok, andthe chat session can be initiated, an acknowledgement message is sent back to the initial JXTAPeer. The initial JXTA Peer receives the message, and starts a conversation tab inside the GUIcomponent.Every message a users writes in the Textbox and sent to the other user, passes from the GUIcomponent, through the String Processing component and then to the Queue Interface. From theQueue Interface, the message passes over the network to the other JXTA Peer entity. The otherJXTA Peer entity receives the message and sends it to its GUI Controller component. Thisprocess is bidirectional. Page 9 of 15
  • Voicenger - Software Design Document3.9 Call a FriendWhen a user calls a friend, an initial message is sent to the other user. If everything is ok, the otherpeer replies with an acknowledgement message and the connection is established. After this, all thesound that is recorded from the microphone in peer A, is send to the FileProcesor component. Thiscomponent splits the sound data in chunks, and then sends those chunks to the Queue Interface.From the Queue Interface, the chunks are sent through the network, to the other JXTA Peer. Theother peer receives those chunks of sound, and sends them to its GUI Controller component. Fromthe GUI Controller, the chunks are sent to the Sound component, which plays the received sound.This process is bidirectional.3.10 Initiate a Conference ChatWhen a user initiates a conference chat with several other users, an action is initiated from insidethe GUI component that passes through the String Processing and goes to the Queue Interface.From here, a message is sent to the all other JXTA Peer entities. The other JXTA Peer entitiesreceive the message through JXTA and pass the message to their respective GUI Controllercomponent. If everything is ok, and the chat session can be initiated, an acknowledgement messageis sent back to the initial JXTA Peer. The initial JXTA Peer receives the message, and starts aconversation tab inside the GUI component.Every message a users writes in the Textbox and sent to all other user, passes from the GUIcomponent, through the String Processing component and then to the Queue Interface. From theQueue Interface, the message passes over the network to all other JXTA Peer entities. The otherJXTA Peer entities receive the message and send it to their respective GUI Controller component.This process is bidirectional.3.11 Set a Discussion TopicWhen a sets a discussion topic inside a chat tab, an action is initiated from inside the GUIcomponent that passes through the String Processing and goes to the Queue Interface. From here,a message with the new discussion topic is sent to the other JXTA Peer entity. The other JXTAPeer entity receives the message through JXTA and passes the message to the GUI Controllercomponent. If everything is ok, an acknowledgement message is sent back to the initial JXTAPeer.3.12 Create a Poll inside a ConferenceWhen a user initiates a poll inside a conference chat with several other users, an action is initiatedfrom inside the GUI component that passes through the String Processing and goes to the QueueInterface. From here, a message with the poll options is sent to the all other JXTA Peer entities.The other JXTA Peer entities receive the message through JXTA and pass the message to theirrespective GUI Controller component. If everything is ok, an acknowledgement message is sentback to the initial JXTA Peer. Page 10 of 15
  • Voicenger - Software Design Document3.13 Send a FileWhen a user sends a file to a friend, the file is sent from the GUI component to the FileProcessorcomponent that splits the file in chunks. These chunks are then sent to the Queue Interface. Fromthe Queue Interface, the chunks are sent through the network, to the other JXTA Peer. The otherpeer receives those chunks, and sends them to its GUI Controller component. From the GUIController, the chunks are sent to the FilePackager component, which saves the received file. Thisprocess is bidirectional.3.14 Add a Textual ImageWhen a user adds a textual image to a conference chat, the image is sent from the GUI componentto the FileProcessor component that splits the file in chunks. These chunks are then sent to theQueue Interface. From the Queue Interface, the chunks are sent through the network, to the allothers JXTA Peer entities. The other peers receive those chunks, and send them to their respectiveGUI Controller component. From the GUI Controller, the chunks are sent to the FilePackagercomponent, and then are displayed in the chat window.3.15 Tagging while in ConferenceWhen a user uses tags inside a conference chat with several other users, an action is initiated frominside the GUI component that passes through the String Processing and goes to the QueueInterface. From here, a message regarding the tag is sent to the all other JXTA Peer entities. Theother JXTA Peer entities receive the message through JXTA and pass the message to theirrespective GUI Controller component. If everything is ok, an acknowledgement message is sentback to the initial JXTA Peer.3.16 Update Facebook StatusEach JXTA Peer can call the Facebook API over the internet, if the user has correctly inputted ausername and a password, and wants to update his Facebook status account. The API calling isactually a HTTP POST message.3.17 Update Twitter StatusEach JXTA Peer can call the Twitter API over the internet, if the user has correctly inputted ausername and a password, and wants to update his Twitter status account. The API calling isactually a HTTP POST message. Page 11 of 15
  • Voicenger - Software Design Document4 Appendices4.1 Data Send Page 12 of 15
  • Voicenger - Software Design Document4.2 Data Receive Page 13 of 15
  • Voicenger - Software Design Document4.3 Server Communication Page 14 of 15
  • Voicenger - Software Design Document4.4 Message Renderer Page 15 of 15