On Tue, Nov 30, 2010 at 4:19 PM, Justin Deoliveira <[email protected]> wrote: > Yeah I think that approach makes sense since the spec supports it and I > don't know of many clients built from those specific services so any change > will probably have minimal impact. > A couple of questions: > 1. How are we going to go about registing the code to http code mappings? > Will they be fixed? or will a particular service be able to add its own > mappings?
Yeah, good question. The mappings for the codes defined in OWS 2.0 are there and I think we'll use them. OWS 2.0 also states services defining new codes will have to state which http response code to use. In general I'd like to see an enumeration like the one I did for WcsException, it's easy to add two fields to specify the error code and the error message. However there are two issues: - the current code uses a string for the exceptionCode - enumerations cannot be extended at runtime and cannot be subclassed either Hmmm... what about defining an ExceptionCode class instead that has the OGC code, the http code and the http error message, and then use the plain old set of static final constants in ServiceException for the common codes? I guess we should also deprecate the constructors taking a string as an argument... ugh, fixing that would result in a massive undertaking, exceptions are everywhere (though exceptions with a code are not exactly the most common thing around in the code). Maybe for the time being we could have ServiceException provide a method to register a new exception code and then have a lookup for the proper ExceptionCode given the exception code as a string? And then fix the code as we go over time... Not sure, this one is sure nasty, ideas to do this without spening a ton of time would be appreciated. > 2. Will we ever want to return specific codes other than 400 and 500. For > example consider the case of a client requesting a layer that does not > exist. A 404 would also make sense in this case. The OWS 2.0 spec appears to be pretty specific on the status codes, so I did not consider chosing our own codes, but if we go for the above ExceptionCode class a service could go and build its own object with a specific http code and error message. Cheers Andrea ----------------------------------------------------- Ing. Andrea Aime Senior Software Engineer GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584962313 fax: +39 0584962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ----------------------------------------------------- ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Geoserver-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-devel
