diff --git a/examples/src/TcpExamples/TcpExample2ConnectionCounting.java b/examples/src/TcpExamples/TcpExample2ConnectionCounting.java index 56226695ffacbe0ed0b3437978dc591c1dfb1771..785df6e1cbfda81291eb13e5990d43417f9b5dce 100644 --- a/examples/src/TcpExamples/TcpExample2ConnectionCounting.java +++ b/examples/src/TcpExamples/TcpExample2ConnectionCounting.java @@ -5,7 +5,7 @@ import java.net.*; /** * <p> - * This program is only slightly more complex than {@link TcpExample1Telnet}, + * This program is only slightly more complex than {@link TcpExamples.TcpExample1Telnet}, * counting each connection instead of immediately exiting after the first connection. * The only thing this program does differently is introduce a loop into the response, * so you don't have to restart the program after one response. diff --git a/examples/src/TcpExamples/TcpExample3Client.java b/examples/src/TcpExamples/TcpExample3Client.java index 527f9ce2ddd16438dae8f742123bc2cd664bc928..d15171ddd5c1339dc9877ee47f0d9098da42b7c5 100644 --- a/examples/src/TcpExamples/TcpExample3Client.java +++ b/examples/src/TcpExamples/TcpExample3Client.java @@ -6,7 +6,7 @@ import java.net.*; /** * <p> * This program duplicates what happened when telnet (or nc) was invoked in prior examples, - * directly connecting to an already-running {@link TcpExample3Server}. + * directly connecting to an already-running {@link TcpExamples.TcpExample3Server}. * In prior examples, we used telnet (or netcat) to connect to the server application. * In this example, we are now writing our own program to make the socket connection. * </p> diff --git a/examples/src/TcpExamples/TcpExample3Server.java b/examples/src/TcpExamples/TcpExample3Server.java index 016480d7c0c1d33a6614c8817a1269c512a2e77f..6a3a83d77a97e27c5372a8ab2b29f9c0c443f8f5 100644 --- a/examples/src/TcpExamples/TcpExample3Server.java +++ b/examples/src/TcpExamples/TcpExample3Server.java @@ -5,8 +5,8 @@ import java.net.*; /** * <p> - * This program is only slightly more complex than {@link TcpExample1Telnet} - * and {@link TcpExample2ConnectionCounting}, awaiting a socket response. + * This program is only slightly more complex than {@link TcpExamples.TcpExample1Telnet} + * and {@link TcpExamples.TcpExample2ConnectionCounting}, awaiting a socket response. * The only thing it does differently is introduce a loop into the response, so * you don't have to restart the program after one response. Also, it prints out * the socket pair the server sees. Run the program via telnet (or nc) diff --git a/examples/src/TcpExamples/TcpExample4Client.java b/examples/src/TcpExamples/TcpExample4Client.java index 4a7fdb6581c893a3ee5b655e0c570e27647b2e97..c2a54ae27bfeb634f6929de5ad051895eaf9a43f 100644 --- a/examples/src/TcpExamples/TcpExample4Client.java +++ b/examples/src/TcpExamples/TcpExample4Client.java @@ -5,9 +5,9 @@ import java.net.*; //import java.time.LocalTime; // conversion? /** - * This client program establishes a socket connection to the {@link TcpExample4DispatchServer}, + * This client program establishes a socket connection to the {@link TcpExamples.TcpExample4DispatchServer}, * then checks how long it takes to read the single line it expects as a server response. - * No fancy footwork here, it is pretty simple and similar to {@link TcpExample3Client}. + * No fancy footwork here, it is pretty simple and similar to {@link TcpExamples.TcpExample3Client}. * * @see TcpExample4DispatchServer * @see TcpExample4HandlerThread diff --git a/examples/src/TcpExamples/TcpExample4HandlerThread.java b/examples/src/TcpExamples/TcpExample4HandlerThread.java index 50d7a01e0f6a65efa83cee5fd935d5aa2f09a464..0b4efa722401fc2a9c76ed14df4475f44fd578df 100644 --- a/examples/src/TcpExamples/TcpExample4HandlerThread.java +++ b/examples/src/TcpExamples/TcpExample4HandlerThread.java @@ -5,14 +5,14 @@ import java.net.*; /** * <p> - * This utility class supports the {@link TcpExample4DispatchServer} program, + * This utility class supports the {@link TcpExamples.TcpExample4DispatchServer} program, * handling all programming logic needed for a new socket connection * to run in a thread of its own. This is the server * portion as well, so we artificially invent what happens * if the server can't respond to a connection for several seconds. * </p> * <p> - * Warning: do not run this class! It is created and used automatically by {@link TcpExample4DispatchServer} at run time. + * Warning: do not run this class! It is created and used automatically by {@link TcpExamples.TcpExample4DispatchServer} at run time. * </p> * * @see TcpExample4Client diff --git a/examples/src/TcpExamples/TcpSentryClient.java b/examples/src/TcpExamples/TcpSentryClient.java index 444983c9efe402253e769b195eb58acbe5f74ccb..a67f953d291d692f9ad6ec962746a439fc83908f 100644 --- a/examples/src/TcpExamples/TcpSentryClient.java +++ b/examples/src/TcpExamples/TcpSentryClient.java @@ -8,17 +8,17 @@ import java.io.*; import java.net.*; /** - * This client program establishes a socket connection to the {@link TcpSentryScenarioDispatchServer}, + * This client program establishes a socket connection to the {@link TcpExamples.TcpSentryDispatchServer}, * then checks how long it takes to read the single line it expects as a server response. - * No fancy footwork here, it is pretty simple and similar to {@link TcpExample3Client}. + * No fancy footwork here, it is pretty simple and similar to {@link TcpExamples.TcpExample3Client}. * - * @see TcpSentryScenarioDispatchServer + * @see TcpSentryDispatchServer * @see TcpSentryHandlerThread * @see TcpExample4Client * @see TcpExample4DispatchServer * @see TcpExample4HandlerThread * - * @see <a href="../../../src/TcpExamples/TcpSentryScenarioTerminalLog.txt" target="blank">TcpSentryScenarioTerminalLog.txt</a> + * @see <a href="../../../src/TcpExamples/TcpSentryTerminalLog.txt" target="blank">TcpSentryTerminalLog.txt</a> * @see <a href="../../../src/TcpExamples/TcpExample4SequenceDiagram.png" target="blank">TcpExample4SequenceDiagram.png</a> * @see <a href="../../../src/TcpExamples/TcpExample4SequenceSketch.png" target="blank">TcpExample4SequenceSketch.png</a> * diff --git a/examples/src/TcpExamples/TcpSentryDispatchServer.java b/examples/src/TcpExamples/TcpSentryDispatchServer.java index 8c84be4bb5b6f9def9d57426a828b49632515633..8debd4a06adbaeec9dc838896f942ab4fa678d17 100644 --- a/examples/src/TcpExamples/TcpSentryDispatchServer.java +++ b/examples/src/TcpExamples/TcpSentryDispatchServer.java @@ -8,13 +8,13 @@ import java.net.*; * new thread to handle multiple incoming socket connections, one after another, all running in parallel. * This advanced technique is often used in high=performance high=capacity server programs. * - * @see TcpSentryScenarioClient + * @see TcpSentryClient * @see TcpSentryHandlerThread * @see TcpExample4Client * @see TcpExample4DispatchServer * @see TcpExample4HandlerThread * - * @see <a href="../../../src/TcpExamples/TcpSentryScenarioTerminalLog.txt" target="blank">TcpSentryScenarioTerminalLog.txt</a> + * @see <a href="../../../src/TcpExamples/TcpSentryTerminalLog.txt" target="blank">TcpSentryTerminalLog.txt</a> * @see <a href="../../../src/TcpExamples/TcpExample4SequenceDiagram.png" target="blank">TcpExample4SequenceDiagram.png</a> * @see <a href="../../../src/TcpExamples/TcpExample4SequenceSketch.png" target="blank">TcpExample4SequenceSketch.png</a> * diff --git a/examples/src/TcpExamples/TcpSentryHandlerThread.java b/examples/src/TcpExamples/TcpSentryHandlerThread.java index f5b3d27df54e0793d4174b880a63204fc7ae1165..c1dbf328c7d799ddf386a3ad79d2edf1d721a4a3 100644 --- a/examples/src/TcpExamples/TcpSentryHandlerThread.java +++ b/examples/src/TcpExamples/TcpSentryHandlerThread.java @@ -7,23 +7,23 @@ import java.util.List; /** * <p> - * This utility class supports the {@link TcpSentryScenarioDispatchServer} program, + * This utility class supports the {@link TcpExamples.TcpSentryDispatchServer} program, * handling all programming logic needed for a new socket connection * to run in a thread of its own. This is the server * portion as well, so we artificially invent what happens * if the server can't respond to a connection for several seconds. * </p> * <p> - * Warning: do not run this class! It is created and used automatically by {@link TcpSentryScenarioDispatchServer} at run time. + * Warning: do not run this class! It is created and used automatically by {@link TcpExamples.TcpSentryDispatchServer} at run time. * </p> * - * @see TcpSentryScenarioClient - * @see TcpSentryScenarioDispatchServer + * @see TcpSentryClient + * @see TcpSentryDispatchServer * @see TcpExample4Client * @see TcpExample4DispatchServer * @see TcpExample4HandlerThread * - * @see <a href="../../../src/TcpExamples/TcpSentryScenarioTerminalLog.txt" target="blank">TcpSentryScenarioTerminalLog.txt</a> + * @see <a href="../../../src/TcpExamples/TcpSentryTerminalLog.txt" target="blank">TcpSentryTerminalLog.txt</a> * @see <a href="../../../src/TcpExamples/TcpExample4SequenceDiagram.png" target="blank">TcpExample4SequenceDiagram.png</a> * @see <a href="../../../src/TcpExamples/TcpExample4SequenceSketch.png" target="blank">TcpExample4SequenceSketch.png</a> * @@ -34,14 +34,18 @@ import java.util.List; public class TcpSentryHandlerThread extends Thread { /** Sentry Scenario access list, as written this list is case sensitive. - * See {@linktourl https://stackoverflow.com/questions/1005073/initialization-of-an-arraylist-in-one-line } + * See <a href="https://stackoverflow.com/questions/1005073/initialization-of-an-arraylist-in-one-line" target="blank">https://stackoverflow.com/questions/1005073/initialization-of-an-arraylist-in-one-line</a> */ public static List<String> allowedNamesList = Arrays.asList("Tim", "Stephen", "Mark", "Rene", "Simon", "James", "Ethan", "Jin Hong", "Don"); + /** Sentry command vocabulary */ public static final String SENTRY_WATCH_PRESENT = "Announcement: the sentry watch is present and standing guard."; + /** Sentry command vocabulary */ public static final String HALT_WHO_GOES_THERE = "Halt who goes there?"; + /** Sentry command vocabulary */ public static final String YOU_MAY_PASS = "You may pass, have a great MOVES day!"; + /** Sentry command vocabulary */ public static final String HOLD_IT_RIGHT_THERE = "You may not pass! Leave immediately or else..."; private static final String prefix = "[sentry] "; @@ -66,8 +70,8 @@ public class TcpSentryHandlerThread extends Thread */ public static void main(String[] args) { - System.out.println ("*** TcpSentryScenarioHandlerThread is not a standalone executable progam."); - System.out.println ("*** Please run TcpSentryScenarioDispatchServer instead... now exiting."); + System.out.println ("*** TcpSentryHandlerThread is not a standalone executable progam."); + System.out.println ("*** Please run TcpSentryDispatchServer instead... now exiting."); } /** Handles one connection. We add an artificial slowness