geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Blum <>
Subject Re: RestHttpOperationInvoker and SimpleHttpOperationInvoker
Date Fri, 26 May 2017 18:33:28 GMT
Hi Jinmei-

*> Do we know why in our admin rest api, we have these two kind
of OpeationInvokers*


The Javadoc
somewhat explains the reason for this, but...

In a nutshell, the Management (or "Admin") REST-like API  has 2 type of
REST service endpoints.

First, are "Well-Known
[2] with actual *Spring Web MVC* Controller Endpoints corresponding to each
of the *Gfsh* commands (e.g. `create region

Then, there is a "Catch-all
endpoint [4], which is what the SimpleHttpOperationInvoker
"invokes" [5].  The idea behind this endpoint was, often times, someone
would add a new command but forget to update the Admin REST API to match,
with "explicit" support (e.g. both this [2] and this [3]) for the new

While this later approach works, it is not highly recommended and is
certainly not very "REST-like", much less "REST-ful".

In fact, the former, "Well-Known" endpoints I setup separately and
individually in order to eventually introduce proper "Resource
abstractions" for each of the REST API service endpoints for each of the
*Gfsh* commands rather than the very use of HTTP Request Parameters to
naively "reconstruct" the Gfsh command-line syntax that is largely still in
place today.  However, I never got that far before the priorities changed.

So, *Gfsh* selects which HTTP-based OperationInvoker to use based on the
availability of the command in the Admin REST API "Index" [2].

Anyway, there is much to know in terms of the reasons why this API was
designed the way it was at the time.  I'd say it still needs a lot of work
realize the full vision I had for it when it was created, something I
documented quite well and gave to the leadership team at that time.

If you have more questions, let's talk live.



On Fri, May 26, 2017 at 9:59 AM, Jinmei Liao <> wrote:

> Hi, team,
> Do we know why in our admin rest api, we have these two kind of
> OpeationInvokers, it looks like when RestHttpOperationInvoker failed to
> find the resource, it will use the SimpleHttpOperationInvoker to try again,
> but shouldn't that also fail as well?
> Here is some of the logic I found in the code. I am wondering why this is
> necessary.
> .....
> if( link is not available){
> throw new RestApiCallForCommandNotFoundException(
>       String.format("No REST API call for command (%1$s) was found!",
> command.getInput()));
> }
> somewhere else in the process:
> catch (RestApiCallForCommandNotFoundException e) {
>     SimpleHttpOperationInvoker.processCommand()
> }
> --
> Cheers
> Jinmei

john.blum10101 (skype)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message