@Path(value="aircrafts")
@Produces(value={"application/xml","application/json"})
public class AircraftsResource
extends Object
| Constructor and Description |
|---|
AircraftsResource() |
| Modifier and Type | Method and Description |
|---|---|
Aircraft |
create(String manufacturer,
String type,
Integer capacity,
Integer x,
Integer y) |
String |
delete(Integer id) |
Aircraft |
get(Integer aircraftId) |
Aircraft |
getAsHtml(Integer id) |
Collection<Aircraft> |
list() |
Collection<Aircraft> |
listAsHtml() |
String |
listAsString() |
Collection<Aircraft> |
listAvailable() |
String |
listAvailableAsString() |
@GET public Collection<Aircraft> list()
@GET @Produces(value="text/html") public Collection<Aircraft> listAsHtml()
@GET @Produces(value="text/plain;qs=0.5") public String listAsString()
@GET
@Path(value="{id}")
@Produces(value="text/html")
@ErrorTemplate(name="/errors/404")
public Aircraft getAsHtml(@PathParam(value="id")
Integer id)
@DELETE
@Path(value="{id}")
@Produces(value="text/plain")
@RolesAllowed(value="admin")
public String delete(@PathParam(value="id")
Integer id)
@POST @Consumes(value="application/x-www-form-urlencoded") @RolesAllowed(value="admin") @Detail public Aircraft create(@FormParam(value="manufacturer") String manufacturer, @FormParam(value="type") String type, @FormParam(value="capacity") Integer capacity, @DefaultValue(value="0") @FormParam(value="x-pos") Integer x, @DefaultValue(value="0") @FormParam(value="y-pos") Integer y)
@GET @Path(value="available") public Collection<Aircraft> listAvailable()
@GET @Path(value="available") @Produces(value="text/plain;qs=0.5") public String listAvailableAsString()
Copyright © 2007-2016, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.