Guide for Extensions

6 Testbed Provider Services (Testbed to FIESTA-IoT)

6.2 TPS Implementation (Wildfly Container)

A TPS instance may be implemented in any language and or environment the Testbed provider chooses to as long as it follows the above API as a REST web service. Shall you choose to implement it in Java we provide a skeleton Java project in order to help you bootstrap the process. Information where this project can be found and to be used is provided in the following sections.

Code Availability and Structure

The Testbed Provider Interface components is offered at FIESTA-IoT GitHub repository, and more specifically under the testbed.tpi repository. The latest version of the components are under the “develop branch”.

The project is divided into two main packages. The “” and “eu.fiestaiot.tpi.api.tps.impl.dataservices”:


Within this package, the “”[1]  class can be found which is the entry point for the Services described at the TPS API above. The main methods of interest are:

  • public Response getLastObservations(String getLastObservationsPayload)
  • public Response getObservations(String getObservationsPayload)
  • public Response pushLastObservations(String pushLastObservationsPayload)
  • public Response stopPushOfObservations(String stopPushOfObservationsPayload)

These methods analyse the payload and forward it to the implementation of them, which resides in the following package.

2) eu.fiestaiot.tpi.api.tps.impl.dataservices

In this package, we have a list of the implementations classes of the different web services exposed from the TPS instance. The Testbed provider needs to implement at least one of them (or two of them in the case of pushLastObservations since it needs the stopPushOfObservations as well). The four classes are:

• [2]
• [3]
• [4]
• [5]

Push Observations Implementation Details

In order to enable the option of a Testbed to push its observations, Fiesta−IoT platform is exposing an interface that accept various annotated document types and is called “pushObservationsStreamProxy”. The endpoint URI of the “pushObservationsStreamProxy” is received within the payload of “pushLastObservations” as shown at the TPS API description above. As soon as the testbed has new data (or based on a specific schedule defined by the testbed) from the “pushLastObservations” received sensor ID list it should send the annotated measurements within the body of the message and the document type as the header of the message. An example endpoint would be:


And the header should contain:

Content-Type: DocumentType (for example: application/rdf+xml)
iPlanetDirectoryPro : {{UserCookie}}

The accepted content types (Content-Type) are:

• application/ld+json
• application/n-quads
• application/n-triples
• application/n3
• application/rdf+json
• application/rdf+thrift
• application/rdf+xml
• application/trig
• application/trix
• application/trix+xml
• application/turtle
• application/x-trig
• application/x-turtle
• null/rdf
• text/csv
• text/n-quads
• text/n3
• text/nquads
• text/plain
• text/rdf+n3
• text/trig
• text/turtle

The UserCookie SHOULD be generated by using the credentials of the user as described above (3.2 Invoking the OpenAM Authentication API to obtain a SSO token). For Example by sending as a header the Username and Password:

  • X-OpenAM-Username : UserX
  • X-OpenAM-Password : PasswordOfUserX

To the following URL:


More details can be found in the "Invoking the OpenAM Authentication API to obtain a SSO token" section of the "FIESTA-IoT Security Framework" book.

System Requirements

The TPS component described above is deployed within a WildFly container and is using Maven as project management.

The prototype runs on Windows, Linux, Mac OS X, and Solaris. In order to run the prototype, you need to ensure that Java 8 and WildFly are installed and/or available on your system. In order to build the prototype you will also need Maven. Before attempting to deploy and run the prototype applications, make sure that you have started WildFly. More details about the specific versions of the tools and libraries that have been used for the development or that are required for the deployment and execution of the prototypes are given in the section below.

Install & Run

The prototype has been implemented as a Maven-based web application. Below WILDFLY_HOME indicates the root directory of the WildFly distribution, and PROJECT_HOME indicates the root directory of the project (tpi.api.tps).

In order to build the prototype, run the following command in PROJECT_HOME:

mvn clean package

Finally, in order to deploy the prototype, run the following command in PROJECT_HOME:

mvn wildfly:deploy

The last step assumes that WildFly is already running on the machine where you run the command.

The produced, from the build process above (mvn clean package), project can be found within PROJECT_HOME/target/ folder and is the tpi.api.tps.war file. Alternatively copy the produced (from the build process above) tpi.api.tps.war file from the target directory (PROJECT_HOME/target/), into the WILDFLY_HOME/standalone/deployments directory of the WildFly distribution,

in order to be automatically deployed.

If the deployment has been successfully completed, the implemented web services described in the section above will be exposed under the following URLs:

  • http://[HOST]:[PORT]/tpi.api.tps/rest/tps/getLastObservations
  • http://[HOST]:[PORT]/tpi.api.tps/rest/tps/getObservations
  • http://[HOST]:[PORT]/tpi.api.tps/rest/tps/pushLastObservations
  • http://[HOST]:[PORT]/tpi.api.tps/rest/tps/stopPushOfObservations

where [HOST] is the host and [PORT] the port that WildFly uses.

[1] /tpi.api.tps/src/main/java/eu/fiestaiot/tpi/api/tps/rest/

[2] /tpi.api.tps/src/main/java/eu/fiestaiot/tpi/api/tps/impl/dataservices/

[3] /tpi.api.tps/src/main/java/eu/fiestaiot/tpi/api/tps/impl/dataservices/

[4] /tpi.api.tps/src/main/java/eu/fiestaiot/tpi/api/tps/impl/dataservices/

[5] /tpi.api.tps/src/main/java/eu/fiestaiot/tpi/api/tps/impl/dataservices/