Conversation
jnm92
left a comment
There was a problem hiding this comment.
looks good overall, just a couple questions/comments
| To enable access to the REST server for a new command, perform the following steps: | ||
|
|
||
| . Ensure that the `geowave-service-rest` project has a dependency on the new command. All classes which the REST server can access are visible from the homepage at `http://localhost:5152`, and should appear in [blue]#blue# if they are not yet implemented. | ||
| . Ensure that the class implementing the operation extends `DefaultOperation`. This is necessary because `DefaultOperation` extends `ServerResource`, which restlet requires for all endpoints. |
There was a problem hiding this comment.
'which restlet requires' -> this is the first mention of restlet, which people might be unfamiliar with, I think just 'which the REST server requires' could be more clear
| ---- | ||
|
|
||
| [start=5] | ||
| . Common code that is invoked from the http request should be implemented in the operation's `computeResults` method (inheriting from `DefaultOperation#computeResults`). This is the method that will be called with the operation is invoked via REST, and should return a Bean object that will be serialized to JSON for the response. If the operation produces no response (for example, in the case of `CopyStoreCommand`), it should return `null`, which can be enforced by specifying a return type of https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html[Void]. The execute method should call `computeResults`, and then display the results (if any) to the console. |
There was a problem hiding this comment.
what is a 'Bean object' in 'should return a bean object that will be serialized to JSON for the response'
There was a problem hiding this comment.
It's a standard notion, but I updated it to make it more clear.
| ---- | ||
|
|
||
| [start=5] | ||
| . Common code that is invoked from the http request should be implemented in the operation's `computeResults` method (inheriting from `DefaultOperation#computeResults`). This is the method that will be called with the operation is invoked via REST, and should return a Bean object that will be serialized to JSON for the response. If the operation produces no response (for example, in the case of `CopyStoreCommand`), it should return `null`, which can be enforced by specifying a return type of https://docs.oracle.com/javase/8/docs/api/java/lang/Void.html[Void]. The execute method should call `computeResults`, and then display the results (if any) to the console. |
There was a problem hiding this comment.
might be worth mentioning that the computeResults logic can be taken directly from the existing execute and then just having execute call that. this is hinted at with 'the execute method shoudl call computeResults' but it might be nice to be more explicit about this, as it could save people a lot of time from reimplementing execute
See https://drive.google.com/file/d/0B5xyQKoKRPyXMDVyMTZXQlVaT2s/view?usp=sharing (click download and then open with a web browser).