@Path(value="/troopers") @Produces(value="application/json") public class StormtrooperResource extends Object
| Constructor and Description |
|---|
StormtrooperResource(StormtrooperDao trooperDao) |
| Modifier and Type | Method and Description |
|---|---|
Stormtrooper |
createTrooper(Stormtrooper trooper) |
void |
deleteTrooper(String id) |
Stormtrooper |
getTrooper(String id) |
StormtrooperView |
getTrooperView(String id) |
Collection<Stormtrooper> |
listTroopers()
Returns a Collection of all Stormtroopers.
|
StormtroopersView |
listTroopersView() |
Stormtrooper |
updateTrooper(String id,
Stormtrooper updatedTrooper) |
@Inject public StormtrooperResource(StormtrooperDao trooperDao)
@GET public Collection<Stormtrooper> listTroopers()
@GET @Produces(value="text/html") public StormtroopersView listTroopersView()
@GET
@Path(value="/{id}")
public Stormtrooper getTrooper(@PathParam(value="id")
String id)
@GET
@Path(value="/{id}")
@Produces(value="text/html")
public StormtrooperView getTrooperView(@PathParam(value="id")
String id)
@POST public Stormtrooper createTrooper(Stormtrooper trooper)
@Path(value="/{id}")
@POST
public Stormtrooper updateTrooper(@PathParam(value="id")
String id,
Stormtrooper updatedTrooper)
@Path(value="/{id}")
@DELETE
public void deleteTrooper(@PathParam(value="id")
String id)
Copyright © 2018–2024 Okta. All rights reserved.