@Path(value="shops/{shopId}/tokens")
public class AccessTokenResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private AccessTokenService |
service |
Constructor and Description |
---|
AccessTokenResource(AccessTokenService service) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
create(java.lang.String shopId,
AccessTokenContext accessTokenContext,
javax.ws.rs.core.UriInfo info)
Creates an access token valid for a shop.
|
javax.ws.rs.core.Response |
delete(java.lang.String shopId,
java.lang.String token)
Deletes an access token
|
javax.ws.rs.core.Response |
findByShopId(java.lang.String shopId)
Gets all access tokens for a shop
|
javax.ws.rs.core.Response |
get(java.lang.String shopId,
java.lang.String token)
Returns the access token
|
javax.ws.rs.core.Response |
save(Token token,
javax.ws.rs.core.UriInfo info)
Saves an access token
|
private final AccessTokenService service
@Inject public AccessTokenResource(AccessTokenService service)
@POST @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response create(@PathParam(value="shopId") java.lang.String shopId, @NotNull AccessTokenContext accessTokenContext, @Context javax.ws.rs.core.UriInfo info)
shopId
- The current shopaccessTokenContext
- The token contextinfo
- current uri context@PUT @Consumes(value="application/json") @Produces(value="application/json") public javax.ws.rs.core.Response save(Token token, @Context javax.ws.rs.core.UriInfo info)
token
- The token to save@DELETE @Path(value="{token}") public javax.ws.rs.core.Response delete(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="token") java.lang.String token)
shopId
- The current shoptoken
- Identifier of the token to revoke@GET @Produces(value="application/json") public javax.ws.rs.core.Response findByShopId(@PathParam(value="shopId") java.lang.String shopId)
shopId
- The current shop@GET @Path(value="{token}") @Produces(value="application/json") public javax.ws.rs.core.Response get(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="token") java.lang.String token)
shopId
- The current shoptoken
- The token identifier