1 / 12

Class Diagram v2

Class Diagram v2. ServerDOATS. ServerIO. ServerManager. ServerSocket. ClientHandler. Socket. StudentData. Class Diagram - Server. ServerDOATS. Constants - None Class Variables - None Instance Variables - None Class Methods void main(String argv[]) Creates and runs a ServerManager

kim
Télécharger la présentation

Class Diagram v2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Class Diagram v2

  2. ServerDOATS ServerIO ServerManager ServerSocket ClientHandler Socket StudentData Class Diagram - Server

  3. ServerDOATS • Constants - None • Class Variables - None • Instance Variables - None • Class Methods • void main(String argv[]) Creates and runs a ServerManager • Instance Methods - None

  4. ServerManager • Constants - None • Class Variables - None • Instance Variables • private HashMap<Integer,StudentData> uncheckedStudents • private int port • private StudentData instructor • Class Methods - None • Instance Methods • ServerManager() create uncheckedStudents, read configuration file, lntiliaze server.mainmenu() • void readConfigurationFile(String fileName) Opens filename and parses the file for configuration values • Map<Integer,StudentData> readStudentList(String filename) Opens filename and parses the file into StudentData objects (Map number => object) • void checkInStudents(HashMap<Integer, StudentData> numbers) Removes the listed numbers from uncheckedStudents • void execute() Then it creates ServerSocket, Creates and runs ClientHandler off of accepted connection

  5. ServerIO • Constants - None • Class Variables - None • Instance Variables - None • Class Methods • String getStudentFile(ServerManager server) Queries user for path to student list • void mainMenu(ServerManager server) Displays main server menu • booldisplayAbsent(HashMap<Integer, StudentData students>) Displays list of students and queries if it should be saved • void saveAbsent(HashMap<Integer, StudentData students>) Saves students back into file • Instance Methods • private ServerIO() This constructor should never be called

  6. ClientHandler • Constants - None • Class Variables - None • Instance Variables • ServerManager manager • Socket socket • BufferedReader input • DataOutputStream output • Class Methods - None • Instance Methods • ClientHandler(ServerManager m, Socket s) Saves m and s in manager and socket and Opens input and output on socket streams • void closeClientHandler() Closes all streams and socket • void execute() Sends instructor, Sends map of students from manager , Waits for response of array of student numbers, Once list is received, Closed connections, Checks in array of student numbers, and Displays list of absent students

  7. StudentData • Constants - None • Class Variables - None • Instance Variables • private int number • private String name • private String password • Class Methods - None • Instance Methods • StudentData(int Number, String Name, String Password) Saves values to appropriate variables • int getNumber() return this.number • String getName() return this.name • String getPassword() return this.password • bool checkPassword(String word) return password.equals(word)

  8. ClientDOATS ClientManager StudentData ClientIO NetworkManager Socket Class Diagram - Client

  9. ClientDOATS • Constants - None • Class Variables - None • Instance Variables - None • Class Methods • void main(String argv[]) Creates a ClientManager • Instance Methods - None

  10. ClientManager • Constants - None • Class Variables - None • Instance Variables • private StudentData instructor • private int hostPort • private String hostName • private HashMap<Integer,StudentData> studentList • private LinkedList<Integer> checkedIn • Class Methods - None • Instance Methods • ClientManager() Reads configuration and Calls ClientIO.mainMenu • void readConfigurationFile(String filename) Opens filename and parses the file for configuration values • void execute() Creates NetworkManager, then gets the instructor and student list (from NetworkManager), runs checkinMenu, adds result to checkedIn until instructor is returned, sends checkedIn, and cleans up

  11. NetworkManager • Constants - None • Class Variables - None • Instance Variables • Socket socket • BufferedReader input • DataOutputStream output • Class Methods - None • Instance Methods • NetworkManager(String hostName, in portNumber) Opens input & output on socket streams and Calls ClientIO.mainmenu() • void closeNetworkManager() Closes all streams and socket • StudentDatagetInstructor() Reads instructor from server and returns it • void sendStudents(LinkedList<Integer> students) Sends checked in students to server • HashMap<Integer, StudentData students> receiveStudents() Gets list of students from server

  12. ClientIO • Constants - None • Class Variables - None • Instance Variables - None • Class Methods • void mainMenu(ClientManager client) Display main menu, calling settingsMenu or client.run() as asked • void settingsMenu(ClientManager client) Prompt and set values in client as needed • int checkInMenu(ClientManager client) Prompt for student id to check in, and calls attemptCheckIn • boolean attemptCheckIn(StudentData student) Gives three tries for password entry and Return true for success and false for fail • Instance Methods • private ClientIO() This constructor should never be used

More Related