@Path(value="/locations") public class LocationBean extends AbstractBean<Location>
Constructor and Description |
---|
LocationBean() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
countREST() |
void |
create(Location entity)
Creates a Location.
|
void |
discover(java.lang.Long id)
Checks a directory stored in "location" for new photographs or films.
|
void |
edit(Location entity)
Updates a Location.
|
Location |
find(java.lang.Long id)
Retrieves a Location.
|
java.util.List<Location> |
findAll()
Retrieve all instances of the entity.
|
java.util.List<Location> |
findRange(java.lang.Integer from,
java.lang.Integer to) |
protected javax.persistence.EntityManager |
getEntityManager()
Returns the Entity manager.
|
void |
init(java.lang.Long id)
Initializes GalleryPhotographs and Galleries based on the file
structure.
|
void |
remove(java.lang.Long id)
Removes a Location.
|
void |
verify(java.lang.Long id)
Checks all the Photographs in a Location, based on their hash map and the
contents of the file.
|
count, findRange, remove
protected javax.persistence.EntityManager getEntityManager()
AbstractBean
getEntityManager
in class AbstractBean<Location>
@POST @Consumes(value={"application/xml","application/json"}) public void create(Location entity)
create
in class AbstractBean<Location>
entity
- Location@PUT @Consumes(value={"application/xml","application/json"}) public void edit(Location entity)
edit
in class AbstractBean<Location>
entity
- Location@DELETE @Path(value="{id}") public void remove(@PathParam(value="id") java.lang.Long id)
id
- unique identifier for the Location, present in the url.@GET @Path(value="{id}") @Produces(value={"application/xml","application/json"}) public Location find(@PathParam(value="id") java.lang.Long id)
find
in class AbstractBean<Location>
id
- unique identifier for the comment, present in the url.javax.ws.rs.WebApplicationException
- with status Response.Status.NOT_FOUND
if
Location with that id does not exist (any more).@GET @Path(value="{id}/discover") public void discover(@PathParam(value="id") java.lang.Long id)
id
- a Long representing the id of the Location entity.JobBean.addPhotographs(gallery.database.entities.Location)
@GET @Produces(value={"application/xml","application/json"}) public java.util.List<Location> findAll()
AbstractBean
findAll
in class AbstractBean<Location>
@GET @Path(value="{from}/{to}") @Produces(value={"application/xml","application/json"}) public java.util.List<Location> findRange(@PathParam(value="from") java.lang.Integer from, @PathParam(value="to") java.lang.Integer to)
@GET @Path(value="count") @Produces(value="text/plain") public java.lang.String countREST()
public void verify(java.lang.Long id)
id
- a Long representing the id of the Location entity.JobBean.addPhotographs(gallery.database.entities.Location)
public void init(java.lang.Long id)
id
- the id of the location.Gallery
,
GalleryPhotograph