-
Notifications
You must be signed in to change notification settings - Fork 0
/
External Documentation.txt
67 lines (49 loc) · 2.06 KB
/
External Documentation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Northwind Server Implementation
We have given a task to build server for the defined protocol "Order3901/1.0" to interact with northwind client to place order.
Restrictions
- Only one client is allowed to interact with server at an instance.
- Server needs to be restarted when client shutdowns.
class
* Server
The main server starting point.
Methods
-> Server
Contructor defining all the required params (like port) to start a server.
-> pullIncomingMessage
Reads the incoming message from socket buffer
* MessageHandler
Processes the incoming message and writes the ouput in the socket buffer.
Methods
-> incomingMessage
Process the incoming message and decodes the header values.
Checks for valid incoming message throws exception if error exists.
-> processBody
Reads the body content based on the header's content-length.
-> performOperation
Checks for valid user before performing any operation.
Performs the given operation and handles the state exceptions.
Handles any operation specific exception cases.
-> WriteOutgoingMessage
Writes the ouput to the ouput socket buffer from which client reads.
-> shutdownConnection
Clears all the user and order details
* MyIdentity
Has username, password and database for identity purpose.
* northwind
Has database operations and computations for northwind.
Methods
-> authenticate
Checks for valid user using lastname and dateofbirth
-> placeOrder
Places the given order; Also checks for any invalid cases and throws exception.
Inserts orderdetails on successfull order placement.
-> listElements
Lists the customer, products and products in the order based on the target
-> checkProduct
Checks whether the product added in current order is valid
* Order
POJO class for storing order details
* Client
POJO class for storing user and session details
References
1) Generate random String of given size in Java. (2018, December 11). Retrieved from https://www.geeksforgeeks.org/generate-random-string-of-given-size-in-java/