|
@@ -8,7 +8,7 @@
|
8
|
8
|
You are to write a command interpreter using the provided SimpleShell class. You're going to create a way for
|
9
|
9
|
commands to be typed into your shell, read the typed commands and arguments, send them off to the Under-A-Rock
|
10
|
10
|
server using a REST API over the HTTP protocol, read the JSON data returned from the URL call, and print it out
|
11
|
|
-nicely formatted for your user.
|
|
11
|
+nicely formatted for your user. If you manage to get this all done in a reasonable time, attempt parts 2 and 3.
|
12
|
12
|
|
13
|
13
|
Under-A-Rock acts a little (very little) like a twitter server or chat server.
|
14
|
14
|
|
|
@@ -49,8 +49,15 @@ Be prepared to defend your choice if which HTTP client library you chose, with r
|
49
|
49
|
You should also create some unit tests for your REST API handlers.
|
50
|
50
|
|
51
|
51
|
It's possible you may also need to understand some of what the Jackson package does for you.
|
|
52
|
+
|
52
|
53
|
* jackson json https://github.com/FasterXML/jackson
|
53
|
54
|
|
|
55
|
+And you may wish to create a couple classes `public class Message` and `public class Id` to make handling
|
|
56
|
+the abstractions implied by the API easier.
|
|
57
|
+
|
|
58
|
+Jackson can help you parse the json into objects,and objects back into JSON strings. Be sure to research how you can
|
|
59
|
+dependencies in the `pom.xml` so that Jackson, well, so that you can use Jackson in the project.
|
|
60
|
+
|
54
|
61
|
## IDs
|
55
|
62
|
|
56
|
63
|
#### ID commands in shell
|
|
@@ -159,4 +166,18 @@ send xt0fer 'Hello old buddy!' to torvalds
|
159
|
166
|
```
|
160
|
167
|
and send it as the body of a POST request to `http://zipcode.rocks:8085/ids/xt0fer/messages/`
|
161
|
168
|
|
|
169
|
+## Part Two
|
|
170
|
+
|
|
171
|
+What's that ProcessBuilder stuff about? In the SimpleShell class, take a look. How can that be used
|
|
172
|
+as a pattern to use threads to make the API calls and wait for the response? Maybe launch a new thread on every request?
|
|
173
|
+
|
|
174
|
+## Part Three
|
|
175
|
+
|
|
176
|
+Build a better set of commands. Make the "fromid" intrinsic, so it isn't needed on the various shell commands.
|
|
177
|
+Add a feature where you can send messages by someone's name. Create a means where the client watches the server for
|
|
178
|
+any private messages to you and only prints them once.
|
|
179
|
+Add another command that watches the global stream and only prints messages once.
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
162
|
183
|
|