WhiteBoard Using RMI
WSU CEG 7370 WhiteBoard Using Java RMI
WbAdmin.java
Go to the documentation of this file.
1 // file: WbAdmin.java by pmateti@wright.edu
2 // This is a "shell" for the WhiteBoard project of CEG 730
3 
4 package WhiteBoard;
5 
6 import java.io.*;
7 import java.util.*;
8 
9 public class WbAdmin {
10 
11  private Vector vServers;
12 
13  private static final String menu = "\nWbAdmin: create a " +
14  "[s]erver, [a]dd client, [q]uery, [t]ransfer, e[x]it";
15 
16  public WbAdmin() {
17  vServers = new Vector();
18  }
19 
20  private void serverCreate() {
21  String args = Invoke.promptAndGet("ServerMachineName");
22  Invoke.javaVM('S', args);
23  }
24 
25  private void addClientReq() {
26  String args = Invoke.promptAndGet("BoardName DisplayOn ServerURL");
27  Invoke.javaVM('C', args);
28  }
29 
30  private void transferReq() {
31  // Transfer a white board to a new server. For you TODO
32  }
33 
34  private void queryReq() {
35  // Query for inforamtion from each server. For you TODO
36  }
37 
38  private void userInteract() {
39  while (true) {
40  String choice = Invoke.promptAndGet(menu);
41  switch (choice.charAt(0)) {
42  case 's': serverCreate(); break;
43  case 'a': addClientReq(); break;
44  case 'q': queryReq(); break;
45  case 't': transferReq(); break;
46  case 'x': System.exit(0); break;
47  }
48  }
49  }
50 
51  public static void main(String[] args) {
52  WbAdmin wa = new WbAdmin();
53  wa.userInteract();
54  }
55 }
56 
57 // -eof-
void addClientReq()
Definition: WbAdmin.java:25
void serverCreate()
Definition: WbAdmin.java:20
void userInteract()
Definition: WbAdmin.java:38
static void main(String[] args)
Definition: WbAdmin.java:51
static final String menu
Definition: WbAdmin.java:13
void transferReq()
Definition: WbAdmin.java:30
Copyright © 2014 www.wright.edu/~pmateti;   thanks to doxygen