admin@glassfish.java.net

REST API and Case Issues

From: Jason Lee <jason.d.lee_at_oracle.com>
Date: Wed, 14 Apr 2010 13:58:48 -0500

I've been working with the REST API, trying to see what needs to be done
to port the Admin Console from AMX to REST, and I've hit a snag. The
REST API seems to...wrap? delegate to? the CLI command classes, and pull
attribute information from their parameters. These parameters are all
lower case. AMX, however, as a layer on top of JMX, returns the JMS
properties in mixed case, which is what the console uses (in practical
terms, we deal with the data as a Map). I know this was covered a long
time ago, but why are we using the command classes and not the
ConfigBeans directly?

There are likely more, but here are the solutions for the Console's
problems as I see it:

* The REST API is altered to use the ConfigBeans directly. This solves
the case issue, but may break any existing clients (are there any)?
This is a bit distasteful as it's a fairly significant change to solve
the problem of one client. On the flip side, though, I do prefer the
mixed case when it comes to reading the output manually, and it might
also make it easier to generated "pretty" wrappers should someone be so
inclined (e.g., validateatmostonceperiod vs ValidateAtMostOncePeriod
could get getValidateatmostonceperiod vs getValidateAtMostOncePeriod).

* Another solution, of course, is to change the admin console, but that
will be a lot of tedious, error-prone work. We'd love to be able to
reimplement our Handlers and let the pages stand as they are. That, of
course, may not be possible, but that's what we'd like to do. :)

* Ken and I briefly batted around some sort of wrapper class, such as a
case-insensitive Map implementation. This looked pretty thorny to get
right off the cuff. I don't think we've written it off just yet, but
it's lower on my list, at least.

Any other thoughts or suggestions? Am I missing something obvious? Can
anyone shed some light on why the REST API behaves as it does (or
correct my understanding of it)?

-- 
Jason Lee
Senior Member of Technical Staff
GlassFish Administration Console
Oracle Corporation
Phone x31197/+1 405-343-1964
Blog http://blogs.steeplesoft.com