eu.scape_project.watch.rest.resource
Class EntityResource

java.lang.Object
  extended by com.wordnik.swagger.core.JavaHelp
      extended by eu.scape_project.watch.rest.resource.EntityResource
Direct Known Subclasses:
EntityResourceJSON, EntityResourceXML

public class EntityResource
extends com.wordnik.swagger.core.JavaHelp

REST API for Entity operations.

Author:
Luis Faria

Constructor Summary
EntityResource()
           
 
Method Summary
 javax.ws.rs.core.Response createEntity(String name, String type)
          Create a new Entity.
 javax.ws.rs.core.Response deleteEntity(String name)
          Delete an existing entity.
 javax.ws.rs.core.Response getEntityByName(String name)
          Get a Entity by its unique name.
 javax.ws.rs.core.Response listEntityOfType(String type, int start, int max)
          Get the list of Entities of a defined EntityType.
 javax.ws.rs.core.Response updateEntity(String name, Entity entity)
          Update an existing entity.
 
Methods inherited from class com.wordnik.swagger.core.JavaHelp
getHelp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityResource

public EntityResource()
Method Detail

getEntityByName

public javax.ws.rs.core.Response getEntityByName(String name)
Get a Entity by its unique name. REST interface for EntityDAO.findById(String).

Parameters:
name - The name of the Entity
Returns:
The Entity object with that name or throws NotFoundException if none found.

listEntityOfType

public javax.ws.rs.core.Response listEntityOfType(String type,
                                                  int start,
                                                  int max)
Get the list of Entities of a defined EntityType.

Parameters:
type - The name of the EntityType
start - The index of the first item to retrieve
max - The maximum number of items to retrieve
Returns:
The list of entities filtered by the above constraints

createEntity

public javax.ws.rs.core.Response createEntity(String name,
                                              String type)
Create a new Entity.

Parameters:
name - The name of the entity
type - the name of the EntityType this entity belongs to
Returns:
The created Entity or throws NotFoundException if the type is not found.

updateEntity

public javax.ws.rs.core.Response updateEntity(String name,
                                              Entity entity)
Update an existing entity.

Parameters:
name - The name of the existing entity
entity - The new entity that will replace the existing one.
Returns:
The entity merged into the KB.

deleteEntity

public javax.ws.rs.core.Response deleteEntity(String name)
Delete an existing entity.

Parameters:
name - the name of the entity
Returns:
The deleted entity or throws NotFoundException if the entity to delete is not found


Copyright © 2012 SCAPE. All Rights Reserved.