eu.scape_project.watch.rest.resource
Class PropertyResource

java.lang.Object
  extended by com.wordnik.swagger.core.JavaHelp
      extended by eu.scape_project.watch.rest.resource.PropertyResource
Direct Known Subclasses:
PropertyResourceJSON, PropertyResourceXML

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

REST API for Property operations.

Author:
Luis Faria

Constructor Summary
PropertyResource()
           
 
Method Summary
 javax.ws.rs.core.Response createProperty(String type, String name, String description)
          Create a new Property.
 javax.ws.rs.core.Response deleteProperty(String type, String name)
          Delete an existing Property.
 javax.ws.rs.core.Response getPropertyByName(String type, String name)
          Get a Property.
 javax.ws.rs.core.Response listEntityOfType(String type, int start, int max)
          List all properties of a EntityType.
 javax.ws.rs.core.Response listProperty()
          List all Properties independently of the EntityType.
 javax.ws.rs.core.Response updateProperty(String type, String name, Property property)
          Update an existing Property.
 
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

PropertyResource

public PropertyResource()
Method Detail

getPropertyByName

public javax.ws.rs.core.Response getPropertyByName(String type,
                                                   String name)
Get a Property.

Parameters:
type - The name of the EntityType this property belongs to
name - The name of the property
Returns:
The Property or throws NotFoundException if not found

listProperty

public javax.ws.rs.core.Response listProperty()
List all Properties independently of the EntityType.

Returns:
The complete list of Properties within the KB

listEntityOfType

public javax.ws.rs.core.Response listEntityOfType(String type,
                                                  int start,
                                                  int max)
List all properties of a 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:
A list of Property filtered by the constraints above.

createProperty

public javax.ws.rs.core.Response createProperty(String type,
                                                String name,
                                                String description)
Create a new Property.

Parameters:
type - The name of the EntityType that this property belongs to.
name - The name of the property, unique within the EntityType
description - Descriptive information about the property
Returns:
The newly created Property or throws NotFoundException if the EntityType is not found.

updateProperty

public javax.ws.rs.core.Response updateProperty(String type,
                                                String name,
                                                Property property)
Update an existing Property.

Parameters:
type - The name of the EntityType the property belongs to
name - The name of the property
property - The new Property that should replace the existing one
Returns:
The new Property merged into the KB

deleteProperty

public javax.ws.rs.core.Response deleteProperty(String type,
                                                String name)
Delete an existing Property.

Parameters:
type - The name of the EntityType the property belongs to
name - The name of the property
Returns:
The deleted Property or throws NotFoundException if not found.


Copyright © 2012 SCAPE. All Rights Reserved.