class Session
This class maintains information about the chat session between two clients. A pair of clients chatting each maintain a Session object, identifying the session with the same unique sessionId.
attributes
sessionId: Integer
chatBuddyName: String {name of client to which this client established a communication session}
sessionKey: String {key used for encryption of messages for a single session}
startTime: Date
state: String
invariant
sessionId is unique for each client-client session
sessionKey must contain one or more capital letters that have an ASCII value between 65 and 90.
state can have the following values: WAIT_REPLY, ACCEPT_REJECT, CHAT
operation specifications
Any of the attributes can be accessed or modified using get- and set- operations.
Encrypted Chat Room 4_Class Specifications(2)
最新推荐文章于 2018-08-18 14:09:42 发布
博客介绍了Session类,该类用于维护两个客户端间聊天会话信息,每个客户端有一个Session对象且用相同唯一sessionId标识。还说明了其属性,如sessionId、chatBuddyName等,以及不变式和操作规范,可通过get-和set-操作访问或修改属性。
1140

被折叠的 条评论
为什么被折叠?



