[Opensim-dev] REST and OpenSim

Alan M Webb alan_webb at us.ibm.com
Fri May 16 15:44:07 UTC 2008


This is not intended to imply anything about the long-term strategy for 
BaseHttpServer, rather it offers a tactical solution that addresses a 
specific need that those of us trying to implement REST interfaces have 
today.

As REST becomes more prevalent, there is a growing need to accommodate it, 
and its special requirements, in BaseHttpServer. I'd like to suggest that 
we do so by incorporating the notion of a User-Agent sensitive handler. 
The handler is registered using the name of the User-Agent it intends to 
support. This handler receives both request and response objects and 
returns nothing (to BaseHttpServer), i.e. it is wholly responsible for 
header management and everything else, as is the nature of REST. Along the 
way we might want to implement some generic REST support to make 
implementing handlers easier, but it is not required. A generic handler 
might take care of "hiding" the request and response packets in the way 
that Stefan has suggested.

I have a version of BaseHttpServer which incorporates these ideas without 
affecting any traffic not associated with the specific user agents being 
targeted. Note that the idea here is not to provide agent handlers for 
common agents such as Firefox, but rather to insulate traffic from a 
functionally specific agent from conflicts with other generic flows; REST 
is just one beneficiary.

I have attached a patch that illustrates the changes I'm talking about.



Thoughts? You can incorporate the change without affecting the way that 
OpenSim works today, and only if you add and agent for a specific client, 
does anything change. The client dictionary uses its keys to detect 
duplicate entries, but the actual matching can be arbitrarily complex. In 
fact, what if we allowed an agent to match based upon an arbitrary 
examination of the request headers?

Best regards
Alan
-------------------
T.J. Watson Research Center, Hawthorne, NY
1-914-784-7286
alan_webb at us.ibm.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080516/312c0a22/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IUserAgentHandler.cs
Type: application/octet-stream
Size: 1846 bytes
Desc: not available
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080516/312c0a22/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amw.diff
Type: application/octet-stream
Size: 11075 bytes
Desc: not available
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20080516/312c0a22/attachment-0003.obj>


More information about the Opensim-dev mailing list