org.glassfish.jersey.examples.beanvalidation.webapp.resource
Class ContactCardResource

java.lang.Object
  extended by org.glassfish.jersey.examples.beanvalidation.webapp.resource.ContactCardResource

@Path(value="contact")
@Produces(value="application/json")
public class ContactCardResource
extends Object

Contact card basic resource class. Provides support for inserting, retrieving and deleting contact cards.

See validation annotations (input method parameters, field, return values).

Author:
Michal Gajdos (michal.gajdos at oracle.com)

Constructor Summary
ContactCardResource()
           
 
Method Summary
 ContactCard addContact(ContactCard contact)
           
 ContactCard deleteContact(Long id)
           
 List<ContactCard> deleteContacts()
           
 ContactCard getContact(Long id)
           
 List<ContactCard> getContacts()
           
 SearchResource search()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContactCardResource

public ContactCardResource()
Method Detail

addContact

@POST
@Consumes(value="application/json")
@NotNull(message="{contact.already.exist}")
public ContactCard addContact(@NotNull
                                                    ContactCard contact)

getContacts

@GET
@NotNull
public List<ContactCard> getContacts()

getContact

@GET
@Path(value="{id}")
@NotNull(message="{contact.does.not.exist}")
public ContactCard getContact(@DecimalMin(value="0",message="{contact.wrong.id}")@PathParam(value="id")
                                               Long id)

deleteContacts

@DELETE
@NotNull
public List<ContactCard> deleteContacts()

deleteContact

@DELETE
@Path(value="{id}")
@NotNull(message="{contact.does.not.exist}")
public ContactCard deleteContact(@DecimalMin(value="0",message="{contact.wrong.id}")@PathParam(value="id")
                                                     Long id)

search

@Path(value="search/{searchType}")
public SearchResource search()


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.