Implementation of the AuthUserAdapter based on the BaseAdapter
+Creates a new AuthUser and the corresponding User
+Used data for creating the user
+returns the created user objects
+Processing and adapting of a get request
+Processing and adapting of a get_all request
+The query provided in the url. +Default is empty dictionary
+Get a AuthUser by its Username.
+username of the user
+returns the AuthUserDTO or undefined if no user with this username exists. The username should be unique.
+Processing and adapting of a post request
+The data for the object creation
+Processing and adapting of a put request
+The id of the object to update
+The data to update the object with
+Abstract
BaseAdapter +Basic abstract implementation of a Adapter between Api and Database
+Protected
constructorImplementation of the UserAdapter based on the BaseAdapter
+Constructor of the DataHandler
+The datatype that we want to see the data from.
+Implementation of the NotificationSubscriptionAdapter based on the BaseAdapter
+Checks if the provided token is valid and adds a notification subscription to the user, which is defined in the token. +The subscription data has to include a valid subscription-token and a fcmToken (to identify the device)
+The data needed to create a new subscription
+Creates a new token, which includes the UserId of this (authenticated) user. +If a friend of this user wants to receive notifications, this token can be used.
+Processing and adapting of a get request
+Processing and adapting of a get_all request
+The query provided in the url. +Default is empty dictionary
+Processing and adapting of a post request
+The data for the object creation
+Processing and adapting of a put request
+The id of the object to update
+The data to update the object with
+Sends a notification to all devices, which have subscribed to the provided User
+User whose subscribers should receive the notification
+title of the notification
+body of the notification
+Implementation of the ThingyAdapter based on the BaseAdapter
+Implementation of the UserAdapter based on the BaseAdapter
+Class for the AccidentDetectionApi
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Abstract for a Base Api that defines the basic properties
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Verifies the token specified in the header.
+Expected Header: key: Bearer, value:
HTTP Context from koa
+next method to call
+Abstract
Abstract for a Base Api that defines the basic properties
+Protected
constructorConstructor of the base middle
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the Air Pressure Api
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the Air Quality Api
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the Button Api
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the BuzzerApi
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the Co2Api
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the FlipApi
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the GPSApi
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the GPS Api
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the LedApi
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the LightApi
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Implementation of the Temp Api
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Abstract for a Base Api that defines the basic properties
+creates a token that the user can give to a friend so that the friend can subscribe for the notifications. +The request body remains empty, but it is a post request +as the response cannot be cached as a new token is generated each time (it's not idempotent)
+HTTP Context from koa +*
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Abstract for a Base Api that defines the basic properties
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Abstract for a Base Api that defines the basic properties
+Validates the Body with a given Validation Schema
+HTTP Context from koa
+Joi Validation Schema
+the validated data or undefined, if the validation was not successful
+Base Handler class for interacting with an Object in the database
+Create the object from the given data in the database
+The for the created object
+Get the json representation of the object out of the database
+The primary key of the object
+Get all objects of a given type
+The query provided for filtering. +Default is empty dictionary
+Update a given entry in the database with the provided data
+The identifier of the object
+The data to be updated
+Base Handler class for interacting with an Object in the database
+Create the object from the given data in the database
+The for the created object
+Get the json representation of the object out of the database
+The primary key of the object
+Get all objects of a given type
+The query provided for filtering. +Default is empty dictionary
+Update a given entry in the database with the provided data
+The identifier of the object
+The data to be updated
+Base Handler class for interacting with an Object in the database
+Abstract
abstract class for the DataHandler to be inherited by the child classes
+Protected
constructorImplementation of the Handler class for Data_AIR_PRESS
+Implementation of the Handler class for Data_AIR_QUAL
+Implementation of the Handler class for Data_BUTTON
+Implementation of the Handler class for Data_BUZZER
+Implementation of the Handler class for Data_CO2EQUIV
+Implementation of the Handler class for unknown Data
+Create the object from the given data in the database
+The for the created object
+Get the json representation of the object out of the database
+The primary key of the object
+Get all objects of a given type
+The query provided for filtering. +Default is empty dictionary
+Update a given entry in the database with the provided data
+The identifier of the object
+The data to be updated
+Implementation of the Handler class for Data_FLIP
+Implementation of the Handler class for Data_GPS
+Implementation of the Handler class for Data_HUMID
+Implementation of the Handler class for Data_LED
+Implementation of the Handler class for Data_LIGHT
+Implementation of the Handler class for Data_TEMP
+Base Handler class for interacting with an Object in the database
+Create the object from the given data in the database
+The for the created object
+Get the json representation of the object out of the database
+The primary key of the object
+Get all objects of a given type
+The query provided for filtering. +Default is empty dictionary
+Update a given entry in the database with the provided data
+The identifier of the object
+The data to be updated
+Base Handler class for interacting with an Object in the database
+Base Handler class for interacting with an Object in the database
+Definition of the accident Model in the database
+Definition of the User used for authentication
+Use of a separate user model so that the password hash is not leaked during normal user handling. +This model should therefore only be used for authentication purposes. +As soon as the user is authenticated, the “normal” user model is used.
+Abstract
Definition of the Base Event Model
+Definition of the Base Event Model
+Definition of the Base Event Model
+Definition of the Base Event Model
+Definition of the Base Event Model
+Definition of the Base Event Model
+Data Model for unforeseen Datavalues not specified on https://exascaleinfolab.github.io/ase2024-docs/
+Definition of the Base Event Model
+Definition of all the Event Types for Tables in the database +For more information see: https://exascaleinfolab.github.io/ase2024-docs/
+Definition of the Base Event Model
+Definition of the Base Event Model
+Definition of the Base Event Model
+Definition of the Base Event Model
+Establish a connection to the configured MQTT Broker
+Handler a mqtt message and call the handlers to insert into the datase
+the topic of the mqtt message
+the mqtt message
+Handles flip events after updating database. +Can't do it directly in Data_FLIPHandler because of circular dependencies
+To run this application, several environment variables are required.
+Since these may include sensitive credentials, do not push your .env
file.
environment Variable | +mandatory | +default Value | +
---|---|---|
MQTT_USERNAME | +true | +orange | +
MQTT_PASSWORD | +true | +< secret > | +
MQTT_PROTOCOL | +false | +mqtt | +
MQTT_HOST | +true | +163.172.151.151 | +
MQTT_PORT | +false | +1889 | +
DATABASE_HOST | +true | +docker: database , local: 127.0.0.1 |
+
DATABASE_PORT | +true | +5432 | +
POSTGRES_PASSWORD | +true | +< secret > | +
POSTGRES_USER | +true | +< secret > | +
POSTGRES_DB | +true | +thingyDB | +
API_CERT_KEY | +true | +< secret > | +
API_SALT_ROUNDS | +false | +e.g. 3 | +
Definition of the Thingy Model as data transfer object
+Definition of the AuthUser Model as plain data transfer object
+Definition of the Event Model as data transfer object
+Definition of the Thingy Model as data transfer object
+Definition of the User Model as plain data transfer object
+Definition of the Generic Data Transfer Object
+Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Const
Creating and exporting the model to be used by all the classes
+
Implementation of the AccidentAdapter based on the BaseAdapter
+