-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatDiagram.puml
More file actions
148 lines (146 loc) · 4.69 KB
/
chatDiagram.puml
File metadata and controls
148 lines (146 loc) · 4.69 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
@startuml
class network.ServerSocketThread {
- int port
- int timeout
- ServerSocketThreadListener listener
+ void run()
}
class ru.chat.server.core.SqlClient {
- {static} Connection connection
- {static} Statement statement
~ {static} void connect()
~ {static} void disconnect()
~ {static} String getNickname(String,String)
}
interface network.ServerSocketThreadListener {
~ void onServerStart(ServerSocketThread)
~ void onServerStop(ServerSocketThread)
~ void onServerSockedCreated(ServerSocketThread,ServerSocket)
~ void onServerTimeout(ServerSocketThread,ServerSocket)
~ void onSocketAccepted(ServerSocketThread,ServerSocket,Socket)
~ void onServerException(ServerSocketThread,Throwable)
}
class ru.chat.client.ClientGUI {
- {static} int WINDOW_WIDTH
- {static} int WINDOW_HEIGHT
- JTextArea log
- JPanel panelTop
- JTextField tfIPAddress
- JTextField tfPort
- JCheckBox cbAlwaysOnTop
- JTextField tfLogin
- JPasswordField tfPassword
- JButton btnLogin
- JPanel panelBottom
- JButton btnDisconnect
- JTextField tfMessage
- JButton btnSend
- JList<String> userList
- boolean shownException
- SocketThread socketThread
+ {static} void main(String[])
+ void actionPerformed(ActionEvent)
- void connect()
- void sendMessage()
- void wrtMsgToLogFile(String,String)
- void putLog(String)
+ void showException(Thread,Throwable)
+ void uncaughtException(Thread,Throwable)
+ void onSocketStart(SocketThread,Socket)
+ void onSocketStop(SocketThread)
+ void onSocketReady(SocketThread,Socket)
+ void onReceiveString(SocketThread,Socket,String)
+ void onSocketException(SocketThread,Exception)
}
interface ru.chat.server.core.ChatServerListener {
~ void onChatServerMessage(String)
}
class ru.chat.server.core.ClientThread {
- String nickname
- boolean isAuthorized
+ String getNickname()
+ boolean isAuthorized()
~ void authAccept(String)
~ void authFail()
~ void msgFormatError(String)
}
class ru.chat.server.core.ChatServer {
- ServerSocketThread server
- DateFormat DATE_FORMAT
- Vector<SocketThread> clients
- ChatServerListener listener
+ void start(int)
+ void stop()
- void putLog(String)
+ void onServerStart(ServerSocketThread)
+ void onServerStop(ServerSocketThread)
+ void onServerSockedCreated(ServerSocketThread,ServerSocket)
+ void onServerTimeout(ServerSocketThread,ServerSocket)
+ void onSocketAccepted(ServerSocketThread,ServerSocket,Socket)
+ void onServerException(ServerSocketThread,Throwable)
+ void onSocketStart(SocketThread,Socket)
+ void onSocketStop(SocketThread)
+ void onSocketReady(SocketThread,Socket)
+ void onReceiveString(SocketThread,Socket,String)
- void handleNonAuthMessage(ClientThread,String)
- void handleAuthMessage(ClientThread,String)
- void sendToAllAuthorizedClients(String)
+ void onSocketException(SocketThread,Exception)
}
interface network.SocketThreadListener {
~ void onSocketStart(SocketThread,Socket)
~ void onSocketStop(SocketThread)
~ void onSocketReady(SocketThread,Socket)
~ void onReceiveString(SocketThread,Socket,String)
~ void onSocketException(SocketThread,Exception)
}
class ru.chat.server.gui.ServerGUI {
- {static} int POS_X
- {static} int POS_Y
- {static} int WINDOW_WIDTH
- {static} int WINDOW_HEIGHT
- ChatServer chatServer
- JButton btnStart
- JButton btnStop
- JPanel panelTop
- JTextArea log
+ {static} void main(String[])
+ void actionPerformed(ActionEvent)
+ void uncaughtException(Thread,Throwable)
+ void onChatServerMessage(String)
}
class ru.chat.common.Common {
+ {static} String DELIMITER
+ {static} String AUTH_REQUEST
+ {static} String AUTH_ACCEPT
+ {static} String AUTH_DENIED
+ {static} String MSG_FORMAT_ERROR
+ {static} String TYPE_BROADCAST
+ {static} String getAuthRequest(String,String)
+ {static} String getAuthAccept(String)
+ {static} String getAuthDenied()
+ {static} String getMsgFormatError(String)
+ {static} String getTypeBroadcast(String,String)
}
class network.SocketThread {
- SocketThreadListener listener
- Socket socket
- DataOutputStream out
+ void run()
+ boolean sendMessage(String)
+ void close()
}
network.Thread <|-- network.ServerSocketThread
java.awt.event.ActionListener <|.. ru.chat.client.ClientGUI
ru.chat.client.UncaughtExceptionHandler <|.. ru.chat.client.ClientGUI
network.SocketThreadListener <|.. ru.chat.client.ClientGUI
ru.chat.client.JFrame <|-- ru.chat.client.ClientGUI
network.SocketThread <|-- ru.chat.server.core.ClientThread
network.ServerSocketThreadListener <|.. ru.chat.server.core.ChatServer
network.SocketThreadListener <|.. ru.chat.server.core.ChatServer
java.awt.event.ActionListener <|.. ru.chat.server.gui.ServerGUI
ru.chat.server.gui.UncaughtExceptionHandler <|.. ru.chat.server.gui.ServerGUI
ru.chat.server.core.ChatServerListener <|.. ru.chat.server.gui.ServerGUI
ru.chat.server.gui.JFrame <|-- ru.chat.server.gui.ServerGUI
network.Thread <|-- network.SocketThread
@enduml