Package de.iip_ecosphere.platform.connectors

The connectors component defining the interface to generic machine/platform connectors. Main classes here are the Some protocols like OPC or Asset Administration Shells (AAS) rely on an information model. Accessing this model in a uniform manner (although some functionality may not be supported depending on the protocol) is described in ModelAccess. For other protocols like MQTT this information model is optional. Connectors have several template parameters, including the data types accessible from the platform (CI for input into the connector, CO for output produced by the connector), the internal data types to be handed over to the underlying protocol implementation (I for input into the protocol, O for output from the protocol) and D for the value data type used in the optional model. For payload-based protocols like MQTT, I and O define the payload type, usually byte[] while CI and CO are left open to be handled by plugins based on InputTypeTranslator and OutputTypeTranslator. For model-based protocols like OPC, I and O are of less significance as the attached type translators directly query the model and produce from that instances of CO or read instances of CI. However, more information must be set up there, so the type translators are refined into ConnectorInputTypeTranslator and ConnectorOutputTypeTranslator. A connector shall define a ConnectorDescriptor as top-level inner class and register the descriptor as service, i.e. provide de.iip_ecosphere.platform.connectors.ConnectorDescriptor file in the META-INF/services folder. To ease working with the type translations, a connector may have a ProtocolAdapter, its basic implementation TranslatingProtocolAdapter utilizes the refined type transformators. Channel-based protocols like MQTT require even more information, here provided through ChannelProtocolAdapter. Moreover, basic implementations for connectors, model access or even the type translators is desirable, as required conventions are already implemented. Thus, when setting up a new connector, please take these classes into account. In some situations it would be desirable to reuse existing serializers. Therefore, we offer the type translation adapters ConnectorInputTypeAdapter and ConnectorOutputTypeAdapter. They can optionally be used as input arguments while connector creation.