Software Requirement Specification: Publish/Subscribe System Bkground
Software Requirement Specification: Publish/Subscribe System Bkground
Software Requirement
Specification
Publish/Subscribe System
BKGROUND
Group-03
1
SRS BKGROUND
Table of Content
1. Introduction
1.1 Purpose............................................................................................... 4
1.2 Motivation............................................................................................ 4
1.3 Scope.................................................................................................. 4
1.4 Glossary............................................................................................... 4
1.5 Overview.............................................................................................. 4
2. Overall Description
2.1 Product Perspective
2.1.1 System Interface........................................................................ 6
2.1.2 User interface............................................................................ 7
2.1.3 Hardware Interface..................................................................... 7
2.1.4 Software Interface...................................................................... 7
2.1.5 Communication Interfaces.......................................................... 8
2.1.6 Memory Constraints................................................................... 8
2.1.7 Operations…............................................................................. 8
2.2 Product Functions
2.2.1 Context Diagram....................................................................... 9
2.2.2 Use Case Diagram................................................................... 10
2.2.3 Application Features…............................................................... 11
2.3 User Characteristics.......................................................................... 11
2.4 Constraints........................................................................................ 11
2.5 Assumptions and Dependencies....................................................... 11
3. Specific Requirements
3.1 External interface
3.1.1 Terminal Client Interface.............................................................. 12
3.1.2 User Management Interface......................................................... 13
3.1.3 Account Creation......................................................................... 13
3.2 Functional Requirements
3.3.1 System Management................................................................. 14
3.3.2 System Monitoring..................................................................... 14
3.3.3 Account Creation.................................................................... 15
3.3.4 Account Removal...................................................................... 16
3.3.5 Session Creation/Authorisation................................................... 17
3.3.5 Message Sending ..................................................................... 17
3.3 Performance Requirements............................................................... 19
3.4 Logical Database Requirements........................................................ 20
2
SRS BKGROUND
3
SRS BKGROUND
1.0. Introduction
1.1. Purpose
The purpose of this document is to present a detailed description of a
publish/subscribe system, BKGROUND. It will explain the purpose and features of the
system, the interfaces of the system, what the system will do, the constraints under
which it must operate and how the system will react to external stimuli. This document is
intended for both the stakeholders and the developers of the system.
1.4. Glossary
Java NIO: Java New I/O, usually called NIO, is a collection of Java programming
language APIs that offer features for intensive I/O operations
Pub/Sub: A publish subscribe system that delivers messages to a large group of users
subscribed to a particular topic
Middleware: Middleware is computer software that connects software components or
some people and their applications
Admin User: Administrator of the system
4
SRS BKGROUND
Terminal User: The subscribing user who will receive the messages and broadcast
messages to specific rooms with permissions
1.5. Overview
The next chapter, the Overall Description section, of this document gives an overview of
the functionality of our system BKGROUND. It describes the informal requirements and
is used to establish a context for the technical requirements specification in the next
chapter.
The third chapter, Requirements Specification, of this document is written primarily for
the developers and describes in technical terms the details of the functionality of the
system.
Both sections of the document describe the same software system in its entirety,
But are intended for different audiences and thus use different language.
5
SRS BKGROUND
6
SRS BKGROUND
7
SRS BKGROUND
2.1.7. Operations
1. Terminal User Operations
● Create a new account - The user should be able to link existing third party
accounts with his existing account, or create a new account in BKGROUND,
using username and password as credentials.
● Manage Sessions - The user should be able to disconnect any existing session
remotely, if he can’t logout from the session from the Terminal Client.
● Authorize Persistent Socket - The user has to authorize himself on starting a new
connection on a terminal server, using a service name, with his secret key
(OAuth 2, in case of third party authorization). The user with this secret key must
be already registered on the system.
● Send Message - The user can send message to another user, or a pub/sub room
(if he has publishing permissions for the room).
8
SRS BKGROUND
and messages sent to him directly. The client can have multiple simultaneous sessions,
so that any message that is sent to him is received on all devices connected using his
credentials.
Figure 2.2.1.1
9
SRS BKGROUND
Figure 2.2.2.1
Figure 2.2.2.2
10
SRS BKGROUND
2.4 Constraints
The major constraints in this project would be the availability of hardware. Decent
amount of hardware is needed for the testing of BKGROUND.
11
SRS BKGROUND
12
SRS BKGROUND
database temporarily (only if the message is directly targeted for the user, and
not targeted for a room).
13
SRS BKGROUND
Introduction: Allow the system administrator to manage the system. This includes
upgrading a particular server with another server, add/remove new set of servers to any
layer and controlling the connections of a server in any layer to servers of the next layer.
Post-Conditions: The action specified by the admin is performed and the system state
is updated accordingly.
Introduction: Allow the system administrator to monitor the state of the system. This
includes monitoring any server / layer etc.
Post-Conditions: The data asked by the system admin is provided to him through the
same web-based interface.
14
SRS BKGROUND
● The data asked by the admin about any server / layer is passed on to the admin
through the web based monitoring system.
15
SRS BKGROUND
Pre-Conditions: None.
Basic Flow:
Action starts when a new user wants to create an account with BKGROUND.
● The Terminal user issues a request to create a new account with BKGROUND
with user credentials.
● BKGROUND adds the new user to the registered users database.
● BKGROUND acknowledges the user that a new account has been created.
Alternate Flow:
● User Already Registered
If the user is already registered with the system BKGROUND send the user
acknowledgement that the account is already registered with system state
unchanged.
● Registration failure
If the registration fails in between due to any reason then BKGROUND will tell
the user about registration failure and simply ask him to register again.
Basic Flow:
Action starts when a new user wants to delete his account from BKGROUND.
● The Terminal user issues a request to delete his account from BKGROUND.
● BKGROUND asks the user for user credentials to verify the actual user.
● The User provides the asked user credentials to verify his/her account.
● BKGROUND authenticates the user and delete his account from the system.
16
SRS BKGROUND
Alternate Flow:
● User Not Registered
If the user is not registered with the system the authentication will fail and
BKGROUND will send the acknowledgement that the account is not registered
with BKGROUND leaving system state unchanged.
● Account deletion failure
If the account deletion process fails in between due to any reason then
BKGROUND will tell the user about process failure and simply ask him to restart
the process again.
Figure 3.2.4
3.2.5 Use Case: Session Creation/Authorization
Basic Flow:
Action starts when a new user wants to connect to BKGROUND.
17
SRS BKGROUND
● The Terminal user issues a request to create a new session with BKGROUND.
● BKGROUND asks the user for user credentials to verify the actual user.
● The User provides the asked user credentials to verify his/her account.
● BKGROUND authenticates the user and establishes a new session with the
system by creating a new TCP connection with the user through one of the
terminal servers.
Alternate Flow:
● User Not Registered
If the user is not registered with the system the authentication will fail and
BKGROUND will send the acknowledgement that the account is not registered
with BKGROUND leaving system state unchanged.
● Session creation failure
If the session creation fails in between due to any other reason then
BKGROUND will close the sockets opened to connect to the user to free any
stale used resources.
Basic Flow:
Action starts when a connected user sends a message to be broadcast on a room.
● The Terminal User sends a message, along with the intended target.
● BKGROUND checks if the sender is authorized to publish the message in the
given room, and publishes the message in the room accordingly.
Alternate Flow:
● Intended target is another user
BKGROUND checks if the sender has permissions to send the message to the
intended recipient user, and sends the direct message accordingly.
● Intended target is not present
BKGROUND will discard the message altogether.
18
SRS BKGROUND
Figure 3.2.6
19
SRS BKGROUND
● For the process of authorisation at the terminal server, we need to store the user
ID and the corresponding secret key for all the registered users.
● When a new user is registered, we need to add to database the new user ID and
its secret key.
● For a particular user, we need to create columns for the different accounts which
user could be using with our system.
● For each account, we need to store the login credential, which may be of
following forms:
○ Username and password in case of a simple account(not using OAuth).
○ Username, appID, and secret authorisation key in case of services which
using OAuth 2.0 such as Google, Facebook, and Twitter.
● For the case, when the user is not connected to the terminal server, we may
need to store the message that is needed to be sent.
● The information about all the devices connected to a specific account is also
needed to be stored in a database.
● The internal information about the different server will be stored. This will include
the IP address of different machines, category (Terminal server, data forwarding
layer, Data processing layer), and virtual ID of the machine.
● The message history of each room will also be saved in a database.
● Message history storage will not be done on the system in case of the direct
messages. In this case, the history will be saved on the client side, so that it is
available to the user.
● A table for different rooms will also be present. This table will contain all the
necessary room-related information such as room administration, room
members, room status messages, etc.
3.6.1 Reliability
Any message that is sent to the user has to be necessarily received by the user
(provided that the user is connected). If the user is not connected then he may only
receive the messages published to rooms instead of direct messages sent to him.
20
SRS BKGROUND
3.6.2 Availability
The terminal users are supposed to maintain a persistent TCP socket connection with
Terminal Servers, and the servers may receive messages to broadcast at any time. So,
the complete system must be up and running always. Any upgrades to the system
should have zero downtime.
3.6.3 Security
The system must make sure that the users who are broadcasting messages to the
rooms have publishing permissions for the room. If the user is sending a direct message
to another user, he must have permissions to send direct messages to that user.
3.6.4 Maintainability
The system has to provide an administrative interface so the layers can be connected
with each other. The system should also allow upgrading with minimum downtime (for
Terminal Servers), and zero downtime for other servers.
3.6.5 Portability
Portability is not a requirement of this system, as the system is to be deployed once on
any machine that can support Java.
21