Class ConsumersService
java.lang.Object
org.eclipse.lyo.server.oauth.webapp.services.ConsumersService
Manages OAuth consumers for this provider.
- Author:
- Samuel Padgett
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.wink.json4j.JSONObject
asJson
(LyoOAuthConsumer consumer) protected Response
removeConsumer
(String key) Deletes an OAuth consumer.updateConsumer
(String key, String name, String trusted, String provisional) Updates an OAuth consumer.
-
Field Details
-
httpRequest
-
httpResponse
-
-
Constructor Details
-
ConsumersService
public ConsumersService()
-
-
Method Details
-
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
Deletes an OAuth consumer.- Parameters:
key
- the consumer key- Returns:
- the HTTP response
-
handleConsumerStoreException
-
asJson
protected org.apache.wink.json4j.JSONObject asJson(LyoOAuthConsumer consumer) throws org.apache.wink.json4j.JSONException - Throws:
org.apache.wink.json4j.JSONException
-