Guide for Extensions
3 Testbed Provider Services (Testbed to FIESTA-IoT)
3.3 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 are offered at FIESTA-IoT GitHub repository, which can be found here: https://github.com/fiesta-iot. The latest version of the components are under the “develop branch”.
The project is divided into two main packages. The “eu.fiestaiot.tpi.api.tps.rest” and “eu.fiestaiot.tpi.api.tps.impl.dataservices”:
Within this package, the “TpiApiTestbedProviderServices.java” class can be found which is the entry point for the Services described at the TPS API above.
The two main methods of interest are:
- public Response getLastObservations(String getLastObservationsPayload)
- public Response getObservations(String getObservationsPayload)
These methods analyse the payload and forwards it to the implementation of them, which resides in the following package.
eu.fiestaiot.tpi.api.tps.impl.dataservicesIn 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. The two classes are:
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.
In order to configure the prototype,
- make sure that all properties listed in $PROJECT_HOME/src/main/resources/fiesta-iot.properties have the appropriate values,
- copy that file into $WILDFLY_HOME/standalone/configuration, and
- issue the following commands:
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
If the deployment has been successfully completed, you will be able to access all web services described in the section above using the following URLs: