[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Jack Krupansky (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908244#action_12908244
 ] 

Jack Krupansky commented on CONNECTORS-98:
--

And that last reference provides examples that illustrate the convention of 
using plurals. For example:

GET /customers/1234 HTTP/1.1

http://www.infoq.com/articles/rest-introduction

The goal here is to use a common style so that people approaching the ACF API 
will not be surprised and have to re-learn things to use this API.


> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Jack Krupansky (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908240#action_12908240
 ] 

Jack Krupansky commented on CONNECTORS-98:
--

On closer examination, all of the examples I have found use an "id" rather than 
a name in the path. Typically a number or maybe alphanumeric with hyphens. So, 
we should consider revisiting that aspect of the API. That avoids the slash 
issue.

So, presumably an app using the API would query the list of connections and the 
JSON would provide the id for each connection and the the app would use those 
ids for API calls.

Another reference:

http://www.infoq.com/articles/rest-introduction
"Give every 'thing' an ID"

> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Jack Krupansky (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908190#action_12908190
 ] 

Jack Krupansky commented on CONNECTORS-98:
--

I am reading IETF RFC 3986 - Uniform Resource Identifier (URI): Generic Syntax, 
section 3.3, "Path", among other things.

See:
http://www.ietf.org/rfc/rfc3986.txt

No conclusion yet.


> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Karl Wright (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908154#action_12908154
 ] 

Karl Wright commented on CONNECTORS-98:
---

bq. My model is that a name should occupy only a single path component.

That implies double encoding, because even if your standard, 
illegal-character-escaping single level of encoding happens to convert "/" into 
"%2F", the app server will turn it back into "/" before you get to see it.

FWIW, there is nothing that stops you from saying "this first part of the path 
is parsed by me, and the rest of the path is interpreted as a string that can 
contain slash characters."  Remember, slash characters are LEGAL in URLs.  I 
don't know what you are reading but a quick glance at just about any url should 
convince you of this.



> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Jack Krupansky (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908148#action_12908148
 ] 

Jack Krupansky commented on CONNECTORS-98:
--

I am still pondering this embedded slash issue and checking into some things 
related to it. Maybe Monday I'll have something more concrete to say.

For example, I want to make sure I understand the rules for what a path can 
have in it in a URI and whether simply placing a name at the tail of the path 
means it can have slashes or other reserved characters in it. My model is that 
a name should occupy only a single path component.


> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Karl Wright (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908125#action_12908125
 ] 

Karl Wright commented on CONNECTORS-98:
---

It turns out that arguments to some existing connector info methods are also 
potentially names that can have "/" characters in them.  That's unfortunate 
because I cannot then avoid double-encoding *something*.


> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Karl Wright (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907957#action_12907957
 ] 

Karl Wright commented on CONNECTORS-98:
---

Created the full cwiki proposal:

https://cwiki.apache.org/confluence/display/CONNECTORS/REST+API+proposal


> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Karl Wright (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907942#action_12907942
 ] 

Karl Wright commented on CONNECTORS-98:
---

Actually, I realize that I *have* decided.  Double-encoding will be too 
confusing.  There is furthermore no reason not to put the connection name at 
the end of the url in all cases - in fact, it naturally works best that way, in 
my view.  Your comment about not using slashes in names may not apply to 
end-users, who will be creating these names, but it certainly *does* apply to 
the one case I was worried about: creating connector-specific command names.  
So I think it's settled.

The final proposal, which I think is the only one that's going to work in all 
dimensions, is the following:

outputconnection/get (connection_name) -> GET 
outputconnection/ ()
outputconnection/save (output_connection_object) -> PUT outputconnection 
(output_connection_object)
outputconnection/delete (connection_name) -> DELETE 
outputconnection/ ()
outputconnection/list () -> GET outputconnections ()
outputconnection/checkstatus (connection_name) -> GET 
status/outputconnection/ ()
outputconnection/execute/ (connection_name, arguments) -> GET 
info//outputconnection/ ()

There will, of course, be similar "status" and "info" urls for all other 
connection types.  The constant here is whenever you see "/outputconnection/" 
it is followed by the output connection name.  That is why I did not suggest 
"list/outputconnection", because that breaks that consistency, but I could be 
convinced to do that instead of using the plural.  I could have turned the 
whole thing around but then we would have either parsing conflicts or you'd 
need to add more to the url:

outputconnection/get (connection_name) -> GET 
outputconnection/instance/ ()

... and I didn't think you'd like that.

This will, of course, set the style for all of the rest of the URLs too.  I'll 
create the full proposal today, just to be sure there are no gotchas.

Note that the things we must GIVE UP for REST are:

(1) Arbitrarily complex JSON arguments to individual connector commands
(2) Commands with "/" in them, to individual connectors



> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (CONNECTORS-98) API should be "pure" RESTful with the API verb represented using the HTTP GET/PUT/POST/DELETE methods

2010-09-10 Thread Karl Wright (JIRA)

[ 
https://issues.apache.org/jira/browse/CONNECTORS-98?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907934#action_12907934
 ] 

Karl Wright commented on CONNECTORS-98:
---

There are currently no restrictions on characters in ACF fields, and I'd be 
loathe to start adding them just to support one person's idea of the proper URL 
over another's.

As for bypassing GetPathInfo, I don't think that's a good idea either.  The 
purpose of that decoding step is to handle non-legal URI characters and non 
7-bit-ascii, both of which we really need.

I think the choice will be between putting all such keys at the end of the URL, 
or double-escaping them.  But I still have not decided which I prefer.


> API should be "pure" RESTful with the API verb represented using the HTTP 
> GET/PUT/POST/DELETE methods
> -
>
> Key: CONNECTORS-98
> URL: https://issues.apache.org/jira/browse/CONNECTORS-98
> Project: Apache Connectors Framework
>  Issue Type: Improvement
>  Components: API
>Affects Versions: LCF Release 0.5
>Reporter: Jack Krupansky
> Fix For: LCF Release 0.5
>
>
> (This was originally a comment on CONNECTORS-56 dated 7/16/2010.)
> It has come to my attention that the API would be more "pure" RESTful if the 
> API verb was represented using the HTTP GET/PUT/POST/DELETE methods and the 
> input argument identifier represented in the context path.
> So,  GET outputconnection/get \{"connection_name":__\} would 
> be GET outputconnections/
> and GET outputconnection/delete \{"connection_name":__\} 
> would be DELETE outputconnections/
> and GET outputconnection/list would be GET outputconnections
> and PUT outputconnection/save 
> \{"outputconnection":__\} would be PUT 
> outputconnections/ 
> \{"outputconnection":__\}
> What we have today is certainly workable, but just not as "pure" as some 
> might desire. It would be better to take care of this before the initial 
> release so that we never have to answer the question of why it wasn't done as 
> a "proper" RESTful API.
> BTW, I did check to verify that an HttpServlet running under Jetty can 
> process the DELETE and PUT methods (using the doDelete and doPut method 
> overrides.)
> Also, POST should be usable as an alternative to PUT for API calls that have 
> large volumes of data.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.