{"id":22868509,"url":"https://github.com/datavenueliveobjects/external-connector-sdk-liveobjects-","last_synced_at":"2025-03-31T10:50:54.937Z","repository":{"id":45525690,"uuid":"276213711","full_name":"DatavenueLiveObjects/external-connector-SDK-LiveObjects-","owner":"DatavenueLiveObjects","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-16T13:50:46.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T15:53:34.847Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DatavenueLiveObjects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-30T21:36:06.000Z","updated_at":"2023-01-16T13:27:50.000Z","dependencies_parsed_at":"2023-02-10T03:46:09.503Z","dependency_job_id":null,"html_url":"https://github.com/DatavenueLiveObjects/external-connector-SDK-LiveObjects-","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2Fexternal-connector-SDK-LiveObjects-","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2Fexternal-connector-SDK-LiveObjects-/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2Fexternal-connector-SDK-LiveObjects-/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2Fexternal-connector-SDK-LiveObjects-/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DatavenueLiveObjects","download_url":"https://codeload.github.com/DatavenueLiveObjects/external-connector-SDK-LiveObjects-/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246458022,"owners_count":20780675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T12:35:36.088Z","updated_at":"2025-03-31T10:50:54.910Z","avatar_url":"https://github.com/DatavenueLiveObjects.png","language":"Java","readme":"## Table of contents\n* [General info](#general-info)\n* [Technologies](#technologies)\n* [Requirements](#requirements)\n* [Build](#build)\n* [Examples](#examples)\n\n## General info\nThis repository contains everything you need to create the external connector mode connection with Live Objects. This project is intended for Live Objects users wishing to explore the external connector mode integration patterns. When you will connect devices that can not use a native connectivity in Live Objects, you can use this library.\n\nMain features are:\n* publish data and devices status\n* manage devices commands: subscribe to command requests and publish command responses\n\nThis library is using SLF4J facade for logging systems allowing the end-user to plug-in the desired logging system at deployment time.\n\n## Technologies\n* Java 8\n* Eclipse Paho 1.2.4\n* Jackson 2.9.0\n* Jackson Databind 2.9.9.3\n* SLF4J API Module 1.7.30\n\n## Requirements\nIn order to use the x-connector-library you need to have:\n* **Live Objects account with external connector API key** (API key generation is described in the [user guide](https://liveobjects.orange-business.com/cms/app/uploads/EN_User-guide-Live-Objects-4.pdf#%5B%7B%22num%22%3A190%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C68%2C574%2C0%5D)),\n* **Java SE Development Kit 8 installed**\n* **Apache Maven installed**\n\nDevice registration in Live Objects isn't required. If it does not exist, it will be automatically created from node Id before publishing its status.\n\n## Build\nIf you want to build x-connector-library, please first clone this repository, then:  \n```\nmvn clean package\n```\nThe jar file built in this way should be attached to the project as a library. \n\n## Examples\n\n#### Creating an ExternalConnectorClient\nTo create an `ExternalConnectorClient` instance and create a connection to Live Objects, you must create an `ExternalConnectorParameters` instance and pass it to `ExternalConnectorClient` constructor:\n```\nExternalConnectorParameters parameters = ExternalConnectorParameters.builder()\n                .hostname(\"ssl://liveobjects.orange-business.com:8883\")\n                .apiKey(\"abcDEfgH123I\")\n                .build();\nExternalConnectorClient externalConnectorClient = new ExternalConnectorClient(parameters);\n```\nNote that an API key and host name are required.\n\n#### Opening the connection\n\nYou can use the sample code to open the connection:\n```\nexternalConnectorClient.connect();\n```\n\n#### NodeStatus publication\nA NodeStatus publication allows to set the ONLINE/OFFLINE status of the device and its capacity to receive or not command requests. To send the NodeStatus to Live Objects, you can use the sample code:\n```\nNodeStatus nodeStatus = new NodeStatus();\nnodeStatus.setStatus(Status.ONLINE);\nnodeStatus.setCapabilities(new NodeStatus.Capabilities(true));\nexternalConnectorClient.sendStatus(exConnectorNodeId, nodeStatus);\n```\n\n#### Data message publication\nA DataMessage publication allows to send a DataMessage on behalf of a specific device. To send DataMessage to Live Objects, you can use the sample code:\n```\nValue payload = new Value(\"payload value\");\nDataMessage dataMessage = new DataMessage();\ndataMessage.setValue(payload);\nexternalConnectorClient.sendMessage(exConnectorNodeId, dataMessage);\n```\nThe data messages sent to the Live Objects platform can be encoded in a customer specific format. For instance, the payload may be a string containing an hexadecimal value or a csv value. In order to use the decoding capability of LiveObjects, a DataMessage must contains additional `value.payload` and `metadata.encoding` fields. To send encoded DataMessage to Live Objects, you can use the sample code:\n```\nValue value = new Value(\"15;25\");\nMetadata metadata = new Metadata(\"test_csv\");\nDataMessage dataMessage = new DataMessage();\ndataMessage.setValue(value);\ndataMessage.setMetadata(metadata);\nexternalConnectorClient.sendMessage(exConnectorNodeId, dataMessage);\n```\nFor more information on decoding, see the [user guide](https://liveobjects.orange-business.com/doc/html/lo_manual_v2.html#DEC).\n\n#### Commands\nA command request is a downlink message that Live Objects sends to the device, with acknowledgement mechanism.\n\nIn order to receive all command requests targeting your devices, you should implement your own message handling class implementing `MessageCallback`: \n```\npublic class MyMessageCallback implements MessageCallback {\n    @Override\n    public Object onMessage(CommandRequest commandRequest) {\n        return null;\n    }\n}\n```\nIf acknowledgement mode isn't set to `NONE`, a command response with the request’s id will be published automatically. Object returned by `onMessage` method will be used as value of response field inside command response. If you want the response field to be blank, return `null`.\n\nUse that prepared `MessageCallback` to create an `ExternalConnectorClient`:\n```\nExternalConnectorParameters parameters = ExternalConnectorParameters.builder()\n                .hostname(\"ssl://liveobjects.orange-business.com:8883\")\n                .apiKey(\"abcDEfgH123I\")\n                .messageCallback(new MyMessageCallback())\n                .build();\nExternalConnectorClient externalConnectorClient = new ExternalConnectorClient(parameters);\n```\n\n#### Closing the connection\n\nYou can use the sample code to close the connection:\n```\nexternalConnectorClient.disconnect();\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatavenueliveobjects%2Fexternal-connector-sdk-liveobjects-","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatavenueliveobjects%2Fexternal-connector-sdk-liveobjects-","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatavenueliveobjects%2Fexternal-connector-sdk-liveobjects-/lists"}