org.glassfish.jersey.examples.flight.resources
Class AircraftsResource
java.lang.Object
org.glassfish.jersey.examples.flight.resources.AircraftsResource
@Path(value="aircrafts")
@Produces(value={"application/xml","application/json"})
public class AircraftsResource- extends Object
JAX-RS resource for accessing & manipulating flight information.
- Author:
- Marek Potociar (marek.potociar at oracle.com)
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AircraftsResource
public AircraftsResource()
list
@GET
public Collection<Aircraft> list()
listAsHtml
@GET
@Produces(value="text/html")
public Collection<Aircraft> listAsHtml()
listAsString
@GET
@Produces(value="text/plain;qs=0.5")
public String listAsString()
get
@GET
@Path(value="{id}")
@Detail
public Aircraft get(@PathParam(value="id")
Integer aircraftId)
getAsHtml
@GET
@Path(value="{id}")
@Produces(value="text/html")
@ErrorTemplate(name="/errors/404")
public Aircraft getAsHtml(@PathParam(value="id")
Integer id)
delete
@DELETE
@Path(value="{id}")
@Produces(value="text/plain")
@RolesAllowed(value="admin")
public String delete(@PathParam(value="id")
Integer id)
create
@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)
listAvailable
@GET
@Path(value="available")
public Collection<Aircraft> listAvailable()
listAvailableAsString
@GET
@Path(value="available")
@Produces(value="text/plain;qs=0.5")
public String listAvailableAsString()
Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.