MOD13 OI4: Conformity Validator - GoranErdeljan/TINF19C-Team-4-Service-Registry GitHub Wiki

Created by Benedict Wetzel

1. Introduction

This module offers functionality to check whether TXT-Records are conform with the OI4-Specification and is a sub-module of MOD10.

2. Requirements

The following requirements are covered by this module:

3. Prerequisites

In order to use this module the following prerequisites should be met:

  • The developer should have a working computer that can access the internet
  • The developer should use a Linux-based OS
  • The developer should have Node.js version 12.14.1 or higher installed
  • The developer should have NPM version 7.10.0 or higher installed
  • The developer should have at least some basic experience with Node.js

4. Dependencies

This module has no dependencies.

5. Technical overview

This module is used to check for conformity with the specifications by the OI4. Having this functionality in a seperate module makes it easy to extend checks for conformity.

5.2 oi4ConformityValidator.js

Function Description
setConfig Sets the configuration of the module. This function must be called before any other functions of this module are called.
check Checks whether the passed TXT-Records should be registered at the OI4-Registry. It returns true when the records contain "oi4=true" and there is no DataSetWriterId specified in the TXT-records or that DataSetWriterId is different to the oi4-Identifier set in the configuration, otherwise the function will return false
buildmam Uses check to determine whether the records are supposed to be published at the MQTT-Broker. If that returns true, it returns a complete Master-Asset-Model, otherwise the return value will be undefined