Difference between revisions of "Implementation notes"

From AMTech WikiDocs
Jump to: navigation, search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
*M2MBridge discovers and loads node.js modules that implement M2MBridge plugin interface (See [[Activities#Thing types|Thing types]]) tacking into account activity observation production configuration (See [[Activities#Observation production configuration|Observation production configuration]]) and M2MBridge user access polices (See [[Access control#Actors|Actors]] and [[M2M Bridge#Edge Configuration|Edge Configuration]]).
+
*M2MBridge discovers (locally, in the file system) and loads node.js modules that implement the M2MBridge plugin interface (See [[Activities#Thing types|Thing types]]) taking into account activity observation production configuration (See [[Activities#Observation production configuration|Observation production configuration]]) and M2MBridge user access polices (See [[Access control#Actors|Actors]] and [[M2M Bridge#Edge Configuration|Edge Configuration]]).
**It leverages AMTech IoT Protocol (See [[IoT Restful API|IoT Restful API]])
+
**M2MBridge leverages AMTech IoT Protocol (See [[IoT Restful API|IoT Restful API]])
***Clone configuration from exiting M2MBridge template instance (See [[M2M Bridge#Edge Configuration|Edge Configuration]])  
+
***Clone configuration from existing M2MBridge template instance (See [[Edge_Configuration|Edge Configuration]])  
 
***Gets observation production configuration (See [[IoT Restful API#Get observation production configuration|Observation production configuration API]])
 
***Gets observation production configuration (See [[IoT Restful API#Get observation production configuration|Observation production configuration API]])
 
***Gets things (See [[IoT Restful API#Get instances by thing type|Get instances by thing type API]])
 
***Gets things (See [[IoT Restful API#Get instances by thing type|Get instances by thing type API]])
Line 7: Line 7:
 
****Dispatch command observations to plugin instance leveraging thing type instance @id (See [[Activities#Thing types|Thing types]])
 
****Dispatch command observations to plugin instance leveraging thing type instance @id (See [[Activities#Thing types|Thing types]])
 
****Restart instance when supported properties change by calling stop and star plugin interface
 
****Restart instance when supported properties change by calling stop and star plugin interface
***Creates configuration information by Thing type leveraging configuration information and client side M2MBridge placeholders (See [[Activities#Observation production configuration|Observation production configuration]] and [[Observation enrichment#Placeholders substitution|Placeholders]])
+
***Creates configuration information by Thing type leveraging configuration information and client side M2MBridge placeholders (See [[Observation_production_config|Observation production configuration]] and [[Sensor%27s_network#Placeholders_substitution|Placeholders]])
 
***Load plugin nodes modules required by configuration
 
***Load plugin nodes modules required by configuration
 
***Creates an instance of plugin for each thing type instance using instance @id as identifier (See [[Activities#Thing types|Thing types]])
 
***Creates an instance of plugin for each thing type instance using instance @id as identifier (See [[Activities#Thing types|Thing types]])
****Plugin object is extended with the properties values from the thing instance (See [https://github.com/AMTechMX/M2MBridge/blob/master/plugins/SNMPDevice/SNMPDevice.js plugin example] )
+
****Plugin object is extended with the properties values from the thing instance (See [[HelloWorld_plugin|plugin example]] )
 
****Properties and methods are injected: (See [https://github.com/AMTechMX/M2MBridge/blob/master/plugins.js for details])
 
****Properties and methods are injected: (See [https://github.com/AMTechMX/M2MBridge/blob/master/plugins.js for details])
 
*****common logger
 
*****common logger
Line 16: Line 16:
 
*****methods for restarting plugin     
 
*****methods for restarting plugin     
 
***Creates a centralized observation dispatcher mechanism with persistence to ensure:
 
***Creates a centralized observation dispatcher mechanism with persistence to ensure:
****Observations delivery in the order that observations occurred.
+
****Observations are delivered in the order that observations occurred.
***Placeholders (See [[Observation enrichment#Placeholders substitution|Placeholders]])
+
**** #{deviceId} m2mBox Id set at bridgeConfig.json configuration file bridgeId property, or a unique id create in absence or this value
+
**** #{typeId} Unique id of the thingType that produces the event
+
**** #{thingId} Unique id of the instances that produces the event
+
**** #{tenantId} Tenant id used to authenticate the m2mBridge, defined at bridgeConfig.json tenant property
+
**** #{userId} User id used to authenticate the m2mBridge, defined at bridgeConfig.json userId property
+

Latest revision as of 18:07, 13 October 2017

  • M2MBridge discovers (locally, in the file system) and loads node.js modules that implement the M2MBridge plugin interface (See Thing types) taking into account activity observation production configuration (See Observation production configuration) and M2MBridge user access polices (See Actors and Edge Configuration).
    • M2MBridge leverages AMTech IoT Protocol (See IoT Restful API)
      • Clone configuration from existing M2MBridge template instance (See Edge Configuration)
      • Gets observation production configuration (See Observation production configuration API)
      • Gets things (See Get instances by thing type API)
      • Receive asynchronous commands and things changes (CRUD operations) (See CRUD and Commands API)
        • Dispatch command observations to plugin instance leveraging thing type instance @id (See Thing types)
        • Restart instance when supported properties change by calling stop and star plugin interface
      • Creates configuration information by Thing type leveraging configuration information and client side M2MBridge placeholders (See Observation production configuration and Placeholders)
      • Load plugin nodes modules required by configuration
      • Creates an instance of plugin for each thing type instance using instance @id as identifier (See Thing types)
        • Plugin object is extended with the properties values from the thing instance (See plugin example )
        • Properties and methods are injected: (See for details)
          • common logger
          • methods to send observations with and without enrichment
          • methods for restarting plugin
      • Creates a centralized observation dispatcher mechanism with persistence to ensure:
        • Observations are delivered in the order that observations occurred.