[Fwd: [Registry-dev] Bug in current API?]
Paul Fremantle
paul at wso2.com
Mon Dec 17 01:11:54 PST 2007
Glen
I agree that its worth changing the API to be:
String put(String suggestedPath, Resource resource)
+1
Paul
Glen Daniels wrote:
> Registrars:
>
> Comments on this?
>
> --Glen
>
> -------- Original Message --------
> Subject: [Registry-dev] Bug in current API?
> Date: Wed, 05 Dec 2007 22:15:19 -0500
> From: Glen Daniels <glen at wso2.com>
> Reply-To: registry-dev at wso2.org
> To: registry-dev at wso2.org
>
> Hey folks:
>
> Was chatting with Jonathan about some Registry and UserManager stuff
> (will be writing a few more mails about other topics later), and one
> thing we realized when discussing storing things in the registry is that
> the Java put() API might need to change a bit....
>
> Consider the way APP works for adding items. We POST to a collection
> URL, and optionally include a "Slug" header which tells the server what
> we'd LIKE the URL of the new resource to be. The server then replies
> including a Location: header which tells us what the ACTUAL URL of the
> new resource is. This is a good model because - a) there might be
> something amiss with the suggested URL, such as unacceptable characters,
> or b) there may already be something there.
>
> I think we need to support this idea directly in the Java API, for
> essentially two reasons. First, we want to make sure that things work
> consistently between the remote registry and a local one. Second, we
> might have the same kind of "path cleaning" issues to deal with with
> even a local implementation (for instance, you can't put to
> "/myDir/;tags" - that should probably turn into "/myDir/_tags" or
> something so as not to conflict with "our" URLs).
>
> So the Java API might want to change in a couple of possible ways.
> First, we could just update the path of the Resource being passed to
> put() with the new path. So you'd have to check resource.getPath() to
> see where it actually ended up. Second, we could have put() return the
> actual result path String. We could also do both. In either case we'd
> want to change the name of the "path" argument to "suggestedPath", with
> appropriate JavaDoc.
>
> Thoughts?
>
> --Glen
>
> _______________________________________________
> Registry-dev mailing list
> Registry-dev at wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>
> _______________________________________________
> Registry-dev mailing list
> Registry-dev at wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/registry-dev
>
--
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair
Office: +1 646 290 8050
Cell: +44 798 447 4618
blog: http://pzf.fremantle.org
paul at wso2.com
"Oxygenating the Web Service Platform", www.wso2.com
More information about the Registry-dev
mailing list