1)User Request to Hub from Application

    Discription: User request to get authentication details to hub.

    Direction: Application ----> SoulHub

    Request Topic: "NameSpaceId + "/CONTROLLER/" + modelNumber + "/" + SERIAL + "/HUB_REQ"
                    e.g. "TEST_123/CONTROLLER/GENfvb5fdgfgfg4/ClouzerSoulTest-51/HUB_REQ"

    Request Object:

        {
            "data":{
                "dataArray":[],
                "clientId":"IOSCocoaMQTT2726",
                "queryData":{
                    "KEY_VAL":"cloudsmaintenance.clouzer.com#PRJ_HUB_1650615290768_17#DEVICE_DRIVERS_SECTION#TSK_INST_DRV_1658485570223_88",
                    "INTERFACE_ID":"ID165848557535807991755172"
                },
                "requestId":"/sync#/sync#krkR5wEefCGcTQzaAEiEashwini.tote@clouzer.com#1658578272433r17r299",
                "userId":"ashwini.tote@bgfhiaajiafbiicfb.cloudsbuilder.clouzer.com",
                "token":"IOSCocoaMQTT2726_1658578173961",
                "CallerInfo":{
                    "source":[],
                    "caller":"soulHubAction",
                    "portalAction":true,
                    "tsEntry":1658578272526
                }
            },
            "type":"get_auth_details"
        }

2)checking soulPy process

    Discription: hub checks python process is running or not.

    Direction: SoulHub ----> ProcessMonitor

    Process: "soulPy"

    Request Topic: "process/status/get"

    Response Topic: "process/status/get_res"

3)hub request to db for interfaces

    Discription: Hub needs to fetch the interfaces therefore hub request to database.

    Direction: SoulHub ----> soulPy

    Request Topic: "soulDb/fetch"

    Request Object:

        {
            "data":{
                "entity_type":"interfaces",
                "and":{
                    "eq":{
                        "KEY_VAL":"cloudsmaintenance.clouzer.com#PRJ_HUB_1650615290768_17#DEVICE_DRIVERS_SECTION#TSK_INST_DRV_1658485570223_88"
                    }
                }
            },
            "communicationId":"1658578272529getCredentials6",
            "CallerInfo":{
                "source":[],
                "caller":"soulHubAction",
                "portalAction":true,
                "tsEntry":1658578272526
            }
        }

    Direction: soulPy ----> soulHub

    Response Topic: "soulDb/Response"

    Response Object:

        {
            "data":[
                {
                    "INTERFACE_ID":"ID165848557535807991755172",
                    "LKEY_VAL":"ID165848557535807991755172",
                    "KEY_VAL":"cloudsmaintenance.clouzer.com#PRJ_HUB_1650615290768_17#DEVICE_DRIVERS_SECTION#TSK_INST_DRV_1658485570223_88",
                    "ACTIVE_STATUS":1,
                    "CML_TYPE":-1,
                    "CML_SUB_TYPE":-1,
                    "CML_MODE":-1,
                    "CML_TITLE":"honeywell clouds",
                    "CML_VERSION":"0.0.8",
                    "TYPE_OF_AUTH":3,
                    "MODE_OF_AUTH":2,
                    "URL_PROVIDER":"www.honeywell.com",
                    "IS_TESTING":1,
                    "DRIVER_NAME":"driver-1640851466744_935",
                    "CML_MANUFACTURER":"honeywell",
                    "entity_type":"interfaces",
                    "CML_MANUFACTURER_ID":"honeywell.clouzer.com#PRJ_ORG_WKS_1614070570544_8614"
                }
            ],
            "type":"dbFetch",
            "communicationId":"1658578272529getCredentials6",
            "CallerInfo":{
                "portalAction":true,
                "caller":"soulHubAction",
                "source":[
                    "soulHub",
                    "soulPy"
                ]
            }
        }

4)hub request to dapi for authentication

    Discription: after fetching interfaces from db hub checks the authentication details.

    Direction: SoulHub ----> Dapi

    Driver: "HONEYWELL"

    Request Topic: interfaceId + "/getAuthDetails" e.g. = (ID165848557535807991755172/getAuthDetails)

    Request Object:

        {
            "dataArray":[],
            "clientId":"IOSCocoaMQTT2726",
            "queryData":{
                "KEY_VAL":"cloudsmaintenance.clouzer.com#PRJ_HUB_1650615290768_17#DEVICE_DRIVERS_SECTION#TSK_INST_DRV_1658485570223_88",
                "INTERFACE_ID":"ID165848557535807991755172"
            },
            "requestId":"/sync#/sync#krkR5wEefCGcTQzaAEiEashwini.tote@clouzer.com#1658578272433r17r299",
            "userId":"ashwini.tote@bgfhiaajiafbiicfb.cloudsbuilder.clouzer.com",
            "token":"IOSCocoaMQTT2726_1658578173961",
            "CallerInfo":{
                "source":[
                    "soulHub"
                ],
                "caller":"soulHubAction",
                "portalAction":true,
                "tsEntry":1658578272526
            },
            "communicationId":"1658578272529getAuthDetails80"
        }

    Direction: DAPI ----> soulHub

    Response Topic: "third_party_url"

    Response Object:

        {
            "data":{
                "ACTIVE_STATUS":1,
                "STATE":"ClouzerSoulTest-51",
                "AUTH_LOCATION":"https://api.honeywell.com/oauth2/authorize?response_type=code&client_id=IDXXJeH66FujsvqjTz8vNVF6LYGUJGx3&redirect_uri=https://test.clouzer.com/ApiHoneywellAuth&state=ClouzerSoulTest-51_ID165848557535807991755172"
            },
            "communicationId":"1658578272529getAuthDetails80"
        }

5)hub sends rersponse to the App

    Discription: hub sends back the response after fetching authentication details from the dapi drivers

    Direction: SoulHub ----> Application

    Response Topic: hubActionResponse/Installer

    Response Object:

        {
            "type":"get_auth_details_hub",
            "dataArray":[
                {
                    "ACTIVE_STATUS":1,
                    "STATE":"ClouzerSoulTest-51",
                    "AUTH_LOCATION":"https://api.honeywell.com/oauth2/authorize?response_type=code&client_id=IDXXJeH66FujsvqjTz8vNVF6LYGUJGx3&redirect_uri=https://test.clouzer.com/ApiHoneywellAuth&state=ClouzerSoulTest-51_ID165848557535807991755172"
                }
            ],
            "requestId":"/sync#/sync#krkR5wEefCGcTQzaAEiEashwini.tote@clouzer.com#1658578272433r17r299",
            "CallerInfo":{
                "source":[],
                "caller":"soulHubAction"
            },
            "userId":"ashwini.tote@bgfhiaajiafbiicfb.cloudsbuilder.clouzer.com",
            "clientId":"IOSCocoaMQTT2726"
        }

Sequence Diagram

test