Changes between Version 6 and Version 7 of RpRepDeployment


Ignore:
Timestamp:
Oct 20, 2010, 12:37:53 PM (14 years ago)
Author:
s.meissner
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RpRepDeployment

    v6 v7  
    1616== Resource Provider's efforts ==
    1717
    18 The REP is basically the **adapter to the SENSEI system that needs to be implemented**.
    19 The Java REP reference implementation provides some helpers to Resource Providers.
    20 The stubs for RPI and RAI methods are given in the example code.
     18The REP is basically the **adapter to the SENSEI system that needs to be implemented**.
     19The Java REP reference implementation provides some help to Resource Providers showing an example using the Restlet framework.
     20
     21The REP class provides a method **createInboundRoot()** in which the routing of REST requests is defined. In the example below all requests issued to {REP_URL}/s/sensorName are routed to the handler class **Sensor Type**
     22
     23{{{
     24@Override
     25public synchronized Restlet createInboundRoot() {
     26
     27        // Create a router Restlet that defines routes.
     28        Router router = new Router(getContext());
     29               
     30        // attach the RAI handler class
     31        String path = "/s/{sensorName}";
     32        Class<SensorType> handler = SensorType.class;
     33        router.attach(path, handler);
     34               
     35        return router;
     36}
     37}}}
     38
     39The parameter sensor Name is taken from the URL used for the HTTP request so that the route can be used for temperature values as well as light values. In the first case the request would be http://{REP_URL}/s/temp in the light value case it would be http://{REP_URL}/s/light.
     40
     41The different handling for temp and light is implemented in the **RAI handler** class called Sensor Type in the example code.
    2142
    2243=== Resource Access Interface ===
     
    6485 
    6586
    66 '''POST''' requests are handled by:
    67 *       public void acceptRepresentation(Representation entity)
    68 
    69 The POST request is meant to be used to subscribe to sensor readings. A subscription needs to be sent in the POST body. The subscription handling is not yet standardised.
    70 
    71 The '''describeXXX''' methods in the SensorType class are used to create a WADL description of the Resource's RAI interface. In the currently used version of the Restlet framework the WADL support is not yet finalised, so that the WADL support cannot be guaranteed. 
    7287
    7388=== RPI methods: ===