Package org.wso2.synapse.samples.jaxrs.foodsample

# Class FoodService

java.lang.Object
org.wso2.synapse.samples.jaxrs.foodsample.FoodService

@Singleton @Path("/foodservice/") public class FoodService extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FoodService()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `javax.ws.rs.core.Response`
  `getAccessToken(javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)`
  `javax.ws.rs.core.Response`
  `getAccessToken1(javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)`
  `javax.ws.rs.core.Response`
  `getAccessToken2(javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)`
  `javax.ws.rs.core.Response`
  `getAccessTokenWithCustomParams(javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)`
  `javax.ws.rs.core.Response`
  `getAccessTokenWithPasswordGrant(javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)`
  `javax.ws.rs.core.Response`
  `getFoodItem(javax.ws.rs.core.HttpHeaders httpHeaders)`
  `javax.ws.rs.core.Response`
  `getFoodItem2(javax.ws.rs.core.HttpHeaders httpHeaders)`
  `javax.ws.rs.core.Response`
  `getUnauthorizedItem(javax.ws.rs.core.HttpHeaders httpHeaders)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### FoodService

    public FoodService()

- ## Method Details

  - ### getAccessToken

    @POST @Path("/token") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public javax.ws.rs.core.Response getAccessToken(@Context javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)

  - ### getAccessToken1

    @POST @Path("/token1") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public javax.ws.rs.core.Response getAccessToken1(@Context javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)

  - ### getAccessToken2

    @POST @Path("/token2") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public javax.ws.rs.core.Response getAccessToken2(@Context javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)

  - ### getAccessTokenWithCustomParams

    @POST @Path("/custom-token") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public javax.ws.rs.core.Response getAccessTokenWithCustomParams(@Context javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)

  - ### getAccessTokenWithPasswordGrant

    @POST @Path("/password-token") @Consumes("application/x-www-form-urlencoded") @Produces("application/json") public javax.ws.rs.core.Response getAccessTokenWithPasswordGrant(@Context javax.ws.rs.core.HttpHeaders httpHeaders, javax.ws.rs.core.MultivaluedMap<String,String> tokenRequestParams)

  - ### getFoodItem

    @GET @Path("/food") @Produces("application/json") public javax.ws.rs.core.Response getFoodItem(@Context javax.ws.rs.core.HttpHeaders httpHeaders)

  - ### getFoodItem2

    @GET @Path("/apple") @Produces("application/json") public javax.ws.rs.core.Response getFoodItem2(@Context javax.ws.rs.core.HttpHeaders httpHeaders)

  - ### getUnauthorizedItem

    @GET @Path("/unauthorized") @Produces("application/json") public javax.ws.rs.core.Response getUnauthorizedItem(@Context javax.ws.rs.core.HttpHeaders httpHeaders)