Class ConsumersService
- java.lang.Object
-
- org.eclipse.lyo.server.oauth.webapp.services.ConsumersService
-
-
Field Summary
Fields Modifier and Type Field Description protected HttpServletRequest
httpRequest
protected HttpServletResponse
httpResponse
-
Constructor Summary
Constructors Constructor Description ConsumersService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.wink.json4j.JSONObject
asJson(LyoOAuthConsumer consumer)
Response
getAllConsumers()
protected Response
handleConsumerStoreException(ConsumerStoreException e)
Response
removeConsumer(String key)
Deletes an OAuth consumer.Response
updateConsumer(String key, String name, String trusted, String provisional)
Updates an OAuth consumer.
-
-
-
Field Detail
-
httpRequest
@Context protected HttpServletRequest httpRequest
-
httpResponse
@Context protected HttpServletResponse httpResponse
-
-
Method Detail
-
getAllConsumers
@GET @Produces("application/json") public Response getAllConsumers() throws org.apache.wink.json4j.JSONException
- Throws:
org.apache.wink.json4j.JSONException
-
updateConsumer
@POST @Path("/{key}") @Consumes("application/x-www-form-urlencoded") public Response updateConsumer(@PathParam("key") String key, @FormParam("name") String name, @FormParam("trusted") String trusted, @FormParam("provisional") String provisional)
Updates an OAuth consumer.- Parameters:
key
- the consumer keyname
- the new name or nulltrusted
- "true" the consumer is trusted. Can be null.provisional
- "true" if the consumer is provisional or "false" if the consumer is authorized. Can be null.- Returns:
- the HTTP response
-
removeConsumer
@DELETE @Path("/{key}") public Response removeConsumer(@PathParam("key") String key)
Deletes an OAuth consumer.- Parameters:
key
- the consumer key- Returns:
- the HTTP response
-
handleConsumerStoreException
protected Response handleConsumerStoreException(ConsumerStoreException e)
-
asJson
protected org.apache.wink.json4j.JSONObject asJson(LyoOAuthConsumer consumer) throws org.apache.wink.json4j.JSONException
- Throws:
org.apache.wink.json4j.JSONException
-
-