@RestResource(path="/petstore", title="Petstore application", description={"This is a sample server Petstore server based on the Petstore sample at Swagger.io.","You can find out more about Swagger at http://swagger.io."}, htmldoc=, properties=@Property(name="SwaggerUI.resolveRefsMaxDepth.i",value="99"), swagger=, staticFiles="htdocs:htdocs", children={SqlQueryResource.class,PhotosResource.class}) public class PetStoreResource extends BasicRestServletJena implements PetStore
Constructor and Description |
---|
PetStoreResource() |
getOptions
destroy, getContext, getPath, getProperties, getRequest, getResponse, getServletConfig, init, log, log, log, log, logObjects, service, setContext, setRestResourceResolver
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public PetStoreResource()
@RestHook(value=INIT) public void startup(RestContextBuilder builder) throws Exception
Exception
@RestMethod(name="GET", path="/", summary="Navigation page", htmldoc=) public ResourceDescriptions getTopPage()
@RestMethod(summary="Initialize database form entry page") public Div getInit()
@RestMethod(summary="Initialize database") public void postInit(@FormData(value="init-method") String initMethod, RestResponse res) throws Exception
Exception
@RestMethod(name="GET", path="/pet", summary="All pets in the store", swagger=, bpx="Pet: tags,photo", htmldoc=, converters=Queryable.class) public Collection<Pet> getPets() throws NotAcceptable
getPets
in interface PetStore
NotAcceptable
@RestMethod(name="GET", path="/pet/{petId}", summary="Find pet by ID", description="Returns a single pet", swagger=) public Pet getPet(long petId) throws IdNotFound, NotAcceptable
getPet
in interface PetStore
IdNotFound
NotAcceptable
@RestMethod(summary="Add a new pet to the store", swagger=) public long postPet(CreatePet pet) throws IdConflict, NotAcceptable, UnsupportedMediaType
postPet
in interface PetStore
IdConflict
NotAcceptable
UnsupportedMediaType
@RestMethod(name="PUT", path="/pet/{petId}", summary="Update an existing pet", swagger=) public Ok updatePet(UpdatePet pet) throws IdNotFound, NotAcceptable, UnsupportedMediaType
updatePet
in interface PetStore
IdNotFound
NotAcceptable
UnsupportedMediaType
@RestMethod(name="GET", path="/pet/findByStatus", summary="Finds Pets by status", description="Multiple status values can be provided with comma separated strings.", swagger=) public Collection<Pet> findPetsByStatus(PetStatus[] status) throws NotAcceptable
findPetsByStatus
in interface PetStore
NotAcceptable
@RestMethod(name="GET", path="/pet/findByTags", summary="Finds Pets by tags", description="Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", swagger=) @Deprecated public Collection<Pet> findPetsByTags(String[] tags) throws InvalidTag, NotAcceptable
findPetsByTags
in interface PetStore
InvalidTag
NotAcceptable
@RestMethod(name="DELETE", path="/pet/{petId}", summary="Deletes a pet", swagger=) public Ok deletePet(String apiKey, long petId) throws IdNotFound, NotAcceptable
deletePet
in interface PetStore
IdNotFound
NotAcceptable
@RestMethod(name="GET", path="/pet/{petId}/edit", summary="Pet edit page", swagger=) public Div editPetPage(@Path(name="petId",description="ID of pet to return",example="123") long petId) throws IdConflict, NotAcceptable, UnsupportedMediaType
@RestMethod(summary="Store navigation page", swagger=) public ResourceDescriptions getStore()
@RestMethod(name="GET", path="/store/order", summary="Petstore orders", swagger=, htmldoc=) public Collection<Order> getOrders() throws NotAcceptable
getOrders
in interface PetStore
NotAcceptable
@RestMethod(name="GET", path="/store/order/{orderId}", summary="Find purchase order by ID", description="Returns a purchase order by ID.", swagger=) public Order getOrder(long orderId) throws InvalidId, IdNotFound, NotAcceptable
getOrder
in interface PetStore
InvalidId
IdNotFound
NotAcceptable
@RestMethod(name="POST", path="/store/order", summary="Place an order for a pet", swagger=, pojoSwaps=DateSwap.ISO8601D.class) public long placeOrder(long petId, String username) throws IdConflict, NotAcceptable, UnsupportedMediaType
placeOrder
in interface PetStore
IdConflict
NotAcceptable
UnsupportedMediaType
@RestMethod(name="DELETE", path="/store/order/{orderId}", summary="Delete purchase order by ID", description={"For valid response try integer IDs with positive integer value.","Negative or non-integer values will generate API errors."}, swagger=) public Ok deleteOrder(long orderId) throws InvalidId, IdNotFound, NotAcceptable
deleteOrder
in interface PetStore
InvalidId
IdNotFound
NotAcceptable
@RestMethod(name="GET", path="/store/inventory", summary="Returns pet inventories by status", description="Returns a map of status codes to quantities", swagger=) public Map<PetStatus,Integer> getStoreInventory() throws NotAcceptable
getStoreInventory
in interface PetStore
NotAcceptable
@RestMethod(name="GET", path="/user", summary="Petstore users", bpx="User: email,password,phone", swagger=) public Collection<User> getUsers() throws NotAcceptable
getUsers
in interface PetStore
NotAcceptable
@RestMethod(name="GET", path="/user/{username}", summary="Get user by user name", swagger=) public User getUser(String username) throws InvalidUsername, IdNotFound, NotAcceptable
getUser
in interface PetStore
InvalidUsername
IdNotFound
NotAcceptable
@RestMethod(summary="Create user", description="This can only be done by the logged in user.", swagger=) public Ok postUser(User user) throws InvalidUsername, IdConflict, NotAcceptable, UnsupportedMediaType
postUser
in interface PetStore
InvalidUsername
IdConflict
NotAcceptable
UnsupportedMediaType
@RestMethod(name="POST", path="/user/createWithArray", summary="Creates list of users with given input array", swagger=) public Ok createUsers(User[] users) throws InvalidUsername, IdConflict, NotAcceptable, UnsupportedMediaType
createUsers
in interface PetStore
InvalidUsername
IdConflict
NotAcceptable
UnsupportedMediaType
@RestMethod(name="PUT", path="/user/{username}", summary="Update user", description="This can only be done by the logged in user.", swagger=) public Ok updateUser(String username, User user) throws InvalidUsername, IdNotFound, NotAcceptable, UnsupportedMediaType
updateUser
in interface PetStore
InvalidUsername
IdNotFound
NotAcceptable
UnsupportedMediaType
@RestMethod(name="DELETE", path="/user/{username}", summary="Delete user", description="This can only be done by the logged in user.", swagger=) public Ok deleteUser(String username) throws InvalidUsername, IdNotFound, NotAcceptable
deleteUser
in interface PetStore
InvalidUsername
IdNotFound
NotAcceptable
@RestMethod(name="GET", path="/user/login", summary="Logs user into the system", swagger=) public Ok login(String username, String password, Value<Integer> rateLimit, Value<ExpiresAfter> expiresAfter, RestRequest req, RestResponse res) throws InvalidLogin, NotAcceptable
login
in interface PetStore
InvalidLogin
NotAcceptable
@RestMethod(name="GET", path="/user/logout", summary="Logs out current logged in user session", swagger=) public Ok logout() throws NotAcceptable
logout
in interface PetStore
NotAcceptable
Copyright © 2018 Apache. All rights reserved.