Class ConsumersService


  • @Path("/oauth/consumers")
    public class ConsumersService
    extends Object
    Manages OAuth consumers for this provider.
    Author:
    Samuel Padgett
    • Constructor Detail

      • ConsumersService

        public ConsumersService()
    • 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 key
        name - the new name or null
        trusted - "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
      • asJson

        protected org.apache.wink.json4j.JSONObject asJson​(LyoOAuthConsumer consumer)
                                                    throws org.apache.wink.json4j.JSONException
        Throws:
        org.apache.wink.json4j.JSONException