diff --git a/application/src/main/data/json/demo/dashboards/gateways.json b/application/src/main/data/json/demo/dashboards/gateways.json
deleted file mode 100644
index f4eb275c3c..0000000000
--- a/application/src/main/data/json/demo/dashboards/gateways.json
+++ /dev/null
@@ -1,1315 +0,0 @@
-{
- "title": "Gateways",
- "image": null,
- "mobileHide": false,
- "mobileOrder": null,
- "configuration": {
- "widgets": {
- "94715984-ae74-76e4-20b7-2f956b01ed80": {
- "type": "latest",
- "sizeX": 24,
- "sizeY": 12,
- "config": {
- "timewindow": {
- "displayValue": "",
- "selectedTab": 0,
- "realtime": {
- "realtimeType": 1,
- "interval": 1000,
- "timewindowMs": 86400000,
- "quickInterval": "CURRENT_DAY"
- },
- "history": {
- "historyType": 0,
- "interval": 1000,
- "timewindowMs": 60000,
- "fixedTimewindow": {
- "startTimeMs": 1694085270425,
- "endTimeMs": 1694171670425
- },
- "quickInterval": "CURRENT_DAY"
- },
- "aggregation": {
- "type": "NONE",
- "limit": 200
- }
- },
- "showTitle": true,
- "backgroundColor": "rgb(255, 255, 255)",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "4px",
- "settings": {
- "enableSearch": true,
- "displayPagination": true,
- "defaultPageSize": 10,
- "defaultSortOrder": "entityName",
- "displayEntityName": true,
- "displayEntityType": false,
- "entitiesTitle": "List of gateways",
- "enableSelectColumnDisplay": true,
- "displayEntityLabel": false,
- "entityNameColumnTitle": "Gateway Name"
- },
- "title": "Devices gateway table",
- "dropShadow": true,
- "enableFullscreen": true,
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400,
- "padding": "5px 10px 5px 10px"
- },
- "useDashboardTimewindow": false,
- "showLegend": false,
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [
- {
- "name": "active",
- "type": "attribute",
- "label": "Active",
- "color": "#2196f3",
- "settings": {
- "columnWidth": "0px",
- "useCellStyleFunction": true,
- "useCellContentFunction": true,
- "cellContentFunction": "value = '⬤';\nreturn value;",
- "cellStyleFunction": "var color;\nif (value == 'false') {\n color = '#EB5757';\n} else {\n color = '#27AE60';\n}\nreturn {\n color: color,\n fontSize: '18px'\n};"
- },
- "_hash": 0.3646047595211721
- },
- {
- "name": "eventsSent",
- "type": "timeseries",
- "label": "Sent",
- "color": "#4caf50",
- "settings": {
- "columnWidth": "0px",
- "useCellStyleFunction": false,
- "useCellContentFunction": false
- },
- "_hash": 0.7235710720767985
- },
- {
- "name": "eventsProduced",
- "type": "timeseries",
- "label": "Events",
- "color": "#f44336",
- "settings": {
- "columnWidth": "0px",
- "useCellStyleFunction": false,
- "useCellContentFunction": false
- },
- "_hash": 0.5085933386303254
- },
- {
- "name": "LOGS",
- "type": "timeseries",
- "label": "Latest log",
- "color": "#ffc107",
- "settings": {
- "columnWidth": "0px",
- "useCellStyleFunction": false,
- "useCellContentFunction": false
- },
- "_hash": 0.3504240371585048,
- "postFuncBody": "if(value) {\n return value.substring(0, 31) + \"...\";\n} else {\n return '';\n}"
- },
- {
- "name": "RemoteLoggingLevel",
- "type": "attribute",
- "label": "Log level",
- "color": "#607d8b",
- "settings": {
- "columnWidth": "0px",
- "useCellStyleFunction": false,
- "useCellContentFunction": false
- },
- "_hash": 0.9785994222542516
- }
- ],
- "entityAliasId": "3e0f533a-0db1-3292-184f-06e73535061a"
- }
- ],
- "showTitleIcon": true,
- "titleIcon": "list",
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "List device",
- "widgetStyle": {},
- "displayTimewindow": true,
- "actions": {
- "headerButton": [
- {
- "name": "Add device",
- "icon": "add",
- "type": "customPretty",
- "customHtml": "
\n",
- "customCss": "",
- "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\n\nopenAddDeviceDialog();\n\nfunction openAddDeviceDialog() {\n customDialog.customDialog(htmlTemplate, AddDeviceDialogController).subscribe();\n}\n\nfunction AddDeviceDialogController(instance) {\n let vm = instance;\n \n vm.addDeviceFormGroup = vm.fb.group({\n deviceName: ['', [vm.validators.required]],\n deviceLabel: [''],\n attributes: vm.fb.group({\n latitude: [null],\n longitude: [null]\n }) \n });\n \n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n \n vm.save = function() {\n vm.addDeviceFormGroup.markAsPristine();\n let device = {\n additionalInfo: {gateway: true},\n name: vm.addDeviceFormGroup.get('deviceName').value,\n type: 'gateway',\n label: vm.addDeviceFormGroup.get('deviceLabel').value\n };\n deviceService.saveDevice(device).subscribe(\n function (device) {\n saveAttributes(device.id).subscribe(\n function () {\n widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n }\n );\n };\n \n function saveAttributes(entityId) {\n let attributes = vm.addDeviceFormGroup.get('attributes').value;\n let attributesArray = [];\n for (let key in attributes) {\n attributesArray.push({key: key, value: attributes[key]});\n }\n if (attributesArray.length > 0) {\n return attributeService.saveEntityAttributes(entityId, \"SERVER_SCOPE\", attributesArray);\n } else {\n return widgetContext.rxjs.of([]);\n }\n }\n}\n",
- "customResources": [],
- "id": "70837a9d-c3de-a9a7-03c5-dccd14998758"
- }
- ],
- "actionCellButton": [
- {
- "id": "78845501-234e-a452-6819-82b5b776e99f",
- "name": "Configuration",
- "icon": "settings",
- "type": "openDashboardState",
- "targetDashboardStateId": "__entityname__config",
- "openRightLayout": false,
- "setEntityId": true
- },
- {
- "id": "f6ffdba8-e40f-2b8d-851b-f5ecaf18606b",
- "name": "Graphs",
- "icon": "show_chart",
- "type": "openDashboardState",
- "targetDashboardStateId": "__entityname_grafic",
- "setEntityId": true
- },
- {
- "name": "Edit device",
- "icon": "edit",
- "type": "customPretty",
- "customHtml": "\n",
- "customCss": "/*=======================================================================*/\n/*========== There are two examples: for edit and add entity ==========*/\n/*=======================================================================*/\n/*======================== Edit entity example ========================*/\n/*=======================================================================*/\n/*\n.edit-entity-form md-input-container {\n padding-right: 10px;\n}\n\n.edit-entity-form .boolean-value-input {\n padding-left: 5px;\n}\n\n.edit-entity-form .boolean-value-input .checkbox-label {\n margin-bottom: 8px;\n color: rgba(0,0,0,0.54);\n font-size: 12px;\n}\n\n.relations-list .header {\n padding-right: 5px;\n padding-bottom: 5px;\n padding-left: 5px;\n}\n\n.relations-list .header .cell {\n padding-right: 5px;\n padding-left: 5px;\n font-size: 12px;\n font-weight: 700;\n color: rgba(0, 0, 0, .54);\n white-space: nowrap;\n}\n\n.relations-list .body {\n padding-right: 5px;\n padding-bottom: 15px;\n padding-left: 5px;\n}\n\n.relations-list .body .row {\n padding-top: 5px;\n}\n\n.relations-list .body .cell {\n padding-right: 5px;\n padding-left: 5px;\n}\n\n.relations-list .body md-autocomplete-wrap md-input-container {\n height: 30px;\n}\n\n.relations-list .body .md-button {\n margin: 0;\n}\n\n.relations-list.old-relations tb-entity-select tb-entity-autocomplete button {\n display: none;\n} \n*/\n/*========================================================================*/\n/*========================= Add entity example =========================*/\n/*========================================================================*/\n/*\n.add-entity-form md-input-container {\n padding-right: 10px;\n}\n\n.add-entity-form .boolean-value-input {\n padding-left: 5px;\n}\n\n.add-entity-form .boolean-value-input .checkbox-label {\n margin-bottom: 8px;\n color: rgba(0,0,0,0.54);\n font-size: 12px;\n}\n\n.relations-list .header {\n padding-right: 5px;\n padding-bottom: 5px;\n padding-left: 5px;\n}\n\n.relations-list .header .cell {\n padding-right: 5px;\n padding-left: 5px;\n font-size: 12px;\n font-weight: 700;\n color: rgba(0, 0, 0, .54);\n white-space: nowrap;\n}\n\n.relations-list .body {\n padding-right: 5px;\n padding-bottom: 15px;\n padding-left: 5px;\n}\n\n.relations-list .body .row {\n padding-top: 5px;\n}\n\n.relations-list .body .cell {\n padding-right: 5px;\n padding-left: 5px;\n}\n\n.relations-list .body md-autocomplete-wrap md-input-container {\n height: 30px;\n}\n\n.relations-list .body .md-button {\n margin: 0;\n}\n*/\n",
- "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet customDialog = $injector.get(widgetContext.servicesMap.get('customDialog'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\nlet attributeService = $injector.get(widgetContext.servicesMap.get('attributeService'));\n\nopenEditDeviceDialog();\n\nfunction openEditDeviceDialog() {\n customDialog.customDialog(htmlTemplate, EditDeviceDialogController).subscribe();\n}\n\nfunction EditDeviceDialogController(instance) {\n let vm = instance;\n \n vm.device = null;\n vm.attributes = {};\n \n vm.editDeviceFormGroup = vm.fb.group({\n deviceName: ['', [vm.validators.required]],\n deviceLabel: [''],\n attributes: vm.fb.group({\n latitude: [null],\n longitude: [null]\n }) \n });\n \n vm.cancel = function() {\n vm.dialogRef.close(null);\n };\n \n vm.save = function() {\n vm.editDeviceFormGroup.markAsPristine();\n vm.device.name = vm.editDeviceFormGroup.get('deviceName').value;\n vm.device.label = vm.editDeviceFormGroup.get('deviceLabel').value;\n deviceService.saveDevice(vm.device).subscribe(\n function () {\n saveAttributes().subscribe(\n function () {\n widgetContext.updateAliases();\n vm.dialogRef.close(null);\n }\n );\n }\n );\n };\n \n getEntityInfo();\n \n function getEntityInfo() {\n deviceService.getDevice(entityId.id).subscribe(\n function (device) {\n attributeService.getEntityAttributes(entityId, 'SERVER_SCOPE',\n ['latitude', 'longitude']).subscribe(\n function (attributes) {\n for (let i = 0; i < attributes.length; i++) {\n vm.attributes[attributes[i].key] = attributes[i].value; \n }\n vm.device = device;\n vm.editDeviceFormGroup.patchValue(\n {\n deviceName: vm.device.name,\n deviceLabel: vm.device.label,\n attributes: {\n latitude: vm.attributes.latitude,\n longitude: vm.attributes.longitude\n }\n }, {emitEvent: false}\n );\n } \n );\n }\n ); \n }\n \n function saveAttributes() {\n let attributes = vm.editDeviceFormGroup.get('attributes').value;\n let attributesArray = [];\n for (let key in attributes) {\n attributesArray.push({key: key, value: attributes[key]});\n }\n if (attributesArray.length > 0) {\n return attributeService.saveEntityAttributes(entityId, 'SERVER_SCOPE', attributesArray);\n } else {\n return widgetContext.rxjs.of([]);\n }\n }\n}\n",
- "customResources": [],
- "id": "242671f3-76c6-6982-7acc-6f12addf0ccc"
- },
- {
- "name": "Delete device",
- "icon": "delete",
- "type": "custom",
- "customFunction": "let $injector = widgetContext.$scope.$injector;\nlet dialogs = $injector.get(widgetContext.servicesMap.get('dialogs'));\nlet deviceService = $injector.get(widgetContext.servicesMap.get('deviceService'));\n\nopenDeleteDeviceDialog();\n\nfunction openDeleteDeviceDialog() {\n let title = \"Are you sure you want to delete the device \" + entityName + \"?\";\n let content = \"Be careful, after the confirmation, the device and all related data will become unrecoverable!\";\n dialogs.confirm(title, content, 'Cancel', 'Delete').subscribe(\n function (result) {\n if (result) {\n deleteDevice();\n }\n }\n );\n}\n\nfunction deleteDevice() {\n deviceService.deleteDevice(entityId.id).subscribe(\n function () {\n widgetContext.updateAliases();\n }\n );\n}\n",
- "id": "862ec2b7-fbcf-376e-f85f-b77c07f36efa"
- }
- ],
- "rowClick": [
- {
- "id": "ad5fc7e1-5e60-e056-6940-a75a383466a1",
- "name": "to_entityname__config",
- "icon": "more_horiz",
- "type": "openDashboardState",
- "targetDashboardStateId": "__entityname__config",
- "setEntityId": true,
- "stateEntityParamName": ""
- }
- ]
- }
- },
- "id": "94715984-ae74-76e4-20b7-2f956b01ed80",
- "typeFullFqn": "system.entity_admin_widgets.device_admin_table"
- },
- "eadabbc7-519e-76fc-ba10-b3fe8c18da10": {
- "type": "timeseries",
- "sizeX": 14,
- "sizeY": 13,
- "config": {
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [
- {
- "name": "LOGS",
- "type": "timeseries",
- "label": "LOGS",
- "color": "#2196f3",
- "settings": {
- "useCellStyleFunction": false,
- "useCellContentFunction": false
- },
- "_hash": 0.3496649158709739,
- "postFuncBody": "return value.replace(/ - (.*) - \\[/gi, ' - $1 - [');"
- }
- ],
- "entityAliasId": "b2487e75-2fa4-f211-142c-434dfd50c70c"
- }
- ],
- "timewindow": {
- "realtime": {
- "interval": 1000,
- "timewindowMs": 2592000000
- },
- "aggregation": {
- "type": "NONE",
- "limit": 200
- }
- },
- "showTitle": true,
- "backgroundColor": "rgb(255, 255, 255)",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "8px",
- "settings": {
- "showTimestamp": true,
- "displayPagination": true,
- "defaultPageSize": 10
- },
- "title": "Debug events (logs)",
- "dropShadow": true,
- "enableFullscreen": true,
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "useDashboardTimewindow": false,
- "showLegend": false,
- "widgetStyle": {},
- "actions": {},
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "displayTimewindow": true
- },
- "id": "eadabbc7-519e-76fc-ba10-b3fe8c18da10",
- "typeFullFqn": "system.cards.timeseries_table"
- },
- "f928afc4-30d1-8d0c-e3cf-777f9f9d1155": {
- "type": "timeseries",
- "sizeX": 17,
- "sizeY": 4,
- "config": {
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [
- {
- "name": "opcuaEventsProduced",
- "type": "timeseries",
- "label": "opcuaEventsProduced",
- "color": "#2196f3",
- "settings": {
- "excludeFromStacking": false,
- "hideDataByDefault": false,
- "disableDataHiding": false,
- "removeFromLegend": false,
- "showLines": true,
- "fillLines": false,
- "showPoints": false,
- "showPointShape": "circle",
- "pointShapeFormatter": "var size = radius * Math.sqrt(Math.PI) / 2;\nctx.moveTo(x - size, y - size);\nctx.lineTo(x + size, y + size);\nctx.moveTo(x - size, y + size);\nctx.lineTo(x + size, y - size);",
- "showPointsLineWidth": 5,
- "showPointsRadius": 3,
- "tooltipValueFormatter": "",
- "showSeparateAxis": false,
- "axisTitle": "",
- "axisPosition": "left",
- "axisTicksFormatter": "",
- "comparisonSettings": {
- "showValuesForComparison": true,
- "comparisonValuesLabel": "",
- "color": ""
- }
- },
- "_hash": 0.1477920581839779
- },
- {
- "name": "opcuaEventsSent",
- "type": "timeseries",
- "label": "opcuaEventsSent",
- "color": "#4caf50",
- "settings": {
- "excludeFromStacking": false,
- "hideDataByDefault": false,
- "disableDataHiding": false,
- "removeFromLegend": false,
- "showLines": true,
- "fillLines": false,
- "showPoints": false,
- "showPointShape": "circle",
- "pointShapeFormatter": "var size = radius * Math.sqrt(Math.PI) / 2;\nctx.moveTo(x - size, y - size);\nctx.lineTo(x + size, y + size);\nctx.moveTo(x - size, y + size);\nctx.lineTo(x + size, y - size);",
- "showPointsLineWidth": 5,
- "showPointsRadius": 3,
- "tooltipValueFormatter": "",
- "showSeparateAxis": false,
- "axisTitle": "",
- "axisPosition": "left",
- "axisTicksFormatter": "",
- "comparisonSettings": {
- "showValuesForComparison": true,
- "comparisonValuesLabel": "",
- "color": ""
- }
- },
- "_hash": 0.6500957113784758
- }
- ],
- "entityAliasId": "b2487e75-2fa4-f211-142c-434dfd50c70c"
- }
- ],
- "timewindow": {
- "realtime": {
- "interval": 1000,
- "timewindowMs": 120000
- },
- "aggregation": {
- "type": "NONE",
- "limit": 25000
- },
- "hideInterval": false,
- "hideAggregation": false
- },
- "showTitle": true,
- "backgroundColor": "#fff",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "8px",
- "settings": {
- "shadowSize": 4,
- "fontColor": "#545454",
- "fontSize": 10,
- "xaxis": {
- "showLabels": true,
- "color": "#545454"
- },
- "yaxis": {
- "showLabels": true,
- "color": "#545454"
- },
- "grid": {
- "color": "#545454",
- "tickColor": "#DDDDDD",
- "verticalLines": true,
- "horizontalLines": true,
- "outlineWidth": 1
- },
- "stack": false,
- "tooltipIndividual": false,
- "timeForComparison": "months",
- "xaxisSecond": {
- "axisPosition": "top",
- "showLabels": true
- },
- "showLegend": true,
- "legendConfig": {
- "direction": "column",
- "position": "right",
- "showMin": true,
- "showMax": true,
- "showAvg": true,
- "showTotal": true
- }
- },
- "title": "Real time information",
- "dropShadow": true,
- "enableFullscreen": true,
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "mobileHeight": null,
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "widgetStyle": {},
- "useDashboardTimewindow": false,
- "displayTimewindow": true,
- "actions": {}
- },
- "id": "f928afc4-30d1-8d0c-e3cf-777f9f9d1155",
- "typeFullFqn": "system.charts.basic_timeseries"
- },
- "2a95b473-042d-59d0-2da2-40d0cccb6c8a": {
- "type": "timeseries",
- "sizeX": 7,
- "sizeY": 7,
- "config": {
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [
- {
- "name": "eventsSent",
- "type": "timeseries",
- "label": "Events",
- "color": "#2196f3",
- "settings": {
- "useCellStyleFunction": false,
- "useCellContentFunction": false
- },
- "_hash": 0.8156044798125357
- },
- {
- "name": "eventsProduced",
- "type": "timeseries",
- "label": "Produced",
- "color": "#4caf50",
- "settings": {
- "useCellStyleFunction": false,
- "useCellContentFunction": false
- },
- "_hash": 0.6538259344015449
- }
- ],
- "entityAliasId": "b2487e75-2fa4-f211-142c-434dfd50c70c"
- }
- ],
- "timewindow": {
- "realtime": {
- "interval": 1000,
- "timewindowMs": 604800000
- },
- "aggregation": {
- "type": "NONE",
- "limit": 200
- }
- },
- "showTitle": true,
- "backgroundColor": "rgb(255, 255, 255)",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "8px",
- "settings": {
- "showTimestamp": true,
- "displayPagination": true,
- "defaultPageSize": 6,
- "hideEmptyLines": true
- },
- "title": "Total Messages",
- "dropShadow": true,
- "enableFullscreen": true,
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "useDashboardTimewindow": false,
- "showLegend": false,
- "widgetStyle": {},
- "actions": {},
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "displayTimewindow": true,
- "legendConfig": {
- "direction": "column",
- "position": "bottom",
- "showMin": false,
- "showMax": false,
- "showAvg": true,
- "showTotal": false
- }
- },
- "id": "2a95b473-042d-59d0-2da2-40d0cccb6c8a",
- "typeFullFqn": "system.cards.timeseries_table"
- },
- "aaa69366-aacc-9028-65aa-645c0f8533ec": {
- "type": "timeseries",
- "sizeX": 17,
- "sizeY": 4,
- "config": {
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [
- {
- "name": "eventsSent",
- "type": "timeseries",
- "label": "eventsSent",
- "color": "#2196f3",
- "settings": {
- "excludeFromStacking": false,
- "hideDataByDefault": false,
- "disableDataHiding": false,
- "removeFromLegend": false,
- "showLines": true,
- "fillLines": false,
- "showPoints": false,
- "showPointShape": "circle",
- "pointShapeFormatter": "var size = radius * Math.sqrt(Math.PI) / 2;\nctx.moveTo(x - size, y - size);\nctx.lineTo(x + size, y + size);\nctx.moveTo(x - size, y + size);\nctx.lineTo(x + size, y - size);",
- "showPointsLineWidth": 5,
- "showPointsRadius": 3,
- "tooltipValueFormatter": "",
- "showSeparateAxis": false,
- "axisTitle": "",
- "axisPosition": "left",
- "axisTicksFormatter": "",
- "comparisonSettings": {
- "showValuesForComparison": true,
- "comparisonValuesLabel": "",
- "color": ""
- }
- },
- "_hash": 0.41414001784591314
- },
- {
- "name": "eventsProduced",
- "type": "timeseries",
- "label": "eventsProduced",
- "color": "#4caf50",
- "settings": {
- "excludeFromStacking": false,
- "hideDataByDefault": false,
- "disableDataHiding": false,
- "removeFromLegend": false,
- "showLines": true,
- "fillLines": false,
- "showPoints": false,
- "showPointShape": "circle",
- "pointShapeFormatter": "var size = radius * Math.sqrt(Math.PI) / 2;\nctx.moveTo(x - size, y - size);\nctx.lineTo(x + size, y + size);\nctx.moveTo(x - size, y + size);\nctx.lineTo(x + size, y - size);",
- "showPointsLineWidth": 5,
- "showPointsRadius": 3,
- "tooltipValueFormatter": "",
- "showSeparateAxis": false,
- "axisTitle": "",
- "axisPosition": "left",
- "axisTicksFormatter": "",
- "comparisonSettings": {
- "showValuesForComparison": true,
- "comparisonValuesLabel": "",
- "color": ""
- }
- },
- "_hash": 0.7819101846284422
- }
- ],
- "entityAliasId": "b2487e75-2fa4-f211-142c-434dfd50c70c"
- }
- ],
- "timewindow": {
- "realtime": {
- "timewindowMs": 60000
- }
- },
- "showTitle": true,
- "backgroundColor": "#fff",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "8px",
- "settings": {
- "shadowSize": 4,
- "fontColor": "#545454",
- "fontSize": 10,
- "xaxis": {
- "showLabels": true,
- "color": "#545454"
- },
- "yaxis": {
- "showLabels": true,
- "color": "#545454"
- },
- "grid": {
- "color": "#545454",
- "tickColor": "#DDDDDD",
- "verticalLines": true,
- "horizontalLines": true,
- "outlineWidth": 1
- },
- "stack": false,
- "tooltipIndividual": false,
- "timeForComparison": "months",
- "xaxisSecond": {
- "axisPosition": "top",
- "showLabels": true
- },
- "showLegend": true,
- "legendConfig": {
- "direction": "column",
- "position": "right",
- "showMin": true,
- "showMax": true,
- "showAvg": true,
- "showTotal": true
- }
- },
- "title": "History information",
- "dropShadow": true,
- "enableFullscreen": true,
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "mobileHeight": null,
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "widgetStyle": {},
- "useDashboardTimewindow": true,
- "displayTimewindow": true,
- "actions": {}
- },
- "id": "aaa69366-aacc-9028-65aa-645c0f8533ec",
- "typeFullFqn": "system.charts.basic_timeseries"
- },
- "ce5c7d01-a3ef-5cf0-4578-8505135c23a0": {
- "type": "timeseries",
- "sizeX": 17,
- "sizeY": 4,
- "config": {
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [
- {
- "name": "bleEventsProduced",
- "type": "timeseries",
- "label": "bleEventsProduced",
- "color": "#2196f3",
- "settings": {
- "excludeFromStacking": false,
- "hideDataByDefault": false,
- "disableDataHiding": false,
- "removeFromLegend": false,
- "showLines": true,
- "fillLines": false,
- "showPoints": false,
- "showPointShape": "circle",
- "pointShapeFormatter": "var size = radius * Math.sqrt(Math.PI) / 2;\nctx.moveTo(x - size, y - size);\nctx.lineTo(x + size, y + size);\nctx.moveTo(x - size, y + size);\nctx.lineTo(x + size, y - size);",
- "showPointsLineWidth": 5,
- "showPointsRadius": 3,
- "tooltipValueFormatter": "",
- "showSeparateAxis": false,
- "axisTitle": "",
- "axisPosition": "left",
- "axisTicksFormatter": "",
- "comparisonSettings": {
- "showValuesForComparison": true,
- "comparisonValuesLabel": "",
- "color": ""
- }
- },
- "_hash": 0.5625165504526104
- },
- {
- "name": "bleEventsSent",
- "type": "timeseries",
- "label": "bleEventsSent",
- "color": "#4caf50",
- "settings": {
- "excludeFromStacking": false,
- "hideDataByDefault": false,
- "disableDataHiding": false,
- "removeFromLegend": false,
- "showLines": true,
- "fillLines": false,
- "showPoints": false,
- "showPointShape": "circle",
- "pointShapeFormatter": "var size = radius * Math.sqrt(Math.PI) / 2;\nctx.moveTo(x - size, y - size);\nctx.lineTo(x + size, y + size);\nctx.moveTo(x - size, y + size);\nctx.lineTo(x + size, y - size);",
- "showPointsLineWidth": 5,
- "showPointsRadius": 3,
- "tooltipValueFormatter": "",
- "showSeparateAxis": false,
- "axisTitle": "",
- "axisPosition": "left",
- "axisTicksFormatter": "",
- "comparisonSettings": {
- "showValuesForComparison": true,
- "comparisonValuesLabel": "",
- "color": ""
- }
- },
- "_hash": 0.6817950080745288
- }
- ],
- "entityAliasId": "b2487e75-2fa4-f211-142c-434dfd50c70c"
- }
- ],
- "timewindow": {
- "realtime": {
- "interval": 5000,
- "timewindowMs": 120000
- },
- "aggregation": {
- "type": "AVG",
- "limit": 25000
- }
- },
- "showTitle": true,
- "backgroundColor": "#fff",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "8px",
- "settings": {
- "shadowSize": 4,
- "fontColor": "#545454",
- "fontSize": 10,
- "xaxis": {
- "showLabels": true,
- "color": "#545454"
- },
- "yaxis": {
- "showLabels": true,
- "color": "#545454"
- },
- "grid": {
- "color": "#545454",
- "tickColor": "#DDDDDD",
- "verticalLines": true,
- "horizontalLines": true,
- "outlineWidth": 1
- },
- "stack": false,
- "tooltipIndividual": false,
- "timeForComparison": "months",
- "xaxisSecond": {
- "axisPosition": "top",
- "showLabels": true
- },
- "showLegend": true,
- "legendConfig": {
- "direction": "column",
- "position": "right",
- "showMin": true,
- "showMax": true,
- "showAvg": true,
- "showTotal": true
- }
- },
- "title": "Real time information",
- "dropShadow": true,
- "enableFullscreen": true,
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "mobileHeight": null,
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "widgetStyle": {},
- "useDashboardTimewindow": false,
- "displayTimewindow": true,
- "actions": {}
- },
- "id": "ce5c7d01-a3ef-5cf0-4578-8505135c23a0",
- "typeFullFqn": "system.charts.basic_timeseries"
- },
- "466f046d-6005-a168-b107-60fcb2469cd5": {
- "type": "latest",
- "sizeX": 7,
- "sizeY": 5,
- "config": {
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [],
- "entityAliasId": "b2487e75-2fa4-f211-142c-434dfd50c70c"
- }
- ],
- "timewindow": {
- "displayValue": "",
- "selectedTab": 0,
- "realtime": {
- "realtimeType": 1,
- "interval": 1000,
- "timewindowMs": 60000,
- "quickInterval": "CURRENT_DAY"
- },
- "history": {
- "historyType": 0,
- "interval": 1000,
- "timewindowMs": 60000,
- "fixedTimewindow": {
- "startTimeMs": 1694085270425,
- "endTimeMs": 1694171670425
- },
- "quickInterval": "CURRENT_DAY"
- },
- "aggregation": {
- "type": "AVG",
- "limit": 25000
- }
- },
- "showTitle": true,
- "backgroundColor": "#fff",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "8px",
- "settings": {
- "eventsTitle": "Gateway Events Form",
- "eventsReg": [
- "EventsProduced",
- "EventsSent"
- ]
- },
- "title": "Gateway events",
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "dropShadow": true,
- "enableFullscreen": true,
- "widgetStyle": {},
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "useDashboardTimewindow": true,
- "displayTimewindow": true,
- "showLegend": false,
- "actions": {}
- },
- "id": "466f046d-6005-a168-b107-60fcb2469cd5",
- "typeFullFqn": "system.gateway_widgets.attributes_card"
- },
- "8fc32225-164f-3258-73f7-e6b6d959cf0b": {
- "type": "latest",
- "sizeX": 10,
- "sizeY": 9,
- "config": {
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [],
- "entityAliasId": "b2487e75-2fa4-f211-142c-434dfd50c70c"
- }
- ],
- "timewindow": {
- "displayValue": "",
- "selectedTab": 0,
- "realtime": {
- "realtimeType": 1,
- "interval": 1000,
- "timewindowMs": 60000,
- "quickInterval": "CURRENT_DAY"
- },
- "history": {
- "historyType": 0,
- "interval": 1000,
- "timewindowMs": 60000,
- "fixedTimewindow": {
- "startTimeMs": 1694085270425,
- "endTimeMs": 1694171670425
- },
- "quickInterval": "CURRENT_DAY"
- },
- "aggregation": {
- "type": "AVG",
- "limit": 25000
- }
- },
- "showTitle": true,
- "backgroundColor": "#fff",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "8px",
- "settings": {
- "gatewayTitle": "Gateway configuration (Single device)",
- "readOnly": false
- },
- "title": "New Gateway configuration (Single device)",
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "dropShadow": true,
- "enableFullscreen": true,
- "widgetStyle": {},
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "useDashboardTimewindow": true,
- "displayTimewindow": true,
- "showLegend": false,
- "actions": {}
- },
- "id": "8fc32225-164f-3258-73f7-e6b6d959cf0b",
- "typeFullFqn": "system.gateway_widgets.config_form_latest"
- },
- "063fc179-c9fd-f952-e714-f24e9c43c05c": {
- "type": "rpc",
- "sizeX": 4,
- "sizeY": 2,
- "config": {
- "targetDeviceAliases": [],
- "showTitle": false,
- "backgroundColor": "#e6e7e8",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "0px",
- "settings": {
- "requestTimeout": 5000,
- "oneWayElseTwoWay": true,
- "styleButton": {
- "isRaised": true,
- "isPrimary": false
- },
- "methodParams": "{}",
- "methodName": "gateway_reboot",
- "buttonText": "GATEWAY REBOOT"
- },
- "title": "New RPC Button",
- "dropShadow": true,
- "enableFullscreen": false,
- "widgetStyle": {},
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "useDashboardTimewindow": true,
- "showLegend": false,
- "actions": {},
- "datasources": [],
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "displayTimewindow": true,
- "targetDeviceAliasIds": [
- "b2487e75-2fa4-f211-142c-434dfd50c70c"
- ]
- },
- "id": "063fc179-c9fd-f952-e714-f24e9c43c05c",
- "typeFullFqn": "system.control_widgets.rpcbutton"
- },
- "3c2134cc-27a0-93e1-dbe1-2fa7c1ce16b7": {
- "type": "rpc",
- "sizeX": 4,
- "sizeY": 2,
- "config": {
- "targetDeviceAliases": [],
- "showTitle": false,
- "backgroundColor": "#e6e7e8",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "0px",
- "settings": {
- "requestTimeout": 5000,
- "oneWayElseTwoWay": true,
- "styleButton": {
- "isRaised": true,
- "isPrimary": false
- },
- "methodName": "gateway_restart",
- "methodParams": "{}",
- "buttonText": "GATEWAY RESTART"
- },
- "title": "New RPC Button",
- "dropShadow": true,
- "enableFullscreen": false,
- "widgetStyle": {},
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "useDashboardTimewindow": true,
- "showLegend": false,
- "actions": {},
- "datasources": [],
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "displayTimewindow": true,
- "targetDeviceAliasIds": [
- "b2487e75-2fa4-f211-142c-434dfd50c70c"
- ]
- },
- "id": "3c2134cc-27a0-93e1-dbe1-2fa7c1ce16b7",
- "typeFullFqn": "system.control_widgets.rpcbutton"
- },
- "6770b6ba-eff8-df05-75f8-c1f9326d4842": {
- "type": "latest",
- "sizeX": 6,
- "sizeY": 4,
- "config": {
- "datasources": [
- {
- "type": "entity",
- "dataKeys": [
- {
- "name": "latitude",
- "type": "attribute",
- "label": "latitude",
- "color": "#2196f3",
- "settings": {},
- "_hash": 0.9743324774725604
- },
- {
- "name": "longitude",
- "type": "attribute",
- "label": "longitude",
- "color": "#4caf50",
- "settings": {},
- "_hash": 0.5530093635101525
- }
- ],
- "entityAliasId": "b2487e75-2fa4-f211-142c-434dfd50c70c"
- }
- ],
- "timewindow": {
- "displayValue": "",
- "selectedTab": 0,
- "realtime": {
- "realtimeType": 1,
- "interval": 1000,
- "timewindowMs": 60000,
- "quickInterval": "CURRENT_DAY"
- },
- "history": {
- "historyType": 0,
- "interval": 1000,
- "timewindowMs": 60000,
- "fixedTimewindow": {
- "startTimeMs": 1694085270425,
- "endTimeMs": 1694171670425
- },
- "quickInterval": "CURRENT_DAY"
- },
- "aggregation": {
- "type": "AVG",
- "limit": 25000
- }
- },
- "showTitle": false,
- "backgroundColor": "#fff",
- "color": "rgba(0, 0, 0, 0.87)",
- "padding": "8px",
- "settings": {
- "fitMapBounds": true,
- "latKeyName": "latitude",
- "lngKeyName": "longitude",
- "showLabel": true,
- "label": "${entityName}",
- "tooltipPattern": "${entityName}
Latitude: ${latitude:7}
Longitude: ${longitude:7}
Delete",
- "markerImageSize": 34,
- "useColorFunction": false,
- "markerImages": [],
- "useMarkerImageFunction": false,
- "color": "#fe7569",
- "mapProvider": "OpenStreetMap.Mapnik",
- "showTooltip": true,
- "autocloseTooltip": true,
- "defaultCenterPosition": [
- 0,
- 0
- ],
- "customProviderTileUrl": "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
- "showTooltipAction": "click",
- "polygonKeyName": "coordinates",
- "polygonOpacity": 0.5,
- "polygonStrokeOpacity": 1,
- "polygonStrokeWeight": 1,
- "zoomOnClick": true,
- "showCoverageOnHover": true,
- "animate": true,
- "maxClusterRadius": 80,
- "removeOutsideVisibleBounds": true,
- "defaultZoomLevel": 5
- },
- "title": "Gateway Location",
- "dropShadow": true,
- "enableFullscreen": false,
- "titleStyle": {
- "fontSize": "16px",
- "fontWeight": 400
- },
- "useDashboardTimewindow": true,
- "showLegend": false,
- "widgetStyle": {},
- "actions": {
- "tooltipAction": [
- {
- "id": "54c293c4-9ca6-e34f-dc6a-0271944c1c66",
- "name": "delete",
- "icon": "more_horiz",
- "type": "custom",
- "customFunction": "var $rootScope = widgetContext.$scope.$injector.get('$rootScope');\nvar entityDatasource = widgetContext.map.subscription.datasources.filter(\n function(entity) {\n return entity.entityId === entityId.id\n });\n\nwidgetContext.map.saveMarkerLocation(entityDatasource[0],\n widgetContext.map.locations[0], {\n \"lat\": null,\n \"lng\": null\n }).then(function succes() {\n $rootScope.$broadcast('widgetForceReInit');\n });"
- }
- ]
- },
- "showTitleIcon": false,
- "titleIcon": null,
- "iconColor": "rgba(0, 0, 0, 0.87)",
- "iconSize": "24px",
- "titleTooltip": "",
- "displayTimewindow": true
- },
- "id": "6770b6ba-eff8-df05-75f8-c1f9326d4842",
- "typeFullFqn": "system.input_widgets.markers_placement_openstreetmap"
- }
- },
- "states": {
- "main_gateway": {
- "name": "Gateways",
- "root": true,
- "layouts": {
- "main": {
- "widgets": {
- "94715984-ae74-76e4-20b7-2f956b01ed80": {
- "sizeX": 24,
- "sizeY": 12,
- "row": 0,
- "col": 0
- }
- },
- "gridSettings": {
- "backgroundColor": "#eeeeee",
- "color": "rgba(0,0,0,0.870588)",
- "columns": 24,
- "backgroundSizeMode": "100%",
- "autoFillHeight": true,
- "mobileAutoFillHeight": false,
- "mobileRowHeight": 70,
- "margin": 10,
- "outerMargin": true
- }
- }
- }
- },
- "__entityname__config": {
- "name": "${entityName} Configuration",
- "root": false,
- "layouts": {
- "main": {
- "widgets": {
- "eadabbc7-519e-76fc-ba10-b3fe8c18da10": {
- "sizeX": 14,
- "sizeY": 13,
- "row": 0,
- "col": 10
- },
- "8fc32225-164f-3258-73f7-e6b6d959cf0b": {
- "sizeX": 10,
- "sizeY": 9,
- "row": 0,
- "col": 0
- },
- "063fc179-c9fd-f952-e714-f24e9c43c05c": {
- "sizeX": 4,
- "sizeY": 2,
- "row": 9,
- "col": 0
- },
- "3c2134cc-27a0-93e1-dbe1-2fa7c1ce16b7": {
- "sizeX": 4,
- "sizeY": 2,
- "row": 11,
- "col": 0
- },
- "6770b6ba-eff8-df05-75f8-c1f9326d4842": {
- "sizeX": 6,
- "sizeY": 4,
- "row": 9,
- "col": 4
- }
- },
- "gridSettings": {
- "backgroundColor": "#eeeeee",
- "color": "rgba(0,0,0,0.870588)",
- "columns": 24,
- "backgroundSizeMode": "100%",
- "autoFillHeight": true,
- "mobileAutoFillHeight": false,
- "mobileRowHeight": 70,
- "margin": 10,
- "outerMargin": true
- }
- }
- }
- },
- "__entityname_grafic": {
- "name": "${entityName} Details",
- "root": false,
- "layouts": {
- "main": {
- "widgets": {
- "f928afc4-30d1-8d0c-e3cf-777f9f9d1155": {
- "sizeX": 17,
- "sizeY": 4,
- "mobileHeight": null,
- "row": 4,
- "col": 7
- },
- "2a95b473-042d-59d0-2da2-40d0cccb6c8a": {
- "sizeX": 7,
- "sizeY": 7,
- "row": 5,
- "col": 0
- },
- "aaa69366-aacc-9028-65aa-645c0f8533ec": {
- "sizeX": 17,
- "sizeY": 4,
- "mobileHeight": null,
- "row": 0,
- "col": 7
- },
- "ce5c7d01-a3ef-5cf0-4578-8505135c23a0": {
- "sizeX": 17,
- "sizeY": 4,
- "mobileHeight": null,
- "row": 8,
- "col": 7
- },
- "466f046d-6005-a168-b107-60fcb2469cd5": {
- "sizeX": 7,
- "sizeY": 5,
- "row": 0,
- "col": 0
- }
- },
- "gridSettings": {
- "backgroundColor": "#eeeeee",
- "color": "rgba(0,0,0,0.870588)",
- "columns": 24,
- "backgroundSizeMode": "auto 100%",
- "autoFillHeight": true,
- "mobileAutoFillHeight": true,
- "mobileRowHeight": 70,
- "margin": 10,
- "outerMargin": true
- }
- }
- }
- }
- },
- "entityAliases": {
- "3e0f533a-0db1-3292-184f-06e73535061a": {
- "id": "3e0f533a-0db1-3292-184f-06e73535061a",
- "alias": "Gateways",
- "filter": {
- "type": "deviceType",
- "resolveMultiple": true,
- "deviceNameFilter": "",
- "deviceTypes": [
- "gateway"
- ]
- }
- },
- "b2487e75-2fa4-f211-142c-434dfd50c70c": {
- "id": "b2487e75-2fa4-f211-142c-434dfd50c70c",
- "alias": "Current Gateway",
- "filter": {
- "type": "stateEntity",
- "resolveMultiple": false,
- "stateEntityParamName": "",
- "defaultStateEntity": null
- }
- }
- },
- "timewindow": {
- "realtime": {
- "interval": 1000,
- "timewindowMs": 86400000
- },
- "aggregation": {
- "type": "NONE",
- "limit": 25000
- },
- "hideInterval": false,
- "hideAggregation": false,
- "hideAggInterval": false
- },
- "settings": {
- "stateControllerId": "entity",
- "showTitle": true,
- "showDashboardsSelect": true,
- "showEntitiesSelect": true,
- "showDashboardTimewindow": true,
- "showDashboardExport": true,
- "toolbarAlwaysOpen": true,
- "titleColor": "rgba(0,0,0,0.870588)"
- },
- "filters": {}
- },
- "externalId": null,
- "name": "Gateways"
-}
\ No newline at end of file
diff --git a/application/src/main/data/json/edge/install_instructions/docker/instructions.md b/application/src/main/data/json/edge/install_instructions/docker/instructions.md
index e308a38076..d8f9731889 100644
--- a/application/src/main/data/json/edge/install_instructions/docker/instructions.md
+++ b/application/src/main/data/json/edge/install_instructions/docker/instructions.md
@@ -51,7 +51,7 @@ services:
- ~/.mytb-edge-logs:/var/log/tb-edge
postgres:
restart: always
- image: "postgres:12"
+ image: "postgres:15"
ports:
- "5432"
environment:
diff --git a/application/src/main/data/json/system/widget_bundles/charts.json b/application/src/main/data/json/system/widget_bundles/charts.json
index 0829c612d0..14c09d3fc4 100644
--- a/application/src/main/data/json/system/widget_bundles/charts.json
+++ b/application/src/main/data/json/system/widget_bundles/charts.json
@@ -11,6 +11,7 @@
"widgetTypeFqns": [
"charts.basic_timeseries",
"charts.state_chart",
+ "range_chart",
"charts.timeseries_bars_flot",
"cards.aggregated_value_card",
"charts.bars",
diff --git a/application/src/main/data/json/system/widget_types/doughnut.json b/application/src/main/data/json/system/widget_types/doughnut.json
index f5a890ad3a..8764bbcace 100644
--- a/application/src/main/data/json/system/widget_types/doughnut.json
+++ b/application/src/main/data/json/system/widget_types/doughnut.json
@@ -2,7 +2,7 @@
"fqn": "doughnut",
"name": "Doughnut",
"deprecated": false,
- "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMkAAACgCAMAAACR47ilAAABrVBMVEUNDQ0AAAD+/v7+/v7u7u7bycvX19f///8Ihyv/X2r//v7z8/P/kJjn5+f5+fkhISHs7Oz9/f3w8PD19fX39/fu7u7CwsL7+/v8/PyDw5XOzs62trb/2dvV1dUnlkX6+vrg8OWrq6v/9vfB4coYjjj09PTr6+uenp7o6OjJyMjv9/Ki0q/y8vLq6uq8vLzc29tltHrh4eGTy6L/6+3/2t3Qz8//8vPq6emQkJD/+vrj4+PHx8f/h4//c31FpWA9PT3//Pza2tr/19qy2b3/r7RYWFj/4uRGpWD/m6L/gopVrG1tbW3/6er/5ef/3+H/3d//aXNVVVX/w8dktHv/TVovLy/w9/KxsLD/paz/3N50u4iGhobR6dfQ6Nf/ur6SkpJ0vId5eXk2nlNKSkr/7e7/sbf/jJX/fYY2nVL/hI50dHRmZmbh4OD109W7urqCgoL/zdHMsLLOwcLcv8HDp6ikpKS8o6T/g4xhYWEXjjj/zdDnxcfBr7A8PDzp3d7b09T27e7f7+Pn0tThx8nSt7r4pat/v5GRkZFutoK728TCuruOxZ22m5ykl5hWrG17FlNEAAAAB3RSTlMGANDBIv4mEkvyGAAADi1JREFUeN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UjwSDBrMbJb+aOsRXVdKCX51CtPamE0fpURtiQk4HSt6p3FiRggfBJCqdrC+ooBIicpooxljh9PLAaIkIRsQe4t5CFyEP5ky0trWT0ei1scRB4x/pJglm2vgDJmsBAHyXOBIeEEWIGNEQc7fMhJyO+LmnRATzRQnTsCUG5dhOK9PClZJ5ANAmW9oJAbOAxNr7Ym/RhWy+lfFn5PWh0Qz0Z3QmuF1CS4iN1lx3A6AVEsK4qBJSIRqdO11khFE8/r5fK8y2j9j/IzBbl1kbfIdcnwEMmamGIJB8AXrYlccfjKHHISYvFq5zBDgjbWZWCoQMBhhATVCcsuR98FmUyQoJwSMCFmnGIZIkEYDTNTHq2GXIZIkOYiCNUqiCjoOFC5kMSQ4kG/54VRV80But3QC/oXDhjS9sZ8+ufWO8mb0zvJ29PmkGx/+Aiboa0N+jTpzfmE74351PV/l9Yow3BWYVkAAAAASUVORK5CYII=",
"description": "Displays the latest values of the attributes or time-series data in a doughnut chart. Supports numeric values only.",
"descriptor": {
"type": "latest",
diff --git a/application/src/main/data/json/system/widget_types/horizontal_doughnut.json b/application/src/main/data/json/system/widget_types/horizontal_doughnut.json
index 1eeffcae6e..f76bf50e48 100644
--- a/application/src/main/data/json/system/widget_types/horizontal_doughnut.json
+++ b/application/src/main/data/json/system/widget_types/horizontal_doughnut.json
@@ -2,7 +2,7 @@
"fqn": "horizontal_doughnut",
"name": "Horizontal doughnut",
"deprecated": false,
- "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMkAAACgCAMAAACR47ilAAABp1BMVEX5+fn9/f3///8AAAD29vby8vL29vb///////8Ihyv/X2r+/f3z8/P4+Pjn5+f6+vr/kJjs7OwhISHx8fHr6uru7u78/PzPzs7CwsK2trbIyMiDw5X/2dva2tq8vLyrq6v19fUnlkUYjjj29vbg8OWRkZH39/d0vIfv9/KTy6L/7O3B4crb29v/h49XV1eenp6i0q//9fXg8OQ9PT3w8PDp6en/govW1dX/+/wnlkbj4+P/293/w8f/4eP/2tz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JS8AbOnAHl5TwAx22g0sKpYAbuKTawSVVpkiVy9FbUCAoYTbS0TJAdArVS85YeBfZyWBmCfgELYNtQZu8hLV2NtE5or8ACks0aXpvBJecw1VyPFfJ8Vwlx9M0H3AOTfMJ5/DV3O5wBvfbeU5d/wHsiOrJpqVt0wAAAABJRU5ErkJggg==",
"description": "Displays the latest values of the attributes or time-series data in a doughnut chart using horizontal layout. Supports numeric values only.",
"descriptor": {
"type": "latest",
diff --git a/application/src/main/data/json/system/widget_types/image_map.json b/application/src/main/data/json/system/widget_types/image_map.json
index 814414a428..2e10796583 100644
--- a/application/src/main/data/json/system/widget_types/image_map.json
+++ b/application/src/main/data/json/system/widget_types/image_map.json
@@ -15,7 +15,7 @@
"settingsSchema": "",
"dataKeySettingsSchema": "",
"settingsDirective": "tb-map-widget-settings",
- "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"First point\",\"entityAliasId\":null,\"filterId\":null,\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"xPos\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.05427416942713381,\"funcBody\":\"var value = prevValue || 0.2;\\nif (time % 5000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"yPos\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.680594833308841,\"funcBody\":\"var value = prevValue || 0.3;\\nif (time % 5000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"temperature\",\"color\":\"#9c27b0\",\"settings\":{},\"_hash\":0.9430343126300238,\"funcBody\":\"var value = prevValue + Math.random() * 40 - 20;\\nif (value < -60) {\\n\\tvalue = -60;\\n} else if (value > 60) {\\n\\tvalue = 60;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Type\",\"color\":\"#8bc34a\",\"settings\":{},\"_hash\":0.1784452363910778,\"funcBody\":\"return \\\"colorpin\\\";\",\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}]},{\"type\":\"function\",\"name\":\"Second point\",\"entityAliasId\":null,\"filterId\":null,\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"xPos\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.05012157428742059,\"funcBody\":\"var value = prevValue || 0.6;\\nif (time % 4000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"yPos\",\"color\":\"#ffc107\",\"settings\":{},\"_hash\":0.6742359401617628,\"funcBody\":\"var value = prevValue || 0.7;\\nif (time % 4000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"temperature\",\"color\":\"#8bc34a\",\"settings\":{},\"_hash\":0.773875863339494,\"funcBody\":\"var value = prevValue + Math.random() * 40 - 20;\\nif (value < -60) {\\n\\tvalue = -60;\\n} else if (value > 60) {\\n\\tvalue = 60;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Type\",\"color\":\"#3f51b5\",\"settings\":{},\"_hash\":0.405822538899673,\"funcBody\":\"return \\\"thermometer\\\";\",\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"provider\":\"image-map\",\"mapImageUrl\":\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gQ3JlYXRlZCB3aXRoIElua3NjYXBlIChodHRwOi8vd3d3Lmlua3NjYXBlLm9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C1zaXplOjkuNjU4Mzc3NjVweDtmb250LXN0eWxlOm5vcm1hbDtmb250LXZhcmlhbnQ6bm9ybWFsO2ZvbnQtd2VpZ2h0Om5vcm1hbDtmb250LXN0cmV0Y2g6bm9ybWFsO2xpbmUtaGVpZ2h0OjEyNSU7bGV0dGVyLXNwYWNpbmc6MHB4O3dvcmQtc3BhY2luZzowcHg7ZmlsbDojMDAwMDAwO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO2ZvbnQtZmFtaWx5OlZlcmRhbmE7LWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjpWZXJkYW5hIgogICAgICAgeD0iNTI5LjYyNTMxIgogICAgICAgeT0iLTU1MC44NDc3OCIKICAgICAgIGlkPSJ0ZXh0NDU0My01IgogICAgICAgc29kaXBvZGk6bGluZXNwYWNpbmc9IjEyNSUiCiAgICAgICB0cmFuc2Zvcm09Im1hdHJpeCgwLDEsLTEsMCwwLDApIj48dHNwYW4KICAgICAgICAgc29kaXBvZGk6cm9sZT0ibGluZSIKICAgICAgICAgaWQ9InRzcGFuNDU0NS0wIgogICAgICAgICB4PSI1MjkuNjI1MzEiCiAgICAgICAgIHk9Ii01NTAuODQ3NzgiPkJyb2Fkd2F5PC90c3Bhbj48L3RleHQ+CiAgPC9nPgo8L3N2Zz4K\",\"latKeyName\":\"latitude\",\"lngKeyName\":\"longitude\",\"xPosKeyName\":\"xPos\",\"yPosKeyName\":\"yPos\",\"defaultCenterPosition\":\"0,0\",\"disableScrollZooming\":false,\"disableDoubleClickZooming\":false,\"disableZoomControl\":false,\"fitMapBounds\":true,\"useDefaultCenterPosition\":false,\"mapPageSize\":16384,\"markerOffsetX\":0.5,\"markerOffsetY\":1,\"posFunction\":\"return {x: origXPos, y: origYPos};\",\"draggableMarker\":false,\"showLabel\":true,\"useLabelFunction\":false,\"label\":\"${entityName}\",\"showTooltip\":true,\"showTooltipAction\":\"click\",\"autocloseTooltip\":true,\"useTooltipFunction\":false,\"tooltipPattern\":\"${entityName}
X Pos: ${xPos:2}
Y Pos: ${yPos:2}
Temperature: ${temperature} °C
See advanced settings for details\",\"tooltipOffsetX\":0,\"tooltipOffsetY\":-1,\"color\":\"#fe7569\",\"useColorFunction\":true,\"colorFunction\":\"var type = dsData[dsIndex]['Type'];\\nif (type == 'colorpin') {\\n\\tvar temperature = dsData[dsIndex]['temperature'];\\n\\tif (typeof temperature !== undefined) {\\n\\t var percent = (temperature + 60)/120 * 100;\\n\\t return tinycolor.mix('blue', 'red', percent).toHexString();\\n\\t}\\n\\treturn 'blue';\\n}\\n\",\"useMarkerImageFunction\":true,\"markerImageSize\":34,\"markerImageFunction\":\"var type = dsData[dsIndex]['Type'];\\nif (type == 'thermometer') {\\n\\tvar res = {\\n\\t url: images[0],\\n\\t size: 40\\n\\t}\\n\\tvar temperature = dsData[dsIndex]['temperature'];\\n\\tif (typeof temperature !== undefined) {\\n\\t var percent = (temperature + 60)/120;\\n\\t var index = Math.min(3, Math.floor(4 * percent));\\n\\t res.url = images[index];\\n\\t}\\n\\treturn res;\\n}\",\"markerImages\":[\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAB/CAYAAAD4mHJdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACWAAAAlgB7MGOJQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAwgSURBVGiB7Zt5cBT3lce/v18fc89oRoPEIRBCHIUxp2ywCAgIxLExvoidZIFNxXE2VXHirIO3aqtSseM43qpNeZfYKecox3bhpJykYgdjDkU2mBAB5vCamMNYAgQyURBCoxnNPd39O/aP7hGSEUR24L/uqqf+zfR77/Pe69/Rv6kWwcgPLRIJfZUAa7xez2xd90QBwDSNZKlkHJHAK+l09mUA7BP4vPpRUVExMVoRef+L998njxx9X57vPi/PnTsnO850yPaT7XLXrrflqjtWymhF+HA0Gp0wEp/kHymEQqG4ptJDGzf+um5RUxMSiV7Z3Lyt88L5nozgHJWj4pGmpqZ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xLKqoqtddbKh6PSVVVtQ4Gg5IHPQI8nx9ck4CbgSuBarJnvARsiUai4XBPmGQyqbWGRCxh2VrZAKYYLtNjZUyXSxsuU6oqyg1fwO91nhUSzvQdwB5gm4h8UvA4OYsoByYDY4EaoBLwAN7sYiDvZ4LsqUo60uNIK3AY2CMioYGM/wPREY0iGUY58wAAAABJRU5ErkJggg==\"],\"showPolygon\":false,\"polygonKeyName\":\"perimeter\",\"editablePolygon\":false,\"showPolygonLabel\":false,\"usePolygonLabelFunction\":false,\"polygonLabel\":\"${entityName}\",\"showPolygonTooltip\":false,\"showPolygonTooltipAction\":\"click\",\"autoClosePolygonTooltip\":true,\"usePolygonTooltipFunction\":false,\"polygonTooltipPattern\":\"${entityName}
TimeStamp: ${ts:7}\",\"polygonColor\":\"#3388ff\",\"polygonOpacity\":0.2,\"usePolygonColorFunction\":false,\"polygonStrokeColor\":\"#3388ff\",\"polygonStrokeOpacity\":1,\"polygonStrokeWeight\":3,\"usePolygonStrokeColorFunction\":false,\"showCircle\":false,\"circleKeyName\":\"perimeter\",\"editableCircle\":false,\"showCircleLabel\":false,\"useCircleLabelFunction\":false,\"circleLabel\":\"${entityName}\",\"showCircleTooltip\":false,\"showCircleTooltipAction\":\"click\",\"autoCloseCircleTooltip\":true,\"useCircleTooltipFunction\":false,\"circleTooltipPattern\":\"${entityName}
TimeStamp: ${ts:7}\",\"circleFillColor\":\"#3388ff\",\"circleFillColorOpacity\":0.2,\"useCircleFillColorFunction\":false,\"circleStrokeColor\":\"#3388ff\",\"circleStrokeOpacity\":1,\"circleStrokeWeight\":3,\"useCircleStrokeColorFunction\":false},\"title\":\"Image Map\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"useDashboardTimewindow\":true,\"showLegend\":false,\"widgetStyle\":{},\"actions\":{}}"
+ "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"First point\",\"entityAliasId\":null,\"filterId\":null,\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"xPos\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.05427416942713381,\"funcBody\":\"var value = prevValue || 0.2;\\nif (time % 5000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"yPos\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.680594833308841,\"funcBody\":\"var value = prevValue || 0.3;\\nif (time % 5000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"temperature\",\"color\":\"#9c27b0\",\"settings\":{},\"_hash\":0.9430343126300238,\"funcBody\":\"var value = prevValue + Math.random() * 40 - 20;\\nif (value < -60) {\\n\\tvalue = -60;\\n} else if (value > 60) {\\n\\tvalue = 60;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Type\",\"color\":\"#8bc34a\",\"settings\":{},\"_hash\":0.1784452363910778,\"funcBody\":\"return \\\"colorpin\\\";\",\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}]},{\"type\":\"function\",\"name\":\"Second point\",\"entityAliasId\":null,\"filterId\":null,\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"xPos\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.05012157428742059,\"funcBody\":\"var value = prevValue || 0.6;\\nif (time % 4000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"yPos\",\"color\":\"#ffc107\",\"settings\":{},\"_hash\":0.6742359401617628,\"funcBody\":\"var value = prevValue || 0.7;\\nif (time % 4000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"temperature\",\"color\":\"#8bc34a\",\"settings\":{},\"_hash\":0.773875863339494,\"funcBody\":\"var value = prevValue + Math.random() * 40 - 20;\\nif (value < -60) {\\n\\tvalue = -60;\\n} else if (value > 60) {\\n\\tvalue = 60;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Type\",\"color\":\"#3f51b5\",\"settings\":{},\"_hash\":0.405822538899673,\"funcBody\":\"return \\\"thermometer\\\";\",\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"provider\":\"image-map\",\"mapImageUrl\":\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTEzNC41IiBoZWlnaHQ9Ijc2Mi43OCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3LjA3MSAtMzA3LjkpIj4KICA8ZyBmaWxsPSJub25lIj4KICAgPHBhdGggZD0ibTkwNi4wMyA3MDYuMTMgMy40MjkyIDE3Ljc5Nm0tODgwLjg5IDQxLjEyMWMxNTAuNDQgNi44MzM0IDE0Ni4zOS0yNi4zMzQgMTY2LjQzLTI5LjMyIDM2LjE0NC01LjM4NDggMTE0LjI5LTYuNTI1NCAxNDguMzMtOC42MjM1IDQzLjM3OC0yLjY3MzggMTQxLjc2LTExLjIzMSAxODguODYtMTkuODM0IDM5LjgxMS03LjI3MjggMjIxLjM3LTAuODYyMzUgMzE5LjA3LTAuODYyMzUgNzAuODI3IDAgMTQ2LjkyLTEuNzI0NyAyMTguMTgtMS43MjQ3LTMxLjYyIDAgMTE3Ljg2LTIuNTg3MSA4Ni4yMzYtMi41ODcxbS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DgyIiBmaWxsPSIjMDAwMDAwIiBmb250LWZhbWlseT0iVmVyZGFuYSIgbGV0dGVyLXNwYWNpbmc9IjBweCIgd29yZC1zcGFjaW5nPSIwcHgiIHN0eWxlPSJsaW5lLWhlaWdodDowJSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHRzcGFuIHg9IjY4NS4yMDgxMyIgeT0iODI3LjUzMDgyIiBmb250LXNpemU9IjkuNjU4NHB4IiBzdHlsZT0ibGluZS1oZWlnaHQ6MS4yNSI+UGF3bmVlPC90c3Bhbj48L3RleHQ+CiAgPHBhdGggdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAyODcuMzYpIiBkPSJtNTU0LjI5IDcyMS40My00LjI4NTctMTc4LjIxLTIuODU3MS00NDAuNzEtMC4zNTcxNC03OS4yODYiIGNvbG9yPSIjMDAwMDAwIiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzYiIHN0cm9rZS13aWR0aD0iMXB4Ii8+CiAgPHRleHQgdHJhbnNmb3JtPSJyb3RhdGUoOTApIiB4PSI1MjkuNjI1MzEiIHk9Ii01NTAuODQ3NzgiIGZpbGw9IiMwMDAwMDAiIGZvbnQtZmFtaWx5PSJWZXJkYW5hIiBsZXR0ZXItc3BhY2luZz0iMHB4IiB3b3JkLXNwYWNpbmc9IjBweCIgc3R5bGU9ImxpbmUtaGVpZ2h0OjAlIiB4bWw6c3BhY2U9InByZXNlcnZlIj48dHNwYW4geD0iNTI5LjYyNTMxIiB5PSItNTUwLjg0Nzc4IiBmb250LXNpemU9IjkuNjU4NHB4IiBzdHlsZT0ibGluZS1oZWlnaHQ6MS4yNSI+QnJvYWR3YXk8L3RzcGFuPjwvdGV4dD4KIDwvZz4KPC9zdmc+Cg==\",\"latKeyName\":\"latitude\",\"lngKeyName\":\"longitude\",\"xPosKeyName\":\"xPos\",\"yPosKeyName\":\"yPos\",\"defaultCenterPosition\":\"0,0\",\"disableScrollZooming\":false,\"disableDoubleClickZooming\":false,\"disableZoomControl\":false,\"fitMapBounds\":true,\"useDefaultCenterPosition\":false,\"mapPageSize\":16384,\"markerOffsetX\":0.5,\"markerOffsetY\":1,\"posFunction\":\"return {x: origXPos, y: origYPos};\",\"draggableMarker\":false,\"showLabel\":true,\"useLabelFunction\":false,\"label\":\"${entityName}\",\"showTooltip\":true,\"showTooltipAction\":\"click\",\"autocloseTooltip\":true,\"useTooltipFunction\":false,\"tooltipPattern\":\"${entityName}
X Pos: ${xPos:2}
Y Pos: ${yPos:2}
Temperature: ${temperature} °C
See advanced settings for details\",\"tooltipOffsetX\":0,\"tooltipOffsetY\":-1,\"color\":\"#fe7569\",\"useColorFunction\":true,\"colorFunction\":\"var type = dsData[dsIndex]['Type'];\\nif (type == 'colorpin') {\\n\\tvar temperature = dsData[dsIndex]['temperature'];\\n\\tif (typeof temperature !== undefined) {\\n\\t var percent = (temperature + 60)/120 * 100;\\n\\t return tinycolor.mix('blue', 'red', percent).toHexString();\\n\\t}\\n\\treturn 'blue';\\n}\\n\",\"useMarkerImageFunction\":true,\"markerImageSize\":34,\"markerImageFunction\":\"var type = dsData[dsIndex]['Type'];\\nif (type == 'thermometer') {\\n\\tvar res = {\\n\\t url: images[0],\\n\\t size: 40\\n\\t}\\n\\tvar temperature = dsData[dsIndex]['temperature'];\\n\\tif (typeof temperature !== undefined) {\\n\\t var percent = (temperature + 60)/120;\\n\\t var index = Math.min(3, Math.floor(4 * percent));\\n\\t res.url = images[index];\\n\\t}\\n\\treturn res;\\n}\",\"markerImages\":[\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAB/CAYAAAD4mHJdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACWAAAAlgB7MGOJQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAwgSURBVGiB7Zt5cBT3lce/v18fc89oRoPEIRBCHIUxp2ywCAgIxLExvoidZIFNxXE2VXHirIO3aqtSseM43qpNeZfYKecox3bhpJykYgdjDkU2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66ebW6mCVLvP5qa4OAoYEg8Gcg7tNIAIEADHdJnbcxmNZ6UQ05nK7TT1x4sRYRVV1/FTTqdLVa9bywgsvEImESKfSAFiWhT9QzqhL6rh25g3UjbokPnJkTaKkxFRaa8NtGbaIy+Up8eS2VgEx0VpXO66+HKfdbW9vV93d7RKNJl3xeNQOd4d1Mp0i3B3yRCKRsmgiYSVTaa9orS23lfR5vany8vKYLxCIeyxLKqoqtddbKh6PSVVVtQ4Gg5IHPQI8nx9ck4CbgSuBarJnvARsiUai4XBPmGQyqbWGRCxh2VrZAKYYLtNjZUyXSxsuU6oqyg1fwO91nhUSzvQdwB5gm4h8UvA4OYsoByYDY4EaoBLwAN7sYiDvZ4LsqUo60uNIK3AY2CMioYGM/wPREY0iGUY58wAAAABJRU5ErkJggg==\"],\"showPolygon\":false,\"polygonKeyName\":\"perimeter\",\"editablePolygon\":false,\"showPolygonLabel\":false,\"usePolygonLabelFunction\":false,\"polygonLabel\":\"${entityName}\",\"showPolygonTooltip\":false,\"showPolygonTooltipAction\":\"click\",\"autoClosePolygonTooltip\":true,\"usePolygonTooltipFunction\":false,\"polygonTooltipPattern\":\"${entityName}
TimeStamp: ${ts:7}\",\"polygonColor\":\"#3388ff\",\"polygonOpacity\":0.2,\"usePolygonColorFunction\":false,\"polygonStrokeColor\":\"#3388ff\",\"polygonStrokeOpacity\":1,\"polygonStrokeWeight\":3,\"usePolygonStrokeColorFunction\":false,\"showCircle\":false,\"circleKeyName\":\"perimeter\",\"editableCircle\":false,\"showCircleLabel\":false,\"useCircleLabelFunction\":false,\"circleLabel\":\"${entityName}\",\"showCircleTooltip\":false,\"showCircleTooltipAction\":\"click\",\"autoCloseCircleTooltip\":true,\"useCircleTooltipFunction\":false,\"circleTooltipPattern\":\"${entityName}
TimeStamp: ${ts:7}\",\"circleFillColor\":\"#3388ff\",\"circleFillColorOpacity\":0.2,\"useCircleFillColorFunction\":false,\"circleStrokeColor\":\"#3388ff\",\"circleStrokeOpacity\":1,\"circleStrokeWeight\":3,\"useCircleStrokeColorFunction\":false},\"title\":\"Image Map\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"useDashboardTimewindow\":true,\"showLegend\":false,\"widgetStyle\":{},\"actions\":{}}"
},
"externalId": null,
"tags": [
diff --git a/application/src/main/data/json/system/widget_types/label_widget.json b/application/src/main/data/json/system/widget_types/label_widget.json
index 9796fc4967..1c7c84109a 100644
--- a/application/src/main/data/json/system/widget_types/label_widget.json
+++ b/application/src/main/data/json/system/widget_types/label_widget.json
@@ -11,7 +11,7 @@
"resources": [],
"templateHtml": "",
"templateCss": "#container {\n overflow: auto;\n}\n\n.tbDatasource-container {\n margin: 5px;\n padding: 8px;\n}\n\n.tbDatasource-title {\n font-size: 1.200rem;\n font-weight: 500;\n padding-bottom: 10px;\n}\n\n.tbDatasource-table {\n width: 100%;\n box-shadow: 0 0 10px #ccc;\n border-collapse: collapse;\n white-space: nowrap;\n font-size: 1.000rem;\n color: #757575;\n}\n\n.tbDatasource-table td {\n position: relative;\n border-top: 1px solid rgba(0, 0, 0, 0.12);\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n padding: 0px 18px;\n box-sizing: border-box;\n}",
- "controllerScript": "self.onInit = function() {\n self.ctx.varsRegex = /\\$\\{([^\\}]*)\\}/g;\n \n var imageUrl = self.ctx.settings.backgroundImageUrl ? self.ctx.settings.backgroundImageUrl :\n 'data:image/svg+xml;base64,PHN2ZyBpZD0ic3ZnMiIgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTAwIiB3aWR0aD0iMTAwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOmRjPSJodHRwOi8vcHV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3VuZCIgeT0iOTkyLjY4IiB4PSIxNS4zMiIgc3Ryb2tlLXdpZHRoPSIuNjM5ODYiIGZpbGw9Im5vbmUiLz4KIDwvZz4KPC9zdmc+Cg==';\n\n self.ctx.$container.css('background', 'url(\"'+imageUrl+'\") no-repeat');\n self.ctx.$container.css('backgroundSize', 'contain');\n self.ctx.$container.css('backgroundPosition', '50% 50%');\n \n function processLabelPattern(pattern, data) {\n var match = self.ctx.varsRegex.exec(pattern);\n var replaceInfo = {};\n replaceInfo.variables = [];\n while (match !== null) {\n var variableInfo = {};\n variableInfo.dataKeyIndex = -1;\n var variable = match[0];\n var label = match[1];\n var valDec = 2;\n var splitVals = label.split(':');\n if (splitVals.length > 1) {\n label = splitVals[0];\n valDec = parseFloat(splitVals[1]);\n }\n variableInfo.variable = variable;\n variableInfo.valDec = valDec;\n \n if (label.startsWith('#')) {\n var keyIndexStr = label.substring(1);\n var n = Math.floor(Number(keyIndexStr));\n if (String(n) === keyIndexStr && n >= 0) {\n variableInfo.dataKeyIndex = n;\n }\n }\n if (variableInfo.dataKeyIndex === -1) {\n for (var i = 0; i < data.length; i++) {\n var datasourceData = data[i];\n var dataKey = datasourceData.dataKey;\n if (dataKey.label === label) {\n variableInfo.dataKeyIndex = i;\n break;\n }\n }\n }\n replaceInfo.variables.push(variableInfo);\n match = self.ctx.varsRegex.exec(pattern);\n }\n return replaceInfo;\n }\n\n var configuredLabels = self.ctx.settings.labels;\n if (!configuredLabels) {\n configuredLabels = [];\n }\n \n self.ctx.labels = [];\n\n for (var l = 0; l < configuredLabels.length; l++) {\n var labelConfig = configuredLabels[l];\n var localConfig = {};\n localConfig.font = {};\n \n localConfig.pattern = labelConfig.pattern ? labelConfig.pattern : '${#0}';\n localConfig.x = labelConfig.x ? labelConfig.x : 0;\n localConfig.y = labelConfig.y ? labelConfig.y : 0;\n localConfig.backgroundColor = labelConfig.backgroundColor ? labelConfig.backgroundColor : 'rgba(0,0,0,0)';\n \n var settingsFont = labelConfig.font;\n if (!settingsFont) {\n settingsFont = {};\n }\n \n localConfig.font.family = settingsFont.family || 'Roboto';\n localConfig.font.size = settingsFont.size ? settingsFont.size : 6;\n localConfig.font.style = settingsFont.style ? settingsFont.style : 'normal';\n localConfig.font.weight = settingsFont.weight ? settingsFont.weight : '500';\n localConfig.font.color = settingsFont.color ? settingsFont.color : '#fff';\n \n localConfig.replaceInfo = processLabelPattern(localConfig.pattern, self.ctx.data);\n \n var label = {};\n var labelElement = $('');\n labelElement.css('position', 'absolute');\n labelElement.css('display', 'none');\n labelElement.css('top', '0');\n labelElement.css('left', '0');\n labelElement.css('backgroundColor', localConfig.backgroundColor);\n labelElement.css('color', localConfig.font.color);\n labelElement.css('fontFamily', localConfig.font.family);\n labelElement.css('fontStyle', localConfig.font.style);\n labelElement.css('fontWeight', localConfig.font.weight);\n \n labelElement.html(localConfig.pattern);\n self.ctx.$container.append(labelElement);\n label.element = labelElement;\n label.config = localConfig;\n label.htmlSet = false;\n label.visible = false;\n self.ctx.labels.push(label);\n }\n\n var bgImg = $('
');\n bgImg.hide();\n bgImg.bind('load', function()\n {\n self.ctx.bImageHeight = $(this).height();\n self.ctx.bImageWidth = $(this).width();\n self.onResize();\n });\n self.ctx.$container.append(bgImg);\n bgImg.attr('src', imageUrl);\n \n self.onDataUpdated();\n}\n\nself.onDataUpdated = function() {\n updateLabels();\n}\n\nself.onResize = function() {\n if (self.ctx.bImageHeight && self.ctx.bImageWidth) {\n var backgroundRect = {};\n var imageRatio = self.ctx.bImageWidth / self.ctx.bImageHeight;\n var componentRatio = self.ctx.width / self.ctx.height;\n if (componentRatio >= imageRatio) {\n backgroundRect.top = 0;\n backgroundRect.bottom = 1.0;\n backgroundRect.xRatio = imageRatio / componentRatio;\n backgroundRect.yRatio = 1;\n var offset = (1 - backgroundRect.xRatio) / 2;\n backgroundRect.left = offset;\n backgroundRect.right = 1 - offset;\n } else {\n backgroundRect.left = 0;\n backgroundRect.right = 1.0;\n backgroundRect.xRatio = 1;\n backgroundRect.yRatio = componentRatio / imageRatio;\n var offset = (1 - backgroundRect.yRatio) / 2;\n backgroundRect.top = offset;\n backgroundRect.bottom = 1 - offset;\n }\n for (var l = 0; l < self.ctx.labels.length; l++) {\n var label = self.ctx.labels[l];\n var labelLeft = backgroundRect.left*100 + (label.config.x*backgroundRect.xRatio);\n var labelTop = backgroundRect.top*100 + (label.config.y*backgroundRect.yRatio);\n var fontSize = self.ctx.height * backgroundRect.yRatio * label.config.font.size / 100;\n label.element.css('top', labelTop + '%');\n label.element.css('left', labelLeft + '%');\n label.element.css('fontSize', fontSize + 'px');\n if (!label.visible) {\n label.element.css('display', 'block');\n label.visible = true;\n }\n }\n } \n}\n\n\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\n\nfunction padValue(val, dec, int) {\n var i = 0;\n var s, strVal, n;\n\n val = parseFloat(val);\n n = (val < 0);\n val = Math.abs(val);\n\n if (dec > 0) {\n strVal = val.toFixed(dec).toString().split('.');\n s = int - strVal[0].length;\n\n for (; i < s; ++i) {\n strVal[0] = '0' + strVal[0];\n }\n\n strVal = (n ? '-' : '') + strVal[0] + '.' + strVal[1];\n }\n\n else {\n strVal = Math.round(val).toString();\n s = int - strVal.length;\n\n for (; i < s; ++i) {\n strVal = '0' + strVal;\n }\n\n strVal = (n ? '-' : '') + strVal;\n }\n\n return strVal;\n}\n\nfunction updateLabels() {\n for (var l = 0; l < self.ctx.labels.length; l++) {\n var label = self.ctx.labels[l];\n var text = label.config.pattern;\n var replaceInfo = label.config.replaceInfo;\n var updated = false;\n for (var v = 0; v < replaceInfo.variables.length; v++) {\n var variableInfo = replaceInfo.variables[v];\n var txtVal = '';\n if (variableInfo.dataKeyIndex > -1) {\n var varData = self.ctx.data[variableInfo.dataKeyIndex].data;\n if (varData.length > 0) {\n var val = varData[varData.length-1][1];\n if (isNumber(val)) {\n txtVal = padValue(val, variableInfo.valDec, 0);\n updated = true;\n } else {\n txtVal = val;\n updated = true;\n }\n }\n }\n text = text.split(variableInfo.variable).join(txtVal);\n }\n if (updated || !label.htmlSet) {\n label.element.html(text);\n if (!label.htmlSet) {\n label.htmlSet = true;\n }\n }\n }\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n singleEntity: true\n };\n};\n\nself.onDestroy = function() {\n}\n",
+ "controllerScript": "self.onInit = function() {\n self.ctx.varsRegex = /\\$\\{([^\\}]*)\\}/g;\n \n var imageUrl = self.ctx.settings.backgroundImageUrl ? self.ctx.settings.backgroundImageUrl :\n 'data:image/svg+xml;base64,PHN2ZyBpZD0ic3ZnMiIgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTAwIiB3aWR0aD0iMTAwIiB2ZXJzaW9uPSIxLjEiIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgdmlld0JveD0iMCAwIDEwMCAxMDAiPgogPGcgaWQ9ImxheWVyMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtOTUyLjM2KSI+CiAgPHJlY3QgaWQ9InJlY3Q0Njg0IiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBoZWlnaHQ9Ijk5LjAxIiB3aWR0aD0iOTkuMDEiIHN0cm9rZT0iIzAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiB5PSI5NTIuODYiIHg9Ii40OTUwNSIgc3Ryb2tlLXdpZHRoPSIuOTkwMTAiIGZpbGw9IiNlZWUiLz4KICA8dGV4dCBpZD0idGV4dDQ2ODYiIHN0eWxlPSJ3b3JkLXNwYWNpbmc6MHB4O2xldHRlci1zcGFjaW5nOjBweDt0ZXh0LWFuY2hvcjptaWRkbGU7dGV4dC1hbGlnbjpjZW50ZXIiIGZvbnQtd2VpZ2h0PSJib2xkIiB4bWw6c3BhY2U9InByZXNlcnZlIiBmb250LXNpemU9IjEwcHgiIGxpbmUtaGVpZ2h0PSIxMjUlIiB5PSI5NzAuNzI4MDkiIHg9IjQ5LjM5NjQ3NyIgZm9udC1mYW1pbHk9IlJvYm90byIgZmlsbD0iIzY2NjY2NiI+PHRzcGFuIGlkPSJ0c3BhbjQ2OTAiIHg9IjUwLjY0NjQ3NyIgeT0iOTcwLjcyODA5Ij5JbWFnZSBiYWNrZ3JvdW5kIDwvdHNwYW4+PHRzcGFuIGlkPSJ0c3BhbjQ2OTIiIHg9IjQ5LjM5NjQ3NyIgeT0iOTgzLjIyODA5Ij5pcyBub3QgY29uZmlndXJlZDwvdHNwYW4+PC90ZXh0PgogIDxyZWN0IGlkPSJyZWN0NDY5NCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgaGVpZ2h0PSIxOS4zNiIgd2lkdGg9IjY5LjM2IiBzdHJva2U9IiMwMDAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgeT0iOTkyLjY4IiB4PSIxNS4zMiIgc3Ryb2tlLXdpZHRoPSIuNjM5ODYiIGZpbGw9Im5vbmUiLz4KIDwvZz4KPC9zdmc+Cg==';\n\n function processLabelPattern(pattern, data) {\n var match = self.ctx.varsRegex.exec(pattern);\n var replaceInfo = {};\n replaceInfo.variables = [];\n while (match !== null) {\n var variableInfo = {};\n variableInfo.dataKeyIndex = -1;\n var variable = match[0];\n var label = match[1];\n var valDec = 2;\n var splitVals = label.split(':');\n if (splitVals.length > 1) {\n label = splitVals[0];\n valDec = parseFloat(splitVals[1]);\n }\n variableInfo.variable = variable;\n variableInfo.valDec = valDec;\n \n if (label.startsWith('#')) {\n var keyIndexStr = label.substring(1);\n var n = Math.floor(Number(keyIndexStr));\n if (String(n) === keyIndexStr && n >= 0) {\n variableInfo.dataKeyIndex = n;\n }\n }\n if (variableInfo.dataKeyIndex === -1) {\n for (var i = 0; i < data.length; i++) {\n var datasourceData = data[i];\n var dataKey = datasourceData.dataKey;\n if (dataKey.label === label) {\n variableInfo.dataKeyIndex = i;\n break;\n }\n }\n }\n replaceInfo.variables.push(variableInfo);\n match = self.ctx.varsRegex.exec(pattern);\n }\n return replaceInfo;\n }\n\n var configuredLabels = self.ctx.settings.labels;\n if (!configuredLabels) {\n configuredLabels = [];\n }\n \n self.ctx.labels = [];\n\n for (var l = 0; l < configuredLabels.length; l++) {\n var labelConfig = configuredLabels[l];\n var localConfig = {};\n localConfig.font = {};\n \n localConfig.pattern = labelConfig.pattern ? labelConfig.pattern : '${#0}';\n localConfig.x = labelConfig.x ? labelConfig.x : 0;\n localConfig.y = labelConfig.y ? labelConfig.y : 0;\n localConfig.backgroundColor = labelConfig.backgroundColor ? labelConfig.backgroundColor : 'rgba(0,0,0,0)';\n \n var settingsFont = labelConfig.font;\n if (!settingsFont) {\n settingsFont = {};\n }\n \n localConfig.font.family = settingsFont.family || 'Roboto';\n localConfig.font.size = settingsFont.size ? settingsFont.size : 6;\n localConfig.font.style = settingsFont.style ? settingsFont.style : 'normal';\n localConfig.font.weight = settingsFont.weight ? settingsFont.weight : '500';\n localConfig.font.color = settingsFont.color ? settingsFont.color : '#fff';\n \n localConfig.replaceInfo = processLabelPattern(localConfig.pattern, self.ctx.data);\n \n var label = {};\n var labelElement = $('');\n labelElement.css('position', 'absolute');\n labelElement.css('display', 'none');\n labelElement.css('top', '0');\n labelElement.css('left', '0');\n labelElement.css('backgroundColor', localConfig.backgroundColor);\n labelElement.css('color', localConfig.font.color);\n labelElement.css('fontFamily', localConfig.font.family);\n labelElement.css('fontStyle', localConfig.font.style);\n labelElement.css('fontWeight', localConfig.font.weight);\n \n labelElement.html(localConfig.pattern);\n self.ctx.$container.append(labelElement);\n label.element = labelElement;\n label.config = localConfig;\n label.htmlSet = false;\n label.visible = false;\n self.ctx.labels.push(label);\n }\n \n self.ctx.imagePipe.transform(imageUrl, {asString: true, ignoreLoadingImage: true}).subscribe(\n function (transformedUrl) {\n self.ctx.$container.css('background', 'url(\"'+transformedUrl+'\") no-repeat');\n self.ctx.$container.css('backgroundSize', 'contain');\n self.ctx.$container.css('backgroundPosition', '50% 50%');\n var bgImg = $('
');\n bgImg.hide();\n bgImg.bind('load', function()\n {\n self.ctx.bImageHeight = $(this).height();\n self.ctx.bImageWidth = $(this).width();\n self.onResize();\n });\n self.ctx.$container.append(bgImg);\n bgImg.attr('src', transformedUrl);\n }\n );\n\n self.onDataUpdated();\n}\n\nself.onDataUpdated = function() {\n updateLabels();\n}\n\nself.onResize = function() {\n if (self.ctx.bImageHeight && self.ctx.bImageWidth) {\n var backgroundRect = {};\n var imageRatio = self.ctx.bImageWidth / self.ctx.bImageHeight;\n var componentRatio = self.ctx.width / self.ctx.height;\n if (componentRatio >= imageRatio) {\n backgroundRect.top = 0;\n backgroundRect.bottom = 1.0;\n backgroundRect.xRatio = imageRatio / componentRatio;\n backgroundRect.yRatio = 1;\n var offset = (1 - backgroundRect.xRatio) / 2;\n backgroundRect.left = offset;\n backgroundRect.right = 1 - offset;\n } else {\n backgroundRect.left = 0;\n backgroundRect.right = 1.0;\n backgroundRect.xRatio = 1;\n backgroundRect.yRatio = componentRatio / imageRatio;\n var offset = (1 - backgroundRect.yRatio) / 2;\n backgroundRect.top = offset;\n backgroundRect.bottom = 1 - offset;\n }\n for (var l = 0; l < self.ctx.labels.length; l++) {\n var label = self.ctx.labels[l];\n var labelLeft = backgroundRect.left*100 + (label.config.x*backgroundRect.xRatio);\n var labelTop = backgroundRect.top*100 + (label.config.y*backgroundRect.yRatio);\n var fontSize = self.ctx.height * backgroundRect.yRatio * label.config.font.size / 100;\n label.element.css('top', labelTop + '%');\n label.element.css('left', labelLeft + '%');\n label.element.css('fontSize', fontSize + 'px');\n if (!label.visible) {\n label.element.css('display', 'block');\n label.visible = true;\n }\n }\n } \n}\n\n\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\n\nfunction padValue(val, dec, int) {\n var i = 0;\n var s, strVal, n;\n\n val = parseFloat(val);\n n = (val < 0);\n val = Math.abs(val);\n\n if (dec > 0) {\n strVal = val.toFixed(dec).toString().split('.');\n s = int - strVal[0].length;\n\n for (; i < s; ++i) {\n strVal[0] = '0' + strVal[0];\n }\n\n strVal = (n ? '-' : '') + strVal[0] + '.' + strVal[1];\n }\n\n else {\n strVal = Math.round(val).toString();\n s = int - strVal.length;\n\n for (; i < s; ++i) {\n strVal = '0' + strVal;\n }\n\n strVal = (n ? '-' : '') + strVal;\n }\n\n return strVal;\n}\n\nfunction updateLabels() {\n for (var l = 0; l < self.ctx.labels.length; l++) {\n var label = self.ctx.labels[l];\n var text = label.config.pattern;\n var replaceInfo = label.config.replaceInfo;\n var updated = false;\n for (var v = 0; v < replaceInfo.variables.length; v++) {\n var variableInfo = replaceInfo.variables[v];\n var txtVal = '';\n if (variableInfo.dataKeyIndex > -1) {\n var varData = self.ctx.data[variableInfo.dataKeyIndex].data;\n if (varData.length > 0) {\n var val = varData[varData.length-1][1];\n if (isNumber(val)) {\n txtVal = padValue(val, variableInfo.valDec, 0);\n updated = true;\n } else {\n txtVal = val;\n updated = true;\n }\n }\n }\n text = text.split(variableInfo.variable).join(txtVal);\n }\n if (updated || !label.htmlSet) {\n label.element.html(text);\n if (!label.htmlSet) {\n label.htmlSet = true;\n }\n }\n }\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n singleEntity: true\n };\n};\n\nself.onDestroy = function() {\n}\n",
"settingsSchema": "",
"dataKeySettingsSchema": "{}\n",
"settingsDirective": "tb-label-widget-settings",
diff --git a/application/src/main/data/json/system/widget_types/markers_placement___image_map.json b/application/src/main/data/json/system/widget_types/markers_placement___image_map.json
index 922a776fe8..35f7d0dce3 100644
--- a/application/src/main/data/json/system/widget_types/markers_placement___image_map.json
+++ b/application/src/main/data/json/system/widget_types/markers_placement___image_map.json
@@ -15,7 +15,7 @@
"settingsSchema": "",
"dataKeySettingsSchema": "",
"settingsDirective": "tb-map-widget-settings",
- "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"First point\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"xPos\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.05427416942713381,\"funcBody\":\"var value = prevValue || 0.2;\\nif (time % 5000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"yPos\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.680594833308841,\"funcBody\":\"var value = prevValue || 0.3;\\nif (time % 5000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"}]},{\"type\":\"function\",\"name\":\"Second point\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"xPos\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.05012157428742059,\"funcBody\":\"var value = prevValue || 0.6;\\nif (time % 4000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"yPos\",\"color\":\"#ffc107\",\"settings\":{},\"_hash\":0.6742359401617628,\"funcBody\":\"var value = prevValue || 0.7;\\nif (time % 4000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"showLabel\":true,\"label\":\"${entityName}\",\"tooltipPattern\":\"${entityName}
X Pos: ${xPos:2}
Y Pos: ${yPos:2}
Delete\",\"markerImageSize\":34,\"useColorFunction\":false,\"markerImages\":[],\"useMarkerImageFunction\":false,\"color\":\"#fe7569\",\"mapImageUrl\":\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9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pIiAvPgogICAgPHRleHQKICAgICAgIHhtbDpzcGFjZT0icHJlc2VydmUiCiAgICAgICBzdHlsZT0iZm9udC1zaXplOjkuNjU4Mzc3NjVweDtmb250LXN0eWxlOm5vcm1hbDtmb250LXZhcmlhbnQ6bm9ybWFsO2ZvbnQtd2VpZ2h0Om5vcm1hbDtmb250LXN0cmV0Y2g6bm9ybWFsO2xpbmUtaGVpZ2h0OjEyNSU7bGV0dGVyLXNwYWNpbmc6MHB4O3dvcmQtc3BhY2luZzowcHg7ZmlsbDojMDAwMDAwO2ZpbGwtb3BhY2l0eToxO3N0cm9rZTpub25lO2ZvbnQtZmFtaWx5OlZlcmRhbmE7LWlua3NjYXBlLWZvbnQtc3BlY2lmaWNhdGlvbjpWZXJkYW5hIgogICAgICAgeD0iNTI5LjYyNTMxIgogICAgICAgeT0iLTU1MC44NDc3OCIKICAgICAgIGlkPSJ0ZXh0NDU0My01IgogICAgICAgc29kaXBvZGk6bGluZXNwYWNpbmc9IjEyNSUiCiAgICAgICB0cmFuc2Zvcm09Im1hdHJpeCgwLDEsLTEsMCwwLDApIj48dHNwYW4KICAgICAgICAgc29kaXBvZGk6cm9sZT0ibGluZSIKICAgICAgICAgaWQ9InRzcGFuNDU0NS0wIgogICAgICAgICB4PSI1MjkuNjI1MzEiCiAgICAgICAgIHk9Ii01NTAuODQ3NzgiPkJyb2Fkd2F5PC90c3Bhbj48L3RleHQ+CiAgPC9nPgo8L3N2Zz4K\",\"xPosKeyName\":\"xPos\",\"yPosKeyName\":\"yPos\",\"posFunction\":\"return {x: origXPos, y: origYPos};\",\"markerOffsetX\":0.5,\"markerOffsetY\":1,\"showTooltip\":true,\"autocloseTooltip\":true,\"showTooltipAction\":\"click\",\"defaultCenterPosition\":\"0,0\",\"provider\":\"image-map\",\"fitMapBounds\":true,\"latKeyName\":\"latitude\",\"lngKeyName\":\"longitude\",\"polygonKeyName\":\"coordinates\",\"polygonOpacity\":0.5,\"polygonStrokeOpacity\":1,\"polygonStrokeWeight\":1,\"mapProvider\":\"HERE.normalDay\",\"draggableMarker\":true,\"editablePolygon\":true,\"mapPageSize\":16384,\"showPolygon\":false,\"polygonTooltipPattern\":\"${entityName}
TimeStamp: ${coordinates|ts:7}
Delete\"},\"title\":\"Markers Placement - Image Map\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"useDashboardTimewindow\":true,\"showLegend\":false,\"widgetStyle\":{},\"actions\":{\"tooltipAction\":[{\"name\":\"delete\",\"icon\":\"more_horiz\",\"type\":\"custom\",\"customFunction\":\"var entityDatasource = widgetContext.map.map.datasources.filter(\\n function(entity) {\\n return entity.entityId === entityId.id;\\n });\\n\\nwidgetContext.map.setMarkerLocation(entityDatasource[0], null, null).subscribe(() => widgetContext.updateAliases());\",\"id\":\"c39f512a-21c6-6b06-3aa1-715262c6553d\"},{\"name\":\"delete_polygon\",\"icon\":\"more_horiz\",\"type\":\"custom\",\"customFunction\":\"var entityDatasource = widgetContext.map.map.datasources.filter(\\n function(entity) {\\n return entity.entityId === entityId.id\\n });\\n\\nwidgetContext.map.savePolygonLocation(entityDatasource[0], null).subscribe(() => widgetContext.updateAliases());\",\"id\":\"94bf5ffd-b526-c6c3-ae3b-ab42191217d9\"}]},\"showTitleIcon\":false,\"titleIcon\":\"more_horiz\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"displayTimewindow\":true}"
+ "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"First point\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"xPos\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.05427416942713381,\"funcBody\":\"var value = prevValue || 0.2;\\nif (time % 5000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"yPos\",\"color\":\"#4caf50\",\"settings\":{},\"_hash\":0.680594833308841,\"funcBody\":\"var value = prevValue || 0.3;\\nif (time % 5000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"}]},{\"type\":\"function\",\"name\":\"Second point\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"xPos\",\"color\":\"#f44336\",\"settings\":{},\"_hash\":0.05012157428742059,\"funcBody\":\"var value = prevValue || 0.6;\\nif (time % 4000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"yPos\",\"color\":\"#ffc107\",\"settings\":{},\"_hash\":0.6742359401617628,\"funcBody\":\"var value = prevValue || 0.7;\\nif (time % 4000 < 500) {\\n value += Math.random() * 0.05 - 0.025;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":true,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"8px\",\"settings\":{\"showLabel\":true,\"label\":\"${entityName}\",\"tooltipPattern\":\"${entityName}
X Pos: ${xPos:2}
Y Pos: ${yPos:2}
Delete\",\"markerImageSize\":34,\"useColorFunction\":false,\"markerImages\":[],\"useMarkerImageFunction\":false,\"color\":\"#fe7569\",\"mapImageUrl\":\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMTEzNC41IiBoZWlnaHQ9Ijc2Mi43OCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI3LjA3MSAtMzA3LjkpIj4KICA8ZyBmaWxsPSJub25lIj4KICAgPHBhdGggZD0ibTkwNi4wMyA3MDYuMTMgMy40MjkyIDE3Ljc5Nm0tODgwLjg5IDQxLjEyMWMxNTAuNDQgNi44MzM0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CiA8L2c+Cjwvc3ZnPgo=\",\"xPosKeyName\":\"xPos\",\"yPosKeyName\":\"yPos\",\"posFunction\":\"return {x: origXPos, y: origYPos};\",\"markerOffsetX\":0.5,\"markerOffsetY\":1,\"showTooltip\":true,\"autocloseTooltip\":true,\"showTooltipAction\":\"click\",\"defaultCenterPosition\":\"0,0\",\"provider\":\"image-map\",\"fitMapBounds\":true,\"latKeyName\":\"latitude\",\"lngKeyName\":\"longitude\",\"polygonKeyName\":\"coordinates\",\"polygonOpacity\":0.5,\"polygonStrokeOpacity\":1,\"polygonStrokeWeight\":1,\"mapProvider\":\"HERE.normalDay\",\"draggableMarker\":true,\"editablePolygon\":true,\"mapPageSize\":16384,\"showPolygon\":false,\"polygonTooltipPattern\":\"${entityName}
TimeStamp: ${coordinates|ts:7}
Delete\"},\"title\":\"Markers Placement - Image Map\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"useDashboardTimewindow\":true,\"showLegend\":false,\"widgetStyle\":{},\"actions\":{\"tooltipAction\":[{\"name\":\"delete\",\"icon\":\"more_horiz\",\"type\":\"custom\",\"customFunction\":\"var entityDatasource = widgetContext.map.map.datasources.filter(\\n function(entity) {\\n return entity.entityId === entityId.id;\\n });\\n\\nwidgetContext.map.setMarkerLocation(entityDatasource[0], null, null).subscribe(() => widgetContext.updateAliases());\",\"id\":\"c39f512a-21c6-6b06-3aa1-715262c6553d\"},{\"name\":\"delete_polygon\",\"icon\":\"more_horiz\",\"type\":\"custom\",\"customFunction\":\"var entityDatasource = widgetContext.map.map.datasources.filter(\\n function(entity) {\\n return entity.entityId === entityId.id\\n });\\n\\nwidgetContext.map.savePolygonLocation(entityDatasource[0], null).subscribe(() => widgetContext.updateAliases());\",\"id\":\"94bf5ffd-b526-c6c3-ae3b-ab42191217d9\"}]},\"showTitleIcon\":false,\"titleIcon\":\"more_horiz\",\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\",\"titleTooltip\":\"\",\"displayTimewindow\":true}"
},
"externalId": null,
"tags": [
diff --git a/application/src/main/data/json/system/widget_types/range_chart.json b/application/src/main/data/json/system/widget_types/range_chart.json
new file mode 100644
index 0000000000..981e3582c5
--- /dev/null
+++ b/application/src/main/data/json/system/widget_types/range_chart.json
@@ -0,0 +1,31 @@
+{
+ "fqn": "range_chart",
+ "name": "Range chart",
+ "deprecated": false,
+ "image": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACgCAMAAAB+IdObAAAC/VBMVEX////////8/PwAAAD///////+bsfP+wEzu7u73lkzz8/P1eWTT09PN1emRpeOcsvSxsbGQpeLc3NyXl5epqanjXHPLy8tti+OgoKD/wU26urr29vbts0fnkUf39/fIrYP4l02oqKjJroPl5eWUrPPDw8PCwsLJroSQqfKLpfKDn/HU1NSnu/X/tzD/pwNyku//vD//sB3m5ub2jj98mfB2lfD2hTD/rRPu8v3/3qD1fCD3+f7K1vnnjEf1eh30awSWrvOBnfFkhOLld1n1dRX0cxH/9N/1cVvld1jmjEf2izn/qQry9f2Yr/P/+u/+9u+RpuP82r//yGDdM1D3kEPzWD32gSixwfBWeN//2JDzY0v+vkf/siT+5+RBaNr7x6DbYWXxTC96mPD+7N+VqN35tID2emX3oWD3k0fm6/zc5PvV3vq2xveWrfL+8/Hd3d09ZNr/6b/6vZCPj4/2h3TfQl3bKkjaIUD/ujnxQCL0bwrC0PiWqN5Kbt3/79D6zMqGhob/0n/iUWn0aVH+vUPZGjr/tSuwwvZpiOLR0dH+2I97e3v1dWDkcV3fPVnxSCr/qw+Jo/F/m/GLoum3xOj64uZef+H41NoyW9hdfNbJycnxqLT7x5/4no/nb4P/zXDiVm3hS2TlcV3zXEPyUzj+uTTwRCbkbRB+mOaareN5k+FyjuBHbNw4YNn7xr3/47D70LD5t6zumqjngJH/2I+Ojo7lYnf4oWC+mF7utEj2iDTmfSrxRyrunw/kZwLL1vWWrfS/zPORqfP98fKjt/GGofHv7+/+7erK0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4LCuDN3IfFln69UCTbxbrt7WlaEbidmarXZ/NXm0ipXBG6mz9epZwv08+gdvpM7W692EO3wfy4M3ss7WzrOUercXy8M3sliFDnmbUnNEDN8IZSs996YYvpGQreUC3dgAIz5bs94O2QAjPluvDtGDDTBC2Zod7aIHm2BksaJzbx82wch8+XoPfdgEI5jN0IuNMLJYoB/BCJNghpcYG+RGFQ6Dwhz9ODZSSIwFJLh1xTTMa93Z+m1o3cWWJyR98KBZ90a0Xs9r5fTxx/j4uYt9cELSq3mznnHFbDJBlx5y8MgAYe29CUXLgMAFhE72yjF4ZPBQcMcvdGSqMHmgcm/ojqAPR5RgDV1OznNrJlTUI6BEA3csMOGFI6kvpVJq1O1SoZRulzI+SqRdp1/B3wC2sN7dwwmsQM6Q534hWK6hRZVEte/8dsowBVglHVN9jK3SS8tKGtRuLUUuVYdUAO1SmSORdhkJ40VURsy+s4IZWzizfqWo1utdlOa0LTTXtI+K0ikXJFWGWTEqtGxKuVDtUlsY1ioV+7xMpL9rRAluBZ+CT41TiEYs84dkXPi/5YzjWkTpFh95KTPHUh6lYJapdinLmWmVagvjEunvGgGXgjNYIZSORuwEBMWclE6CGZgiSicY8Upa3hNcoJgKE6Vjy/dHHVLIVqkoyVkqzU6hFYrW0dgb4XBvxMgKRVtWH3LrnlJUo1VIioNkGPP4bbhvAFNUEUxyYh66WloRrdKy4JN2qeEGqTQ7i3+EPGnoZLvJvItlSMnTWbb57wJH9RLtM9lpbDpOnc3O/ACb/i1NA1ABvwAAAABJRU5ErkJggg==",
+ "description": "Displays changes to time-series data over time visualized with color ranges — for example, temperature or humidity readings.",
+ "descriptor": {
+ "type": "timeseries",
+ "sizeX": 8,
+ "sizeY": 5,
+ "resources": [],
+ "templateHtml": "\n",
+ "templateCss": ".legend {\n font-size: 13px;\n line-height: 10px;\n}\n\n.legend table { \n border-spacing: 0px;\n border-collapse: separate;\n}\n\n.mouse-events .flot-overlay {\n cursor: crosshair; \n}\n\n",
+ "controllerScript": "self.onInit = function() {\n self.ctx.$scope.rangeChartWidget.onInit();\n};\n\nself.onDataUpdated = function() {\n self.ctx.$scope.rangeChartWidget.onDataUpdated();\n}\n\nself.typeParameters = function() {\n return {\n maxDatasources: 1,\n maxDataKeys: 1,\n singleEntity: true,\n previewWidth: '80%',\n embedTitlePanel: true,\n hasAdditionalLatestDataKeys: false,\n defaultDataKeysFunction: function() {\n return [{ name: 'temperature', label: 'Temperature', type: 'timeseries' }];\n }\n };\n}\n",
+ "settingsSchema": "{}",
+ "dataKeySettingsSchema": "{}",
+ "latestDataKeySettingsSchema": "{}",
+ "settingsDirective": "tb-range-chart-widget-settings",
+ "dataKeySettingsDirective": "",
+ "latestDataKeySettingsDirective": "",
+ "hasBasicMode": true,
+ "basicModeDirective": "tb-range-chart-basic-config",
+ "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Temperature\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.8587686344902596,\"funcBody\":\"var value = prevValue + Math.random() * 40 - 20;\\nif (value < -60) {\\n\\tvalue = -60;\\n} else if (value > 60) {\\n\\tvalue = 60;\\n}\\nreturn value;\",\"aggregationType\":null,\"units\":null,\"decimals\":null,\"usePostProcessing\":null,\"postFuncBody\":null}]}],\"timewindow\":{\"hideInterval\":false,\"hideLastInterval\":false,\"hideQuickInterval\":false,\"hideAggregation\":false,\"hideAggInterval\":false,\"hideTimezone\":false,\"selectedTab\":0,\"realtime\":{\"realtimeType\":0,\"timewindowMs\":60000,\"quickInterval\":\"CURRENT_DAY\",\"interval\":1000},\"aggregation\":{\"type\":\"AVG\",\"limit\":25000},\"timezone\":null},\"showTitle\":true,\"backgroundColor\":\"rgba(0, 0, 0, 0)\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"dataZoom\":true,\"rangeColors\":[{\"to\":-20,\"color\":\"#234CC7\"},{\"from\":-20,\"to\":0,\"color\":\"#305AD7\"},{\"from\":0,\"to\":10,\"color\":\"#7191EF\"},{\"from\":10,\"to\":20,\"color\":\"#FFA600\"},{\"from\":20,\"to\":30,\"color\":\"#F36900\"},{\"from\":30,\"to\":40,\"color\":\"#F04022\"},{\"from\":40,\"color\":\"#D81838\"}],\"outOfRangeColor\":\"#ccc\",\"fillArea\":true,\"showLegend\":true,\"legendPosition\":\"top\",\"legendLabelFont\":{\"family\":\"Roboto\",\"size\":12,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"400\",\"lineHeight\":\"16px\"},\"legendLabelColor\":\"rgba(0, 0, 0, 0.76)\",\"showTooltip\":true,\"tooltipValueFont\":{\"family\":\"Roboto\",\"size\":12,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"500\",\"lineHeight\":\"16px\"},\"tooltipValueColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipShowDate\":true,\"tooltipDateFormat\":{\"format\":\"dd MMM yyyy HH:mm\",\"lastUpdateAgo\":false,\"custom\":false},\"tooltipDateFont\":{\"family\":\"Roboto\",\"size\":11,\"sizeUnit\":\"px\",\"style\":\"normal\",\"weight\":\"400\",\"lineHeight\":\"16px\"},\"tooltipDateColor\":\"rgba(0, 0, 0, 0.76)\",\"tooltipBackgroundColor\":\"rgba(255, 255, 255, 0.76)\",\"tooltipBackgroundBlur\":4,\"background\":{\"type\":\"color\",\"color\":\"#fff\",\"overlay\":{\"enabled\":false,\"color\":\"rgba(255,255,255,0.72)\",\"blur\":3}}},\"title\":\"Range chart\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":null,\"mobileHeight\":null,\"configMode\":\"basic\",\"actions\":{},\"showTitleIcon\":false,\"titleIcon\":\"thermostat\",\"iconColor\":\"#1F6BDD\",\"useDashboardTimewindow\":false,\"displayTimewindow\":true,\"titleFont\":{\"size\":16,\"sizeUnit\":\"px\",\"family\":\"Roboto\",\"weight\":\"500\",\"style\":\"normal\",\"lineHeight\":\"24px\"},\"titleColor\":\"rgba(0, 0, 0, 0.87)\",\"titleTooltip\":\"\",\"widgetStyle\":{},\"widgetCss\":\"\",\"pageSize\":1024,\"units\":\"°C\",\"decimals\":0,\"noDataDisplayMessage\":\"\",\"timewindowStyle\":{\"showIcon\":false,\"iconSize\":\"24px\",\"icon\":null,\"iconPosition\":\"left\",\"font\":{\"size\":12,\"sizeUnit\":\"px\",\"family\":\"Roboto\",\"weight\":\"400\",\"style\":\"normal\",\"lineHeight\":\"16px\"},\"color\":\"rgba(0, 0, 0, 0.38)\",\"displayTypePrefix\":true},\"margin\":\"0px\",\"borderRadius\":\"0px\",\"iconSize\":\"0px\"}"
+ },
+ "externalId": null,
+ "tags": [
+ "range",
+ "color range",
+ "line chart"
+ ]
+}
\ No newline at end of file
diff --git a/application/src/main/data/json/demo/dashboards/gateway.json b/application/src/main/data/json/tenant/dashboards/gateways.json
similarity index 99%
rename from application/src/main/data/json/demo/dashboards/gateway.json
rename to application/src/main/data/json/tenant/dashboards/gateways.json
index b35b480ef2..972aed299f 100644
--- a/application/src/main/data/json/demo/dashboards/gateway.json
+++ b/application/src/main/data/json/tenant/dashboards/gateways.json
@@ -1,5 +1,5 @@
{
- "title": "Gateway",
+ "title": "ThingsBoard IoT Gateways",
"image": null,
"mobileHide": false,
"mobileOrder": null,
@@ -40,7 +40,7 @@
"color": "rgba(0, 0, 0, 0.87)",
"padding": "4px",
"settings": {
- "entitiesTitle": "Gateway list",
+ "entitiesTitle": "Gateways list",
"enableSearch": true,
"enableSelectColumnDisplay": false,
"enableStickyHeader": true,
@@ -55,7 +55,7 @@
"defaultSortOrder": "entityName",
"useRowStyleFunction": false
},
- "title": "New Entities table",
+ "title": "Gateways list",
"dropShadow": true,
"enableFullscreen": false,
"titleStyle": {
@@ -571,11 +571,11 @@
"padding": "8px",
"settings": {
"useMarkdownTextFunction": true,
- "markdownTextFunction": "var blockData = '';\nvar connectorsIndex = ctx.actionsApi.getActionDescriptors('elementClick').findIndex(action=>action.name==\"Connecotrs\");\nvar logsIndex = ctx.actionsApi.getActionDescriptors('elementClick').findIndex(action=>action.name==\"Logs\");\nfunction generateMatHeader(index) {\n if( index !== undefined && index > -1) {\n return ``\n } else {\n return \"\" \n }\n}\nfunction createDataBlock(value, label, dividerStyle, mobile, index) {\n blockData += `\n \n \n \n ${generateMatHeader(index)}\n ${label}\n \n ${value}\n `;\n}\ncreateDataBlock(data[0].Status, \"Status\", data[0].Status === \"Active\"? 'divider-green' : 'divider-red');\ncreateDataBlock(data[0].Name, \"Gateway Name\", '', ctx.isMobile);\ncreateDataBlock(data[0].Type, \"Gateway Type\", '');\ncreateDataBlock(\n `${(data[1]?data[1].count:0)} `\n + \" | \" + \n `${(data[2]?data[2][\"count 2\"]:0)} `\n , \"Devices (Active | Inactive)\", '');\ncreateDataBlock(\n `${(data[0].active_connectors?JSON.parse(data[0].active_connectors).length:0)} `\n + \" | \" + \n `${(data[0].inactive_connectors?JSON.parse(data[0].inactive_connectors).length:0)} `\n , \"Connectors (Active | Inactive)\", '', '', connectorsIndex);\ncreateDataBlock(data[0].ALL_ERRORS_COUNT || 0, \"Errors\", (data[0].ALL_ERRORS_COUNT || 0) === 0 ? 'divider-green' : 'divider-red', '', logsIndex);\nreturn `${blockData}
`;",
+ "markdownTextFunction": "var blockData = '';\nvar connectorsIndex = ctx.actionsApi.getActionDescriptors('elementClick').findIndex(action=>action.name==\"Connectors\");\nvar logsIndex = ctx.actionsApi.getActionDescriptors('elementClick').findIndex(action=>action.name==\"Logs\");\nfunction generateMatHeader(index) {\n if( index !== undefined && index > -1) {\n return ``\n } else {\n return \"\" \n }\n}\nfunction createDataBlock(value, label, dividerStyle, mobile, index) {\n blockData += `\n \n \n \n ${generateMatHeader(index)}\n ${label}\n \n ${value}\n `;\n}\ncreateDataBlock(data[0].Status, \"Status\", data[0].Status === \"Active\"? 'divider-green' : 'divider-red');\ncreateDataBlock(data[0].Name, \"Gateway Name\", '', ctx.isMobile);\ncreateDataBlock(data[0].Type, \"Gateway Type\", '');\ncreateDataBlock(\n `${(data[1]?data[1].count:0)} `\n + \" | \" + \n `${(data[2]?data[2][\"count 2\"]:0)} `\n , \"Devices (Active | Inactive)\", '');\ncreateDataBlock(\n `${(data[0].active_connectors?JSON.parse(data[0].active_connectors).length:0)} `\n + \" | \" + \n `${(data[0].inactive_connectors?JSON.parse(data[0].inactive_connectors).length:0)} `\n , \"Connectors (Active | Inactive)\", '', '', connectorsIndex);\ncreateDataBlock(data[0].ALL_ERRORS_COUNT || 0, \"Errors\", (data[0].ALL_ERRORS_COUNT || 0) === 0 ? 'divider-green' : 'divider-red', '', logsIndex);\nreturn `${blockData}
`;",
"applyDefaultMarkdownStyle": false,
"markdownCss": ".divider {\n position: absolute;\n width: 3px;\n top: 8px;\n border-radius: 2px;\n bottom: 8px;\n border: 1px solid rgba(31, 70, 144, 1);\n background-color: rgba(31, 70, 144, 1);\n left: 10px;\n}\n.divider-green .divider {\n border: 1px solid rgb(25,128,56);\n background-color: rgb(25,128,56);\n}\n\n.divider-green .mat-mdc-card-content {\n color: rgb(25,128,56);\n}\n\n.divider-red .divider {\n border: 1px solid rgb(203,37,48);\n background-color: rgb(203,37,48);\n}\n\n.divider-red .mat-mdc-card-content {\n color: rgb(203,37,48);\n}\n\n.mdc-card {\n position: relative;\n padding-left: 10px;\n margin-bottom: 1px;\n}\n\n.mat-mdc-card-subtitle {\n font-weight: 400;\n font-size: 12px;\n}\n\n.mat-mdc-card-header {\n padding: 8px 16px 0;\n}\n\n.mat-mdc-card-content:last-child {\n padding-bottom: 8px;\n font-size: 16px;\n}\n\n.cards-container {\n height: calc(100% - 1px);\n justify-content: stretch;\n align-items: center;\n margin-bottom: 1px;\n}\n\n::ng-deep.tb-home-widget-link > div {\n flex-grow: 1;\n cursor: pointer;\n}\n\n .tb-home-widget-link {\n width: 100%;\n }\n\n .tb-home-widget-link:hover::after{\n color: inherit;\n }\n \n .tb-home-widget-link::after{\n content: 'arrow_forward';\n display: inline-block;\n transform: rotate(315deg);\n font-family: 'Material Icons';\n font-weight: normal;\n font-style: normal;\n font-size: 18px;\n color: rgba(0, 0, 0, 0.12);\n vertical-align: bottom;\n margin-left: 6px;\n}"
},
- "title": "New Markdown/HTML Card",
+ "title": "Connectors",
"showTitleIcon": false,
"iconColor": "rgba(0, 0, 0, 0.87)",
"iconSize": "24px",
@@ -599,7 +599,7 @@
"actions": {
"elementClick": [
{
- "name": "Connecotrs",
+ "name": "Connectors",
"icon": "more_horiz",
"useShowWidgetActionFunction": null,
"showWidgetActionFunction": "return true;",
@@ -680,7 +680,7 @@
"defaultSortOrder": "-createdTime",
"useRowStyleFunction": false
},
- "title": "New Alarms table",
+ "title": "Alarms",
"dropShadow": true,
"enableFullscreen": false,
"titleStyle": {
@@ -1074,7 +1074,7 @@
}
]
},
- "title": "New RPC remote shell",
+ "title": "RPC remote shell",
"dropShadow": true,
"enableFullscreen": true,
"widgetStyle": {
@@ -1485,7 +1485,7 @@
}
]
},
- "title": "New RPC debug terminal",
+ "title": "RPC debug terminal",
"dropShadow": true,
"enableFullscreen": true,
"widgetStyle": {},
@@ -1868,7 +1868,7 @@
"applyDefaultMarkdownStyle": false,
"markdownCss": ".action-buttons-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n align-content: center;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n}"
},
- "title": "New Markdown/HTML Card",
+ "title": "Service command",
"showTitleIcon": false,
"iconColor": "rgba(0, 0, 0, 0.87)",
"iconSize": "24px",
@@ -1980,7 +1980,7 @@
"applyDefaultMarkdownStyle": false,
"markdownCss": ".action-buttons-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n align-content: start;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n}"
},
- "title": "New Markdown/HTML Card",
+ "title": "General configuration",
"showTitleIcon": false,
"iconColor": "rgba(0, 0, 0, 0.87)",
"iconSize": "24px",
@@ -2145,7 +2145,7 @@
"applyDefaultMarkdownStyle": true,
"markdownCss": ".mat-mdc-form-field-subscript-wrapper {\n display: none !important;\n}"
},
- "title": "New Markdown/HTML Card",
+ "title": "Gateway devices",
"showTitleIcon": false,
"iconColor": "rgba(0, 0, 0, 0.87)",
"iconSize": "24px",
@@ -4939,7 +4939,7 @@
"applyDefaultMarkdownStyle": false,
"markdownCss": ".action-container {\r\n display: flex;\r\n flex-wrap: wrap;\r\n flex-direction: row;\r\n height: 100%;\r\n width: 100%;\r\n}\r\n\r\nbutton {\r\n flex-grow: 1;\r\n margin: 10px;\r\n min-width: 150px;\r\n height: auto;\r\n}"
},
- "title": "New Markdown/HTML Card",
+ "title": "Gateway commands",
"showTitleIcon": false,
"iconColor": "rgba(0, 0, 0, 0.87)",
"iconSize": "24px",
diff --git a/application/src/main/data/upgrade/3.6.1/schema_update.sql b/application/src/main/data/upgrade/3.6.1/schema_update.sql
new file mode 100644
index 0000000000..ebcf20a2c5
--- /dev/null
+++ b/application/src/main/data/upgrade/3.6.1/schema_update.sql
@@ -0,0 +1,37 @@
+--
+-- Copyright © 2016-2023 The Thingsboard Authors
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+-- RESOURCES UPDATE START
+
+DO
+$$
+ BEGIN
+ IF NOT EXISTS(SELECT 1 FROM information_schema.columns WHERE table_name = 'resource' AND column_name = 'data' AND data_type = 'bytea') THEN
+ ALTER TABLE resource RENAME COLUMN data TO base64_data;
+ ALTER TABLE resource ADD COLUMN data bytea;
+ UPDATE resource SET data = decode(base64_data, 'base64') WHERE base64_data IS NOT NULL;
+ ALTER TABLE resource DROP COLUMN base64_data;
+ END IF;
+ END;
+$$;
+
+ALTER TABLE resource ADD COLUMN IF NOT EXISTS descriptor varchar;
+ALTER TABLE resource ADD COLUMN IF NOT EXISTS preview bytea;
+ALTER TABLE resource ADD COLUMN IF NOT EXISTS external_id uuid;
+
+CREATE INDEX IF NOT EXISTS idx_resource_etag ON resource(tenant_id, etag);
+
+-- RESOURCES UPDATE END
diff --git a/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java b/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java
index 3d4340f6c9..607d5d8791 100644
--- a/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java
+++ b/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java
@@ -29,6 +29,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.service.executors.PubSubRuleNodeExecutorProvider;
import org.thingsboard.rule.engine.api.MailService;
import org.thingsboard.rule.engine.api.NotificationCenter;
import org.thingsboard.rule.engine.api.SmsService;
@@ -322,6 +323,11 @@ public class ActorSystemContext {
@Getter
private NotificationExecutorService notificationExecutor;
+ @Lazy
+ @Autowired
+ @Getter
+ private PubSubRuleNodeExecutorProvider pubSubRuleNodeExecutorProvider;
+
@Autowired
@Getter
private SharedEventLoopGroupService sharedEventLoopGroupService;
diff --git a/application/src/main/java/org/thingsboard/server/actors/device/DeviceActor.java b/application/src/main/java/org/thingsboard/server/actors/device/DeviceActor.java
index 48425d58db..d69b9aec0b 100644
--- a/application/src/main/java/org/thingsboard/server/actors/device/DeviceActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/device/DeviceActor.java
@@ -64,6 +64,9 @@ public class DeviceActor extends ContextAwareActor {
case DEVICE_ATTRIBUTES_UPDATE_TO_DEVICE_ACTOR_MSG:
processor.processAttributesUpdate((DeviceAttributesEventNotificationMsg) msg);
break;
+ case DEVICE_DELETE_TO_DEVICE_ACTOR_MSG:
+ ctx.stop(ctx.getSelf());
+ break;
case DEVICE_CREDENTIALS_UPDATE_TO_DEVICE_ACTOR_MSG:
processor.processCredentialsUpdate(msg);
break;
diff --git a/application/src/main/java/org/thingsboard/server/actors/ruleChain/DefaultTbContext.java b/application/src/main/java/org/thingsboard/server/actors/ruleChain/DefaultTbContext.java
index ca1d174322..28963b383a 100644
--- a/application/src/main/java/org/thingsboard/server/actors/ruleChain/DefaultTbContext.java
+++ b/application/src/main/java/org/thingsboard/server/actors/ruleChain/DefaultTbContext.java
@@ -104,6 +104,7 @@ import org.thingsboard.server.dao.widget.WidgetsBundleService;
import org.thingsboard.server.gen.transport.TransportProtos;
import org.thingsboard.server.queue.TbQueueCallback;
import org.thingsboard.server.queue.TbQueueMsgMetadata;
+import org.thingsboard.server.service.executors.PubSubRuleNodeExecutorProvider;
import org.thingsboard.server.service.script.RuleNodeJsScriptEngine;
import org.thingsboard.server.service.script.RuleNodeTbelScriptEngine;
@@ -538,6 +539,11 @@ class DefaultTbContext implements TbContext {
return mainCtx.getNotificationExecutor();
}
+ @Override
+ public PubSubRuleNodeExecutorProvider getPubSubRuleNodeExecutorProvider() {
+ return mainCtx.getPubSubRuleNodeExecutorProvider();
+ }
+
@Override
@Deprecated
public ScriptEngine createJsScriptEngine(String script, String... argNames) {
diff --git a/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java b/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java
index c9f5448df3..86f338e89d 100644
--- a/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java
@@ -53,10 +53,13 @@ import org.thingsboard.server.common.msg.queue.PartitionChangeMsg;
import org.thingsboard.server.common.msg.queue.QueueToRuleEngineMsg;
import org.thingsboard.server.common.msg.queue.RuleEngineException;
import org.thingsboard.server.common.msg.queue.ServiceType;
+import org.thingsboard.server.common.msg.rule.engine.DeviceDeleteMsg;
import org.thingsboard.server.service.edge.rpc.EdgeRpcService;
import org.thingsboard.server.service.transport.msg.TransportToDeviceActorMsgWrapper;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
@Slf4j
public class TenantActor extends RuleChainManagerActor {
@@ -65,8 +68,11 @@ public class TenantActor extends RuleChainManagerActor {
private boolean isCore;
private ApiUsageState apiUsageState;
+ private Set deletedDevices;
+
private TenantActor(ActorSystemContext systemContext, TenantId tenantId) {
super(systemContext, tenantId);
+ this.deletedDevices = new HashSet<>();
}
boolean cantFindTenant = false;
@@ -221,6 +227,10 @@ public class TenantActor extends RuleChainManagerActor {
if (!isCore) {
log.warn("RECEIVED INVALID MESSAGE: {}", msg);
}
+ if (deletedDevices.contains(msg.getDeviceId())) {
+ log.debug("RECEIVED MESSAGE FOR DELETED DEVICE: {}", msg);
+ return;
+ }
TbActorRef deviceActor = getOrCreateDeviceActor(msg.getDeviceId());
if (priority) {
deviceActor.tellWithHighPriority(msg);
@@ -240,7 +250,8 @@ public class TenantActor extends RuleChainManagerActor {
log.info("[{}] Received API state update. Going to ENABLE Rule Engine execution.", tenantId);
initRuleChains();
}
- } else if (msg.getEntityId().getEntityType() == EntityType.EDGE) {
+ }
+ if (msg.getEntityId().getEntityType() == EntityType.EDGE) {
EdgeId edgeId = new EdgeId(msg.getEntityId().getId());
EdgeRpcService edgeRpcService = systemContext.getEdgeRpcService();
if (msg.getEvent() == ComponentLifecycleEvent.DELETED) {
@@ -249,7 +260,13 @@ public class TenantActor extends RuleChainManagerActor {
Edge edge = systemContext.getEdgeService().findEdgeById(tenantId, edgeId);
edgeRpcService.updateEdge(tenantId, edge);
}
- } else if (isRuleEngine) {
+ }
+ if (msg.getEntityId().getEntityType() == EntityType.DEVICE && ComponentLifecycleEvent.DELETED == msg.getEvent()) {
+ DeviceId deviceId = (DeviceId) msg.getEntityId();
+ onToDeviceActorMsg(new DeviceDeleteMsg(tenantId, deviceId), true);
+ deletedDevices.add(deviceId);
+ }
+ if (isRuleEngine) {
TbActorRef target = getEntityActorRef(msg.getEntityId());
if (target != null) {
if (msg.getEntityId().getEntityType() == EntityType.RULE_CHAIN) {
diff --git a/application/src/main/java/org/thingsboard/server/config/CustomOAuth2AuthorizationRequestResolver.java b/application/src/main/java/org/thingsboard/server/config/CustomOAuth2AuthorizationRequestResolver.java
index 4d227345b1..e0d5d3e04e 100644
--- a/application/src/main/java/org/thingsboard/server/config/CustomOAuth2AuthorizationRequestResolver.java
+++ b/application/src/main/java/org/thingsboard/server/config/CustomOAuth2AuthorizationRequestResolver.java
@@ -38,6 +38,7 @@ import org.springframework.web.util.UriComponentsBuilder;
import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.dao.oauth2.OAuth2Configuration;
import org.thingsboard.server.dao.oauth2.OAuth2Service;
+import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.security.auth.oauth2.TbOAuth2ParameterNames;
import org.thingsboard.server.service.security.model.token.OAuth2AppTokenFactory;
import org.thingsboard.server.utils.MiscUtils;
@@ -51,6 +52,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
+@TbCoreComponent
@Service
@Slf4j
public class CustomOAuth2AuthorizationRequestResolver implements OAuth2AuthorizationRequestResolver {
diff --git a/application/src/main/java/org/thingsboard/server/config/TbRuleEngineSecurityConfiguration.java b/application/src/main/java/org/thingsboard/server/config/TbRuleEngineSecurityConfiguration.java
new file mode 100644
index 0000000000..7b3a752f57
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/config/TbRuleEngineSecurityConfiguration.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.config;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
+import org.springframework.boot.autoconfigure.security.SecurityProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.annotation.Order;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.web.SecurityFilterChain;
+
+@Configuration
+@EnableWebSecurity
+@EnableGlobalMethodSecurity(prePostEnabled = true)
+@Order(SecurityProperties.BASIC_AUTH_ORDER)
+@ConditionalOnExpression("'${service.type:null}'=='tb-rule-engine'")
+public class TbRuleEngineSecurityConfiguration {
+
+ @Bean
+ SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
+ http.headers().cacheControl().and().frameOptions().disable()
+ .and().cors().and().csrf().disable()
+ .authorizeRequests()
+ .antMatchers("/actuator/prometheus").permitAll()
+ .anyRequest().authenticated();
+ return http.build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/controller/AssetProfileController.java b/application/src/main/java/org/thingsboard/server/controller/AssetProfileController.java
index 47a7eede4b..d9a2923d52 100644
--- a/application/src/main/java/org/thingsboard/server/controller/AssetProfileController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/AssetProfileController.java
@@ -35,6 +35,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException;
import org.thingsboard.server.common.data.id.AssetProfileId;
import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
+import org.thingsboard.server.dao.resource.ImageService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.asset.profile.TbAssetProfileService;
import org.thingsboard.server.service.security.permission.Operation;
@@ -45,6 +46,8 @@ import static org.thingsboard.server.controller.ControllerConstants.ASSET_PROFIL
import static org.thingsboard.server.controller.ControllerConstants.ASSET_PROFILE_INFO_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.ASSET_PROFILE_SORT_PROPERTY_ALLOWABLE_VALUES;
import static org.thingsboard.server.controller.ControllerConstants.ASSET_PROFILE_TEXT_SEARCH_DESCRIPTION;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.NEW_LINE;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_DATA_PARAMETERS;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_NUMBER_DESCRIPTION;
@@ -64,6 +67,7 @@ import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LI
public class AssetProfileController extends BaseController {
private final TbAssetProfileService tbAssetProfileService;
+ private final ImageService imageService;
@ApiOperation(value = "Get Asset Profile (getAssetProfileById)",
notes = "Fetch the Asset Profile object based on the provided Asset Profile Id. " +
@@ -74,10 +78,16 @@ public class AssetProfileController extends BaseController {
@ResponseBody
public AssetProfile getAssetProfileById(
@ApiParam(value = ASSET_PROFILE_ID_PARAM_DESCRIPTION)
- @PathVariable(ASSET_PROFILE_ID) String strAssetProfileId) throws ThingsboardException {
+ @PathVariable(ASSET_PROFILE_ID) String strAssetProfileId,
+ @ApiParam(value = INLINE_IMAGES_DESCRIPTION)
+ @RequestParam(value = INLINE_IMAGES, required = false) boolean inlineImages) throws ThingsboardException {
checkParameter(ASSET_PROFILE_ID, strAssetProfileId);
AssetProfileId assetProfileId = new AssetProfileId(toUUID(strAssetProfileId));
- return checkAssetProfileId(assetProfileId, Operation.READ);
+ var result = checkAssetProfileId(assetProfileId, Operation.READ);
+ if (inlineImages) {
+ imageService.inlineImage(result);
+ }
+ return result;
}
@ApiOperation(value = "Get Asset Profile Info (getAssetProfileInfoById)",
diff --git a/application/src/main/java/org/thingsboard/server/controller/BaseController.java b/application/src/main/java/org/thingsboard/server/controller/BaseController.java
index 365f1fc379..8226610a7d 100644
--- a/application/src/main/java/org/thingsboard/server/controller/BaseController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/BaseController.java
@@ -124,6 +124,7 @@ import org.thingsboard.server.dao.oauth2.OAuth2Service;
import org.thingsboard.server.dao.ota.OtaPackageService;
import org.thingsboard.server.dao.queue.QueueService;
import org.thingsboard.server.dao.relation.RelationService;
+import org.thingsboard.server.dao.resource.ResourceService;
import org.thingsboard.server.dao.rpc.RpcService;
import org.thingsboard.server.dao.rule.RuleChainService;
import org.thingsboard.server.dao.service.ConstraintValidator;
@@ -145,7 +146,6 @@ import org.thingsboard.server.service.entitiy.user.TbUserSettingsService;
import org.thingsboard.server.service.ota.OtaPackageStateService;
import org.thingsboard.server.service.profile.TbAssetProfileCache;
import org.thingsboard.server.service.profile.TbDeviceProfileCache;
-import org.thingsboard.server.service.resource.TbResourceService;
import org.thingsboard.server.service.security.model.SecurityUser;
import org.thingsboard.server.service.security.permission.AccessControlService;
import org.thingsboard.server.service.security.permission.Operation;
@@ -272,7 +272,7 @@ public abstract class BaseController {
protected PartitionService partitionService;
@Autowired
- protected TbResourceService resourceService;
+ protected ResourceService resourceService;
@Autowired
protected OtaPackageService otaPackageService;
@@ -587,7 +587,7 @@ public abstract class BaseController {
checkWidgetTypeId(new WidgetTypeId(entityId.getId()), operation);
return;
case TB_RESOURCE:
- checkResourceId(new TbResourceId(entityId.getId()), operation);
+ checkResourceInfoId(new TbResourceId(entityId.getId()), operation);
return;
case OTA_PACKAGE:
checkOtaPackageId(new OtaPackageId(entityId.getId()), operation);
diff --git a/application/src/main/java/org/thingsboard/server/controller/ControllerConstants.java b/application/src/main/java/org/thingsboard/server/controller/ControllerConstants.java
index e6b4235cf9..5c1842b4b4 100644
--- a/application/src/main/java/org/thingsboard/server/controller/ControllerConstants.java
+++ b/application/src/main/java/org/thingsboard/server/controller/ControllerConstants.java
@@ -32,6 +32,9 @@ public class ControllerConstants {
protected static final String PAGE_DATA_PARAMETERS = "You can specify parameters to filter the results. " +
"The result is wrapped with PageData object that allows you to iterate over result set using pagination. " +
"See the 'Model' tab of the Response Class for more details. ";
+
+ protected static final String INLINE_IMAGES = "inlineImages";
+ protected static final String INLINE_IMAGES_DESCRIPTION = "Inline images as a data URL (Base64)";
protected static final String DASHBOARD_ID_PARAM_DESCRIPTION = "A string value representing the dashboard id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
protected static final String RPC_ID_PARAM_DESCRIPTION = "A string value representing the rpc id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
protected static final String DEVICE_ID_PARAM_DESCRIPTION = "A string value representing the device id. For example, '784f394c-42b6-435a-983c-b7beff2784f9'";
@@ -142,6 +145,8 @@ public class ControllerConstants {
protected static final String RESOURCE_INFO_DESCRIPTION = "Resource Info is a lightweight object that includes main information about the Resource excluding the heavyweight data. ";
protected static final String RESOURCE_DESCRIPTION = "Resource is a heavyweight object that includes main information about the Resource and also data. ";
+ protected static final String RESOURCE_INCLUDE_SYSTEM_IMAGES_DESCRIPTION = "Use 'true' to include system images. Disabled by default. Ignored for requests by users with system administrator authority.";
+
protected static final String RESOURCE_TEXT_SEARCH_DESCRIPTION = "The case insensitive 'substring' filter based on the resource title.";
protected static final String RESOURCE_SORT_PROPERTY_ALLOWABLE_VALUES = "createdTime, title, resourceType, tenantId";
protected static final String RESOURCE_TYPE_PROPERTY_ALLOWABLE_VALUES = "LWM2M_MODEL, JKS, PKCS_12, JS_MODULE";
diff --git a/application/src/main/java/org/thingsboard/server/controller/DashboardController.java b/application/src/main/java/org/thingsboard/server/controller/DashboardController.java
index afc737ab88..502e40e929 100644
--- a/application/src/main/java/org/thingsboard/server/controller/DashboardController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/DashboardController.java
@@ -51,6 +51,7 @@ import org.thingsboard.server.common.data.id.EdgeId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
+import org.thingsboard.server.dao.resource.ImageService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.dashboard.TbDashboardService;
import org.thingsboard.server.service.security.model.SecurityUser;
@@ -74,6 +75,8 @@ import static org.thingsboard.server.controller.ControllerConstants.EDGE_ID;
import static org.thingsboard.server.controller.ControllerConstants.EDGE_ID_PARAM_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.EDGE_UNASSIGN_ASYNC_FIRST_STEP_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.EDGE_UNASSIGN_RECEIVE_STEP_DESCRIPTION;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_DATA_PARAMETERS;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_NUMBER_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_SIZE_DESCRIPTION;
@@ -94,6 +97,7 @@ import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LI
public class DashboardController extends BaseController {
private final TbDashboardService tbDashboardService;
+ private final ImageService imageService;
public static final String DASHBOARD_ID = "dashboardId";
private static final String HOME_DASHBOARD_ID = "homeDashboardId";
@@ -153,10 +157,16 @@ public class DashboardController extends BaseController {
@ResponseBody
public Dashboard getDashboardById(
@ApiParam(value = DASHBOARD_ID_PARAM_DESCRIPTION)
- @PathVariable(DASHBOARD_ID) String strDashboardId) throws ThingsboardException {
+ @PathVariable(DASHBOARD_ID) String strDashboardId,
+ @ApiParam(value = INLINE_IMAGES_DESCRIPTION)
+ @RequestParam(value = INLINE_IMAGES, required = false) boolean inlineImages) throws ThingsboardException {
checkParameter(DASHBOARD_ID, strDashboardId);
DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
- return checkDashboardId(dashboardId, Operation.READ);
+ var result = checkDashboardId(dashboardId, Operation.READ);
+ if (inlineImages) {
+ imageService.inlineImages(result);
+ }
+ return result;
}
@ApiOperation(value = "Create Or Update Dashboard (saveDashboard)",
diff --git a/application/src/main/java/org/thingsboard/server/controller/DeviceConnectivityController.java b/application/src/main/java/org/thingsboard/server/controller/DeviceConnectivityController.java
index 83d4d16034..dca113621c 100644
--- a/application/src/main/java/org/thingsboard/server/controller/DeviceConnectivityController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/DeviceConnectivityController.java
@@ -106,7 +106,7 @@ public class DeviceConnectivityController extends BaseController {
@RequestMapping(value = "/device-connectivity/gateway-launch/{deviceId}", method = RequestMethod.GET)
@ResponseBody
public JsonNode getGatewayLaunchCommands(@ApiParam(value = DEVICE_ID_PARAM_DESCRIPTION)
- @PathVariable(DEVICE_ID) String strDeviceId, HttpServletRequest request) throws ThingsboardException, URISyntaxException {
+ @PathVariable(DEVICE_ID) String strDeviceId, HttpServletRequest request) throws ThingsboardException, URISyntaxException {
checkParameter(DEVICE_ID, strDeviceId);
DeviceId deviceId = new DeviceId(toUUID(strDeviceId));
Device device = checkDeviceId(deviceId, Operation.READ_CREDENTIALS);
diff --git a/application/src/main/java/org/thingsboard/server/controller/DeviceProfileController.java b/application/src/main/java/org/thingsboard/server/controller/DeviceProfileController.java
index c888d67252..3c07946309 100644
--- a/application/src/main/java/org/thingsboard/server/controller/DeviceProfileController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/DeviceProfileController.java
@@ -37,6 +37,7 @@ import org.thingsboard.server.common.data.exception.ThingsboardException;
import org.thingsboard.server.common.data.id.DeviceProfileId;
import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
+import org.thingsboard.server.dao.resource.ImageService;
import org.thingsboard.server.dao.timeseries.TimeseriesService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.device.profile.TbDeviceProfileService;
@@ -52,6 +53,8 @@ import static org.thingsboard.server.controller.ControllerConstants.DEVICE_PROFI
import static org.thingsboard.server.controller.ControllerConstants.DEVICE_PROFILE_INFO_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.DEVICE_PROFILE_SORT_PROPERTY_ALLOWABLE_VALUES;
import static org.thingsboard.server.controller.ControllerConstants.DEVICE_PROFILE_TEXT_SEARCH_DESCRIPTION;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.NEW_LINE;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_DATA_PARAMETERS;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_NUMBER_DESCRIPTION;
@@ -72,6 +75,7 @@ import static org.thingsboard.server.controller.ControllerConstants.UUID_WIKI_LI
public class DeviceProfileController extends BaseController {
private final TbDeviceProfileService tbDeviceProfileService;
+ private final ImageService imageService;
@Autowired
private TimeseriesService timeseriesService;
@@ -85,10 +89,16 @@ public class DeviceProfileController extends BaseController {
@ResponseBody
public DeviceProfile getDeviceProfileById(
@ApiParam(value = DEVICE_PROFILE_ID_PARAM_DESCRIPTION)
- @PathVariable(DEVICE_PROFILE_ID) String strDeviceProfileId) throws ThingsboardException {
+ @PathVariable(DEVICE_PROFILE_ID) String strDeviceProfileId,
+ @ApiParam(value = INLINE_IMAGES_DESCRIPTION)
+ @RequestParam(value = INLINE_IMAGES, required = false) boolean inlineImages) throws ThingsboardException {
checkParameter(DEVICE_PROFILE_ID, strDeviceProfileId);
DeviceProfileId deviceProfileId = new DeviceProfileId(toUUID(strDeviceProfileId));
- return checkDeviceProfileId(deviceProfileId, Operation.READ);
+ var result = checkDeviceProfileId(deviceProfileId, Operation.READ);
+ if (inlineImages) {
+ imageService.inlineImage(result);
+ }
+ return result;
}
@ApiOperation(value = "Get Device Profile Info (getDeviceProfileInfoById)",
diff --git a/application/src/main/java/org/thingsboard/server/controller/ImageController.java b/application/src/main/java/org/thingsboard/server/controller/ImageController.java
new file mode 100644
index 0000000000..7685640929
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/controller/ImageController.java
@@ -0,0 +1,283 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.controller;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import io.swagger.annotations.ApiParam;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.io.ByteArrayResource;
+import org.springframework.http.CacheControl;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.Base64Utils;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+import org.thingsboard.server.common.data.ImageDescriptor;
+import org.thingsboard.server.common.data.ImageExportData;
+import org.thingsboard.server.common.data.ResourceType;
+import org.thingsboard.server.common.data.TbImageDeleteResult;
+import org.thingsboard.server.common.data.TbResource;
+import org.thingsboard.server.common.data.TbResourceInfo;
+import org.thingsboard.server.common.data.exception.ThingsboardException;
+import org.thingsboard.server.common.data.id.TenantId;
+import org.thingsboard.server.common.data.page.PageData;
+import org.thingsboard.server.common.data.page.PageLink;
+import org.thingsboard.server.common.data.security.Authority;
+import org.thingsboard.server.dao.resource.ImageService;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.dao.resource.ImageCacheKey;
+import org.thingsboard.server.service.resource.TbImageService;
+import org.thingsboard.server.service.security.model.SecurityUser;
+import org.thingsboard.server.service.security.permission.Operation;
+import org.thingsboard.server.service.security.permission.Resource;
+
+import java.util.concurrent.TimeUnit;
+
+import static org.thingsboard.server.controller.ControllerConstants.PAGE_NUMBER_DESCRIPTION;
+import static org.thingsboard.server.controller.ControllerConstants.PAGE_SIZE_DESCRIPTION;
+import static org.thingsboard.server.controller.ControllerConstants.RESOURCE_INCLUDE_SYSTEM_IMAGES_DESCRIPTION;
+import static org.thingsboard.server.controller.ControllerConstants.RESOURCE_SORT_PROPERTY_ALLOWABLE_VALUES;
+import static org.thingsboard.server.controller.ControllerConstants.RESOURCE_TEXT_SEARCH_DESCRIPTION;
+import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_ALLOWABLE_VALUES;
+import static org.thingsboard.server.controller.ControllerConstants.SORT_ORDER_DESCRIPTION;
+import static org.thingsboard.server.controller.ControllerConstants.SORT_PROPERTY_DESCRIPTION;
+
+@Slf4j
+@RestController
+@TbCoreComponent
+@RequiredArgsConstructor
+public class ImageController extends BaseController {
+
+ private final ImageService imageService;
+ private final TbImageService tbImageService;
+ @Value("${cache.image.systemImagesBrowserTtlInMinutes:0}")
+ private int systemImagesBrowserTtlInMinutes;
+ @Value("${cache.image.tenantImagesBrowserTtlInMinutes:0}")
+ private int tenantImagesBrowserTtlInMinutes;
+
+ private static final String IMAGE_URL = "/api/images/{type}/{key}";
+ private static final String SYSTEM_IMAGE = "system";
+ private static final String TENANT_IMAGE = "tenant";
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @PostMapping("/api/image")
+ public TbResourceInfo uploadImage(@RequestPart MultipartFile file,
+ @RequestPart(required = false) String title) throws Exception {
+ SecurityUser user = getCurrentUser();
+ TbResource image = new TbResource();
+ image.setTenantId(user.getTenantId());
+ accessControlService.checkPermission(user, Resource.TB_RESOURCE, Operation.CREATE, null, image);
+
+ image.setFileName(file.getOriginalFilename());
+ if (StringUtils.isNotEmpty(title)) {
+ image.setTitle(title);
+ } else {
+ image.setTitle(file.getOriginalFilename());
+ }
+ image.setResourceType(ResourceType.IMAGE);
+ ImageDescriptor descriptor = new ImageDescriptor();
+ descriptor.setMediaType(file.getContentType());
+ image.setDescriptorValue(descriptor);
+ image.setData(file.getBytes());
+ return tbImageService.save(image, user);
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @PutMapping(IMAGE_URL)
+ public TbResourceInfo updateImage(@PathVariable String type,
+ @PathVariable String key,
+ @RequestPart MultipartFile file) throws Exception {
+ TbResourceInfo imageInfo = checkImageInfo(type, key, Operation.WRITE);
+ TbResource image = new TbResource(imageInfo);
+ image.setData(file.getBytes());
+ image.setFileName(file.getOriginalFilename());
+ image.updateDescriptor(ImageDescriptor.class, descriptor -> {
+ descriptor.setMediaType(file.getContentType());
+ return descriptor;
+ });
+ return tbImageService.save(image, getCurrentUser());
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @PutMapping(IMAGE_URL + "/info")
+ public TbResourceInfo updateImageInfo(@PathVariable String type,
+ @PathVariable String key,
+ @RequestBody TbResourceInfo newImageInfo) throws ThingsboardException {
+ TbResourceInfo imageInfo = checkImageInfo(type, key, Operation.WRITE);
+ imageInfo.setTitle(newImageInfo.getTitle());
+ return tbImageService.save(imageInfo, getCurrentUser());
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
+ @GetMapping(value = IMAGE_URL, produces = "image/*")
+ public ResponseEntity downloadImage(@PathVariable String type,
+ @PathVariable String key,
+ @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws Exception {
+ return downloadIfChanged(type, key, etag, false);
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @GetMapping(value = IMAGE_URL + "/export")
+ public ImageExportData exportImage(@PathVariable String type, @PathVariable String key) throws Exception {
+ TbResourceInfo imageInfo = checkImageInfo(type, key, Operation.READ);
+ ImageDescriptor descriptor = imageInfo.getDescriptor(ImageDescriptor.class);
+ byte[] data = imageService.getImageData(imageInfo.getTenantId(), imageInfo.getId());
+ return new ImageExportData(descriptor.getMediaType(), imageInfo.getFileName(), imageInfo.getTitle(), imageInfo.getResourceKey(), Base64Utils.encodeToString(data));
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @PutMapping("/api/image/import")
+ public TbResourceInfo importImage(@RequestBody ImageExportData imageData) throws Exception {
+ SecurityUser user = getCurrentUser();
+ TbResource image = new TbResource();
+ image.setTenantId(user.getTenantId());
+ accessControlService.checkPermission(user, Resource.TB_RESOURCE, Operation.CREATE, null, image);
+
+ image.setFileName(imageData.getFileName());
+ if (StringUtils.isNotEmpty(imageData.getTitle())) {
+ image.setTitle(imageData.getTitle());
+ } else {
+ image.setTitle(imageData.getFileName());
+ }
+ image.setResourceKey(imageData.getResourceKey());
+ image.setResourceType(ResourceType.IMAGE);
+ ImageDescriptor descriptor = new ImageDescriptor();
+ descriptor.setMediaType(imageData.getMediaType());
+ image.setDescriptorValue(descriptor);
+ image.setData(Base64Utils.decodeFromString(imageData.getData()));
+ return tbImageService.save(image, user);
+
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
+ @GetMapping(value = IMAGE_URL + "/preview", produces = "image/png")
+ public ResponseEntity downloadImagePreview(@PathVariable String type,
+ @PathVariable String key,
+ @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws Exception {
+ return downloadIfChanged(type, key, etag, true);
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @GetMapping(IMAGE_URL + "/info")
+ public TbResourceInfo getImageInfo(@PathVariable String type,
+ @PathVariable String key) throws ThingsboardException {
+ return checkImageInfo(type, key, Operation.READ);
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @GetMapping("/api/images")
+ public PageData getImages(@ApiParam(value = PAGE_SIZE_DESCRIPTION, required = true)
+ @RequestParam int pageSize,
+ @ApiParam(value = PAGE_NUMBER_DESCRIPTION, required = true)
+ @RequestParam int page,
+ @ApiParam(value = RESOURCE_INCLUDE_SYSTEM_IMAGES_DESCRIPTION)
+ @RequestParam(required = false) boolean includeSystemImages,
+ @ApiParam(value = RESOURCE_TEXT_SEARCH_DESCRIPTION)
+ @RequestParam(required = false) String textSearch,
+ @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = RESOURCE_SORT_PROPERTY_ALLOWABLE_VALUES)
+ @RequestParam(required = false) String sortProperty,
+ @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES)
+ @RequestParam(required = false) String sortOrder) throws ThingsboardException {
+ // PE: generic permission
+ PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder);
+ TenantId tenantId = getTenantId();
+ if (getCurrentUser().getAuthority() == Authority.SYS_ADMIN || !includeSystemImages) {
+ return checkNotNull(imageService.getImagesByTenantId(tenantId, pageLink));
+ } else {
+ return checkNotNull(imageService.getAllImagesByTenantId(tenantId, pageLink));
+ }
+ }
+
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @DeleteMapping(IMAGE_URL)
+ public ResponseEntity deleteImage(@PathVariable String type,
+ @PathVariable String key,
+ @RequestParam(name = "force", required = false) boolean force) throws ThingsboardException {
+ TbResourceInfo imageInfo = checkImageInfo(type, key, Operation.DELETE);
+ TbImageDeleteResult result = tbImageService.delete(imageInfo, getCurrentUser(), force);
+ return (result.isSuccess() ? ResponseEntity.ok() : ResponseEntity.badRequest()).body(result);
+ }
+
+ private ResponseEntity downloadIfChanged(String type, String key, String etag, boolean preview) throws ThingsboardException, JsonProcessingException {
+ ImageCacheKey cacheKey = new ImageCacheKey(getTenantId(type), key, preview);
+ if (StringUtils.isNotEmpty(etag)) {
+ etag = StringUtils.remove(etag, '\"'); // etag is wrapped in double quotes due to HTTP specification
+ if (etag.equals(tbImageService.getETag(cacheKey))) {
+ return ResponseEntity.status(HttpStatus.NOT_MODIFIED).build();
+ }
+ }
+ TenantId tenantId = getTenantId();
+ TbResourceInfo imageInfo = checkImageInfo(type, key, Operation.READ);
+ String fileName = imageInfo.getFileName();
+ ImageDescriptor descriptor = imageInfo.getDescriptor(ImageDescriptor.class);
+ byte[] data;
+ if (preview) {
+ descriptor = descriptor.getPreviewDescriptor();
+ data = imageService.getImagePreview(tenantId, imageInfo.getId());
+ } else {
+ data = imageService.getImageData(tenantId, imageInfo.getId());
+ }
+ tbImageService.putETag(cacheKey, descriptor.getEtag());
+ var result = ResponseEntity.ok()
+ .header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + fileName)
+ .header("x-filename", fileName)
+ .header("Content-Type", descriptor.getMediaType())
+ .contentLength(data.length)
+ .eTag(descriptor.getEtag());
+ if (systemImagesBrowserTtlInMinutes > 0 && imageInfo.getTenantId().isSysTenantId()) {
+ result.cacheControl(CacheControl.maxAge(systemImagesBrowserTtlInMinutes, TimeUnit.MINUTES));
+ } else if (tenantImagesBrowserTtlInMinutes > 0 && !imageInfo.getTenantId().isSysTenantId()) {
+ result.cacheControl(CacheControl.maxAge(tenantImagesBrowserTtlInMinutes, TimeUnit.MINUTES));
+ } else {
+ result.cacheControl(CacheControl.noCache());
+ }
+ return result.body(new ByteArrayResource(data));
+ }
+
+ private TbResourceInfo checkImageInfo(String imageType, String key, Operation operation) throws ThingsboardException {
+ TenantId tenantId = getTenantId(imageType);
+ TbResourceInfo imageInfo = imageService.getImageInfoByTenantIdAndKey(tenantId, key);
+ checkEntity(getCurrentUser(), checkNotNull(imageInfo), operation);
+ return imageInfo;
+ }
+
+ private TenantId getTenantId(String imageType) throws ThingsboardException {
+ TenantId tenantId;
+ if (imageType.equals(TENANT_IMAGE)) {
+ tenantId = getTenantId();
+ } else if (imageType.equals(SYSTEM_IMAGE)) {
+ tenantId = TenantId.SYS_TENANT_ID;
+ } else {
+ throw new IllegalArgumentException("Invalid image URL");
+ }
+ return tenantId;
+ }
+
+}
\ No newline at end of file
diff --git a/application/src/main/java/org/thingsboard/server/controller/TbResourceController.java b/application/src/main/java/org/thingsboard/server/controller/TbResourceController.java
index 94e318f37c..5a1758f860 100644
--- a/application/src/main/java/org/thingsboard/server/controller/TbResourceController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/TbResourceController.java
@@ -19,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.http.CacheControl;
import org.springframework.http.HttpHeaders;
@@ -26,16 +27,17 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.thingsboard.server.common.data.ResourceType;
-import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.TbResource;
import org.thingsboard.server.common.data.TbResourceInfo;
import org.thingsboard.server.common.data.TbResourceInfoFilter;
@@ -50,8 +52,11 @@ import org.thingsboard.server.service.resource.TbResourceService;
import org.thingsboard.server.service.security.permission.Operation;
import org.thingsboard.server.service.security.permission.Resource;
-import java.util.Base64;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import static org.thingsboard.server.controller.ControllerConstants.AVAILABLE_FOR_ANY_AUTHORIZED_USER;
import static org.thingsboard.server.controller.ControllerConstants.LWM2M_OBJECT_DESCRIPTION;
@@ -87,15 +92,14 @@ public class TbResourceController extends BaseController {
@ApiOperation(value = "Download Resource (downloadResource)", notes = "Download Resource based on the provided Resource Id." + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
- @RequestMapping(value = "/resource/{resourceId}/download", method = RequestMethod.GET)
- @ResponseBody
- public ResponseEntity downloadResource(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
- @PathVariable(RESOURCE_ID) String strResourceId) throws ThingsboardException {
+ @GetMapping(value = "/resource/{resourceId}/download")
+ public ResponseEntity downloadResource(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
+ @PathVariable(RESOURCE_ID) String strResourceId) throws ThingsboardException {
checkParameter(RESOURCE_ID, strResourceId);
TbResourceId resourceId = new TbResourceId(toUUID(strResourceId));
TbResource tbResource = checkResourceId(resourceId, Operation.READ);
- ByteArrayResource resource = new ByteArrayResource(Base64.getDecoder().decode(tbResource.getData().getBytes()));
+ ByteArrayResource resource = new ByteArrayResource(tbResource.getData());
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + tbResource.getFileName())
.header("x-filename", tbResource.getFileName())
@@ -106,42 +110,38 @@ public class TbResourceController extends BaseController {
@ApiOperation(value = "Download LWM2M Resource (downloadLwm2mResourceIfChanged)", notes = DOWNLOAD_RESOURCE_IF_NOT_CHANGED + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
- @RequestMapping(value = "/resource/lwm2m/{resourceId}/download", method = RequestMethod.GET, produces = "application/xml")
- @ResponseBody
- public ResponseEntity downloadLwm2mResourceIfChanged(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
- @PathVariable(RESOURCE_ID) String strResourceId,
- @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws ThingsboardException {
+ @GetMapping(value = "/resource/lwm2m/{resourceId}/download", produces = "application/xml")
+ public ResponseEntity downloadLwm2mResourceIfChanged(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
+ @PathVariable(RESOURCE_ID) String strResourceId,
+ @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws ThingsboardException {
return downloadResourceIfChanged(ResourceType.LWM2M_MODEL, strResourceId, etag);
}
@ApiOperation(value = "Download PKCS_12 Resource (downloadPkcs12ResourceIfChanged)", notes = DOWNLOAD_RESOURCE_IF_NOT_CHANGED + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
@RequestMapping(value = "/resource/pkcs12/{resourceId}/download", method = RequestMethod.GET, produces = "application/x-pkcs12")
- @ResponseBody
- public ResponseEntity downloadPkcs12ResourceIfChanged(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
- @PathVariable(RESOURCE_ID) String strResourceId,
- @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws ThingsboardException {
+ public ResponseEntity downloadPkcs12ResourceIfChanged(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
+ @PathVariable(RESOURCE_ID) String strResourceId,
+ @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws ThingsboardException {
return downloadResourceIfChanged(ResourceType.PKCS_12, strResourceId, etag);
}
@ApiOperation(value = "Download JKS Resource (downloadJksResourceIfChanged)",
notes = DOWNLOAD_RESOURCE_IF_NOT_CHANGED + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
- @RequestMapping(value = "/resource/jks/{resourceId}/download", method = RequestMethod.GET, produces = "application/x-java-keystore")
- @ResponseBody
- public ResponseEntity downloadJksResourceIfChanged(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
- @PathVariable(RESOURCE_ID) String strResourceId,
- @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws ThingsboardException {
+ @GetMapping(value = "/resource/jks/{resourceId}/download", produces = "application/x-java-keystore")
+ public ResponseEntity downloadJksResourceIfChanged(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
+ @PathVariable(RESOURCE_ID) String strResourceId,
+ @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws ThingsboardException {
return downloadResourceIfChanged(ResourceType.JKS, strResourceId, etag);
}
@ApiOperation(value = "Download JS Resource (downloadJsResourceIfChanged)", notes = DOWNLOAD_RESOURCE_IF_NOT_CHANGED + AVAILABLE_FOR_ANY_AUTHORIZED_USER)
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
- @RequestMapping(value = "/resource/js/{resourceId}/download", method = RequestMethod.GET, produces = "application/javascript")
- @ResponseBody
- public ResponseEntity downloadJsResourceIfChanged(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
- @PathVariable(RESOURCE_ID) String strResourceId,
- @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws ThingsboardException {
+ @GetMapping(value = "/resource/js/{resourceId}/download", produces = "application/javascript")
+ public ResponseEntity downloadJsResourceIfChanged(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
+ @PathVariable(RESOURCE_ID) String strResourceId,
+ @RequestHeader(name = HttpHeaders.IF_NONE_MATCH, required = false) String etag) throws ThingsboardException {
return downloadResourceIfChanged(ResourceType.JS_MODULE, strResourceId, etag);
}
@@ -150,8 +150,7 @@ public class TbResourceController extends BaseController {
RESOURCE_INFO_DESCRIPTION + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH,
produces = "application/json")
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
- @RequestMapping(value = "/resource/info/{resourceId}", method = RequestMethod.GET)
- @ResponseBody
+ @GetMapping(value = "/resource/info/{resourceId}")
public TbResourceInfo getResourceInfoById(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
@PathVariable(RESOURCE_ID) String strResourceId) throws ThingsboardException {
checkParameter(RESOURCE_ID, strResourceId);
@@ -162,10 +161,10 @@ public class TbResourceController extends BaseController {
@ApiOperation(value = "Get Resource (getResourceById)",
notes = "Fetch the Resource object based on the provided Resource Id. " +
RESOURCE_DESCRIPTION + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH,
- produces = "application/json")
+ produces = "application/json", hidden = true)
+ @Deprecated // resource's data should be fetched with a download request
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
- @RequestMapping(value = "/resource/{resourceId}", method = RequestMethod.GET)
- @ResponseBody
+ @GetMapping(value = "/resource/{resourceId}")
public TbResource getResourceById(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
@PathVariable(RESOURCE_ID) String strResourceId) throws ThingsboardException {
checkParameter(RESOURCE_ID, strResourceId);
@@ -184,13 +183,12 @@ public class TbResourceController extends BaseController {
produces = "application/json",
consumes = "application/json")
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
- @RequestMapping(value = "/resource", method = RequestMethod.POST)
- @ResponseBody
- public TbResource saveResource(@ApiParam(value = "A JSON value representing the Resource.")
- @RequestBody TbResource resource) throws Exception {
+ @PostMapping(value = "/resource")
+ public TbResourceInfo saveResource(@ApiParam(value = "A JSON value representing the Resource.")
+ @RequestBody TbResource resource) throws Exception {
resource.setTenantId(getTenantId());
checkEntity(resource.getId(), resource, Resource.TB_RESOURCE);
- return tbResourceService.save(resource, getCurrentUser());
+ return new TbResourceInfo(tbResourceService.save(resource, getCurrentUser()));
}
@ApiOperation(value = "Get Resource Infos (getResources)",
@@ -198,8 +196,7 @@ public class TbResourceController extends BaseController {
PAGE_DATA_PARAMETERS + RESOURCE_INFO_DESCRIPTION + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH,
produces = "application/json")
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
- @RequestMapping(value = "/resource", method = RequestMethod.GET)
- @ResponseBody
+ @GetMapping(value = "/resource")
public PageData getResources(@ApiParam(value = PAGE_SIZE_DESCRIPTION, required = true)
@RequestParam int pageSize,
@ApiParam(value = PAGE_NUMBER_DESCRIPTION, required = true)
@@ -215,9 +212,14 @@ public class TbResourceController extends BaseController {
PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder);
TbResourceInfoFilter.TbResourceInfoFilterBuilder filter = TbResourceInfoFilter.builder();
filter.tenantId(getTenantId());
+ Set resourceTypes = new HashSet<>();
if (StringUtils.isNotEmpty(resourceType)) {
- filter.resourceType(ResourceType.valueOf(resourceType));
+ resourceTypes.add(ResourceType.valueOf(resourceType));
+ } else {
+ Collections.addAll(resourceTypes, ResourceType.values());
+ resourceTypes.remove(ResourceType.IMAGE);
}
+ filter.resourceTypes(resourceTypes);
if (Authority.SYS_ADMIN.equals(getCurrentUser().getAuthority())) {
return checkNotNull(resourceService.findTenantResourcesByTenantId(filter.build(), pageLink));
} else {
@@ -225,13 +227,36 @@ public class TbResourceController extends BaseController {
}
}
+ @ApiOperation(value = "Get All Resource Infos (getAllResources)",
+ notes = "Returns a page of Resource Info objects owned by tenant. " +
+ PAGE_DATA_PARAMETERS + RESOURCE_INFO_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH,
+ produces = "application/json")
+ @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
+ @GetMapping(value = "/resource/tenant")
+ public PageData getTenantResources(@ApiParam(value = PAGE_SIZE_DESCRIPTION, required = true)
+ @RequestParam int pageSize,
+ @ApiParam(value = PAGE_NUMBER_DESCRIPTION, required = true)
+ @RequestParam int page,
+ @ApiParam(value = RESOURCE_TEXT_SEARCH_DESCRIPTION)
+ @RequestParam(required = false) String textSearch,
+ @ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = RESOURCE_SORT_PROPERTY_ALLOWABLE_VALUES)
+ @RequestParam(required = false) String sortProperty,
+ @ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES)
+ @RequestParam(required = false) String sortOrder) throws ThingsboardException {
+ PageLink pageLink = createPageLink(pageSize, page, textSearch, sortProperty, sortOrder);
+ TbResourceInfoFilter filter = TbResourceInfoFilter.builder()
+ .tenantId(getTenantId())
+ .resourceTypes(EnumSet.allOf(ResourceType.class))
+ .build();
+ return checkNotNull(resourceService.findTenantResourcesByTenantId(filter, pageLink));
+ }
+
@ApiOperation(value = "Get LwM2M Objects (getLwm2mListObjectsPage)",
notes = "Returns a page of LwM2M objects parsed from Resources with type 'LWM2M_MODEL' owned by tenant or sysadmin. " +
PAGE_DATA_PARAMETERS + LWM2M_OBJECT_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH,
produces = "application/json")
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
- @RequestMapping(value = "/resource/lwm2m/page", method = RequestMethod.GET)
- @ResponseBody
+ @GetMapping(value = "/resource/lwm2m/page")
public List getLwm2mListObjectsPage(@ApiParam(value = PAGE_SIZE_DESCRIPTION, required = true)
@RequestParam int pageSize,
@ApiParam(value = PAGE_NUMBER_DESCRIPTION, required = true)
@@ -243,7 +268,7 @@ public class TbResourceController extends BaseController {
@ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES)
@RequestParam(required = false) String sortOrder) throws ThingsboardException {
PageLink pageLink = new PageLink(pageSize, page, textSearch);
- return checkNotNull(resourceService.findLwM2mObjectPage(getTenantId(), sortProperty, sortOrder, pageLink));
+ return checkNotNull(tbResourceService.findLwM2mObjectPage(getTenantId(), sortProperty, sortOrder, pageLink));
}
@ApiOperation(value = "Get LwM2M Objects (getLwm2mListObjects)",
@@ -251,22 +276,20 @@ public class TbResourceController extends BaseController {
"You can specify parameters to filter the results. " + LWM2M_OBJECT_DESCRIPTION + TENANT_AUTHORITY_PARAGRAPH,
produces = "application/json")
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN')")
- @RequestMapping(value = "/resource/lwm2m", method = RequestMethod.GET)
- @ResponseBody
+ @GetMapping(value = "/resource/lwm2m")
public List getLwm2mListObjects(@ApiParam(value = SORT_ORDER_DESCRIPTION, allowableValues = SORT_ORDER_ALLOWABLE_VALUES, required = true)
@RequestParam String sortOrder,
@ApiParam(value = SORT_PROPERTY_DESCRIPTION, allowableValues = LWM2M_OBJECT_SORT_PROPERTY_ALLOWABLE_VALUES, required = true)
@RequestParam String sortProperty,
@ApiParam(value = "LwM2M Object ids.", required = true)
@RequestParam(required = false) String[] objectIds) throws ThingsboardException {
- return checkNotNull(resourceService.findLwM2mObject(getTenantId(), sortOrder, sortProperty, objectIds));
+ return checkNotNull(tbResourceService.findLwM2mObject(getTenantId(), sortOrder, sortProperty, objectIds));
}
@ApiOperation(value = "Delete Resource (deleteResource)",
notes = "Deletes the Resource. Referencing non-existing Resource Id will cause an error." + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
@PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
- @RequestMapping(value = "/resource/{resourceId}", method = RequestMethod.DELETE)
- @ResponseBody
+ @DeleteMapping(value = "/resource/{resourceId}")
public void deleteResource(@ApiParam(value = RESOURCE_ID_PARAM_DESCRIPTION)
@PathVariable("resourceId") String strResourceId) throws ThingsboardException {
checkParameter(RESOURCE_ID, strResourceId);
@@ -275,12 +298,12 @@ public class TbResourceController extends BaseController {
tbResourceService.delete(tbResource, getCurrentUser());
}
- private ResponseEntity downloadResourceIfChanged(ResourceType type, String strResourceId, String etag) throws ThingsboardException {
+ private ResponseEntity downloadResourceIfChanged(ResourceType resourceType, String strResourceId, String etag) throws ThingsboardException {
checkParameter(RESOURCE_ID, strResourceId);
TbResourceId resourceId = new TbResourceId(toUUID(strResourceId));
-
if (etag != null) {
TbResourceInfo tbResourceInfo = checkResourceInfoId(resourceId, Operation.READ);
+ etag = StringUtils.remove(etag, '\"'); // etag is wrapped in double quotes due to HTTP specification
if (etag.equals(tbResourceInfo.getEtag())) {
return ResponseEntity.status(HttpStatus.NOT_MODIFIED)
.eTag(tbResourceInfo.getEtag())
@@ -289,15 +312,16 @@ public class TbResourceController extends BaseController {
}
TbResource tbResource = checkResourceId(resourceId, Operation.READ);
- ByteArrayResource resource = new ByteArrayResource(Base64.getDecoder().decode(tbResource.getData().getBytes()));
+ ByteArrayResource resource = new ByteArrayResource(tbResource.getData());
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + tbResource.getFileName())
.header("x-filename", tbResource.getFileName())
.contentLength(resource.contentLength())
- .header("Content-Type", type.getMediaType())
+ .header("Content-Type", resourceType.getMediaType())
.cacheControl(CacheControl.noCache())
.eTag(tbResource.getEtag())
.body(resource);
}
+
}
\ No newline at end of file
diff --git a/application/src/main/java/org/thingsboard/server/controller/TelemetryController.java b/application/src/main/java/org/thingsboard/server/controller/TelemetryController.java
index 5f88752ff4..55f4f3afbd 100644
--- a/application/src/main/java/org/thingsboard/server/controller/TelemetryController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/TelemetryController.java
@@ -74,7 +74,7 @@ import org.thingsboard.server.common.data.kv.ReadTsKvQuery;
import org.thingsboard.server.common.data.kv.StringDataEntry;
import org.thingsboard.server.common.data.kv.TsKvEntry;
import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration;
-import org.thingsboard.server.common.transport.adaptor.JsonConverter;
+import org.thingsboard.server.common.adaptor.JsonConverter;
import org.thingsboard.server.dao.timeseries.TimeseriesService;
import org.thingsboard.server.exception.InvalidParametersException;
import org.thingsboard.server.exception.UncheckedApiException;
diff --git a/application/src/main/java/org/thingsboard/server/controller/TenantProfileController.java b/application/src/main/java/org/thingsboard/server/controller/TenantProfileController.java
index 6fbee00f7f..1fe492d692 100644
--- a/application/src/main/java/org/thingsboard/server/controller/TenantProfileController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/TenantProfileController.java
@@ -133,6 +133,7 @@ public class TenantProfileController extends BaseController {
" \"maxRuleChains\": 0,\n" +
" \"maxResourcesInBytes\": 0,\n" +
" \"maxOtaPackagesInBytes\": 0,\n" +
+ " \"maxResourceSize\": 0,\n" +
" \"transportTenantMsgRateLimit\": \"1000:1,20000:60\",\n" +
" \"transportTenantTelemetryMsgRateLimit\": \"1000:1,20000:60\",\n" +
" \"transportTenantTelemetryDataPointsRateLimit\": \"1000:1,20000:60\",\n" +
diff --git a/application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java b/application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java
index f90a196edf..fa18fe4265 100644
--- a/application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java
@@ -43,6 +43,7 @@ import org.thingsboard.server.common.data.widget.WidgetTypeDetails;
import org.thingsboard.server.common.data.widget.WidgetTypeInfo;
import org.thingsboard.server.common.data.widget.WidgetsBundle;
import org.thingsboard.server.dao.model.ModelConstants;
+import org.thingsboard.server.dao.resource.ImageService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.widgets.type.TbWidgetTypeService;
import org.thingsboard.server.service.security.permission.Operation;
@@ -53,6 +54,8 @@ import java.util.Collections;
import java.util.List;
import static org.thingsboard.server.controller.ControllerConstants.AVAILABLE_FOR_ANY_AUTHORIZED_USER;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_DATA_PARAMETERS;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_NUMBER_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_SIZE_DESCRIPTION;
@@ -72,6 +75,7 @@ import static org.thingsboard.server.controller.ControllerConstants.WIDGET_TYPE_
public class WidgetTypeController extends AutoCommitController {
private final TbWidgetTypeService tbWidgetTypeService;
+ private final ImageService imageService;
private static final String WIDGET_TYPE_DESCRIPTION = "Widget Type represents the template for widget creation. Widget Type and Widget are similar to class and object in OOP theory.";
private static final String WIDGET_TYPE_DETAILS_DESCRIPTION = "Widget Type Details extend Widget Type and add image and description properties. " +
@@ -92,10 +96,16 @@ public class WidgetTypeController extends AutoCommitController {
@ResponseBody
public WidgetTypeDetails getWidgetTypeById(
@ApiParam(value = WIDGET_TYPE_ID_PARAM_DESCRIPTION, required = true)
- @PathVariable("widgetTypeId") String strWidgetTypeId) throws ThingsboardException {
+ @PathVariable("widgetTypeId") String strWidgetTypeId,
+ @ApiParam(value = INLINE_IMAGES_DESCRIPTION)
+ @RequestParam(value = INLINE_IMAGES, required = false) boolean inlineImages) throws ThingsboardException {
checkParameter("widgetTypeId", strWidgetTypeId);
WidgetTypeId widgetTypeId = new WidgetTypeId(toUUID(strWidgetTypeId));
- return checkWidgetTypeId(widgetTypeId, Operation.READ);
+ var result = checkWidgetTypeId(widgetTypeId, Operation.READ);
+ if (inlineImages) {
+ imageService.inlineImages(result);
+ }
+ return result;
}
@ApiOperation(value = "Get Widget Type Info (getWidgetTypeInfoById)",
@@ -216,7 +226,7 @@ public class WidgetTypeController extends AutoCommitController {
@ApiOperation(value = "Get all Widget types for specified Bundle (getBundleWidgetTypes)",
notes = "Returns an array of Widget Type objects that belong to specified Widget Bundle." + WIDGET_TYPE_DESCRIPTION + " " + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
- @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
@RequestMapping(value = "/widgetTypes", params = {"widgetsBundleId"}, method = RequestMethod.GET)
@ResponseBody
public List getBundleWidgetTypes(
@@ -248,14 +258,21 @@ public class WidgetTypeController extends AutoCommitController {
@ApiOperation(value = "Get all Widget types details for specified Bundle (getBundleWidgetTypes)",
notes = "Returns an array of Widget Type Details objects that belong to specified Widget Bundle." + WIDGET_TYPE_DETAILS_DESCRIPTION + " " + SYSTEM_OR_TENANT_AUTHORITY_PARAGRAPH)
- @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')")
+ @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')")
@RequestMapping(value = "/widgetTypesDetails", params = {"widgetsBundleId"}, method = RequestMethod.GET)
@ResponseBody
public List getBundleWidgetTypesDetails(
@ApiParam(value = "Widget Bundle Id", required = true)
- @RequestParam("widgetsBundleId") String strWidgetsBundleId) throws ThingsboardException {
+ @RequestParam("widgetsBundleId") String strWidgetsBundleId,
+ @ApiParam(value = INLINE_IMAGES_DESCRIPTION)
+ @RequestParam(value = INLINE_IMAGES, required = false) boolean inlineImages
+ ) throws ThingsboardException {
WidgetsBundleId widgetsBundleId = new WidgetsBundleId(toUUID(strWidgetsBundleId));
- return checkNotNull(widgetTypeService.findWidgetTypesDetailsByWidgetsBundleId(getTenantId(), widgetsBundleId));
+ var result = checkNotNull(widgetTypeService.findWidgetTypesDetailsByWidgetsBundleId(getTenantId(), widgetsBundleId));
+ if (inlineImages) {
+ result.forEach(imageService::inlineImages);
+ }
+ return result;
}
@ApiOperation(value = "Get all Widget type fqns for specified Bundle (getBundleWidgetTypeFqns)",
@@ -369,6 +386,7 @@ public class WidgetTypeController extends AutoCommitController {
String typeFqn = fqn.substring(scopeQualifier.length() + 1);
WidgetType widgetType = widgetTypeService.findWidgetTypeByTenantIdAndFqn(tenantId, typeFqn);
checkNotNull(widgetType);
+
accessControlService.checkPermission(getCurrentUser(), Resource.WIDGET_TYPE, Operation.READ, widgetType.getId(), widgetType);
return widgetType;
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java b/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java
index f62d1b7b05..1fe203249f 100644
--- a/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java
@@ -36,6 +36,7 @@ import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
import org.thingsboard.server.common.data.security.Authority;
import org.thingsboard.server.common.data.widget.WidgetsBundle;
+import org.thingsboard.server.dao.resource.ImageService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.widgets.bundle.TbWidgetsBundleService;
import org.thingsboard.server.service.security.permission.Operation;
@@ -47,6 +48,8 @@ import java.util.List;
import java.util.Set;
import static org.thingsboard.server.controller.ControllerConstants.AVAILABLE_FOR_ANY_AUTHORIZED_USER;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES;
+import static org.thingsboard.server.controller.ControllerConstants.INLINE_IMAGES_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_DATA_PARAMETERS;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_NUMBER_DESCRIPTION;
import static org.thingsboard.server.controller.ControllerConstants.PAGE_SIZE_DESCRIPTION;
@@ -66,6 +69,7 @@ import static org.thingsboard.server.controller.ControllerConstants.WIDGET_BUNDL
public class WidgetsBundleController extends BaseController {
private final TbWidgetsBundleService tbWidgetsBundleService;
+ private final ImageService imageService;
private static final String WIDGET_BUNDLE_DESCRIPTION = "Widget Bundle represents a group(bundle) of widgets. Widgets are grouped into bundle by type or use case. ";
private static final String FULL_SEARCH_PARAM_DESCRIPTION = "Optional boolean parameter indicating extended search of widget bundles by description and by name / description of related widget types";
@@ -78,10 +82,16 @@ public class WidgetsBundleController extends BaseController {
@ResponseBody
public WidgetsBundle getWidgetsBundleById(
@ApiParam(value = WIDGET_BUNDLE_ID_PARAM_DESCRIPTION, required = true)
- @PathVariable("widgetsBundleId") String strWidgetsBundleId) throws ThingsboardException {
+ @PathVariable("widgetsBundleId") String strWidgetsBundleId,
+ @ApiParam(value = INLINE_IMAGES_DESCRIPTION)
+ @RequestParam(value = INLINE_IMAGES, required = false) boolean inlineImages) throws ThingsboardException {
checkParameter("widgetsBundleId", strWidgetsBundleId);
WidgetsBundleId widgetsBundleId = new WidgetsBundleId(toUUID(strWidgetsBundleId));
- return checkWidgetsBundleId(widgetsBundleId, Operation.READ);
+ var result = checkWidgetsBundleId(widgetsBundleId, Operation.READ);
+ if (inlineImages) {
+ imageService.inlineImage(result);
+ }
+ return result;
}
@ApiOperation(value = "Create Or Update Widget Bundle (saveWidgetsBundle)",
@@ -196,9 +206,9 @@ public class WidgetsBundleController extends BaseController {
} else {
TenantId tenantId = getCurrentUser().getTenantId();
if (tenantOnly != null && tenantOnly) {
- return checkNotNull(widgetsBundleService.findTenantWidgetsBundlesByTenantIdAndPageLink(tenantId, fullSearch != null && fullSearch, pageLink));
+ return checkNotNull(widgetsBundleService.findTenantWidgetsBundlesByTenantIdAndPageLink(tenantId, fullSearch != null && fullSearch, pageLink));
} else {
- return checkNotNull(widgetsBundleService.findAllTenantWidgetsBundlesByTenantIdAndPageLink(tenantId, fullSearch != null && fullSearch, pageLink));
+ return checkNotNull(widgetsBundleService.findAllTenantWidgetsBundlesByTenantIdAndPageLink(tenantId, fullSearch != null && fullSearch, pageLink));
}
}
}
diff --git a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java
index 0730bca8f8..3fc68b9cc3 100644
--- a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java
+++ b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java
@@ -112,6 +112,8 @@ public class ThingsboardInstallService {
} else if ("3.0.1-cassandra".equals(upgradeFromVersion)) {
log.info("Migrating ThingsBoard latest timeseries data from cassandra to SQL database ...");
latestMigrateService.migrate();
+ } else if (upgradeFromVersion.equals("3.6.2-images")) {
+ installScripts.updateImages();
} else {
switch (upgradeFromVersion) {
case "1.2.3": //NOSONAR, Need to execute gradual upgrade starting from upgradeFromVersion
@@ -266,6 +268,15 @@ public class ThingsboardInstallService {
log.info("Upgrading ThingsBoard from version 3.6.0 to 3.6.1 ...");
databaseEntitiesUpgradeService.upgradeDatabase("3.6.0");
dataUpdateService.updateData("3.6.0");
+ case "3.6.1":
+ log.info("Upgrading ThingsBoard from version 3.6.1 to 3.6.2 ...");
+ databaseEntitiesUpgradeService.upgradeDatabase("3.6.1");
+ installScripts.loadSystemImages();
+ if (!getEnv("SKIP_IMAGES_MIGRATION", false)) {
+ installScripts.updateImages();
+ } else {
+ log.info("Skipping images migration. Run the upgrade with fromVersion as '3.6.2-images' to migrate");
+ }
//TODO DON'T FORGET to update switch statement in the CacheCleanupService if you need to clear the cache
break;
default:
@@ -319,6 +330,7 @@ public class ThingsboardInstallService {
// systemDataLoaderService.loadSystemPlugins();
// systemDataLoaderService.loadSystemRules();
installScripts.loadSystemLwm2mResources();
+ installScripts.loadSystemImages();
if (loadDemo) {
log.info("Loading demo data...");
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/EdgeContextComponent.java b/application/src/main/java/org/thingsboard/server/service/edge/EdgeContextComponent.java
index 0d2b6675c9..c62bd81242 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/EdgeContextComponent.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/EdgeContextComponent.java
@@ -42,7 +42,7 @@ import org.thingsboard.server.dao.widget.WidgetTypeService;
import org.thingsboard.server.dao.widget.WidgetsBundleService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.edge.rpc.EdgeEventStorageSettings;
-import org.thingsboard.server.service.edge.rpc.constructor.EdgeMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.constructor.edge.EdgeMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.alarm.AlarmEdgeProcessor;
import org.thingsboard.server.service.edge.rpc.processor.asset.AssetEdgeProcessor;
import org.thingsboard.server.service.edge.rpc.processor.asset.AssetProfileEdgeProcessor;
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java
index 7318b1eb24..99f126c4a7 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/EdgeGrpcSession.java
@@ -623,37 +623,37 @@ public final class EdgeGrpcSession implements Closeable {
case ASSET:
return ctx.getAssetProcessor().convertAssetEventToDownlink(edgeEvent, this.edge.getId(), this.edgeVersion);
case ENTITY_VIEW:
- return ctx.getEntityViewProcessor().convertEntityViewEventToDownlink(edgeEvent);
+ return ctx.getEntityViewProcessor().convertEntityViewEventToDownlink(edgeEvent, this.edgeVersion);
case DASHBOARD:
- return ctx.getDashboardProcessor().convertDashboardEventToDownlink(edgeEvent);
+ return ctx.getDashboardProcessor().convertDashboardEventToDownlink(edgeEvent, this.edgeVersion);
case CUSTOMER:
- return ctx.getCustomerProcessor().convertCustomerEventToDownlink(edgeEvent);
+ return ctx.getCustomerProcessor().convertCustomerEventToDownlink(edgeEvent, this.edgeVersion);
case RULE_CHAIN:
- return ctx.getRuleChainProcessor().convertRuleChainEventToDownlink(edgeEvent);
+ return ctx.getRuleChainProcessor().convertRuleChainEventToDownlink(edgeEvent, this.edgeVersion);
case RULE_CHAIN_METADATA:
return ctx.getRuleChainProcessor().convertRuleChainMetadataEventToDownlink(edgeEvent, this.edgeVersion);
case ALARM:
- return ctx.getAlarmProcessor().convertAlarmEventToDownlink(edgeEvent);
+ return ctx.getAlarmProcessor().convertAlarmEventToDownlink(edgeEvent, this.edgeVersion);
case USER:
- return ctx.getUserProcessor().convertUserEventToDownlink(edgeEvent);
+ return ctx.getUserProcessor().convertUserEventToDownlink(edgeEvent, this.edgeVersion);
case RELATION:
- return ctx.getRelationProcessor().convertRelationEventToDownlink(edgeEvent);
+ return ctx.getRelationProcessor().convertRelationEventToDownlink(edgeEvent, this.edgeVersion);
case WIDGETS_BUNDLE:
- return ctx.getWidgetBundleProcessor().convertWidgetsBundleEventToDownlink(edgeEvent);
+ return ctx.getWidgetBundleProcessor().convertWidgetsBundleEventToDownlink(edgeEvent, this.edgeVersion);
case WIDGET_TYPE:
return ctx.getWidgetTypeProcessor().convertWidgetTypeEventToDownlink(edgeEvent, this.edgeVersion);
case ADMIN_SETTINGS:
- return ctx.getAdminSettingsProcessor().convertAdminSettingsEventToDownlink(edgeEvent);
+ return ctx.getAdminSettingsProcessor().convertAdminSettingsEventToDownlink(edgeEvent, this.edgeVersion);
case OTA_PACKAGE:
- return ctx.getOtaPackageEdgeProcessor().convertOtaPackageEventToDownlink(edgeEvent);
+ return ctx.getOtaPackageEdgeProcessor().convertOtaPackageEventToDownlink(edgeEvent, this.edgeVersion);
case TB_RESOURCE:
- return ctx.getResourceEdgeProcessor().convertResourceEventToDownlink(edgeEvent);
+ return ctx.getResourceEdgeProcessor().convertResourceEventToDownlink(edgeEvent, this.edgeVersion);
case QUEUE:
- return ctx.getQueueEdgeProcessor().convertQueueEventToDownlink(edgeEvent);
+ return ctx.getQueueEdgeProcessor().convertQueueEventToDownlink(edgeEvent, this.edgeVersion);
case TENANT:
- return ctx.getTenantEdgeProcessor().convertTenantEventToDownlink(edgeEvent, this.getEdgeVersion());
+ return ctx.getTenantEdgeProcessor().convertTenantEventToDownlink(edgeEvent, this.edgeVersion);
case TENANT_PROFILE:
- return ctx.getTenantProfileEdgeProcessor().convertTenantProfileEventToDownlink(edgeEvent, this.getEdgeVersion());
+ return ctx.getTenantProfileEdgeProcessor().convertTenantProfileEventToDownlink(edgeEvent, this.edgeVersion);
default:
log.warn("[{}] Unsupported edge event type [{}]", this.tenantId, edgeEvent);
return null;
@@ -670,52 +670,52 @@ public final class EdgeGrpcSession implements Closeable {
}
if (uplinkMsg.getDeviceProfileUpdateMsgCount() > 0) {
for (DeviceProfileUpdateMsg deviceProfileUpdateMsg : uplinkMsg.getDeviceProfileUpdateMsgList()) {
- result.add(ctx.getDeviceProfileProcessor().processDeviceProfileMsgFromEdge(edge.getTenantId(), edge, deviceProfileUpdateMsg));
+ result.add(ctx.getDeviceProfileProcessor().processDeviceProfileMsgFromEdge(edge.getTenantId(), edge, deviceProfileUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getDeviceUpdateMsgCount() > 0) {
for (DeviceUpdateMsg deviceUpdateMsg : uplinkMsg.getDeviceUpdateMsgList()) {
- result.add(ctx.getDeviceProcessor().processDeviceMsgFromEdge(edge.getTenantId(), edge, deviceUpdateMsg));
+ result.add(ctx.getDeviceProcessor().processDeviceMsgFromEdge(edge.getTenantId(), edge, deviceUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getDeviceCredentialsUpdateMsgCount() > 0) {
for (DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg : uplinkMsg.getDeviceCredentialsUpdateMsgList()) {
- result.add(ctx.getDeviceProcessor().processDeviceCredentialsMsgFromEdge(edge.getTenantId(), edge.getId(), deviceCredentialsUpdateMsg));
+ result.add(ctx.getDeviceProcessor().processDeviceCredentialsMsgFromEdge(edge.getTenantId(), edge.getId(), deviceCredentialsUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getAssetProfileUpdateMsgCount() > 0) {
for (AssetProfileUpdateMsg assetProfileUpdateMsg : uplinkMsg.getAssetProfileUpdateMsgList()) {
- result.add(ctx.getAssetProfileProcessor().processAssetProfileMsgFromEdge(edge.getTenantId(), edge, assetProfileUpdateMsg));
+ result.add(ctx.getAssetProfileProcessor().processAssetProfileMsgFromEdge(edge.getTenantId(), edge, assetProfileUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getAssetUpdateMsgCount() > 0) {
for (AssetUpdateMsg assetUpdateMsg : uplinkMsg.getAssetUpdateMsgList()) {
- result.add(ctx.getAssetProcessor().processAssetMsgFromEdge(edge.getTenantId(), edge, assetUpdateMsg));
+ result.add(ctx.getAssetProcessor().processAssetMsgFromEdge(edge.getTenantId(), edge, assetUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getAlarmUpdateMsgCount() > 0) {
for (AlarmUpdateMsg alarmUpdateMsg : uplinkMsg.getAlarmUpdateMsgList()) {
- result.add(ctx.getAlarmProcessor().processAlarmMsgFromEdge(edge.getTenantId(), edge.getId(), alarmUpdateMsg));
+ result.add(ctx.getAlarmProcessor().processAlarmMsgFromEdge(edge.getTenantId(), edge.getId(), alarmUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getEntityViewUpdateMsgCount() > 0) {
for (EntityViewUpdateMsg entityViewUpdateMsg : uplinkMsg.getEntityViewUpdateMsgList()) {
- result.add(ctx.getEntityViewProcessor().processEntityViewMsgFromEdge(edge.getTenantId(), edge, entityViewUpdateMsg));
+ result.add(ctx.getEntityViewProcessor().processEntityViewMsgFromEdge(edge.getTenantId(), edge, entityViewUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getRelationUpdateMsgCount() > 0) {
for (RelationUpdateMsg relationUpdateMsg : uplinkMsg.getRelationUpdateMsgList()) {
- result.add(ctx.getRelationProcessor().processRelationMsgFromEdge(edge.getTenantId(), edge, relationUpdateMsg));
+ result.add(ctx.getRelationProcessor().processRelationMsgFromEdge(edge.getTenantId(), edge, relationUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getDashboardUpdateMsgCount() > 0) {
for (DashboardUpdateMsg dashboardUpdateMsg : uplinkMsg.getDashboardUpdateMsgList()) {
- result.add(ctx.getDashboardProcessor().processDashboardMsgFromEdge(edge.getTenantId(), edge, dashboardUpdateMsg));
+ result.add(ctx.getDashboardProcessor().processDashboardMsgFromEdge(edge.getTenantId(), edge, dashboardUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getResourceUpdateMsgCount() > 0) {
for (ResourceUpdateMsg resourceUpdateMsg : uplinkMsg.getResourceUpdateMsgList()) {
- result.add(ctx.getResourceEdgeProcessor().processResourceMsgFromEdge(edge.getTenantId(), edge, resourceUpdateMsg));
+ result.add(ctx.getResourceEdgeProcessor().processResourceMsgFromEdge(edge.getTenantId(), edge, resourceUpdateMsg, this.edgeVersion));
}
}
if (uplinkMsg.getRuleChainMetadataRequestMsgCount() > 0) {
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AssetMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AssetMsgConstructor.java
deleted file mode 100644
index 86ffc6dd5c..0000000000
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AssetMsgConstructor.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Copyright © 2016-2023 The Thingsboard Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.thingsboard.server.service.edge.rpc.constructor;
-
-import org.springframework.stereotype.Component;
-import org.thingsboard.common.util.JacksonUtil;
-import org.thingsboard.server.common.data.asset.Asset;
-import org.thingsboard.server.common.data.id.AssetId;
-import org.thingsboard.server.gen.edge.v1.AssetUpdateMsg;
-import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
-import org.thingsboard.server.queue.util.TbCoreComponent;
-
-@Component
-@TbCoreComponent
-public class AssetMsgConstructor {
-
- public AssetUpdateMsg constructAssetUpdatedMsg(UpdateMsgType msgType, Asset asset) {
- AssetUpdateMsg.Builder builder = AssetUpdateMsg.newBuilder()
- .setMsgType(msgType)
- .setIdMSB(asset.getUuidId().getMostSignificantBits())
- .setIdLSB(asset.getUuidId().getLeastSignificantBits())
- .setName(asset.getName())
- .setType(asset.getType());
- if (asset.getLabel() != null) {
- builder.setLabel(asset.getLabel());
- }
- if (asset.getCustomerId() != null) {
- builder.setCustomerIdMSB(asset.getCustomerId().getId().getMostSignificantBits());
- builder.setCustomerIdLSB(asset.getCustomerId().getId().getLeastSignificantBits());
- }
- if (asset.getAssetProfileId() != null) {
- builder.setAssetProfileIdMSB(asset.getAssetProfileId().getId().getMostSignificantBits());
- builder.setAssetProfileIdLSB(asset.getAssetProfileId().getId().getLeastSignificantBits());
- }
- if (asset.getAdditionalInfo() != null) {
- builder.setAdditionalInfo(JacksonUtil.toString(asset.getAdditionalInfo()));
- }
- return builder.build();
- }
-
- public AssetUpdateMsg constructAssetDeleteMsg(AssetId assetId) {
- return AssetUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(assetId.getId().getMostSignificantBits())
- .setIdLSB(assetId.getId().getLeastSignificantBits()).build();
- }
-}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DeviceProfileMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DeviceProfileMsgConstructor.java
deleted file mode 100644
index d8e19ee854..0000000000
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DeviceProfileMsgConstructor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright © 2016-2023 The Thingsboard Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.thingsboard.server.service.edge.rpc.constructor;
-
-import com.google.protobuf.ByteString;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.thingsboard.server.common.data.DeviceProfile;
-import org.thingsboard.server.common.data.id.DeviceProfileId;
-import org.thingsboard.server.gen.edge.v1.DeviceProfileUpdateMsg;
-import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
-import org.thingsboard.server.queue.util.DataDecodingEncodingService;
-import org.thingsboard.server.queue.util.TbCoreComponent;
-
-import java.nio.charset.StandardCharsets;
-
-@Component
-@TbCoreComponent
-public class DeviceProfileMsgConstructor {
-
- @Autowired
- private DataDecodingEncodingService dataDecodingEncodingService;
-
- public DeviceProfileUpdateMsg constructDeviceProfileUpdatedMsg(UpdateMsgType msgType, DeviceProfile deviceProfile) {
- DeviceProfileUpdateMsg.Builder builder = DeviceProfileUpdateMsg.newBuilder()
- .setMsgType(msgType)
- .setIdMSB(deviceProfile.getId().getId().getMostSignificantBits())
- .setIdLSB(deviceProfile.getId().getId().getLeastSignificantBits())
- .setName(deviceProfile.getName())
- .setDefault(deviceProfile.isDefault())
- .setType(deviceProfile.getType().name())
- .setProfileDataBytes(ByteString.copyFrom(dataDecodingEncodingService.encode(deviceProfile.getProfileData())));
- if (deviceProfile.getDefaultQueueName() != null) {
- builder.setDefaultQueueName(deviceProfile.getDefaultQueueName());
- }
- if (deviceProfile.getDescription() != null) {
- builder.setDescription(deviceProfile.getDescription());
- }
- if (deviceProfile.getTransportType() != null) {
- builder.setTransportType(deviceProfile.getTransportType().name());
- }
- if (deviceProfile.getProvisionType() != null) {
- builder.setProvisionType(deviceProfile.getProvisionType().name());
- }
- if (deviceProfile.getProvisionDeviceKey() != null) {
- builder.setProvisionDeviceKey(deviceProfile.getProvisionDeviceKey());
- }
- if (deviceProfile.getImage() != null) {
- builder.setImage(ByteString.copyFrom(deviceProfile.getImage().getBytes(StandardCharsets.UTF_8)));
- }
- if (deviceProfile.getFirmwareId() != null) {
- builder.setFirmwareIdMSB(deviceProfile.getFirmwareId().getId().getMostSignificantBits())
- .setFirmwareIdLSB(deviceProfile.getFirmwareId().getId().getLeastSignificantBits());
- }
- if (deviceProfile.getSoftwareId() != null) {
- builder.setSoftwareIdMSB(deviceProfile.getSoftwareId().getId().getMostSignificantBits())
- .setSoftwareIdLSB(deviceProfile.getSoftwareId().getId().getLeastSignificantBits());
- }
- if (deviceProfile.getDefaultEdgeRuleChainId() != null) {
- builder.setDefaultRuleChainIdMSB(deviceProfile.getDefaultEdgeRuleChainId().getId().getMostSignificantBits())
- .setDefaultRuleChainIdLSB(deviceProfile.getDefaultEdgeRuleChainId().getId().getLeastSignificantBits());
- }
- if (deviceProfile.getDefaultDashboardId() != null) {
- builder.setDefaultDashboardIdMSB(deviceProfile.getDefaultDashboardId().getId().getMostSignificantBits())
- .setDefaultDashboardIdLSB(deviceProfile.getDefaultDashboardId().getId().getLeastSignificantBits());
- }
- return builder.build();
- }
-
- public DeviceProfileUpdateMsg constructDeviceProfileDeleteMsg(DeviceProfileId deviceProfileId) {
- return DeviceProfileUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(deviceProfileId.getId().getMostSignificantBits())
- .setIdLSB(deviceProfileId.getId().getLeastSignificantBits()).build();
- }
-
-}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/MsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/MsgConstructor.java
new file mode 100644
index 0000000000..071f2bc25d
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/MsgConstructor.java
@@ -0,0 +1,20 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor;
+
+public interface MsgConstructor {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/MsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/MsgConstructorFactory.java
new file mode 100644
index 0000000000..93f08c27ca
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/MsgConstructorFactory.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public abstract class MsgConstructorFactory {
+
+ @Autowired
+ protected T v1Constructor;
+
+ @Autowired
+ protected U v2Constructor;
+
+ public MsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
+ switch (edgeVersion) {
+ case V_3_3_0:
+ case V_3_3_3:
+ case V_3_4_0:
+ case V_3_6_0:
+ case V_3_6_1:
+ return v1Constructor;
+ case V_3_6_2:
+ default:
+ return v2Constructor;
+ }
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/TenantProfileMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/TenantProfileMsgConstructor.java
deleted file mode 100644
index 9fdb1bf069..0000000000
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/TenantProfileMsgConstructor.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Copyright © 2016-2023 The Thingsboard Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.thingsboard.server.service.edge.rpc.constructor;
-
-import com.google.protobuf.ByteString;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import org.thingsboard.server.common.data.TenantProfile;
-import org.thingsboard.server.gen.edge.v1.EdgeVersion;
-import org.thingsboard.server.gen.edge.v1.TenantProfileUpdateMsg;
-import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
-import org.thingsboard.server.queue.util.DataDecodingEncodingService;
-import org.thingsboard.server.queue.util.TbCoreComponent;
-import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
-
-@Component
-@TbCoreComponent
-public class TenantProfileMsgConstructor {
-
- @Autowired
- private DataDecodingEncodingService dataDecodingEncodingService;
-
- public TenantProfileUpdateMsg constructTenantProfileUpdateMsg(UpdateMsgType msgType, TenantProfile tenantProfile, EdgeVersion edgeVersion) {
- ByteString profileData = EdgeVersionUtils.isEdgeVersionOlderThan(edgeVersion, EdgeVersion.V_3_6_1) ?
- ByteString.empty() : ByteString.copyFrom(dataDecodingEncodingService.encode(tenantProfile.getProfileData()));
- TenantProfileUpdateMsg.Builder builder = TenantProfileUpdateMsg.newBuilder()
- .setMsgType(msgType)
- .setIdMSB(tenantProfile.getId().getId().getMostSignificantBits())
- .setIdLSB(tenantProfile.getId().getId().getLeastSignificantBits())
- .setName(tenantProfile.getName())
- .setDefault(tenantProfile.isDefault())
- .setIsolatedRuleChain(tenantProfile.isIsolatedTbRuleEngine())
- .setProfileDataBytes(profileData);
- if (tenantProfile.getDescription() != null) {
- builder.setDescription(tenantProfile.getDescription());
- }
- return builder.build();
- }
-}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/WidgetsBundleMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/WidgetsBundleMsgConstructor.java
deleted file mode 100644
index 5b615ca9f8..0000000000
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/WidgetsBundleMsgConstructor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * Copyright © 2016-2023 The Thingsboard Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.thingsboard.server.service.edge.rpc.constructor;
-
-import com.google.protobuf.ByteString;
-import org.springframework.stereotype.Component;
-import org.thingsboard.common.util.JacksonUtil;
-import org.thingsboard.server.common.data.id.TenantId;
-import org.thingsboard.server.common.data.id.WidgetsBundleId;
-import org.thingsboard.server.common.data.widget.WidgetsBundle;
-import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
-import org.thingsboard.server.gen.edge.v1.WidgetsBundleUpdateMsg;
-import org.thingsboard.server.queue.util.TbCoreComponent;
-
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-
-@Component
-@TbCoreComponent
-public class WidgetsBundleMsgConstructor {
-
- public WidgetsBundleUpdateMsg constructWidgetsBundleUpdateMsg(UpdateMsgType msgType, WidgetsBundle widgetsBundle, List widgets) {
- WidgetsBundleUpdateMsg.Builder builder = WidgetsBundleUpdateMsg.newBuilder()
- .setMsgType(msgType)
- .setIdMSB(widgetsBundle.getId().getId().getMostSignificantBits())
- .setIdLSB(widgetsBundle.getId().getId().getLeastSignificantBits())
- .setTitle(widgetsBundle.getTitle())
- .setAlias(widgetsBundle.getAlias());
- if (widgetsBundle.getImage() != null) {
- builder.setImage(ByteString.copyFrom(widgetsBundle.getImage().getBytes(StandardCharsets.UTF_8)));
- }
- if (widgetsBundle.getDescription() != null) {
- builder.setDescription(widgetsBundle.getDescription());
- }
- if (widgetsBundle.getOrder() != null) {
- builder.setOrder(widgetsBundle.getOrder());
- }
- if (widgetsBundle.getTenantId().equals(TenantId.SYS_TENANT_ID)) {
- builder.setIsSystem(true);
- }
- builder.setWidgets(JacksonUtil.toString(widgets));
- return builder.build();
- }
-
- public WidgetsBundleUpdateMsg constructWidgetsBundleDeleteMsg(WidgetsBundleId widgetsBundleId) {
- return WidgetsBundleUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(widgetsBundleId.getId().getMostSignificantBits())
- .setIdLSB(widgetsBundleId.getId().getLeastSignificantBits())
- .build();
- }
-}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructor.java
new file mode 100644
index 0000000000..fd3b4ef95d
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructor.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.alarm;
+
+import org.thingsboard.server.common.data.alarm.Alarm;
+import org.thingsboard.server.gen.edge.v1.AlarmUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface AlarmMsgConstructor extends MsgConstructor {
+
+ AlarmUpdateMsg constructAlarmUpdatedMsg(UpdateMsgType msgType, Alarm alarm, String entityName);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorFactory.java
new file mode 100644
index 0000000000..6d7e7ebd5c
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.alarm;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class AlarmMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AlarmMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorV1.java
similarity index 90%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AlarmMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorV1.java
index 15d7c27ff6..b1294f5904 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AlarmMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorV1.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.alarm;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
@@ -24,10 +24,11 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class AlarmMsgConstructor {
+public class AlarmMsgConstructorV1 implements AlarmMsgConstructor {
+ @Override
public AlarmUpdateMsg constructAlarmUpdatedMsg(UpdateMsgType msgType, Alarm alarm, String entityName) {
- AlarmUpdateMsg.Builder builder = AlarmUpdateMsg.newBuilder()
+ return AlarmUpdateMsg.newBuilder()
.setMsgType(msgType)
.setIdMSB(alarm.getId().getId().getMostSignificantBits())
.setIdLSB(alarm.getId().getId().getLeastSignificantBits())
@@ -44,8 +45,6 @@ public class AlarmMsgConstructor {
.setDetails(JacksonUtil.toString(alarm.getDetails()))
.setPropagate(alarm.isPropagate())
.setPropagateToOwner(alarm.isPropagateToOwner())
- .setPropagateToTenant(alarm.isPropagateToTenant());
- return builder.build();
+ .setPropagateToTenant(alarm.isPropagateToTenant()).build();
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorV2.java
new file mode 100644
index 0000000000..9034755db6
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorV2.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.alarm;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.alarm.Alarm;
+import org.thingsboard.server.gen.edge.v1.AlarmUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class AlarmMsgConstructorV2 implements AlarmMsgConstructor {
+
+ @Override
+ public AlarmUpdateMsg constructAlarmUpdatedMsg(UpdateMsgType msgType, Alarm alarm, String entityName) {
+ return AlarmUpdateMsg.newBuilder().setMsgType(msgType)
+ .setEntity(JacksonUtil.toString(alarm))
+ .setIdMSB(alarm.getId().getId().getMostSignificantBits())
+ .setIdLSB(alarm.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructor.java
new file mode 100644
index 0000000000..338375ac37
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructor.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.asset;
+
+import org.thingsboard.server.common.data.asset.Asset;
+import org.thingsboard.server.common.data.asset.AssetProfile;
+import org.thingsboard.server.common.data.id.AssetId;
+import org.thingsboard.server.common.data.id.AssetProfileId;
+import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.AssetUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface AssetMsgConstructor extends MsgConstructor {
+
+ AssetUpdateMsg constructAssetUpdatedMsg(UpdateMsgType msgType, Asset asset);
+
+ AssetUpdateMsg constructAssetDeleteMsg(AssetId assetId);
+
+ AssetProfileUpdateMsg constructAssetProfileUpdatedMsg(UpdateMsgType msgType, AssetProfile assetProfile);
+
+ AssetProfileUpdateMsg constructAssetProfileDeleteMsg(AssetProfileId assetProfileId);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorFactory.java
new file mode 100644
index 0000000000..880beb446c
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.asset;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class AssetMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AssetProfileMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorV1.java
similarity index 63%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AssetProfileMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorV1.java
index f5b921a32b..95e1e0e597 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AssetProfileMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorV1.java
@@ -13,13 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.asset;
import com.google.protobuf.ByteString;
import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.asset.Asset;
import org.thingsboard.server.common.data.asset.AssetProfile;
-import org.thingsboard.server.common.data.id.AssetProfileId;
import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.AssetUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
@@ -27,8 +29,34 @@ import java.nio.charset.StandardCharsets;
@Component
@TbCoreComponent
-public class AssetProfileMsgConstructor {
+public class AssetMsgConstructorV1 extends BaseAssetMsgConstructor {
+ @Override
+ public AssetUpdateMsg constructAssetUpdatedMsg(UpdateMsgType msgType, Asset asset) {
+ AssetUpdateMsg.Builder builder = AssetUpdateMsg.newBuilder()
+ .setMsgType(msgType)
+ .setIdMSB(asset.getUuidId().getMostSignificantBits())
+ .setIdLSB(asset.getUuidId().getLeastSignificantBits())
+ .setName(asset.getName())
+ .setType(asset.getType());
+ if (asset.getLabel() != null) {
+ builder.setLabel(asset.getLabel());
+ }
+ if (asset.getCustomerId() != null) {
+ builder.setCustomerIdMSB(asset.getCustomerId().getId().getMostSignificantBits());
+ builder.setCustomerIdLSB(asset.getCustomerId().getId().getLeastSignificantBits());
+ }
+ if (asset.getAssetProfileId() != null) {
+ builder.setAssetProfileIdMSB(asset.getAssetProfileId().getId().getMostSignificantBits());
+ builder.setAssetProfileIdLSB(asset.getAssetProfileId().getId().getLeastSignificantBits());
+ }
+ if (asset.getAdditionalInfo() != null) {
+ builder.setAdditionalInfo(JacksonUtil.toString(asset.getAdditionalInfo()));
+ }
+ return builder.build();
+ }
+
+ @Override
public AssetProfileUpdateMsg constructAssetProfileUpdatedMsg(UpdateMsgType msgType, AssetProfile assetProfile) {
AssetProfileUpdateMsg.Builder builder = AssetProfileUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -55,12 +83,4 @@ public class AssetProfileMsgConstructor {
}
return builder.build();
}
-
- public AssetProfileUpdateMsg constructAssetProfileDeleteMsg(AssetProfileId assetProfileId) {
- return AssetProfileUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(assetProfileId.getId().getMostSignificantBits())
- .setIdLSB(assetProfileId.getId().getLeastSignificantBits()).build();
- }
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorV2.java
new file mode 100644
index 0000000000..b7e00473b5
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/AssetMsgConstructorV2.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.asset;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.asset.Asset;
+import org.thingsboard.server.common.data.asset.AssetProfile;
+import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.AssetUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class AssetMsgConstructorV2 extends BaseAssetMsgConstructor {
+
+ @Override
+ public AssetUpdateMsg constructAssetUpdatedMsg(UpdateMsgType msgType, Asset asset) {
+ return AssetUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(asset))
+ .setIdMSB(asset.getUuidId().getMostSignificantBits())
+ .setIdLSB(asset.getUuidId().getLeastSignificantBits()).build();
+ }
+
+ @Override
+ public AssetProfileUpdateMsg constructAssetProfileUpdatedMsg(UpdateMsgType msgType, AssetProfile assetProfile) {
+ return AssetProfileUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(assetProfile))
+ .setIdMSB(assetProfile.getId().getId().getMostSignificantBits())
+ .setIdLSB(assetProfile.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/BaseAssetMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/BaseAssetMsgConstructor.java
new file mode 100644
index 0000000000..b8fe8ad870
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/asset/BaseAssetMsgConstructor.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.asset;
+
+import org.thingsboard.server.common.data.id.AssetId;
+import org.thingsboard.server.common.data.id.AssetProfileId;
+import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.AssetUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+
+public abstract class BaseAssetMsgConstructor implements AssetMsgConstructor {
+
+ @Override
+ public AssetUpdateMsg constructAssetDeleteMsg(AssetId assetId) {
+ return AssetUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(assetId.getId().getMostSignificantBits())
+ .setIdLSB(assetId.getId().getLeastSignificantBits()).build();
+ }
+
+ @Override
+ public AssetProfileUpdateMsg constructAssetProfileDeleteMsg(AssetProfileId assetProfileId) {
+ return AssetProfileUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(assetProfileId.getId().getMostSignificantBits())
+ .setIdLSB(assetProfileId.getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/BaseCustomerMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/BaseCustomerMsgConstructor.java
new file mode 100644
index 0000000000..6d532a5e1c
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/BaseCustomerMsgConstructor.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.customer;
+
+import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.gen.edge.v1.CustomerUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+
+public abstract class BaseCustomerMsgConstructor implements CustomerMsgConstructor {
+
+ @Override
+ public CustomerUpdateMsg constructCustomerDeleteMsg(CustomerId customerId) {
+ return CustomerUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(customerId.getId().getMostSignificantBits())
+ .setIdLSB(customerId.getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructor.java
new file mode 100644
index 0000000000..7351822a3f
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructor.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.customer;
+
+import org.thingsboard.server.common.data.Customer;
+import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.gen.edge.v1.CustomerUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface CustomerMsgConstructor extends MsgConstructor {
+
+ CustomerUpdateMsg constructCustomerUpdatedMsg(UpdateMsgType msgType, Customer customer);
+
+ CustomerUpdateMsg constructCustomerDeleteMsg(CustomerId customerId);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorFactory.java
new file mode 100644
index 0000000000..3e84fba57f
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.customer;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class CustomerMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/CustomerMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorV1.java
similarity index 82%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/CustomerMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorV1.java
index 0465dd5a94..e6bb95defa 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/CustomerMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorV1.java
@@ -13,20 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.customer;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.Customer;
-import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.gen.edge.v1.CustomerUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class CustomerMsgConstructor {
+public class CustomerMsgConstructorV1 extends BaseCustomerMsgConstructor {
+ @Override
public CustomerUpdateMsg constructCustomerUpdatedMsg(UpdateMsgType msgType, Customer customer) {
CustomerUpdateMsg.Builder builder = CustomerUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -62,11 +62,4 @@ public class CustomerMsgConstructor {
}
return builder.build();
}
-
- public CustomerUpdateMsg constructCustomerDeleteMsg(CustomerId customerId) {
- return CustomerUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(customerId.getId().getMostSignificantBits())
- .setIdLSB(customerId.getId().getLeastSignificantBits()).build();
- }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorV2.java
new file mode 100644
index 0000000000..94764e1178
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorV2.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.customer;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.Customer;
+import org.thingsboard.server.gen.edge.v1.CustomerUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class CustomerMsgConstructorV2 extends BaseCustomerMsgConstructor {
+
+ @Override
+ public CustomerUpdateMsg constructCustomerUpdatedMsg(UpdateMsgType msgType, Customer customer) {
+ return CustomerUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(customer))
+ .setIdMSB(customer.getId().getId().getMostSignificantBits())
+ .setIdLSB(customer.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/BaseDashboardMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/BaseDashboardMsgConstructor.java
new file mode 100644
index 0000000000..f8e42c1461
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/BaseDashboardMsgConstructor.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.dashboard;
+
+import org.thingsboard.server.common.data.id.DashboardId;
+import org.thingsboard.server.gen.edge.v1.DashboardUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+
+public abstract class BaseDashboardMsgConstructor implements DashboardMsgConstructor {
+
+ @Override
+ public DashboardUpdateMsg constructDashboardDeleteMsg(DashboardId dashboardId) {
+ return DashboardUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(dashboardId.getId().getMostSignificantBits())
+ .setIdLSB(dashboardId.getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructor.java
new file mode 100644
index 0000000000..96504e5036
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructor.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.dashboard;
+
+import org.thingsboard.server.common.data.Dashboard;
+import org.thingsboard.server.common.data.id.DashboardId;
+import org.thingsboard.server.gen.edge.v1.DashboardUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface DashboardMsgConstructor extends MsgConstructor {
+
+ DashboardUpdateMsg constructDashboardUpdatedMsg(UpdateMsgType msgType, Dashboard dashboard);
+
+ DashboardUpdateMsg constructDashboardDeleteMsg(DashboardId dashboardId);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorFactory.java
new file mode 100644
index 0000000000..384327f5bc
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.dashboard;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class DashboardMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DashboardMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorV1.java
similarity index 79%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DashboardMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorV1.java
index 50c2b46891..6a3bb43797 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DashboardMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorV1.java
@@ -13,20 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.dashboard;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.Dashboard;
-import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.gen.edge.v1.DashboardUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class DashboardMsgConstructor {
+public class DashboardMsgConstructorV1 extends BaseDashboardMsgConstructor {
+ @Override
public DashboardUpdateMsg constructDashboardUpdatedMsg(UpdateMsgType msgType, Dashboard dashboard) {
DashboardUpdateMsg.Builder builder = DashboardUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -46,12 +46,4 @@ public class DashboardMsgConstructor {
}
return builder.build();
}
-
- public DashboardUpdateMsg constructDashboardDeleteMsg(DashboardId dashboardId) {
- return DashboardUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(dashboardId.getId().getMostSignificantBits())
- .setIdLSB(dashboardId.getId().getLeastSignificantBits()).build();
- }
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorV2.java
new file mode 100644
index 0000000000..0940423119
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/dashboard/DashboardMsgConstructorV2.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.dashboard;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.Dashboard;
+import org.thingsboard.server.gen.edge.v1.DashboardUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class DashboardMsgConstructorV2 extends BaseDashboardMsgConstructor {
+
+ @Override
+ public DashboardUpdateMsg constructDashboardUpdatedMsg(UpdateMsgType msgType, Dashboard dashboard) {
+ return DashboardUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(dashboard))
+ .setIdMSB(dashboard.getId().getId().getMostSignificantBits())
+ .setIdLSB(dashboard.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/BaseDeviceMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/BaseDeviceMsgConstructor.java
new file mode 100644
index 0000000000..21d761dc26
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/BaseDeviceMsgConstructor.java
@@ -0,0 +1,102 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.device;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.id.DeviceId;
+import org.thingsboard.server.common.data.id.DeviceProfileId;
+import org.thingsboard.server.gen.edge.v1.DeviceProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.DeviceRpcCallMsg;
+import org.thingsboard.server.gen.edge.v1.DeviceUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.RpcRequestMsg;
+import org.thingsboard.server.gen.edge.v1.RpcResponseMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+
+import java.util.UUID;
+
+public abstract class BaseDeviceMsgConstructor implements DeviceMsgConstructor {
+
+ @Override
+ public DeviceUpdateMsg constructDeviceDeleteMsg(DeviceId deviceId) {
+ return DeviceUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(deviceId.getId().getMostSignificantBits())
+ .setIdLSB(deviceId.getId().getLeastSignificantBits()).build();
+ }
+
+ @Override
+ public DeviceProfileUpdateMsg constructDeviceProfileDeleteMsg(DeviceProfileId deviceProfileId) {
+ return DeviceProfileUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(deviceProfileId.getId().getMostSignificantBits())
+ .setIdLSB(deviceProfileId.getId().getLeastSignificantBits()).build();
+ }
+
+ @Override
+ public DeviceRpcCallMsg constructDeviceRpcCallMsg(UUID deviceId, JsonNode body) {
+ DeviceRpcCallMsg.Builder builder = constructDeviceRpcMsg(deviceId, body);
+ if (body.has("error") || body.has("response")) {
+ RpcResponseMsg.Builder responseBuilder = RpcResponseMsg.newBuilder();
+ if (body.has("error")) {
+ responseBuilder.setError(body.get("error").asText());
+ } else {
+ responseBuilder.setResponse(body.get("response").asText());
+ }
+ builder.setResponseMsg(responseBuilder.build());
+ } else {
+ RpcRequestMsg.Builder requestBuilder = RpcRequestMsg.newBuilder();
+ requestBuilder.setMethod(body.get("method").asText());
+ requestBuilder.setParams(body.get("params").asText());
+ builder.setRequestMsg(requestBuilder.build());
+ }
+ return builder.build();
+ }
+
+ private DeviceRpcCallMsg.Builder constructDeviceRpcMsg(UUID deviceId, JsonNode body) {
+ DeviceRpcCallMsg.Builder builder = DeviceRpcCallMsg.newBuilder()
+ .setDeviceIdMSB(deviceId.getMostSignificantBits())
+ .setDeviceIdLSB(deviceId.getLeastSignificantBits())
+ .setRequestId(body.get("requestId").asInt());
+ if (body.get("oneway") != null) {
+ builder.setOneway(body.get("oneway").asBoolean());
+ }
+ if (body.get("requestUUID") != null) {
+ UUID requestUUID = UUID.fromString(body.get("requestUUID").asText());
+ builder.setRequestUuidMSB(requestUUID.getMostSignificantBits())
+ .setRequestUuidLSB(requestUUID.getLeastSignificantBits());
+ }
+ if (body.get("expirationTime") != null) {
+ builder.setExpirationTime(body.get("expirationTime").asLong());
+ }
+ if (body.get("persisted") != null) {
+ builder.setPersisted(body.get("persisted").asBoolean());
+ }
+ if (body.get("retries") != null) {
+ builder.setRetries(body.get("retries").asInt());
+ }
+ if (body.get("additionalInfo") != null) {
+ builder.setAdditionalInfo(JacksonUtil.toString(body.get("additionalInfo")));
+ }
+ if (body.get("serviceId") != null) {
+ builder.setServiceId(body.get("serviceId").asText());
+ }
+ if (body.get("sessionId") != null) {
+ builder.setSessionId(body.get("sessionId").asText());
+ }
+ return builder;
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructor.java
new file mode 100644
index 0000000000..4636dfd5ae
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructor.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.device;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import org.thingsboard.server.common.data.Device;
+import org.thingsboard.server.common.data.DeviceProfile;
+import org.thingsboard.server.common.data.id.DeviceId;
+import org.thingsboard.server.common.data.id.DeviceProfileId;
+import org.thingsboard.server.common.data.security.DeviceCredentials;
+import org.thingsboard.server.gen.edge.v1.DeviceCredentialsUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.DeviceProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.DeviceRpcCallMsg;
+import org.thingsboard.server.gen.edge.v1.DeviceUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+import java.util.UUID;
+
+public interface DeviceMsgConstructor extends MsgConstructor {
+
+ DeviceUpdateMsg constructDeviceUpdatedMsg(UpdateMsgType msgType, Device device);
+
+ DeviceUpdateMsg constructDeviceDeleteMsg(DeviceId deviceId);
+
+ DeviceCredentialsUpdateMsg constructDeviceCredentialsUpdatedMsg(DeviceCredentials deviceCredentials);
+
+ DeviceProfileUpdateMsg constructDeviceProfileUpdatedMsg(UpdateMsgType msgType, DeviceProfile deviceProfile);
+
+ DeviceProfileUpdateMsg constructDeviceProfileDeleteMsg(DeviceProfileId deviceProfileId);
+
+ DeviceRpcCallMsg constructDeviceRpcCallMsg(UUID deviceId, JsonNode body);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorFactory.java
new file mode 100644
index 0000000000..b384259e14
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorFactory.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.device;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class DeviceMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DeviceMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorV1.java
similarity index 57%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DeviceMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorV1.java
index 78b785a5d8..4442387b21 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/DeviceMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorV1.java
@@ -13,34 +13,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.device;
-import com.fasterxml.jackson.databind.JsonNode;
import com.google.protobuf.ByteString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.Device;
-import org.thingsboard.server.common.data.id.DeviceId;
+import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.security.DeviceCredentials;
import org.thingsboard.server.gen.edge.v1.DeviceCredentialsUpdateMsg;
-import org.thingsboard.server.gen.edge.v1.DeviceRpcCallMsg;
+import org.thingsboard.server.gen.edge.v1.DeviceProfileUpdateMsg;
import org.thingsboard.server.gen.edge.v1.DeviceUpdateMsg;
-import org.thingsboard.server.gen.edge.v1.RpcRequestMsg;
-import org.thingsboard.server.gen.edge.v1.RpcResponseMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.DataDecodingEncodingService;
import org.thingsboard.server.queue.util.TbCoreComponent;
-import java.util.UUID;
+import java.nio.charset.StandardCharsets;
@Component
@TbCoreComponent
-public class DeviceMsgConstructor {
+public class DeviceMsgConstructorV1 extends BaseDeviceMsgConstructor {
@Autowired
private DataDecodingEncodingService dataDecodingEncodingService;
+ @Override
public DeviceUpdateMsg constructDeviceUpdatedMsg(UpdateMsgType msgType, Device device) {
DeviceUpdateMsg.Builder builder = DeviceUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -76,6 +74,7 @@ public class DeviceMsgConstructor {
return builder.build();
}
+ @Override
public DeviceCredentialsUpdateMsg constructDeviceCredentialsUpdatedMsg(DeviceCredentials deviceCredentials) {
DeviceCredentialsUpdateMsg.Builder builder = DeviceCredentialsUpdateMsg.newBuilder()
.setDeviceIdMSB(deviceCredentials.getDeviceId().getId().getMostSignificantBits())
@@ -90,63 +89,50 @@ public class DeviceMsgConstructor {
return builder.build();
}
- public DeviceUpdateMsg constructDeviceDeleteMsg(DeviceId deviceId) {
- return DeviceUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(deviceId.getId().getMostSignificantBits())
- .setIdLSB(deviceId.getId().getLeastSignificantBits()).build();
- }
-
- public DeviceRpcCallMsg constructDeviceRpcCallMsg(UUID deviceId, JsonNode body) {
- DeviceRpcCallMsg.Builder builder = constructDeviceRpcMsg(deviceId, body);
- if (body.has("error") || body.has("response")) {
- RpcResponseMsg.Builder responseBuilder = RpcResponseMsg.newBuilder();
- if (body.has("error")) {
- responseBuilder.setError(body.get("error").asText());
- } else {
- responseBuilder.setResponse(body.get("response").asText());
- }
- builder.setResponseMsg(responseBuilder.build());
- } else {
- RpcRequestMsg.Builder requestBuilder = RpcRequestMsg.newBuilder();
- requestBuilder.setMethod(body.get("method").asText());
- requestBuilder.setParams(body.get("params").asText());
- builder.setRequestMsg(requestBuilder.build());
+ @Override
+ public DeviceProfileUpdateMsg constructDeviceProfileUpdatedMsg(UpdateMsgType msgType, DeviceProfile deviceProfile) {
+ DeviceProfileUpdateMsg.Builder builder = DeviceProfileUpdateMsg.newBuilder()
+ .setMsgType(msgType)
+ .setIdMSB(deviceProfile.getId().getId().getMostSignificantBits())
+ .setIdLSB(deviceProfile.getId().getId().getLeastSignificantBits())
+ .setName(deviceProfile.getName())
+ .setDefault(deviceProfile.isDefault())
+ .setType(deviceProfile.getType().name())
+ .setProfileDataBytes(ByteString.copyFrom(dataDecodingEncodingService.encode(deviceProfile.getProfileData())));
+ if (deviceProfile.getDefaultQueueName() != null) {
+ builder.setDefaultQueueName(deviceProfile.getDefaultQueueName());
}
- return builder.build();
- }
-
- private DeviceRpcCallMsg.Builder constructDeviceRpcMsg(UUID deviceId, JsonNode body) {
- DeviceRpcCallMsg.Builder builder = DeviceRpcCallMsg.newBuilder()
- .setDeviceIdMSB(deviceId.getMostSignificantBits())
- .setDeviceIdLSB(deviceId.getLeastSignificantBits())
- .setRequestId(body.get("requestId").asInt());
- if (body.get("oneway") != null) {
- builder.setOneway(body.get("oneway").asBoolean());
+ if (deviceProfile.getDescription() != null) {
+ builder.setDescription(deviceProfile.getDescription());
}
- if (body.get("requestUUID") != null) {
- UUID requestUUID = UUID.fromString(body.get("requestUUID").asText());
- builder.setRequestUuidMSB(requestUUID.getMostSignificantBits())
- .setRequestUuidLSB(requestUUID.getLeastSignificantBits());
+ if (deviceProfile.getTransportType() != null) {
+ builder.setTransportType(deviceProfile.getTransportType().name());
}
- if (body.get("expirationTime") != null) {
- builder.setExpirationTime(body.get("expirationTime").asLong());
+ if (deviceProfile.getProvisionType() != null) {
+ builder.setProvisionType(deviceProfile.getProvisionType().name());
}
- if (body.get("persisted") != null) {
- builder.setPersisted(body.get("persisted").asBoolean());
+ if (deviceProfile.getProvisionDeviceKey() != null) {
+ builder.setProvisionDeviceKey(deviceProfile.getProvisionDeviceKey());
}
- if (body.get("retries") != null) {
- builder.setRetries(body.get("retries").asInt());
+ if (deviceProfile.getImage() != null) {
+ builder.setImage(ByteString.copyFrom(deviceProfile.getImage().getBytes(StandardCharsets.UTF_8)));
}
- if (body.get("additionalInfo") != null) {
- builder.setAdditionalInfo(JacksonUtil.toString(body.get("additionalInfo")));
+ if (deviceProfile.getFirmwareId() != null) {
+ builder.setFirmwareIdMSB(deviceProfile.getFirmwareId().getId().getMostSignificantBits())
+ .setFirmwareIdLSB(deviceProfile.getFirmwareId().getId().getLeastSignificantBits());
}
- if (body.get("serviceId") != null) {
- builder.setServiceId(body.get("serviceId").asText());
+ if (deviceProfile.getSoftwareId() != null) {
+ builder.setSoftwareIdMSB(deviceProfile.getSoftwareId().getId().getMostSignificantBits())
+ .setSoftwareIdLSB(deviceProfile.getSoftwareId().getId().getLeastSignificantBits());
}
- if (body.get("sessionId") != null) {
- builder.setSessionId(body.get("sessionId").asText());
+ if (deviceProfile.getDefaultEdgeRuleChainId() != null) {
+ builder.setDefaultRuleChainIdMSB(deviceProfile.getDefaultEdgeRuleChainId().getId().getMostSignificantBits())
+ .setDefaultRuleChainIdLSB(deviceProfile.getDefaultEdgeRuleChainId().getId().getLeastSignificantBits());
}
- return builder;
+ if (deviceProfile.getDefaultDashboardId() != null) {
+ builder.setDefaultDashboardIdMSB(deviceProfile.getDefaultDashboardId().getId().getMostSignificantBits())
+ .setDefaultDashboardIdLSB(deviceProfile.getDefaultDashboardId().getId().getLeastSignificantBits());
+ }
+ return builder.build();
}
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorV2.java
new file mode 100644
index 0000000000..189251f8c4
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorV2.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.device;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.Device;
+import org.thingsboard.server.common.data.DeviceProfile;
+import org.thingsboard.server.common.data.security.DeviceCredentials;
+import org.thingsboard.server.gen.edge.v1.DeviceCredentialsUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.DeviceProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.DeviceUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class DeviceMsgConstructorV2 extends BaseDeviceMsgConstructor {
+
+ @Override
+ public DeviceUpdateMsg constructDeviceUpdatedMsg(UpdateMsgType msgType, Device device) {
+ return DeviceUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(device))
+ .setIdMSB(device.getId().getId().getMostSignificantBits())
+ .setIdLSB(device.getId().getId().getLeastSignificantBits()).build();
+ }
+
+ @Override
+ public DeviceCredentialsUpdateMsg constructDeviceCredentialsUpdatedMsg(DeviceCredentials deviceCredentials) {
+ return DeviceCredentialsUpdateMsg.newBuilder().setEntity(JacksonUtil.toString(deviceCredentials)).build();
+ }
+
+ @Override
+ public DeviceProfileUpdateMsg constructDeviceProfileUpdatedMsg(UpdateMsgType msgType, DeviceProfile deviceProfile) {
+ return DeviceProfileUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(deviceProfile))
+ .setIdMSB(deviceProfile.getId().getId().getMostSignificantBits())
+ .setIdLSB(deviceProfile.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EdgeMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/edge/EdgeMsgConstructor.java
similarity index 96%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EdgeMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/edge/EdgeMsgConstructor.java
index 3416240b2c..c3741ee8bf 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EdgeMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/edge/EdgeMsgConstructor.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.edge;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/BaseEntityViewMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/BaseEntityViewMsgConstructor.java
new file mode 100644
index 0000000000..a037e3ee09
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/BaseEntityViewMsgConstructor.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.entityview;
+
+import org.thingsboard.server.common.data.id.EntityViewId;
+import org.thingsboard.server.gen.edge.v1.EntityViewUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+
+public abstract class BaseEntityViewMsgConstructor implements EntityViewMsgConstructor {
+
+ @Override
+ public EntityViewUpdateMsg constructEntityViewDeleteMsg(EntityViewId entityViewId) {
+ return EntityViewUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(entityViewId.getId().getMostSignificantBits())
+ .setIdLSB(entityViewId.getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructor.java
new file mode 100644
index 0000000000..7f14f62c68
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructor.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.entityview;
+
+import org.thingsboard.server.common.data.EntityView;
+import org.thingsboard.server.common.data.id.EntityViewId;
+import org.thingsboard.server.gen.edge.v1.EntityViewUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface EntityViewMsgConstructor extends MsgConstructor {
+
+ EntityViewUpdateMsg constructEntityViewUpdatedMsg(UpdateMsgType msgType, EntityView entityView);
+
+ EntityViewUpdateMsg constructEntityViewDeleteMsg(EntityViewId entityViewId);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorFactory.java
new file mode 100644
index 0000000000..849f7f093a
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.entityview;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class EntityViewMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EntityViewMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorV1.java
similarity index 72%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EntityViewMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorV1.java
index 235199d75e..da369ecf90 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EntityViewMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorV1.java
@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.entityview;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.EntityView;
-import org.thingsboard.server.common.data.id.EntityViewId;
import org.thingsboard.server.gen.edge.v1.EdgeEntityType;
import org.thingsboard.server.gen.edge.v1.EntityViewUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
@@ -26,20 +26,11 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class EntityViewMsgConstructor {
+public class EntityViewMsgConstructorV1 extends BaseEntityViewMsgConstructor {
+ @Override
public EntityViewUpdateMsg constructEntityViewUpdatedMsg(UpdateMsgType msgType, EntityView entityView) {
- EdgeEntityType entityType;
- switch (entityView.getEntityId().getEntityType()) {
- case DEVICE:
- entityType = EdgeEntityType.DEVICE;
- break;
- case ASSET:
- entityType = EdgeEntityType.ASSET;
- break;
- default:
- throw new RuntimeException("Unsupported entity type [" + entityView.getEntityId().getEntityType() + "]");
- }
+ EdgeEntityType edgeEntityType = checkEntityType(entityView.getEntityId().getEntityType());
EntityViewUpdateMsg.Builder builder = EntityViewUpdateMsg.newBuilder()
.setMsgType(msgType)
.setIdMSB(entityView.getId().getId().getMostSignificantBits())
@@ -48,7 +39,7 @@ public class EntityViewMsgConstructor {
.setType(entityView.getType())
.setEntityIdMSB(entityView.getEntityId().getId().getMostSignificantBits())
.setEntityIdLSB(entityView.getEntityId().getId().getLeastSignificantBits())
- .setEntityType(entityType);
+ .setEntityType(edgeEntityType);
if (entityView.getCustomerId() != null) {
builder.setCustomerIdMSB(entityView.getCustomerId().getId().getMostSignificantBits());
builder.setCustomerIdLSB(entityView.getCustomerId().getId().getLeastSignificantBits());
@@ -59,10 +50,14 @@ public class EntityViewMsgConstructor {
return builder.build();
}
- public EntityViewUpdateMsg constructEntityViewDeleteMsg(EntityViewId entityViewId) {
- return EntityViewUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(entityViewId.getId().getMostSignificantBits())
- .setIdLSB(entityViewId.getId().getLeastSignificantBits()).build();
+ private EdgeEntityType checkEntityType(EntityType entityType) {
+ switch (entityType) {
+ case DEVICE:
+ return EdgeEntityType.DEVICE;
+ case ASSET:
+ return EdgeEntityType.ASSET;
+ default:
+ throw new RuntimeException("Unsupported entity type [" + entityType + "]");
+ }
}
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorV2.java
new file mode 100644
index 0000000000..c1eae91097
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorV2.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.entityview;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.EntityView;
+import org.thingsboard.server.gen.edge.v1.EntityViewUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class EntityViewMsgConstructorV2 extends BaseEntityViewMsgConstructor {
+
+ @Override
+ public EntityViewUpdateMsg constructEntityViewUpdatedMsg(UpdateMsgType msgType, EntityView entityView) {
+ return EntityViewUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(entityView))
+ .setIdMSB(entityView.getId().getId().getMostSignificantBits())
+ .setIdLSB(entityView.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/BaseOtaPackageMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/BaseOtaPackageMsgConstructor.java
new file mode 100644
index 0000000000..110c24caca
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/BaseOtaPackageMsgConstructor.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.ota;
+
+import org.thingsboard.server.common.data.id.OtaPackageId;
+import org.thingsboard.server.gen.edge.v1.OtaPackageUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+
+public abstract class BaseOtaPackageMsgConstructor implements OtaPackageMsgConstructor {
+
+ @Override
+ public OtaPackageUpdateMsg constructOtaPackageDeleteMsg(OtaPackageId otaPackageId) {
+ return OtaPackageUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(otaPackageId.getId().getMostSignificantBits())
+ .setIdLSB(otaPackageId.getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructor.java
new file mode 100644
index 0000000000..500500a7fc
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructor.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.ota;
+
+import org.thingsboard.server.common.data.OtaPackage;
+import org.thingsboard.server.common.data.id.OtaPackageId;
+import org.thingsboard.server.gen.edge.v1.OtaPackageUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface OtaPackageMsgConstructor extends MsgConstructor {
+
+ OtaPackageUpdateMsg constructOtaPackageUpdatedMsg(UpdateMsgType msgType, OtaPackage otaPackage);
+
+ OtaPackageUpdateMsg constructOtaPackageDeleteMsg(OtaPackageId otaPackageId);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorFactory.java
new file mode 100644
index 0000000000..fd775d77ff
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorFactory.java
@@ -0,0 +1,30 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.ota;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.customer.CustomerMsgConstructorV1;
+import org.thingsboard.server.service.edge.rpc.constructor.customer.CustomerMsgConstructorV2;
+
+@Component
+@TbCoreComponent
+public class OtaPackageMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/OtaPackageMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorV1.java
similarity index 84%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/OtaPackageMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorV1.java
index 253305a5ab..5e1f297c01 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/OtaPackageMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorV1.java
@@ -13,21 +13,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.ota;
import com.google.protobuf.ByteString;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.OtaPackage;
-import org.thingsboard.server.common.data.id.OtaPackageId;
import org.thingsboard.server.gen.edge.v1.OtaPackageUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class OtaPackageMsgConstructor {
+public class OtaPackageMsgConstructorV1 extends BaseOtaPackageMsgConstructor {
+ @Override
public OtaPackageUpdateMsg constructOtaPackageUpdatedMsg(UpdateMsgType msgType, OtaPackage otaPackage) {
OtaPackageUpdateMsg.Builder builder = OtaPackageUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -69,12 +69,4 @@ public class OtaPackageMsgConstructor {
}
return builder.build();
}
-
- public OtaPackageUpdateMsg constructOtaPackageDeleteMsg(OtaPackageId otaPackageId) {
- return OtaPackageUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(otaPackageId.getId().getMostSignificantBits())
- .setIdLSB(otaPackageId.getId().getLeastSignificantBits()).build();
- }
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorV2.java
new file mode 100644
index 0000000000..69d7f12874
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorV2.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.ota;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.OtaPackage;
+import org.thingsboard.server.gen.edge.v1.OtaPackageUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class OtaPackageMsgConstructorV2 extends BaseOtaPackageMsgConstructor {
+
+ @Override
+ public OtaPackageUpdateMsg constructOtaPackageUpdatedMsg(UpdateMsgType msgType, OtaPackage otaPackage) {
+ return OtaPackageUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(otaPackage))
+ .setIdMSB(otaPackage.getId().getId().getMostSignificantBits())
+ .setIdLSB(otaPackage.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/BaseQueueMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/BaseQueueMsgConstructor.java
new file mode 100644
index 0000000000..486a143d85
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/BaseQueueMsgConstructor.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.queue;
+
+import org.thingsboard.server.common.data.id.QueueId;
+import org.thingsboard.server.gen.edge.v1.QueueUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+
+public abstract class BaseQueueMsgConstructor implements QueueMsgConstructor {
+
+ @Override
+ public QueueUpdateMsg constructQueueDeleteMsg(QueueId queueId) {
+ return QueueUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(queueId.getId().getMostSignificantBits())
+ .setIdLSB(queueId.getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructor.java
new file mode 100644
index 0000000000..847f19419e
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructor.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.queue;
+
+import org.thingsboard.server.common.data.id.QueueId;
+import org.thingsboard.server.common.data.queue.Queue;
+import org.thingsboard.server.gen.edge.v1.QueueUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface QueueMsgConstructor extends MsgConstructor {
+
+ QueueUpdateMsg constructQueueUpdatedMsg(UpdateMsgType msgType, Queue queue);
+
+ QueueUpdateMsg constructQueueDeleteMsg(QueueId queueId);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorFactory.java
new file mode 100644
index 0000000000..0f9a4b9e2e
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.queue;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class QueueMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/QueueMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorV1.java
similarity index 93%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/QueueMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorV1.java
index 2644a5409b..8621ce1011 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/QueueMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorV1.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.queue;
import org.springframework.stereotype.Component;
import org.thingsboard.server.common.data.id.QueueId;
@@ -28,10 +28,11 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class QueueMsgConstructor {
+public class QueueMsgConstructorV1 extends BaseQueueMsgConstructor {
+ @Override
public QueueUpdateMsg constructQueueUpdatedMsg(UpdateMsgType msgType, Queue queue) {
- QueueUpdateMsg.Builder builder = QueueUpdateMsg.newBuilder()
+ return QueueUpdateMsg.newBuilder()
.setMsgType(msgType)
.setIdMSB(queue.getId().getId().getMostSignificantBits())
.setIdLSB(queue.getId().getId().getLeastSignificantBits())
@@ -44,8 +45,7 @@ public class QueueMsgConstructor {
.setConsumerPerPartition(queue.isConsumerPerPartition())
.setPackProcessingTimeout(queue.getPackProcessingTimeout())
.setSubmitStrategy(createSubmitStrategyProto(queue.getSubmitStrategy()))
- .setProcessingStrategy(createProcessingStrategyProto(queue.getProcessingStrategy()));
- return builder.build();
+ .setProcessingStrategy(createProcessingStrategyProto(queue.getProcessingStrategy())).build();
}
private ProcessingStrategyProto createProcessingStrategyProto(ProcessingStrategy processingStrategy) {
@@ -71,5 +71,4 @@ public class QueueMsgConstructor {
.setIdMSB(queueId.getId().getMostSignificantBits())
.setIdLSB(queueId.getId().getLeastSignificantBits()).build();
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorV2.java
new file mode 100644
index 0000000000..1bf80eea64
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorV2.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.queue;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.queue.Queue;
+import org.thingsboard.server.gen.edge.v1.QueueUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class QueueMsgConstructorV2 extends BaseQueueMsgConstructor {
+
+ @Override
+ public QueueUpdateMsg constructQueueUpdatedMsg(UpdateMsgType msgType, Queue queue) {
+ return QueueUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(queue))
+ .setIdMSB(queue.getId().getId().getMostSignificantBits())
+ .setIdLSB(queue.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructor.java
new file mode 100644
index 0000000000..f7fac6ce71
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructor.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.relation;
+
+import org.thingsboard.server.common.data.relation.EntityRelation;
+import org.thingsboard.server.gen.edge.v1.RelationUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface RelationMsgConstructor extends MsgConstructor {
+
+ RelationUpdateMsg constructRelationUpdatedMsg(UpdateMsgType msgType, EntityRelation entityRelation);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorFactory.java
new file mode 100644
index 0000000000..4ec02c5b49
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorFactory.java
@@ -0,0 +1,30 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.relation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.customer.CustomerMsgConstructorV1;
+import org.thingsboard.server.service.edge.rpc.constructor.customer.CustomerMsgConstructorV2;
+
+@Component
+@TbCoreComponent
+public class RelationMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/RelationMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorV1.java
similarity index 93%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/RelationMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorV1.java
index 24786a4f7c..394086fdd0 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/RelationMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorV1.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.relation;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
@@ -24,8 +24,9 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class RelationMsgConstructor {
+public class RelationMsgConstructorV1 implements RelationMsgConstructor {
+ @Override
public RelationUpdateMsg constructRelationUpdatedMsg(UpdateMsgType msgType, EntityRelation entityRelation) {
RelationUpdateMsg.Builder builder = RelationUpdateMsg.newBuilder()
.setMsgType(msgType)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorV2.java
new file mode 100644
index 0000000000..4510909490
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorV2.java
@@ -0,0 +1,34 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.relation;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.relation.EntityRelation;
+import org.thingsboard.server.gen.edge.v1.RelationUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class RelationMsgConstructorV2 implements RelationMsgConstructor {
+
+
+ @Override
+ public RelationUpdateMsg constructRelationUpdatedMsg(UpdateMsgType msgType, EntityRelation entityRelation) {
+ return RelationUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(entityRelation)).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/BaseResourceMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/BaseResourceMsgConstructor.java
new file mode 100644
index 0000000000..620f71c9e7
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/BaseResourceMsgConstructor.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.resource;
+
+import org.thingsboard.server.common.data.id.TbResourceId;
+import org.thingsboard.server.gen.edge.v1.ResourceUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+
+public abstract class BaseResourceMsgConstructor implements ResourceMsgConstructor {
+
+ @Override
+ public ResourceUpdateMsg constructResourceDeleteMsg(TbResourceId tbResourceId) {
+ return ResourceUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(tbResourceId.getId().getMostSignificantBits())
+ .setIdLSB(tbResourceId.getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructor.java
new file mode 100644
index 0000000000..cfeedced80
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructor.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.resource;
+
+import org.thingsboard.server.common.data.TbResource;
+import org.thingsboard.server.common.data.id.TbResourceId;
+import org.thingsboard.server.gen.edge.v1.ResourceUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface ResourceMsgConstructor extends MsgConstructor {
+
+ ResourceUpdateMsg constructResourceUpdatedMsg(UpdateMsgType msgType, TbResource tbResource);
+
+ ResourceUpdateMsg constructResourceDeleteMsg(TbResourceId tbResourceId);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorFactory.java
new file mode 100644
index 0000000000..2c67d8731e
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.resource;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class ResourceMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ResourceMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorV1.java
similarity index 74%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ResourceMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorV1.java
index 27b7dc3978..d110076bea 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ResourceMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorV1.java
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.resource;
+import com.google.protobuf.ByteString;
import org.springframework.stereotype.Component;
import org.thingsboard.server.common.data.TbResource;
-import org.thingsboard.server.common.data.id.TbResourceId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.gen.edge.v1.ResourceUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
@@ -25,8 +25,9 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class ResourceMsgConstructor {
+public class ResourceMsgConstructorV1 extends BaseResourceMsgConstructor {
+ @Override
public ResourceUpdateMsg constructResourceUpdatedMsg(UpdateMsgType msgType, TbResource tbResource) {
ResourceUpdateMsg.Builder builder = ResourceUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -37,21 +38,14 @@ public class ResourceMsgConstructor {
.setResourceType(tbResource.getResourceType().name())
.setFileName(tbResource.getFileName());
if (tbResource.getData() != null) {
- builder.setData(tbResource.getData());
+ builder.setData(tbResource.getEncodedData());
}
if (tbResource.getEtag() != null) {
builder.setEtag(tbResource.getEtag());
}
- if (tbResource.getTenantId().equals(TenantId.SYS_TENANT_ID)) {
+ if (TenantId.SYS_TENANT_ID.equals(tbResource.getTenantId())) {
builder.setIsSystem(true);
}
return builder.build();
}
-
- public ResourceUpdateMsg constructResourceDeleteMsg(TbResourceId tbResourceId) {
- return ResourceUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(tbResourceId.getId().getMostSignificantBits())
- .setIdLSB(tbResourceId.getId().getLeastSignificantBits()).build();
- }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorV2.java
new file mode 100644
index 0000000000..094e5636bb
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorV2.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.resource;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.TbResource;
+import org.thingsboard.server.gen.edge.v1.ResourceUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class ResourceMsgConstructorV2 extends BaseResourceMsgConstructor {
+
+ @Override
+ public ResourceUpdateMsg constructResourceUpdatedMsg(UpdateMsgType msgType, TbResource tbResource) {
+ return ResourceUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(tbResource))
+ .setIdMSB(tbResource.getId().getId().getMostSignificantBits())
+ .setIdLSB(tbResource.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/AbstractRuleChainMetadataConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMetadataConstructor.java
similarity index 88%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/AbstractRuleChainMetadataConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMetadataConstructor.java
index a720d0aab6..be10a714f6 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/AbstractRuleChainMetadataConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMetadataConstructor.java
@@ -24,6 +24,7 @@ import org.thingsboard.server.common.data.rule.NodeConnectionInfo;
import org.thingsboard.server.common.data.rule.RuleChainConnectionInfo;
import org.thingsboard.server.common.data.rule.RuleChainMetaData;
import org.thingsboard.server.common.data.rule.RuleNode;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.NodeConnectionInfoProto;
import org.thingsboard.server.gen.edge.v1.RuleChainConnectionInfoProto;
import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
@@ -36,23 +37,17 @@ import java.util.NavigableSet;
@Slf4j
@AllArgsConstructor
-public abstract class AbstractRuleChainMetadataConstructor implements RuleChainMetadataConstructor {
+public abstract class BaseRuleChainMetadataConstructor implements RuleChainMetadataConstructor {
@Override
public RuleChainMetadataUpdateMsg constructRuleChainMetadataUpdatedMsg(TenantId tenantId,
UpdateMsgType msgType,
- RuleChainMetaData ruleChainMetaData) {
- try {
- RuleChainMetadataUpdateMsg.Builder builder = RuleChainMetadataUpdateMsg.newBuilder();
- builder.setRuleChainIdMSB(ruleChainMetaData.getRuleChainId().getId().getMostSignificantBits())
- .setRuleChainIdLSB(ruleChainMetaData.getRuleChainId().getId().getLeastSignificantBits());
- constructRuleChainMetadataUpdatedMsg(tenantId, builder, ruleChainMetaData);
- builder.setMsgType(msgType);
- return builder.build();
- } catch (Exception ex) {
- log.error("[{}] Can't construct RuleChainMetadataUpdateMsg", tenantId, ex);
- }
- return null;
+ RuleChainMetaData ruleChainMetaData,
+ EdgeVersion edgeVersion) {
+ RuleChainMetadataUpdateMsg.Builder builder = RuleChainMetadataUpdateMsg.newBuilder();
+ constructRuleChainMetadataUpdatedMsg(tenantId, builder, ruleChainMetaData);
+ builder.setMsgType(msgType);
+ return builder.build();
}
protected abstract void constructRuleChainMetadataUpdatedMsg(TenantId tenantId,
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/RuleChainMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMsgConstructor.java
similarity index 54%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/RuleChainMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMsgConstructor.java
index 8f91f5d19e..cf5967fac1 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/RuleChainMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMsgConstructor.java
@@ -13,57 +13,32 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.rule;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Component;
-import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.id.RuleChainId;
import org.thingsboard.server.common.data.id.TenantId;
-import org.thingsboard.server.common.data.rule.RuleChain;
import org.thingsboard.server.common.data.rule.RuleChainMetaData;
import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
import org.thingsboard.server.gen.edge.v1.RuleChainUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
-import org.thingsboard.server.queue.util.TbCoreComponent;
-import org.thingsboard.server.service.edge.rpc.constructor.rule.RuleChainMetadataConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.rule.RuleChainMetadataConstructorFactory;
-@Component
-@Slf4j
-@TbCoreComponent
-public class RuleChainMsgConstructor {
+public abstract class BaseRuleChainMsgConstructor implements RuleChainMsgConstructor {
- public RuleChainUpdateMsg constructRuleChainUpdatedMsg(UpdateMsgType msgType, RuleChain ruleChain, boolean isRoot) {
- RuleChainUpdateMsg.Builder builder = RuleChainUpdateMsg.newBuilder()
- .setMsgType(msgType)
- .setIdMSB(ruleChain.getId().getId().getMostSignificantBits())
- .setIdLSB(ruleChain.getId().getId().getLeastSignificantBits())
- .setName(ruleChain.getName())
- .setRoot(isRoot)
- .setDebugMode(ruleChain.isDebugMode())
- .setConfiguration(JacksonUtil.toString(ruleChain.getConfiguration()));
- if (ruleChain.getFirstRuleNodeId() != null) {
- builder.setFirstRuleNodeIdMSB(ruleChain.getFirstRuleNodeId().getId().getMostSignificantBits())
- .setFirstRuleNodeIdLSB(ruleChain.getFirstRuleNodeId().getId().getLeastSignificantBits());
- }
- return builder.build();
+ @Override
+ public RuleChainUpdateMsg constructRuleChainDeleteMsg(RuleChainId ruleChainId) {
+ return RuleChainUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(ruleChainId.getId().getMostSignificantBits())
+ .setIdLSB(ruleChainId.getId().getLeastSignificantBits()).build();
}
+ @Override
public RuleChainMetadataUpdateMsg constructRuleChainMetadataUpdatedMsg(TenantId tenantId,
UpdateMsgType msgType,
RuleChainMetaData ruleChainMetaData,
EdgeVersion edgeVersion) {
- RuleChainMetadataConstructor ruleChainMetadataConstructor
- = RuleChainMetadataConstructorFactory.getByEdgeVersion(edgeVersion);
- return ruleChainMetadataConstructor.constructRuleChainMetadataUpdatedMsg(tenantId, msgType, ruleChainMetaData);
- }
-
- public RuleChainUpdateMsg constructRuleChainDeleteMsg(RuleChainId ruleChainId) {
- return RuleChainUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(ruleChainId.getId().getMostSignificantBits())
- .setIdLSB(ruleChainId.getId().getLeastSignificantBits()).build();
+ RuleChainMetadataConstructor ruleChainMetadataConstructor = RuleChainMetadataConstructorFactory.getByEdgeVersion(edgeVersion);
+ return ruleChainMetadataConstructor.constructRuleChainMetadataUpdatedMsg(tenantId, msgType, ruleChainMetaData, edgeVersion);
}
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructor.java
index 51b7380e48..f80b30b3c4 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructor.java
@@ -17,6 +17,7 @@ package org.thingsboard.server.service.edge.rpc.constructor.rule;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.rule.RuleChainMetaData;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
@@ -24,5 +25,6 @@ public interface RuleChainMetadataConstructor {
RuleChainMetadataUpdateMsg constructRuleChainMetadataUpdatedMsg(TenantId tenantId,
UpdateMsgType msgType,
- RuleChainMetaData ruleChainMetaData);
+ RuleChainMetaData ruleChainMetaData,
+ EdgeVersion edgeVersion);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorFactory.java
index 1c581267c4..cdc7e128d3 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorFactory.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorFactory.java
@@ -25,8 +25,12 @@ public final class RuleChainMetadataConstructorFactory {
return new RuleChainMetadataConstructorV330();
case V_3_3_3:
case V_3_4_0:
- default:
+ case V_3_6_0:
+ case V_3_6_1:
return new RuleChainMetadataConstructorV340();
+ case V_3_6_2:
+ default:
+ return new RuleChainMetadataConstructorV362();
}
}
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV330.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV330.java
index 33fc39b7e7..64d362342b 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV330.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV330.java
@@ -36,7 +36,7 @@ import java.util.UUID;
import java.util.stream.Collectors;
@Slf4j
-public class RuleChainMetadataConstructorV330 extends AbstractRuleChainMetadataConstructor {
+public class RuleChainMetadataConstructorV330 extends BaseRuleChainMetadataConstructor {
private static final String RULE_CHAIN_INPUT_NODE = TbRuleChainInputNode.class.getName();
private static final String TB_RULE_CHAIN_OUTPUT_NODE = TbRuleChainOutputNode.class.getName();
@@ -45,6 +45,8 @@ public class RuleChainMetadataConstructorV330 extends AbstractRuleChainMetadataC
protected void constructRuleChainMetadataUpdatedMsg(TenantId tenantId,
RuleChainMetadataUpdateMsg.Builder builder,
RuleChainMetaData ruleChainMetaData) {
+ builder.setRuleChainIdMSB(ruleChainMetaData.getRuleChainId().getId().getMostSignificantBits())
+ .setRuleChainIdLSB(ruleChainMetaData.getRuleChainId().getId().getLeastSignificantBits());
List supportedNodes = filterNodes(ruleChainMetaData.getNodes());
NavigableSet removedNodeIndexes = getRemovedNodeIndexes(ruleChainMetaData.getNodes(), ruleChainMetaData.getConnections());
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV340.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV340.java
index 9a37e416db..2133024931 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV340.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV340.java
@@ -23,12 +23,14 @@ import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
import java.util.TreeSet;
@Slf4j
-public class RuleChainMetadataConstructorV340 extends AbstractRuleChainMetadataConstructor {
+public class RuleChainMetadataConstructorV340 extends BaseRuleChainMetadataConstructor {
@Override
protected void constructRuleChainMetadataUpdatedMsg(TenantId tenantId,
RuleChainMetadataUpdateMsg.Builder builder,
RuleChainMetaData ruleChainMetaData) {
+ builder.setRuleChainIdMSB(ruleChainMetaData.getRuleChainId().getId().getMostSignificantBits())
+ .setRuleChainIdLSB(ruleChainMetaData.getRuleChainId().getId().getLeastSignificantBits());
builder.addAllNodes(constructNodes(ruleChainMetaData.getNodes()))
.addAllConnections(constructConnections(ruleChainMetaData.getConnections()))
.addAllRuleChainConnections(constructRuleChainConnections(ruleChainMetaData.getRuleChainConnections(), new TreeSet<>()));
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV362.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV362.java
new file mode 100644
index 0000000000..7a8a6d02cb
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV362.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.rule;
+
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.id.TenantId;
+import org.thingsboard.server.common.data.rule.RuleChainMetaData;
+import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
+
+public class RuleChainMetadataConstructorV362 extends BaseRuleChainMetadataConstructor {
+
+ @Override
+ protected void constructRuleChainMetadataUpdatedMsg(TenantId tenantId, RuleChainMetadataUpdateMsg.Builder builder, RuleChainMetaData ruleChainMetaData) {
+ builder.setEntity(JacksonUtil.toString(ruleChainMetaData));
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructor.java
new file mode 100644
index 0000000000..8ea2ff9a63
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructor.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.rule;
+
+import org.thingsboard.server.common.data.id.RuleChainId;
+import org.thingsboard.server.common.data.id.TenantId;
+import org.thingsboard.server.common.data.rule.RuleChain;
+import org.thingsboard.server.common.data.rule.RuleChainMetaData;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.RuleChainUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface RuleChainMsgConstructor extends MsgConstructor {
+
+ RuleChainUpdateMsg constructRuleChainUpdatedMsg(UpdateMsgType msgType, RuleChain ruleChain, boolean isRoot);
+
+ RuleChainUpdateMsg constructRuleChainDeleteMsg(RuleChainId ruleChainId);
+
+ RuleChainMetadataUpdateMsg constructRuleChainMetadataUpdatedMsg(TenantId tenantId,
+ UpdateMsgType msgType,
+ RuleChainMetaData ruleChainMetaData,
+ EdgeVersion edgeVersion);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorFactory.java
new file mode 100644
index 0000000000..2c1a839ab9
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.rule;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class RuleChainMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV1.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV1.java
new file mode 100644
index 0000000000..6c918cfc56
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV1.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.rule;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.rule.RuleChain;
+import org.thingsboard.server.gen.edge.v1.RuleChainUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class RuleChainMsgConstructorV1 extends BaseRuleChainMsgConstructor {
+
+ @Override
+ public RuleChainUpdateMsg constructRuleChainUpdatedMsg(UpdateMsgType msgType, RuleChain ruleChain, boolean isRoot) {
+ RuleChainUpdateMsg.Builder builder = RuleChainUpdateMsg.newBuilder()
+ .setMsgType(msgType)
+ .setIdMSB(ruleChain.getId().getId().getMostSignificantBits())
+ .setIdLSB(ruleChain.getId().getId().getLeastSignificantBits())
+ .setName(ruleChain.getName())
+ .setRoot(isRoot)
+ .setDebugMode(ruleChain.isDebugMode())
+ .setConfiguration(JacksonUtil.toString(ruleChain.getConfiguration()));
+ if (ruleChain.getFirstRuleNodeId() != null) {
+ builder.setFirstRuleNodeIdMSB(ruleChain.getFirstRuleNodeId().getId().getMostSignificantBits())
+ .setFirstRuleNodeIdLSB(ruleChain.getFirstRuleNodeId().getId().getLeastSignificantBits());
+ }
+ return builder.build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV2.java
new file mode 100644
index 0000000000..f5c1c12b39
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV2.java
@@ -0,0 +1,39 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.rule;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.rule.RuleChain;
+import org.thingsboard.server.gen.edge.v1.RuleChainUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class RuleChainMsgConstructorV2 extends BaseRuleChainMsgConstructor {
+
+ @Override
+ public RuleChainUpdateMsg constructRuleChainUpdatedMsg(UpdateMsgType msgType, RuleChain ruleChain, boolean isRoot) {
+ boolean isTemplateRoot = ruleChain.isRoot();
+ ruleChain.setRoot(isRoot);
+ RuleChainUpdateMsg result = RuleChainUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(ruleChain))
+ .setIdMSB(ruleChain.getId().getId().getMostSignificantBits())
+ .setIdLSB(ruleChain.getId().getId().getLeastSignificantBits()).build();
+ ruleChain.setRoot(isTemplateRoot);
+ return result;
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructor.java
new file mode 100644
index 0000000000..da4f964218
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructor.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.settings;
+
+import org.thingsboard.server.common.data.AdminSettings;
+import org.thingsboard.server.gen.edge.v1.AdminSettingsUpdateMsg;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface AdminSettingsMsgConstructor extends MsgConstructor {
+
+ AdminSettingsUpdateMsg constructAdminSettingsUpdateMsg(AdminSettings adminSettings);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorFactory.java
new file mode 100644
index 0000000000..ecf6131e52
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.settings;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class AdminSettingsMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AdminSettingsMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorV1.java
similarity index 81%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AdminSettingsMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorV1.java
index 79754b867c..cbbd9b5bb8 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/AdminSettingsMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorV1.java
@@ -13,26 +13,27 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.settings;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.AdminSettings;
+import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.gen.edge.v1.AdminSettingsUpdateMsg;
import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class AdminSettingsMsgConstructor {
+public class AdminSettingsMsgConstructorV1 implements AdminSettingsMsgConstructor {
+ @Override
public AdminSettingsUpdateMsg constructAdminSettingsUpdateMsg(AdminSettings adminSettings) {
AdminSettingsUpdateMsg.Builder builder = AdminSettingsUpdateMsg.newBuilder()
.setKey(adminSettings.getKey())
.setJsonValue(JacksonUtil.toString(adminSettings.getJsonValue()));
- if (adminSettings.getId() != null) {
+ if (TenantId.SYS_TENANT_ID.equals(adminSettings.getTenantId())) {
builder.setIsSystem(true);
}
return builder.build();
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorV2.java
new file mode 100644
index 0000000000..de92d2a1f9
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorV2.java
@@ -0,0 +1,32 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.settings;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.AdminSettings;
+import org.thingsboard.server.gen.edge.v1.AdminSettingsUpdateMsg;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class AdminSettingsMsgConstructorV2 implements AdminSettingsMsgConstructor {
+
+ @Override
+ public AdminSettingsUpdateMsg constructAdminSettingsUpdateMsg(AdminSettings adminSettings) {
+ return AdminSettingsUpdateMsg.newBuilder().setEntity(JacksonUtil.toString(adminSettings)).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EntityDataMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/telemetry/EntityDataMsgConstructor.java
similarity index 97%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EntityDataMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/telemetry/EntityDataMsgConstructor.java
index 47dbad231d..4ec6376a4d 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/EntityDataMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/telemetry/EntityDataMsgConstructor.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.telemetry;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
@@ -28,7 +28,7 @@ import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.edge.EdgeEventActionType;
import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.TenantId;
-import org.thingsboard.server.common.transport.adaptor.JsonConverter;
+import org.thingsboard.server.common.adaptor.JsonConverter;
import org.thingsboard.server.gen.edge.v1.AttributeDeleteMsg;
import org.thingsboard.server.gen.edge.v1.EntityDataProto;
import org.thingsboard.server.gen.transport.TransportProtos;
@@ -36,8 +36,8 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
import java.util.List;
-@Component
@Slf4j
+@Component
@TbCoreComponent
public class EntityDataMsgConstructor {
@@ -106,5 +106,4 @@ public class EntityDataMsgConstructor {
}
return result;
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructor.java
new file mode 100644
index 0000000000..3de654fda6
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructor.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.tenant;
+
+import org.thingsboard.server.common.data.Tenant;
+import org.thingsboard.server.common.data.TenantProfile;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.gen.edge.v1.TenantProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.TenantUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface TenantMsgConstructor extends MsgConstructor {
+
+ TenantUpdateMsg constructTenantUpdateMsg(UpdateMsgType msgType, Tenant tenant);
+
+ TenantProfileUpdateMsg constructTenantProfileUpdateMsg(UpdateMsgType msgType, TenantProfile tenantProfile, EdgeVersion edgeVersion);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorFactory.java
new file mode 100644
index 0000000000..7735d67684
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.tenant;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class TenantMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/TenantMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV1.java
similarity index 59%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/TenantMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV1.java
index 321a57970a..a3f815cc18 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/TenantMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV1.java
@@ -13,19 +13,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.tenant;
+import com.google.protobuf.ByteString;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.Tenant;
+import org.thingsboard.server.common.data.TenantProfile;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.gen.edge.v1.TenantProfileUpdateMsg;
import org.thingsboard.server.gen.edge.v1.TenantUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.DataDecodingEncodingService;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
@Component
@TbCoreComponent
-public class TenantMsgConstructor {
+public class TenantMsgConstructorV1 implements TenantMsgConstructor {
+ @Autowired
+ private DataDecodingEncodingService dataDecodingEncodingService;
+
+ @Override
public TenantUpdateMsg constructTenantUpdateMsg(UpdateMsgType msgType, Tenant tenant) {
TenantUpdateMsg.Builder builder = TenantUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -64,4 +75,22 @@ public class TenantMsgConstructor {
}
return builder.build();
}
+
+ @Override
+ public TenantProfileUpdateMsg constructTenantProfileUpdateMsg(UpdateMsgType msgType, TenantProfile tenantProfile, EdgeVersion edgeVersion) {
+ ByteString profileData = EdgeVersionUtils.isEdgeVersionOlderThan(edgeVersion, EdgeVersion.V_3_6_1) ?
+ ByteString.empty() : ByteString.copyFrom(dataDecodingEncodingService.encode(tenantProfile.getProfileData()));
+ TenantProfileUpdateMsg.Builder builder = TenantProfileUpdateMsg.newBuilder()
+ .setMsgType(msgType)
+ .setIdMSB(tenantProfile.getId().getId().getMostSignificantBits())
+ .setIdLSB(tenantProfile.getId().getId().getLeastSignificantBits())
+ .setName(tenantProfile.getName())
+ .setDefault(tenantProfile.isDefault())
+ .setIsolatedRuleChain(tenantProfile.isIsolatedTbRuleEngine())
+ .setProfileDataBytes(profileData);
+ if (tenantProfile.getDescription() != null) {
+ builder.setDescription(tenantProfile.getDescription());
+ }
+ return builder.build();
+ }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV2.java
new file mode 100644
index 0000000000..69531e5630
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorV2.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.tenant;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.Tenant;
+import org.thingsboard.server.common.data.TenantProfile;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.gen.edge.v1.TenantProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.TenantUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class TenantMsgConstructorV2 implements TenantMsgConstructor {
+
+ @Override
+ public TenantUpdateMsg constructTenantUpdateMsg(UpdateMsgType msgType, Tenant tenant) {
+ return TenantUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(tenant)).build();
+ }
+
+ @Override
+ public TenantProfileUpdateMsg constructTenantProfileUpdateMsg(UpdateMsgType msgType, TenantProfile tenantProfile, EdgeVersion edgeVersion) {
+ return TenantProfileUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(tenantProfile)).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/BaseUserMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/BaseUserMsgConstructor.java
new file mode 100644
index 0000000000..aef35d8f50
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/BaseUserMsgConstructor.java
@@ -0,0 +1,31 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.user;
+
+import org.thingsboard.server.common.data.id.UserId;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.gen.edge.v1.UserUpdateMsg;
+
+public abstract class BaseUserMsgConstructor implements UserMsgConstructor {
+
+ @Override
+ public UserUpdateMsg constructUserDeleteMsg(UserId userId) {
+ return UserUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(userId.getId().getMostSignificantBits())
+ .setIdLSB(userId.getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructor.java
new file mode 100644
index 0000000000..3184f8c751
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructor.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.user;
+
+import org.thingsboard.server.common.data.User;
+import org.thingsboard.server.common.data.id.UserId;
+import org.thingsboard.server.common.data.security.UserCredentials;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.gen.edge.v1.UserCredentialsUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UserUpdateMsg;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+public interface UserMsgConstructor extends MsgConstructor {
+
+ UserUpdateMsg constructUserUpdatedMsg(UpdateMsgType msgType, User user);
+
+ UserUpdateMsg constructUserDeleteMsg(UserId userId);
+
+ UserCredentialsUpdateMsg constructUserCredentialsUpdatedMsg(UserCredentials userCredentials);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorFactory.java
new file mode 100644
index 0000000000..bf1e4197c0
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.user;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class UserMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/UserMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorV1.java
similarity index 79%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/UserMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorV1.java
index fbd3b31688..3fe635c54c 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/UserMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorV1.java
@@ -13,12 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.user;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.User;
-import org.thingsboard.server.common.data.id.UserId;
import org.thingsboard.server.common.data.security.UserCredentials;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.gen.edge.v1.UserCredentialsUpdateMsg;
@@ -27,8 +26,9 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
-public class UserMsgConstructor {
+public class UserMsgConstructorV1 extends BaseUserMsgConstructor {
+ @Override
public UserUpdateMsg constructUserUpdatedMsg(UpdateMsgType msgType, User user) {
UserUpdateMsg.Builder builder = UserUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -52,19 +52,12 @@ public class UserMsgConstructor {
return builder.build();
}
- public UserUpdateMsg constructUserDeleteMsg(UserId userId) {
- return UserUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(userId.getId().getMostSignificantBits())
- .setIdLSB(userId.getId().getLeastSignificantBits()).build();
- }
-
+ @Override
public UserCredentialsUpdateMsg constructUserCredentialsUpdatedMsg(UserCredentials userCredentials) {
- UserCredentialsUpdateMsg.Builder builder = UserCredentialsUpdateMsg.newBuilder()
+ return UserCredentialsUpdateMsg.newBuilder()
.setUserIdMSB(userCredentials.getUserId().getId().getMostSignificantBits())
.setUserIdLSB(userCredentials.getUserId().getId().getLeastSignificantBits())
.setEnabled(userCredentials.isEnabled())
- .setPassword(userCredentials.getPassword());
- return builder.build();
+ .setPassword(userCredentials.getPassword()).build();
}
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorV2.java
new file mode 100644
index 0000000000..0b4c592712
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorV2.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.user;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.User;
+import org.thingsboard.server.common.data.security.UserCredentials;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.gen.edge.v1.UserCredentialsUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.UserUpdateMsg;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+@Component
+@TbCoreComponent
+public class UserMsgConstructorV2 extends BaseUserMsgConstructor {
+
+ @Override
+ public UserUpdateMsg constructUserUpdatedMsg(UpdateMsgType msgType, User user) {
+ return UserUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(user))
+ .setIdMSB(user.getId().getId().getMostSignificantBits())
+ .setIdLSB(user.getId().getId().getLeastSignificantBits()).build();
+ }
+
+ @Override
+ public UserCredentialsUpdateMsg constructUserCredentialsUpdatedMsg(UserCredentials userCredentials) {
+ return UserCredentialsUpdateMsg.newBuilder().setEntity(JacksonUtil.toString(userCredentials)).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/BaseWidgetMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/BaseWidgetMsgConstructor.java
new file mode 100644
index 0000000000..6b4b3ac821
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/BaseWidgetMsgConstructor.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.widget;
+
+import org.thingsboard.server.common.data.id.WidgetTypeId;
+import org.thingsboard.server.common.data.id.WidgetsBundleId;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.gen.edge.v1.WidgetTypeUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.WidgetsBundleUpdateMsg;
+
+public abstract class BaseWidgetMsgConstructor implements WidgetMsgConstructor {
+
+ @Override
+ public WidgetsBundleUpdateMsg constructWidgetsBundleDeleteMsg(WidgetsBundleId widgetsBundleId) {
+ return WidgetsBundleUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(widgetsBundleId.getId().getMostSignificantBits())
+ .setIdLSB(widgetsBundleId.getId().getLeastSignificantBits())
+ .build();
+ }
+
+ @Override
+ public WidgetTypeUpdateMsg constructWidgetTypeDeleteMsg(WidgetTypeId widgetTypeId) {
+ return WidgetTypeUpdateMsg.newBuilder()
+ .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
+ .setIdMSB(widgetTypeId.getId().getMostSignificantBits())
+ .setIdLSB(widgetTypeId.getId().getLeastSignificantBits())
+ .build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructor.java
new file mode 100644
index 0000000000..544ba39b13
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructor.java
@@ -0,0 +1,39 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.widget;
+
+import org.thingsboard.server.common.data.id.WidgetTypeId;
+import org.thingsboard.server.common.data.id.WidgetsBundleId;
+import org.thingsboard.server.common.data.widget.WidgetTypeDetails;
+import org.thingsboard.server.common.data.widget.WidgetsBundle;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.gen.edge.v1.WidgetTypeUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.WidgetsBundleUpdateMsg;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructor;
+
+import java.util.List;
+
+public interface WidgetMsgConstructor extends MsgConstructor {
+
+ WidgetsBundleUpdateMsg constructWidgetsBundleUpdateMsg(UpdateMsgType msgType, WidgetsBundle widgetsBundle, List widgets);
+
+ WidgetsBundleUpdateMsg constructWidgetsBundleDeleteMsg(WidgetsBundleId widgetsBundleId);
+
+ WidgetTypeUpdateMsg constructWidgetTypeUpdateMsg(UpdateMsgType msgType, WidgetTypeDetails widgetTypeDetails, EdgeVersion edgeVersion);
+
+ WidgetTypeUpdateMsg constructWidgetTypeDeleteMsg(WidgetTypeId widgetTypeId);
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorFactory.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorFactory.java
new file mode 100644
index 0000000000..3a963f7041
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorFactory.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.widget;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.MsgConstructorFactory;
+
+@Component
+@TbCoreComponent
+public class WidgetMsgConstructorFactory extends MsgConstructorFactory {
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/WidgetTypeMsgConstructor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorV1.java
similarity index 67%
rename from application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/WidgetTypeMsgConstructor.java
rename to application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorV1.java
index 17a66a47d4..67bdbf1f54 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/WidgetTypeMsgConstructor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorV1.java
@@ -13,25 +13,54 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.thingsboard.server.service.edge.rpc.constructor;
+package org.thingsboard.server.service.edge.rpc.constructor.widget;
+import com.google.protobuf.ByteString;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.id.TenantId;
-import org.thingsboard.server.common.data.id.WidgetTypeId;
import org.thingsboard.server.common.data.widget.WidgetTypeDetails;
+import org.thingsboard.server.common.data.widget.WidgetsBundle;
import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.gen.edge.v1.WidgetTypeUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.WidgetsBundleUpdateMsg;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
+import java.nio.charset.StandardCharsets;
import java.util.Arrays;
+import java.util.List;
@Component
@TbCoreComponent
-public class WidgetTypeMsgConstructor {
+public class WidgetMsgConstructorV1 extends BaseWidgetMsgConstructor {
+ @Override
+ public WidgetsBundleUpdateMsg constructWidgetsBundleUpdateMsg(UpdateMsgType msgType, WidgetsBundle widgetsBundle, List widgets) {
+ WidgetsBundleUpdateMsg.Builder builder = WidgetsBundleUpdateMsg.newBuilder()
+ .setMsgType(msgType)
+ .setIdMSB(widgetsBundle.getId().getId().getMostSignificantBits())
+ .setIdLSB(widgetsBundle.getId().getId().getLeastSignificantBits())
+ .setTitle(widgetsBundle.getTitle())
+ .setAlias(widgetsBundle.getAlias());
+ if (widgetsBundle.getImage() != null) {
+ builder.setImage(ByteString.copyFrom(widgetsBundle.getImage().getBytes(StandardCharsets.UTF_8)));
+ }
+ if (widgetsBundle.getDescription() != null) {
+ builder.setDescription(widgetsBundle.getDescription());
+ }
+ if (widgetsBundle.getOrder() != null) {
+ builder.setOrder(widgetsBundle.getOrder());
+ }
+ if (widgetsBundle.getTenantId().equals(TenantId.SYS_TENANT_ID)) {
+ builder.setIsSystem(true);
+ }
+ builder.setWidgets(JacksonUtil.toString(widgets));
+ return builder.build();
+ }
+
+ @Override
public WidgetTypeUpdateMsg constructWidgetTypeUpdateMsg(UpdateMsgType msgType, WidgetTypeDetails widgetTypeDetails, EdgeVersion edgeVersion) {
WidgetTypeUpdateMsg.Builder builder = WidgetTypeUpdateMsg.newBuilder()
.setMsgType(msgType)
@@ -73,12 +102,4 @@ public class WidgetTypeMsgConstructor {
}
return builder.build();
}
-
- public WidgetTypeUpdateMsg constructWidgetTypeDeleteMsg(WidgetTypeId widgetTypeId) {
- return WidgetTypeUpdateMsg.newBuilder()
- .setMsgType(UpdateMsgType.ENTITY_DELETED_RPC_MESSAGE)
- .setIdMSB(widgetTypeId.getId().getMostSignificantBits())
- .setIdLSB(widgetTypeId.getId().getLeastSignificantBits())
- .build();
- }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorV2.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorV2.java
new file mode 100644
index 0000000000..aacc3c8399
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorV2.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.edge.rpc.constructor.widget;
+
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.JacksonUtil;
+import org.thingsboard.server.common.data.widget.WidgetTypeDetails;
+import org.thingsboard.server.common.data.widget.WidgetsBundle;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
+import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.gen.edge.v1.WidgetTypeUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.WidgetsBundleUpdateMsg;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+import java.util.List;
+
+@Component
+@TbCoreComponent
+public class WidgetMsgConstructorV2 extends BaseWidgetMsgConstructor {
+
+ @Override
+ public WidgetsBundleUpdateMsg constructWidgetsBundleUpdateMsg(UpdateMsgType msgType, WidgetsBundle widgetsBundle, List widgets) {
+ return WidgetsBundleUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(widgetsBundle))
+ .setWidgets(JacksonUtil.toString(widgets))
+ .setIdMSB(widgetsBundle.getId().getId().getMostSignificantBits())
+ .setIdLSB(widgetsBundle.getId().getId().getLeastSignificantBits()).build();
+ }
+
+ @Override
+ public WidgetTypeUpdateMsg constructWidgetTypeUpdateMsg(UpdateMsgType msgType, WidgetTypeDetails widgetTypeDetails, EdgeVersion edgeVersion) {
+ return WidgetTypeUpdateMsg.newBuilder().setMsgType(msgType).setEntity(JacksonUtil.toString(widgetTypeDetails))
+ .setIdMSB(widgetTypeDetails.getId().getId().getMostSignificantBits())
+ .setIdLSB(widgetTypeDetails.getId().getId().getLeastSignificantBits()).build();
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/BaseEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/BaseEdgeProcessor.java
index 8790b5d1fd..fe5fc76f2c 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/BaseEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/BaseEdgeProcessor.java
@@ -90,27 +90,23 @@ import org.thingsboard.server.queue.TbQueueCallback;
import org.thingsboard.server.queue.TbQueueMsgMetadata;
import org.thingsboard.server.queue.discovery.PartitionService;
import org.thingsboard.server.queue.provider.TbQueueProducerProvider;
-import org.thingsboard.server.service.edge.rpc.constructor.AdminSettingsMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.AlarmMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.AssetMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.AssetProfileMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.CustomerMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.DashboardMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.DeviceMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.DeviceProfileMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.EdgeMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.EntityDataMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.EntityViewMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.OtaPackageMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.QueueMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.RelationMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.RuleChainMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.ResourceMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.TenantMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.TenantProfileMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.UserMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.WidgetTypeMsgConstructor;
-import org.thingsboard.server.service.edge.rpc.constructor.WidgetsBundleMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.constructor.alarm.AlarmMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.asset.AssetMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.customer.CustomerMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.dashboard.DashboardMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.device.DeviceMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.edge.EdgeMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.constructor.entityview.EntityViewMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.ota.OtaPackageMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.queue.QueueMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.relation.RelationMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.resource.ResourceMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.rule.RuleChainMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.settings.AdminSettingsMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.telemetry.EntityDataMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.constructor.tenant.TenantMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.user.UserMsgConstructorFactory;
+import org.thingsboard.server.service.edge.rpc.constructor.widget.WidgetMsgConstructorFactory;
import org.thingsboard.server.service.entitiy.TbNotificationEntityService;
import org.thingsboard.server.service.executors.DbCallbackExecutorService;
import org.thingsboard.server.service.profile.TbAssetProfileCache;
@@ -253,61 +249,49 @@ public abstract class BaseEdgeProcessor {
protected EntityDataMsgConstructor entityDataMsgConstructor;
@Autowired
- protected RuleChainMsgConstructor ruleChainMsgConstructor;
+ protected RuleChainMsgConstructorFactory ruleChainMsgConstructorFactory;
@Autowired
- protected AlarmMsgConstructor alarmMsgConstructor;
+ protected AlarmMsgConstructorFactory alarmMsgConstructorFactory;
@Autowired
- protected DeviceMsgConstructor deviceMsgConstructor;
+ protected DeviceMsgConstructorFactory deviceMsgConstructorFactory;
@Autowired
- protected AssetMsgConstructor assetMsgConstructor;
+ protected AssetMsgConstructorFactory assetMsgConstructorFactory;
@Autowired
- protected EntityViewMsgConstructor entityViewMsgConstructor;
+ protected EntityViewMsgConstructorFactory entityViewMsgConstructorFactory;
@Autowired
- protected DashboardMsgConstructor dashboardMsgConstructor;
+ protected DashboardMsgConstructorFactory dashboardMsgConstructorFactory;
@Autowired
- protected RelationMsgConstructor relationMsgConstructor;
+ protected RelationMsgConstructorFactory relationMsgConstructorFactory;
@Autowired
- protected UserMsgConstructor userMsgConstructor;
+ protected UserMsgConstructorFactory userMsgConstructorFactory;
@Autowired
- protected CustomerMsgConstructor customerMsgConstructor;
+ protected CustomerMsgConstructorFactory customerMsgConstructorFactory;
@Autowired
- protected DeviceProfileMsgConstructor deviceProfileMsgConstructor;
+ protected TenantMsgConstructorFactory tenantMsgConstructorFactory;
@Autowired
- protected AssetProfileMsgConstructor assetProfileMsgConstructor;
+ protected WidgetMsgConstructorFactory widgetMsgConstructorFactory;
@Autowired
- protected TenantMsgConstructor tenantMsgConstructor;
+ protected AdminSettingsMsgConstructorFactory adminSettingsMsgConstructorFactory;
@Autowired
- protected TenantProfileMsgConstructor tenantProfileMsgConstructor;
+ protected OtaPackageMsgConstructorFactory otaPackageMsgConstructorFactory;
@Autowired
- protected WidgetsBundleMsgConstructor widgetsBundleMsgConstructor;
+ protected QueueMsgConstructorFactory queueMsgConstructorFactory;
@Autowired
- protected WidgetTypeMsgConstructor widgetTypeMsgConstructor;
-
- @Autowired
- protected AdminSettingsMsgConstructor adminSettingsMsgConstructor;
-
- @Autowired
- protected OtaPackageMsgConstructor otaPackageMsgConstructor;
-
- @Autowired
- protected QueueMsgConstructor queueMsgConstructor;
-
- @Autowired
- protected ResourceMsgConstructor resourceMsgConstructor;
+ protected ResourceMsgConstructorFactory resourceMsgConstructorFactory;
@Autowired
protected EdgeSynchronizationManager edgeSynchronizationManager;
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/AlarmEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/AlarmEdgeProcessor.java
index 882fd90c46..b934a33d54 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/AlarmEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/AlarmEdgeProcessor.java
@@ -34,6 +34,7 @@ import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
import org.thingsboard.server.gen.edge.v1.AlarmUpdateMsg;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.transport.TransportProtos;
import org.thingsboard.server.queue.util.TbCoreComponent;
@@ -46,19 +47,19 @@ import java.util.UUID;
@TbCoreComponent
public class AlarmEdgeProcessor extends BaseAlarmProcessor {
- public ListenableFuture processAlarmMsgFromEdge(TenantId tenantId, EdgeId edgeId, AlarmUpdateMsg alarmUpdateMsg) {
+ public ListenableFuture processAlarmMsgFromEdge(TenantId tenantId, EdgeId edgeId, AlarmUpdateMsg alarmUpdateMsg, EdgeVersion edgeVersion) {
log.trace("[{}] processAlarmMsgFromEdge [{}]", tenantId, alarmUpdateMsg);
try {
edgeSynchronizationManager.getEdgeId().set(edgeId);
- return processAlarmMsg(tenantId, alarmUpdateMsg);
+ return processAlarmMsg(tenantId, alarmUpdateMsg, edgeVersion);
} finally {
edgeSynchronizationManager.getEdgeId().remove();
}
}
- public DownlinkMsg convertAlarmEventToDownlink(EdgeEvent edgeEvent) {
- AlarmUpdateMsg alarmUpdateMsg =
- convertAlarmEventToAlarmMsg(edgeEvent.getTenantId(), edgeEvent.getEntityId(), edgeEvent.getAction(), edgeEvent.getBody());
+ public DownlinkMsg convertAlarmEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
+ AlarmUpdateMsg alarmUpdateMsg = convertAlarmEventToAlarmMsg(edgeEvent.getTenantId(), edgeEvent.getEntityId(),
+ edgeEvent.getAction(), edgeEvent.getBody(), edgeVersion);
if (alarmUpdateMsg != null) {
return DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
@@ -122,5 +123,4 @@ public class AlarmEdgeProcessor extends BaseAlarmProcessor {
} while (pageData != null && pageData.hasNext());
return futures;
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/BaseAlarmProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/BaseAlarmProcessor.java
index 3fb086cd52..99b8d2c12a 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/BaseAlarmProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/BaseAlarmProcessor.java
@@ -37,18 +37,29 @@ import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.EntityViewId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.gen.edge.v1.AlarmUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
+import org.thingsboard.server.service.edge.rpc.constructor.alarm.AlarmMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@Slf4j
public abstract class BaseAlarmProcessor extends BaseEdgeProcessor {
- protected ListenableFuture processAlarmMsg(TenantId tenantId, AlarmUpdateMsg alarmUpdateMsg) {
- EntityId originatorId = getAlarmOriginator(tenantId, alarmUpdateMsg.getOriginatorName(),
- EntityType.valueOf(alarmUpdateMsg.getOriginatorType()));
+ public ListenableFuture processAlarmMsg(TenantId tenantId, AlarmUpdateMsg alarmUpdateMsg, EdgeVersion edgeVersion) {
+ log.trace("[{}] processAlarmMsg [{}]", tenantId, alarmUpdateMsg);
AlarmId alarmId = new AlarmId(new UUID(alarmUpdateMsg.getIdMSB(), alarmUpdateMsg.getIdLSB()));
+ boolean isEdgeVersionOlderThan_3_6_2 = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion);
+ Alarm alarm = isEdgeVersionOlderThan_3_6_2 ? createDeprecatedAlarm(tenantId, alarmUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(alarmUpdateMsg.getEntity(), Alarm.class);
+ if (alarm == null) {
+ throw new RuntimeException("[{" + tenantId + "}] alarmUpdateMsg {" + alarmUpdateMsg + "} cannot be converted to alarm");
+ }
+ EntityId originatorId = isEdgeVersionOlderThan_3_6_2
+ ? getAlarmOriginator(tenantId, alarmUpdateMsg.getOriginatorName(), EntityType.valueOf(alarmUpdateMsg.getOriginatorType()))
+ : alarm.getOriginator();
if (originatorId == null) {
log.warn("[{}] Originator not found for the alarm msg {}", tenantId, alarmUpdateMsg);
return Futures.immediateFuture(null);
@@ -58,21 +69,8 @@ public abstract class BaseAlarmProcessor extends BaseEdgeProcessor {
switch (alarmUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
- Alarm alarm = new Alarm();
alarm.setId(alarmId);
- alarm.setTenantId(tenantId);
- alarm.setType(alarmUpdateMsg.getName());
alarm.setOriginator(originatorId);
- alarm.setSeverity(AlarmSeverity.valueOf(alarmUpdateMsg.getSeverity()));
- alarm.setStartTs(alarmUpdateMsg.getStartTs());
- var alarmStatus = AlarmStatus.valueOf(alarmUpdateMsg.getStatus());
- alarm.setClearTs(alarmUpdateMsg.getClearTs());
- alarm.setPropagate(alarmUpdateMsg.getPropagate());
- alarm.setCleared(alarmStatus.isCleared());
- alarm.setAcknowledged(alarmStatus.isAck());
- alarm.setAckTs(alarmUpdateMsg.getAckTs());
- alarm.setEndTs(alarmUpdateMsg.getEndTs());
- alarm.setDetails(JacksonUtil.toJsonNode(alarmUpdateMsg.getDetails()));
if (UpdateMsgType.ENTITY_CREATED_RPC_MESSAGE.equals(alarmUpdateMsg.getMsgType())) {
alarmService.createAlarm(AlarmCreateOrUpdateActiveRequest.fromAlarm(alarm, null, alarmId));
} else {
@@ -82,14 +80,13 @@ public abstract class BaseAlarmProcessor extends BaseEdgeProcessor {
case ALARM_ACK_RPC_MESSAGE:
Alarm alarmToAck = alarmService.findAlarmById(tenantId, alarmId);
if (alarmToAck != null) {
- alarmService.acknowledgeAlarm(tenantId, alarmId, alarmUpdateMsg.getAckTs());
+ alarmService.acknowledgeAlarm(tenantId, alarmId, alarm.getAckTs());
}
break;
case ALARM_CLEAR_RPC_MESSAGE:
Alarm alarmToClear = alarmService.findAlarmById(tenantId, alarmId);
if (alarmToClear != null) {
- alarmService.clearAlarm(tenantId, alarmId, alarmUpdateMsg.getClearTs(),
- JacksonUtil.toJsonNode(alarmUpdateMsg.getDetails()));
+ alarmService.clearAlarm(tenantId, alarmId, alarm.getClearTs(), alarm.getDetails());
}
break;
case ENTITY_DELETED_RPC_MESSAGE:
@@ -109,7 +106,24 @@ public abstract class BaseAlarmProcessor extends BaseEdgeProcessor {
return Futures.immediateFuture(null);
}
- protected AlarmUpdateMsg convertAlarmEventToAlarmMsg(TenantId tenantId, UUID entityId, EdgeEventActionType actionType, JsonNode body) {
+ private Alarm createDeprecatedAlarm(TenantId tenantId, AlarmUpdateMsg alarmUpdateMsg) {
+ Alarm alarm = new Alarm();
+ alarm.setTenantId(tenantId);
+ alarm.setType(alarmUpdateMsg.getName());
+ alarm.setSeverity(AlarmSeverity.valueOf(alarmUpdateMsg.getSeverity()));
+ alarm.setStartTs(alarmUpdateMsg.getStartTs());
+ AlarmStatus alarmStatus = AlarmStatus.valueOf(alarmUpdateMsg.getStatus());
+ alarm.setClearTs(alarmUpdateMsg.getClearTs());
+ alarm.setPropagate(alarmUpdateMsg.getPropagate());
+ alarm.setCleared(alarmStatus.isCleared());
+ alarm.setAcknowledged(alarmStatus.isAck());
+ alarm.setAckTs(alarmUpdateMsg.getAckTs());
+ alarm.setEndTs(alarmUpdateMsg.getEndTs());
+ alarm.setDetails(JacksonUtil.toJsonNode(alarmUpdateMsg.getDetails()));
+ return alarm;
+ }
+
+ public AlarmUpdateMsg convertAlarmEventToAlarmMsg(TenantId tenantId, UUID entityId, EdgeEventActionType actionType, JsonNode body, EdgeVersion edgeVersion) {
AlarmId alarmId = new AlarmId(entityId);
UpdateMsgType msgType = getUpdateMsgType(actionType);
switch (actionType) {
@@ -119,12 +133,16 @@ public abstract class BaseAlarmProcessor extends BaseEdgeProcessor {
case ALARM_CLEAR:
Alarm alarm = alarmService.findAlarmById(tenantId, alarmId);
if (alarm != null) {
- return alarmMsgConstructor.constructAlarmUpdatedMsg(msgType, alarm, findOriginatorEntityName(tenantId, alarm));
+ return ((AlarmMsgConstructor) alarmMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructAlarmUpdatedMsg(msgType, alarm, findOriginatorEntityName(tenantId, alarm));
}
break;
case DELETED:
Alarm deletedAlarm = JacksonUtil.convertValue(body, Alarm.class);
- return alarmMsgConstructor.constructAlarmUpdatedMsg(msgType, deletedAlarm, findOriginatorEntityName(tenantId, deletedAlarm));
+ if (deletedAlarm != null) {
+ return ((AlarmMsgConstructor) alarmMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructAlarmUpdatedMsg(msgType, deletedAlarm, findOriginatorEntityName(tenantId, deletedAlarm));
+ }
}
return null;
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/AssetEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/AssetEdgeProcessor.java
index caa03af8a5..e760a4d73a 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/AssetEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/AssetEdgeProcessor.java
@@ -41,6 +41,8 @@ import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.asset.AssetMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@@ -49,7 +51,7 @@ import java.util.UUID;
@TbCoreComponent
public class AssetEdgeProcessor extends BaseAssetProcessor {
- public ListenableFuture processAssetMsgFromEdge(TenantId tenantId, Edge edge, AssetUpdateMsg assetUpdateMsg) {
+ public ListenableFuture processAssetMsgFromEdge(TenantId tenantId, Edge edge, AssetUpdateMsg assetUpdateMsg, EdgeVersion edgeVersion) {
log.trace("[{}] executing processAssetMsgFromEdge [{}] from edge [{}]", tenantId, assetUpdateMsg, edge.getId());
AssetId assetId = new AssetId(new UUID(assetUpdateMsg.getIdMSB(), assetUpdateMsg.getIdLSB()));
try {
@@ -58,7 +60,7 @@ public class AssetEdgeProcessor extends BaseAssetProcessor {
switch (assetUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
- saveOrUpdateAsset(tenantId, assetId, assetUpdateMsg, edge);
+ saveOrUpdateAsset(tenantId, assetId, assetUpdateMsg, edge, edgeVersion);
return Futures.immediateFuture(null);
case ENTITY_DELETED_RPC_MESSAGE:
Asset assetToDelete = assetService.findAssetById(tenantId, assetId);
@@ -82,9 +84,8 @@ public class AssetEdgeProcessor extends BaseAssetProcessor {
}
}
- private void saveOrUpdateAsset(TenantId tenantId, AssetId assetId, AssetUpdateMsg assetUpdateMsg, Edge edge) {
- CustomerId customerId = safeGetCustomerId(assetUpdateMsg.getCustomerIdMSB(), assetUpdateMsg.getCustomerIdLSB());
- Pair resultPair = super.saveOrUpdateAsset(tenantId, assetId, assetUpdateMsg, customerId);
+ private void saveOrUpdateAsset(TenantId tenantId, AssetId assetId, AssetUpdateMsg assetUpdateMsg, Edge edge, EdgeVersion edgeVersion) {
+ Pair resultPair = super.saveOrUpdateAsset(tenantId, assetId, assetUpdateMsg, edgeVersion);
Boolean created = resultPair.getFirst();
if (created) {
createRelationFromEdge(tenantId, edge.getId(), assetId);
@@ -120,23 +121,24 @@ public class AssetEdgeProcessor extends BaseAssetProcessor {
Asset asset = assetService.findAssetById(edgeEvent.getTenantId(), assetId);
if (asset != null && !BaseAssetService.TB_SERVICE_QUEUE.equals(asset.getType())) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- AssetUpdateMsg assetUpdateMsg =
- assetMsgConstructor.constructAssetUpdatedMsg(msgType, asset);
+ AssetUpdateMsg assetUpdateMsg = ((AssetMsgConstructor)
+ assetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructAssetUpdatedMsg(msgType, asset);
DownlinkMsg.Builder builder = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addAssetUpdateMsg(assetUpdateMsg);
if (UpdateMsgType.ENTITY_CREATED_RPC_MESSAGE.equals(msgType)) {
AssetProfile assetProfile = assetProfileService.findAssetProfileById(edgeEvent.getTenantId(), asset.getAssetProfileId());
assetProfile = checkIfAssetProfileDefaultFieldsAssignedToEdge(edgeEvent.getTenantId(), edgeId, assetProfile, edgeVersion);
- builder.addAssetProfileUpdateMsg(assetProfileMsgConstructor.constructAssetProfileUpdatedMsg(msgType, assetProfile));
+ builder.addAssetProfileUpdateMsg(((AssetMsgConstructor) assetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructAssetProfileUpdatedMsg(msgType, assetProfile));
}
downlinkMsg = builder.build();
}
break;
case DELETED:
case UNASSIGNED_FROM_EDGE:
- AssetUpdateMsg assetUpdateMsg =
- assetMsgConstructor.constructAssetDeleteMsg(assetId);
+ AssetUpdateMsg assetUpdateMsg = ((AssetMsgConstructor)
+ assetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructAssetDeleteMsg(assetId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addAssetUpdateMsg(assetUpdateMsg)
@@ -145,4 +147,12 @@ public class AssetEdgeProcessor extends BaseAssetProcessor {
}
return downlinkMsg;
}
+
+ @Override
+ protected void setCustomerId(TenantId tenantId, CustomerId customerId, Asset asset, AssetUpdateMsg assetUpdateMsg, EdgeVersion edgeVersion) {
+ CustomerId customerUUID = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? safeGetCustomerId(assetUpdateMsg.getCustomerIdMSB(), assetUpdateMsg.getCustomerIdLSB())
+ : asset.getCustomerId() != null ? asset.getCustomerId() : customerId;
+ asset.setCustomerId(customerUUID);
+ }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/AssetProfileEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/AssetProfileEdgeProcessor.java
index fb55edd8c5..a18030992d 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/AssetProfileEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/AssetProfileEdgeProcessor.java
@@ -40,6 +40,8 @@ import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.asset.AssetMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@@ -48,7 +50,7 @@ import java.util.UUID;
@TbCoreComponent
public class AssetProfileEdgeProcessor extends BaseAssetProfileProcessor {
- public ListenableFuture processAssetProfileMsgFromEdge(TenantId tenantId, Edge edge, AssetProfileUpdateMsg assetProfileUpdateMsg) {
+ public ListenableFuture processAssetProfileMsgFromEdge(TenantId tenantId, Edge edge, AssetProfileUpdateMsg assetProfileUpdateMsg, EdgeVersion edgeVersion) {
log.trace("[{}] executing processAssetProfileMsgFromEdge [{}] from edge [{}]", tenantId, assetProfileUpdateMsg, edge.getId());
AssetProfileId assetProfileId = new AssetProfileId(new UUID(assetProfileUpdateMsg.getIdMSB(), assetProfileUpdateMsg.getIdLSB()));
try {
@@ -57,7 +59,7 @@ public class AssetProfileEdgeProcessor extends BaseAssetProfileProcessor {
switch (assetProfileUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
- saveOrUpdateAssetProfile(tenantId, assetProfileId, assetProfileUpdateMsg, edge);
+ saveOrUpdateAssetProfile(tenantId, assetProfileId, assetProfileUpdateMsg, edge, edgeVersion);
return Futures.immediateFuture(null);
case ENTITY_DELETED_RPC_MESSAGE:
case UNRECOGNIZED:
@@ -72,8 +74,8 @@ public class AssetProfileEdgeProcessor extends BaseAssetProfileProcessor {
}
}
- private void saveOrUpdateAssetProfile(TenantId tenantId, AssetProfileId assetProfileId, AssetProfileUpdateMsg assetProfileUpdateMsg, Edge edge) {
- Pair resultPair = super.saveOrUpdateAssetProfile(tenantId, assetProfileId, assetProfileUpdateMsg);
+ private void saveOrUpdateAssetProfile(TenantId tenantId, AssetProfileId assetProfileId, AssetProfileUpdateMsg assetProfileUpdateMsg, Edge edge, EdgeVersion edgeVersion) {
+ Pair resultPair = super.saveOrUpdateAssetProfile(tenantId, assetProfileId, assetProfileUpdateMsg, edgeVersion);
Boolean created = resultPair.getFirst();
if (created) {
createRelationFromEdge(tenantId, edge.getId(), assetProfileId);
@@ -106,8 +108,8 @@ public class AssetProfileEdgeProcessor extends BaseAssetProfileProcessor {
if (assetProfile != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
assetProfile = checkIfAssetProfileDefaultFieldsAssignedToEdge(edgeEvent.getTenantId(), edgeId, assetProfile, edgeVersion);
- AssetProfileUpdateMsg assetProfileUpdateMsg =
- assetProfileMsgConstructor.constructAssetProfileUpdatedMsg(msgType, assetProfile);
+ AssetProfileUpdateMsg assetProfileUpdateMsg = ((AssetMsgConstructor)
+ assetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructAssetProfileUpdatedMsg(msgType, assetProfile);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addAssetProfileUpdateMsg(assetProfileUpdateMsg)
@@ -115,8 +117,8 @@ public class AssetProfileEdgeProcessor extends BaseAssetProfileProcessor {
}
break;
case DELETED:
- AssetProfileUpdateMsg assetProfileUpdateMsg =
- assetProfileMsgConstructor.constructAssetProfileDeleteMsg(assetProfileId);
+ AssetProfileUpdateMsg assetProfileUpdateMsg = ((AssetMsgConstructor)
+ assetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructAssetProfileDeleteMsg(assetProfileId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addAssetProfileUpdateMsg(assetProfileUpdateMsg)
@@ -127,19 +129,23 @@ public class AssetProfileEdgeProcessor extends BaseAssetProfileProcessor {
}
@Override
- protected void setDefaultRuleChainId(TenantId tenantId, AssetProfile assetProfile, AssetProfileUpdateMsg assetProfileUpdateMsg) {
- // do nothing on cloud
+ protected void setDefaultRuleChainId(TenantId tenantId, AssetProfile assetProfile, RuleChainId ruleChainId) {
+ assetProfile.setDefaultRuleChainId(ruleChainId);
}
@Override
- protected void setDefaultEdgeRuleChainId(TenantId tenantId,AssetProfile assetProfile, AssetProfileUpdateMsg assetProfileUpdateMsg) {
- UUID defaultEdgeRuleChainUUID = safeGetUUID(assetProfileUpdateMsg.getDefaultRuleChainIdMSB(), assetProfileUpdateMsg.getDefaultRuleChainIdLSB());
+ protected void setDefaultEdgeRuleChainId(AssetProfile assetProfile, RuleChainId ruleChainId, AssetProfileUpdateMsg assetProfileUpdateMsg, EdgeVersion edgeVersion) {
+ UUID defaultEdgeRuleChainUUID = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? safeGetUUID(assetProfileUpdateMsg.getDefaultRuleChainIdMSB(), assetProfileUpdateMsg.getDefaultRuleChainIdLSB())
+ : ruleChainId != null ? ruleChainId.getId() : null;
assetProfile.setDefaultEdgeRuleChainId(defaultEdgeRuleChainUUID != null ? new RuleChainId(defaultEdgeRuleChainUUID) : null);
}
@Override
- protected void setDefaultDashboardId(TenantId tenantId, AssetProfile assetProfile, AssetProfileUpdateMsg assetProfileUpdateMsg) {
- UUID defaultDashboardUUID = safeGetUUID(assetProfileUpdateMsg.getDefaultDashboardIdMSB(), assetProfileUpdateMsg.getDefaultDashboardIdLSB());
+ protected void setDefaultDashboardId(TenantId tenantId, DashboardId dashboardId, AssetProfile assetProfile, AssetProfileUpdateMsg assetProfileUpdateMsg, EdgeVersion edgeVersion) {
+ UUID defaultDashboardUUID = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? safeGetUUID(assetProfileUpdateMsg.getDefaultDashboardIdMSB(), assetProfileUpdateMsg.getDefaultDashboardIdLSB())
+ : assetProfile.getDefaultDashboardId() != null ? assetProfile.getDefaultDashboardId().getId() : (dashboardId != null ? dashboardId.getId() : null);
assetProfile.setDefaultDashboardId(defaultDashboardUUID != null ? new DashboardId(defaultDashboardUUID) : null);
}
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/BaseAssetProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/BaseAssetProcessor.java
index f8dcdbd8f6..6403631f50 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/BaseAssetProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/BaseAssetProcessor.java
@@ -26,43 +26,43 @@ import org.thingsboard.server.common.data.id.AssetProfileId;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.gen.edge.v1.AssetUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@Slf4j
public abstract class BaseAssetProcessor extends BaseEdgeProcessor {
- protected Pair saveOrUpdateAsset(TenantId tenantId, AssetId assetId, AssetUpdateMsg assetUpdateMsg, CustomerId customerId) {
+ protected Pair saveOrUpdateAsset(TenantId tenantId, AssetId assetId, AssetUpdateMsg assetUpdateMsg, EdgeVersion edgeVersion) {
boolean created = false;
boolean assetNameUpdated = false;
assetCreationLock.lock();
try {
- Asset asset = assetService.findAssetById(tenantId, assetId);
- String assetName = assetUpdateMsg.getName();
+ Asset asset = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createAsset(tenantId, assetId, assetUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(assetUpdateMsg.getEntity(), Asset.class);
if (asset == null) {
+ throw new RuntimeException("[{" + tenantId + "}] assetUpdateMsg {" + assetUpdateMsg + " } cannot be converted to asset");
+ }
+ Asset assetById = assetService.findAssetById(tenantId, assetId);
+ if (assetById == null) {
created = true;
- asset = new Asset();
- asset.setTenantId(tenantId);
- asset.setCreatedTime(Uuids.unixTimestamp(assetId.getId()));
+ asset.setId(null);
+ } else {
+ asset.setId(assetId);
}
+ String assetName = asset.getName();
Asset assetByName = assetService.findAssetByTenantIdAndName(tenantId, assetName);
if (assetByName != null && !assetByName.getId().equals(assetId)) {
assetName = assetName + "_" + StringUtils.randomAlphanumeric(15);
log.warn("[{}] Asset with name {} already exists. Renaming asset name to {}",
- tenantId, assetUpdateMsg.getName(), assetName);
+ tenantId, asset.getName(), assetName);
assetNameUpdated = true;
}
asset.setName(assetName);
- asset.setType(assetUpdateMsg.getType());
- asset.setLabel(assetUpdateMsg.hasLabel() ? assetUpdateMsg.getLabel() : null);
- asset.setAdditionalInfo(assetUpdateMsg.hasAdditionalInfo()
- ? JacksonUtil.toJsonNode(assetUpdateMsg.getAdditionalInfo()) : null);
-
- UUID assetProfileUUID = safeGetUUID(assetUpdateMsg.getAssetProfileIdMSB(), assetUpdateMsg.getAssetProfileIdLSB());
- asset.setAssetProfileId(assetProfileUUID != null ? new AssetProfileId(assetProfileUUID) : null);
-
- asset.setCustomerId(customerId);
+ setCustomerId(tenantId, created ? null : assetById.getCustomerId(), asset, assetUpdateMsg, edgeVersion);
assetValidator.validate(asset, Asset::getTenantId);
if (created) {
@@ -77,4 +77,24 @@ public abstract class BaseAssetProcessor extends BaseEdgeProcessor {
}
return Pair.of(created, assetNameUpdated);
}
+
+ private Asset createAsset(TenantId tenantId, AssetId assetId, AssetUpdateMsg assetUpdateMsg) {
+ Asset asset = new Asset();
+ asset.setTenantId(tenantId);
+ asset.setName(assetUpdateMsg.getName());
+ asset.setCreatedTime(Uuids.unixTimestamp(assetId.getId()));
+ asset.setType(assetUpdateMsg.getType());
+ asset.setLabel(assetUpdateMsg.hasLabel() ? assetUpdateMsg.getLabel() : null);
+ asset.setAdditionalInfo(assetUpdateMsg.hasAdditionalInfo()
+ ? JacksonUtil.toJsonNode(assetUpdateMsg.getAdditionalInfo()) : null);
+
+ UUID assetProfileUUID = safeGetUUID(assetUpdateMsg.getAssetProfileIdMSB(), assetUpdateMsg.getAssetProfileIdLSB());
+ asset.setAssetProfileId(assetProfileUUID != null ? new AssetProfileId(assetProfileUUID) : null);
+
+ CustomerId customerId = safeGetCustomerId(assetUpdateMsg.getCustomerIdMSB(), assetUpdateMsg.getCustomerIdLSB());
+ asset.setCustomerId(customerId);
+ return asset;
+ }
+
+ protected abstract void setCustomerId(TenantId tenantId, CustomerId customerId, Asset asset, AssetUpdateMsg assetUpdateMsg, EdgeVersion edgeVersion);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/BaseAssetProfileProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/BaseAssetProfileProcessor.java
index 67c8f8de44..68d52e74b6 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/BaseAssetProfileProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/asset/BaseAssetProfileProcessor.java
@@ -18,54 +18,66 @@ package org.thingsboard.server.service.edge.rpc.processor.asset;
import com.datastax.oss.driver.api.core.uuid.Uuids;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.util.Pair;
+import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.asset.AssetProfile;
import org.thingsboard.server.common.data.id.AssetProfileId;
+import org.thingsboard.server.common.data.id.DashboardId;
+import org.thingsboard.server.common.data.id.RuleChainId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.gen.edge.v1.AssetProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.nio.charset.StandardCharsets;
@Slf4j
public abstract class BaseAssetProfileProcessor extends BaseEdgeProcessor {
- protected Pair saveOrUpdateAssetProfile(TenantId tenantId, AssetProfileId assetProfileId, AssetProfileUpdateMsg assetProfileUpdateMsg) {
+ protected Pair saveOrUpdateAssetProfile(TenantId tenantId, AssetProfileId assetProfileId, AssetProfileUpdateMsg assetProfileUpdateMsg, EdgeVersion edgeVersion) {
boolean created = false;
boolean assetProfileNameUpdated = false;
assetCreationLock.lock();
try {
- AssetProfile assetProfile = assetProfileService.findAssetProfileById(tenantId, assetProfileId);
- String assetProfileName = assetProfileUpdateMsg.getName();
+ AssetProfile assetProfile = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createAssetProfile(tenantId, assetProfileId, assetProfileUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(assetProfileUpdateMsg.getEntity(), AssetProfile.class);
if (assetProfile == null) {
+ throw new RuntimeException("[{" + tenantId + "}] assetProfileUpdateMsg {" + assetProfileUpdateMsg + "} cannot be converted to asset profile");
+ }
+ boolean isDefault = assetProfile.isDefault();
+ AssetProfile assetProfileById = assetProfileService.findAssetProfileById(tenantId, assetProfileId);
+ if (assetProfileById == null) {
created = true;
- assetProfile = new AssetProfile();
- assetProfile.setTenantId(tenantId);
- assetProfile.setCreatedTime(Uuids.unixTimestamp(assetProfileId.getId()));
+ assetProfile.setId(null);
+ } else {
+ assetProfile.setId(assetProfileId);
}
+ assetProfile.setDefault(false);
+ String assetProfileName = assetProfile.getName();
AssetProfile assetProfileByName = assetProfileService.findAssetProfileByName(tenantId, assetProfileName);
if (assetProfileByName != null && !assetProfileByName.getId().equals(assetProfileId)) {
assetProfileName = assetProfileName + "_" + StringUtils.randomAlphabetic(15);
log.warn("[{}] Asset profile with name {} already exists. Renaming asset profile name to {}",
- tenantId, assetProfileUpdateMsg.getName(), assetProfileName);
+ tenantId, assetProfile.getName(), assetProfileName);
assetProfileNameUpdated = true;
}
assetProfile.setName(assetProfileName);
- assetProfile.setDefault(assetProfileUpdateMsg.getDefault());
- assetProfile.setDefaultQueueName(assetProfileUpdateMsg.hasDefaultQueueName() ? assetProfileUpdateMsg.getDefaultQueueName() : null);
- assetProfile.setDescription(assetProfileUpdateMsg.hasDescription() ? assetProfileUpdateMsg.getDescription() : null);
- assetProfile.setImage(assetProfileUpdateMsg.hasImage()
- ? new String(assetProfileUpdateMsg.getImage().toByteArray(), StandardCharsets.UTF_8) : null);
- setDefaultRuleChainId(tenantId, assetProfile, assetProfileUpdateMsg);
- setDefaultEdgeRuleChainId(tenantId, assetProfile, assetProfileUpdateMsg);
- setDefaultDashboardId(tenantId, assetProfile, assetProfileUpdateMsg);
+ RuleChainId ruleChainId = assetProfile.getDefaultRuleChainId();
+ setDefaultRuleChainId(tenantId, assetProfile, created ? null : assetProfileById.getDefaultRuleChainId());
+ setDefaultEdgeRuleChainId(assetProfile, ruleChainId, assetProfileUpdateMsg, edgeVersion);
+ setDefaultDashboardId(tenantId, created ? null : assetProfileById.getDefaultDashboardId(), assetProfile, assetProfileUpdateMsg, edgeVersion);
assetProfileValidator.validate(assetProfile, AssetProfile::getTenantId);
if (created) {
assetProfile.setId(assetProfileId);
}
assetProfileService.saveAssetProfile(assetProfile, false);
+ if (isDefault) {
+ assetProfileService.setDefaultAssetProfile(tenantId, assetProfileId);
+ }
} catch (Exception e) {
log.error("[{}] Failed to process asset profile update msg [{}]", tenantId, assetProfileUpdateMsg, e);
throw e;
@@ -75,9 +87,22 @@ public abstract class BaseAssetProfileProcessor extends BaseEdgeProcessor {
return Pair.of(created, assetProfileNameUpdated);
}
- protected abstract void setDefaultRuleChainId(TenantId tenantId, AssetProfile assetProfile, AssetProfileUpdateMsg assetProfileUpdateMsg);
+ private AssetProfile createAssetProfile(TenantId tenantId, AssetProfileId assetProfileId, AssetProfileUpdateMsg assetProfileUpdateMsg) {
+ AssetProfile assetProfile = new AssetProfile();
+ assetProfile.setTenantId(tenantId);
+ assetProfile.setName(assetProfileUpdateMsg.getName());
+ assetProfile.setCreatedTime(Uuids.unixTimestamp(assetProfileId.getId()));
+ assetProfile.setDefault(assetProfileUpdateMsg.getDefault());
+ assetProfile.setDefaultQueueName(assetProfileUpdateMsg.hasDefaultQueueName() ? assetProfileUpdateMsg.getDefaultQueueName() : null);
+ assetProfile.setDescription(assetProfileUpdateMsg.hasDescription() ? assetProfileUpdateMsg.getDescription() : null);
+ assetProfile.setImage(assetProfileUpdateMsg.hasImage()
+ ? new String(assetProfileUpdateMsg.getImage().toByteArray(), StandardCharsets.UTF_8) : null);
+ return assetProfile;
+ }
+
+ protected abstract void setDefaultRuleChainId(TenantId tenantId, AssetProfile assetProfile, RuleChainId ruleChainId);
- protected abstract void setDefaultEdgeRuleChainId(TenantId tenantId, AssetProfile assetProfile, AssetProfileUpdateMsg assetProfileUpdateMsg);
+ protected abstract void setDefaultEdgeRuleChainId(AssetProfile assetProfile, RuleChainId ruleChainId, AssetProfileUpdateMsg assetProfileUpdateMsg, EdgeVersion edgeVersion);
- protected abstract void setDefaultDashboardId(TenantId tenantId, AssetProfile assetProfile, AssetProfileUpdateMsg assetProfileUpdateMsg);
+ protected abstract void setDefaultDashboardId(TenantId tenantId, DashboardId dashboardId, AssetProfile assetProfile, AssetProfileUpdateMsg assetProfileUpdateMsg, EdgeVersion edgeVersion);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/customer/CustomerEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/customer/CustomerEdgeProcessor.java
index f553d6d5a0..9b9d99fcc3 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/customer/CustomerEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/customer/CustomerEdgeProcessor.java
@@ -33,9 +33,11 @@ import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
import org.thingsboard.server.gen.edge.v1.CustomerUpdateMsg;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.gen.transport.TransportProtos;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.customer.CustomerMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
import java.util.ArrayList;
@@ -47,7 +49,7 @@ import java.util.UUID;
@TbCoreComponent
public class CustomerEdgeProcessor extends BaseEdgeProcessor {
- public DownlinkMsg convertCustomerEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertCustomerEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
CustomerId customerId = new CustomerId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -56,8 +58,8 @@ public class CustomerEdgeProcessor extends BaseEdgeProcessor {
Customer customer = customerService.findCustomerById(edgeEvent.getTenantId(), customerId);
if (customer != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- CustomerUpdateMsg customerUpdateMsg =
- customerMsgConstructor.constructCustomerUpdatedMsg(msgType, customer);
+ CustomerUpdateMsg customerUpdateMsg = ((CustomerMsgConstructor)
+ customerMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructCustomerUpdatedMsg(msgType, customer);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addCustomerUpdateMsg(customerUpdateMsg)
@@ -65,8 +67,8 @@ public class CustomerEdgeProcessor extends BaseEdgeProcessor {
}
break;
case DELETED:
- CustomerUpdateMsg customerUpdateMsg =
- customerMsgConstructor.constructCustomerDeleteMsg(customerId);
+ CustomerUpdateMsg customerUpdateMsg = ((CustomerMsgConstructor)
+ customerMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructCustomerDeleteMsg(customerId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addCustomerUpdateMsg(customerUpdateMsg)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/BaseDashboardProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/BaseDashboardProcessor.java
index 687e14a07d..0ae26d5160 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/BaseDashboardProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/BaseDashboardProcessor.java
@@ -25,60 +25,88 @@ import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.gen.edge.v1.DashboardUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.Set;
@Slf4j
public abstract class BaseDashboardProcessor extends BaseEdgeProcessor {
- protected boolean saveOrUpdateDashboard(TenantId tenantId, DashboardId dashboardId, DashboardUpdateMsg dashboardUpdateMsg, CustomerId customerId) {
+ protected boolean saveOrUpdateDashboard(TenantId tenantId, DashboardId dashboardId, DashboardUpdateMsg dashboardUpdateMsg, CustomerId customerId, EdgeVersion edgeVersion) {
boolean created = false;
- Dashboard dashboard = dashboardService.findDashboardById(tenantId, dashboardId);
+ Dashboard dashboard = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createDashboard(tenantId, dashboardId, dashboardUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(dashboardUpdateMsg.getEntity(), Dashboard.class);
if (dashboard == null) {
- created = true;
- dashboard = new Dashboard();
- dashboard.setTenantId(tenantId);
- dashboard.setCreatedTime(Uuids.unixTimestamp(dashboardId.getId()));
+ throw new RuntimeException("[{" + tenantId + "}] dashboardUpdateMsg {" + dashboardUpdateMsg + "} cannot be converted to dashboard");
}
- dashboard.setTitle(dashboardUpdateMsg.getTitle());
- dashboard.setImage(dashboardUpdateMsg.hasImage() ? dashboardUpdateMsg.getImage() : null);
- dashboard.setConfiguration(JacksonUtil.toJsonNode(dashboardUpdateMsg.getConfiguration()));
-
Set assignedCustomers = null;
- if (dashboardUpdateMsg.hasAssignedCustomers()) {
- assignedCustomers = JacksonUtil.fromString(dashboardUpdateMsg.getAssignedCustomers(), new TypeReference<>() {});
- assignedCustomers = filterNonExistingCustomers(tenantId, assignedCustomers);
- dashboard.setAssignedCustomers(assignedCustomers);
+ Dashboard dashboardById = dashboardService.findDashboardById(tenantId, dashboardId);
+ if (dashboardById == null) {
+ created = true;
+ dashboard.setId(null);
+ } else {
+ dashboard.setId(dashboardId);
+ assignedCustomers = filterNonExistingCustomers(tenantId, dashboardById.getAssignedCustomers());
}
- dashboard.setMobileOrder(dashboardUpdateMsg.hasMobileOrder() ? dashboardUpdateMsg.getMobileOrder() : null);
- dashboard.setMobileHide(dashboardUpdateMsg.getMobileHide());
-
dashboardValidator.validate(dashboard, Dashboard::getTenantId);
if (created) {
dashboard.setId(dashboardId);
}
+ Set msgAssignedCustomers = filterNonExistingCustomers(tenantId, dashboard.getAssignedCustomers());
+ if (msgAssignedCustomers != null) {
+ if (assignedCustomers == null) {
+ assignedCustomers = msgAssignedCustomers;
+ } else {
+ assignedCustomers.addAll(msgAssignedCustomers);
+ }
+ }
+ dashboard.setAssignedCustomers(assignedCustomers);
Dashboard savedDashboard = dashboardService.saveDashboard(dashboard, false);
- if (assignedCustomers != null && !assignedCustomers.isEmpty()) {
- for (ShortCustomerInfo assignedCustomer : assignedCustomers) {
+ if (msgAssignedCustomers != null && !msgAssignedCustomers.isEmpty()) {
+ for (ShortCustomerInfo assignedCustomer : msgAssignedCustomers) {
if (assignedCustomer.getCustomerId().equals(customerId)) {
- dashboardService.assignDashboardToCustomer(tenantId, dashboardId, assignedCustomer.getCustomerId());
+ dashboardService.assignDashboardToCustomer(tenantId, savedDashboard.getId(), assignedCustomer.getCustomerId());
}
}
} else {
- unassignCustomersFromDashboard(tenantId, savedDashboard);
+ unassignCustomersFromDashboard(tenantId, savedDashboard, customerId);
}
return created;
}
- protected abstract Set filterNonExistingCustomers(TenantId tenantId, Set assignedCustomers);
+ private Dashboard createDashboard(TenantId tenantId, DashboardId dashboardId, DashboardUpdateMsg dashboardUpdateMsg) {
+ Dashboard dashboard = new Dashboard();
+ dashboard.setTenantId(tenantId);
+ dashboard.setCreatedTime(Uuids.unixTimestamp(dashboardId.getId()));
+ dashboard.setTitle(dashboardUpdateMsg.getTitle());
+ dashboard.setImage(dashboardUpdateMsg.hasImage() ? dashboardUpdateMsg.getImage() : null);
+ dashboard.setConfiguration(JacksonUtil.toJsonNode(dashboardUpdateMsg.getConfiguration()));
+
+ Set assignedCustomers;
+ if (dashboardUpdateMsg.hasAssignedCustomers()) {
+ assignedCustomers = JacksonUtil.fromString(dashboardUpdateMsg.getAssignedCustomers(), new TypeReference<>() {});
+ assignedCustomers = filterNonExistingCustomers(tenantId, assignedCustomers);
+ dashboard.setAssignedCustomers(assignedCustomers);
+ }
- private void unassignCustomersFromDashboard(TenantId tenantId, Dashboard dashboard) {
+ dashboard.setMobileOrder(dashboardUpdateMsg.hasMobileOrder() ? dashboardUpdateMsg.getMobileOrder() : null);
+ dashboard.setMobileHide(dashboardUpdateMsg.getMobileHide());
+ return dashboard;
+ }
+
+ private void unassignCustomersFromDashboard(TenantId tenantId, Dashboard dashboard, CustomerId customerId) {
if (dashboard.getAssignedCustomers() != null && !dashboard.getAssignedCustomers().isEmpty()) {
for (ShortCustomerInfo assignedCustomer : dashboard.getAssignedCustomers()) {
- dashboardService.unassignDashboardFromCustomer(tenantId, dashboard.getId(), assignedCustomer.getCustomerId());
+ if (assignedCustomer.getCustomerId().equals(customerId)) {
+ dashboardService.unassignDashboardFromCustomer(tenantId, dashboard.getId(), assignedCustomer.getCustomerId());
+ }
}
}
}
+
+ protected abstract Set filterNonExistingCustomers(TenantId tenantId, Set assignedCustomers);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/DashboardEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/DashboardEdgeProcessor.java
index 291491a2fe..3104e1ac35 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/DashboardEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/DashboardEdgeProcessor.java
@@ -25,7 +25,6 @@ import org.thingsboard.server.common.data.EdgeUtils;
import org.thingsboard.server.common.data.ShortCustomerInfo;
import org.thingsboard.server.common.data.edge.Edge;
import org.thingsboard.server.common.data.edge.EdgeEvent;
-import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.msg.TbMsgType;
@@ -33,8 +32,10 @@ import org.thingsboard.server.common.msg.TbMsgMetaData;
import org.thingsboard.server.dao.exception.DataValidationException;
import org.thingsboard.server.gen.edge.v1.DashboardUpdateMsg;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.dashboard.DashboardMsgConstructor;
import java.util.Set;
import java.util.UUID;
@@ -44,7 +45,7 @@ import java.util.UUID;
@TbCoreComponent
public class DashboardEdgeProcessor extends BaseDashboardProcessor {
- public ListenableFuture processDashboardMsgFromEdge(TenantId tenantId, Edge edge, DashboardUpdateMsg dashboardUpdateMsg) {
+ public ListenableFuture processDashboardMsgFromEdge(TenantId tenantId, Edge edge, DashboardUpdateMsg dashboardUpdateMsg, EdgeVersion edgeVersion) {
log.trace("[{}] executing processDashboardMsgFromEdge [{}] from edge [{}]", tenantId, dashboardUpdateMsg, edge.getId());
DashboardId dashboardId = new DashboardId(new UUID(dashboardUpdateMsg.getIdMSB(), dashboardUpdateMsg.getIdLSB()));
try {
@@ -53,7 +54,7 @@ public class DashboardEdgeProcessor extends BaseDashboardProcessor {
switch (dashboardUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
- saveOrUpdateDashboard(tenantId, dashboardId, dashboardUpdateMsg, edge);
+ saveOrUpdateDashboard(tenantId, dashboardId, dashboardUpdateMsg, edge, edgeVersion);
return Futures.immediateFuture(null);
case ENTITY_DELETED_RPC_MESSAGE:
Dashboard dashboardToDelete = dashboardService.findDashboardById(tenantId, dashboardId);
@@ -77,9 +78,9 @@ public class DashboardEdgeProcessor extends BaseDashboardProcessor {
}
}
- private void saveOrUpdateDashboard(TenantId tenantId, DashboardId dashboardId, DashboardUpdateMsg dashboardUpdateMsg, Edge edge) {
- CustomerId customerId = safeGetCustomerId(dashboardUpdateMsg.getCustomerIdMSB(), dashboardUpdateMsg.getCustomerIdLSB());
- boolean created = super.saveOrUpdateDashboard(tenantId, dashboardId, dashboardUpdateMsg, customerId);
+ private void saveOrUpdateDashboard(TenantId tenantId, DashboardId dashboardId, DashboardUpdateMsg dashboardUpdateMsg, Edge edge, EdgeVersion edgeVersion) {
+ boolean created = super.saveOrUpdateDashboard(tenantId, dashboardId, dashboardUpdateMsg,
+ edge.getCustomerId(), edgeVersion);
if (created) {
createRelationFromEdge(tenantId, edge.getId(), dashboardId);
pushDashboardCreatedEventToRuleEngine(tenantId, edge, dashboardId);
@@ -98,7 +99,7 @@ public class DashboardEdgeProcessor extends BaseDashboardProcessor {
}
}
- public DownlinkMsg convertDashboardEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertDashboardEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
DashboardId dashboardId = new DashboardId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -110,8 +111,8 @@ public class DashboardEdgeProcessor extends BaseDashboardProcessor {
Dashboard dashboard = dashboardService.findDashboardById(edgeEvent.getTenantId(), dashboardId);
if (dashboard != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- DashboardUpdateMsg dashboardUpdateMsg =
- dashboardMsgConstructor.constructDashboardUpdatedMsg(msgType, dashboard);
+ DashboardUpdateMsg dashboardUpdateMsg = ((DashboardMsgConstructor)
+ dashboardMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructDashboardUpdatedMsg(msgType, dashboard);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDashboardUpdateMsg(dashboardUpdateMsg)
@@ -120,8 +121,8 @@ public class DashboardEdgeProcessor extends BaseDashboardProcessor {
break;
case DELETED:
case UNASSIGNED_FROM_EDGE:
- DashboardUpdateMsg dashboardUpdateMsg =
- dashboardMsgConstructor.constructDashboardDeleteMsg(dashboardId);
+ DashboardUpdateMsg dashboardUpdateMsg = ((DashboardMsgConstructor)
+ dashboardMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructDashboardDeleteMsg(dashboardId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDashboardUpdateMsg(dashboardUpdateMsg)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/BaseDeviceProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/BaseDeviceProcessor.java
index 8958db0c44..e2ac06e84b 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/BaseDeviceProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/BaseDeviceProcessor.java
@@ -32,8 +32,10 @@ import org.thingsboard.server.common.data.security.DeviceCredentials;
import org.thingsboard.server.common.data.security.DeviceCredentialsType;
import org.thingsboard.server.gen.edge.v1.DeviceCredentialsUpdateMsg;
import org.thingsboard.server.gen.edge.v1.DeviceUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.queue.util.DataDecodingEncodingService;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.Optional;
import java.util.UUID;
@@ -44,46 +46,35 @@ public abstract class BaseDeviceProcessor extends BaseEdgeProcessor {
@Autowired
protected DataDecodingEncodingService dataDecodingEncodingService;
- protected Pair saveOrUpdateDevice(TenantId tenantId, DeviceId deviceId, DeviceUpdateMsg deviceUpdateMsg, CustomerId customerId) {
+ protected Pair saveOrUpdateDevice(TenantId tenantId, DeviceId deviceId, DeviceUpdateMsg deviceUpdateMsg, EdgeVersion edgeVersion) {
boolean created = false;
boolean deviceNameUpdated = false;
deviceCreationLock.lock();
try {
- Device device = deviceService.findDeviceById(tenantId, deviceId);
- String deviceName = deviceUpdateMsg.getName();
+ Device device = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createDevice(tenantId, deviceId, deviceUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(deviceUpdateMsg.getEntity(), Device.class);
if (device == null) {
+ throw new RuntimeException("[{" + tenantId + "}] deviceUpdateMsg {" + deviceUpdateMsg + "} cannot be converted to device");
+ }
+ Device deviceById = deviceService.findDeviceById(tenantId, deviceId);
+ if (deviceById == null) {
created = true;
- device = new Device();
- device.setTenantId(tenantId);
- device.setCreatedTime(Uuids.unixTimestamp(deviceId.getId()));
+ device.setId(null);
+ } else {
+ device.setId(deviceId);
}
+ String deviceName = device.getName();
Device deviceByName = deviceService.findDeviceByTenantIdAndName(tenantId, deviceName);
if (deviceByName != null && !deviceByName.getId().equals(deviceId)) {
deviceName = deviceName + "_" + StringUtils.randomAlphabetic(15);
log.warn("[{}] Device with name {} already exists. Renaming device name to {}",
- tenantId, deviceUpdateMsg.getName(), deviceName);
+ tenantId, device.getName(), deviceName);
deviceNameUpdated = true;
}
device.setName(deviceName);
- device.setType(deviceUpdateMsg.getType());
- device.setLabel(deviceUpdateMsg.hasLabel() ? deviceUpdateMsg.getLabel() : null);
- device.setAdditionalInfo(deviceUpdateMsg.hasAdditionalInfo()
- ? JacksonUtil.toJsonNode(deviceUpdateMsg.getAdditionalInfo()) : null);
-
- UUID deviceProfileUUID = safeGetUUID(deviceUpdateMsg.getDeviceProfileIdMSB(), deviceUpdateMsg.getDeviceProfileIdLSB());
- device.setDeviceProfileId(deviceProfileUUID != null ? new DeviceProfileId(deviceProfileUUID) : null);
-
- device.setCustomerId(customerId);
+ setCustomerId(tenantId, created ? null : deviceById.getCustomerId(), device, deviceUpdateMsg, edgeVersion);
- Optional deviceDataOpt =
- dataDecodingEncodingService.decode(deviceUpdateMsg.getDeviceDataBytes().toByteArray());
- device.setDeviceData(deviceDataOpt.orElse(null));
-
- UUID firmwareUUID = safeGetUUID(deviceUpdateMsg.getFirmwareIdMSB(), deviceUpdateMsg.getFirmwareIdLSB());
- device.setFirmwareId(firmwareUUID != null ? new OtaPackageId(firmwareUUID) : null);
-
- UUID softwareUUID = safeGetUUID(deviceUpdateMsg.getSoftwareIdMSB(), deviceUpdateMsg.getSoftwareIdLSB());
- device.setSoftwareId(softwareUUID != null ? new OtaPackageId(softwareUUID) : null);
deviceValidator.validate(device, Device::getTenantId);
if (created) {
device.setId(deviceId);
@@ -100,25 +91,53 @@ public abstract class BaseDeviceProcessor extends BaseEdgeProcessor {
} catch (Exception e) {
log.error("[{}] Failed to process device update msg [{}]", tenantId, deviceUpdateMsg, e);
throw e;
- } finally {
+ } finally {
deviceCreationLock.unlock();
}
return Pair.of(created, deviceNameUpdated);
}
- protected void updateDeviceCredentials(TenantId tenantId, DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg) {
- DeviceId deviceId = new DeviceId(new UUID(deviceCredentialsUpdateMsg.getDeviceIdMSB(), deviceCredentialsUpdateMsg.getDeviceIdLSB()));
- Device device = deviceService.findDeviceById(tenantId, deviceId);
+ private Device createDevice(TenantId tenantId, DeviceId deviceId, DeviceUpdateMsg deviceUpdateMsg) {
+ Device device = new Device();
+ device.setTenantId(tenantId);
+ device.setCreatedTime(Uuids.unixTimestamp(deviceId.getId()));
+ device.setName(deviceUpdateMsg.getName());
+ device.setType(deviceUpdateMsg.getType());
+ device.setLabel(deviceUpdateMsg.hasLabel() ? deviceUpdateMsg.getLabel() : null);
+ device.setAdditionalInfo(deviceUpdateMsg.hasAdditionalInfo()
+ ? JacksonUtil.toJsonNode(deviceUpdateMsg.getAdditionalInfo()) : null);
+
+ UUID deviceProfileUUID = safeGetUUID(deviceUpdateMsg.getDeviceProfileIdMSB(), deviceUpdateMsg.getDeviceProfileIdLSB());
+ device.setDeviceProfileId(deviceProfileUUID != null ? new DeviceProfileId(deviceProfileUUID) : null);
+
+ Optional deviceDataOpt = dataDecodingEncodingService.decode(deviceUpdateMsg.getDeviceDataBytes().toByteArray());
+ device.setDeviceData(deviceDataOpt.orElse(null));
+
+ UUID firmwareUUID = safeGetUUID(deviceUpdateMsg.getFirmwareIdMSB(), deviceUpdateMsg.getFirmwareIdLSB());
+ device.setFirmwareId(firmwareUUID != null ? new OtaPackageId(firmwareUUID) : null);
+ UUID softwareUUID = safeGetUUID(deviceUpdateMsg.getSoftwareIdMSB(), deviceUpdateMsg.getSoftwareIdLSB());
+ device.setSoftwareId(softwareUUID != null ? new OtaPackageId(softwareUUID) : null);
+
+ return device;
+ }
+
+ protected void updateDeviceCredentials(TenantId tenantId, DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg, EdgeVersion edgeVersion) {
+ DeviceCredentials deviceCredentials = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createDeviceCredentials(deviceCredentialsUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(deviceCredentialsUpdateMsg.getEntity(), DeviceCredentials.class);
+ if (deviceCredentials == null) {
+ throw new RuntimeException("[{" + tenantId + "}] deviceCredentialsUpdateMsg {" + deviceCredentialsUpdateMsg + "} cannot be converted to device credentials");
+ }
+ Device device = deviceService.findDeviceById(tenantId, deviceCredentials.getDeviceId());
if (device != null) {
log.debug("[{}] Updating device credentials for device [{}]. New device credentials Id [{}], value [{}]",
- tenantId, device.getName(), deviceCredentialsUpdateMsg.getCredentialsId(), deviceCredentialsUpdateMsg.getCredentialsValue());
+ tenantId, device.getName(), deviceCredentials.getCredentialsId(), deviceCredentials.getCredentialsValue());
try {
- DeviceCredentials deviceCredentials = deviceCredentialsService.findDeviceCredentialsByDeviceId(tenantId, device.getId());
- deviceCredentials.setCredentialsType(DeviceCredentialsType.valueOf(deviceCredentialsUpdateMsg.getCredentialsType()));
- deviceCredentials.setCredentialsId(deviceCredentialsUpdateMsg.getCredentialsId());
- deviceCredentials.setCredentialsValue(deviceCredentialsUpdateMsg.hasCredentialsValue()
- ? deviceCredentialsUpdateMsg.getCredentialsValue() : null);
- deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentials);
+ DeviceCredentials deviceCredentialsByDeviceId = deviceCredentialsService.findDeviceCredentialsByDeviceId(tenantId, device.getId());
+ deviceCredentialsByDeviceId.setCredentialsType(deviceCredentials.getCredentialsType());
+ deviceCredentialsByDeviceId.setCredentialsId(deviceCredentials.getCredentialsId());
+ deviceCredentialsByDeviceId.setCredentialsValue(deviceCredentials.getCredentialsValue());
+ deviceCredentialsService.updateDeviceCredentials(tenantId, deviceCredentialsByDeviceId);
} catch (Exception e) {
log.error("[{}] Can't update device credentials for device [{}], deviceCredentialsUpdateMsg [{}]",
@@ -126,7 +145,19 @@ public abstract class BaseDeviceProcessor extends BaseEdgeProcessor {
throw new RuntimeException(e);
}
} else {
- log.warn("[{}] Can't find device by id [{}], deviceCredentialsUpdateMsg [{}]", tenantId, deviceId, deviceCredentialsUpdateMsg);
+ log.warn("[{}] Can't find device by id [{}], deviceCredentialsUpdateMsg [{}]", tenantId, deviceCredentials.getDeviceId(), deviceCredentialsUpdateMsg);
}
}
+
+ private DeviceCredentials createDeviceCredentials(DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg) {
+ DeviceCredentials deviceCredentials = new DeviceCredentials();
+ deviceCredentials.setDeviceId(new DeviceId(new UUID(deviceCredentialsUpdateMsg.getDeviceIdMSB(), deviceCredentialsUpdateMsg.getDeviceIdLSB())));
+ deviceCredentials.setCredentialsType(DeviceCredentialsType.valueOf(deviceCredentialsUpdateMsg.getCredentialsType()));
+ deviceCredentials.setCredentialsId(deviceCredentialsUpdateMsg.getCredentialsId());
+ deviceCredentials.setCredentialsValue(deviceCredentialsUpdateMsg.hasCredentialsValue()
+ ? deviceCredentialsUpdateMsg.getCredentialsValue() : null);
+ return deviceCredentials;
+ }
+
+ protected abstract void setCustomerId(TenantId tenantId, CustomerId customerId, Device device, DeviceUpdateMsg deviceUpdateMsg, EdgeVersion edgeVersion);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/BaseDeviceProfileProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/BaseDeviceProfileProcessor.java
index bd35a42e59..55153a7a79 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/BaseDeviceProfileProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/BaseDeviceProfileProcessor.java
@@ -19,18 +19,23 @@ import com.datastax.oss.driver.api.core.uuid.Uuids;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.util.Pair;
+import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.DeviceProfileProvisionType;
import org.thingsboard.server.common.data.DeviceProfileType;
import org.thingsboard.server.common.data.DeviceTransportType;
import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.device.profile.DeviceProfileData;
+import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.DeviceProfileId;
import org.thingsboard.server.common.data.id.OtaPackageId;
+import org.thingsboard.server.common.data.id.RuleChainId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.gen.edge.v1.DeviceProfileUpdateMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.queue.util.DataDecodingEncodingService;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.nio.charset.StandardCharsets;
import java.util.Optional;
@@ -42,74 +47,95 @@ public abstract class BaseDeviceProfileProcessor extends BaseEdgeProcessor {
@Autowired
private DataDecodingEncodingService dataDecodingEncodingService;
- protected Pair saveOrUpdateDeviceProfile(TenantId tenantId, DeviceProfileId deviceProfileId, DeviceProfileUpdateMsg deviceProfileUpdateMsg) {
+ protected Pair saveOrUpdateDeviceProfile(TenantId tenantId, DeviceProfileId deviceProfileId, DeviceProfileUpdateMsg deviceProfileUpdateMsg, EdgeVersion edgeVersion) {
boolean created = false;
boolean deviceProfileNameUpdated = false;
deviceCreationLock.lock();
try {
- DeviceProfile deviceProfile = deviceProfileService.findDeviceProfileById(tenantId, deviceProfileId);
- String deviceProfileName = deviceProfileUpdateMsg.getName();
+ DeviceProfile deviceProfile = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createDeviceProfile(tenantId, deviceProfileId, deviceProfileUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(deviceProfileUpdateMsg.getEntity(), DeviceProfile.class);
if (deviceProfile == null) {
+ throw new RuntimeException("[{" + tenantId + "}] deviceProfileUpdateMsg {" + deviceProfileUpdateMsg + "} cannot be converted to device profile");
+ }
+ boolean isDefault = deviceProfile.isDefault();
+ DeviceProfile deviceProfileById = deviceProfileService.findDeviceProfileById(tenantId, deviceProfileId);
+ if (deviceProfileById == null) {
created = true;
- deviceProfile = new DeviceProfile();
- deviceProfile.setTenantId(tenantId);
- deviceProfile.setCreatedTime(Uuids.unixTimestamp(deviceProfileId.getId()));
+ deviceProfile.setId(null);
+ } else {
+ deviceProfile.setId(deviceProfileId);
}
+ String deviceProfileName = deviceProfile.getName();
DeviceProfile deviceProfileByName = deviceProfileService.findDeviceProfileByName(tenantId, deviceProfileName);
if (deviceProfileByName != null && !deviceProfileByName.getId().equals(deviceProfileId)) {
deviceProfileName = deviceProfileName + "_" + StringUtils.randomAlphabetic(15);
log.warn("[{}] Device profile with name {} already exists. Renaming device profile name to {}",
- tenantId, deviceProfileUpdateMsg.getName(), deviceProfileName);
+ tenantId, deviceProfile.getName(), deviceProfileName);
deviceProfileNameUpdated = true;
}
+ deviceProfile.setDefault(false);
deviceProfile.setName(deviceProfileName);
- deviceProfile.setDescription(deviceProfileUpdateMsg.hasDescription() ? deviceProfileUpdateMsg.getDescription() : null);
- deviceProfile.setType(DeviceProfileType.valueOf(deviceProfileUpdateMsg.getType()));
- deviceProfile.setTransportType(deviceProfileUpdateMsg.hasTransportType()
- ? DeviceTransportType.valueOf(deviceProfileUpdateMsg.getTransportType()) : DeviceTransportType.DEFAULT);
- deviceProfile.setImage(deviceProfileUpdateMsg.hasImage()
- ? new String(deviceProfileUpdateMsg.getImage().toByteArray(), StandardCharsets.UTF_8) : null);
- deviceProfile.setProvisionType(deviceProfileUpdateMsg.hasProvisionType()
- ? DeviceProfileProvisionType.valueOf(deviceProfileUpdateMsg.getProvisionType()) : DeviceProfileProvisionType.DISABLED);
- deviceProfile.setProvisionDeviceKey(deviceProfileUpdateMsg.hasProvisionDeviceKey()
- ? deviceProfileUpdateMsg.getProvisionDeviceKey() : null);
- deviceProfile.setDefaultQueueName(deviceProfileUpdateMsg.getDefaultQueueName());
-
- Optional profileDataOpt =
- dataDecodingEncodingService.decode(deviceProfileUpdateMsg.getProfileDataBytes().toByteArray());
- deviceProfile.setProfileData(profileDataOpt.orElse(null));
-
- setDefaultRuleChainId(tenantId, deviceProfile, deviceProfileUpdateMsg);
- setDefaultEdgeRuleChainId(tenantId, deviceProfile, deviceProfileUpdateMsg);
- setDefaultDashboardId(tenantId, deviceProfile, deviceProfileUpdateMsg);
- String defaultQueueName = StringUtils.isNotBlank(deviceProfileUpdateMsg.getDefaultQueueName())
- ? deviceProfileUpdateMsg.getDefaultQueueName() : null;
- deviceProfile.setDefaultQueueName(defaultQueueName);
-
- UUID firmwareUUID = safeGetUUID(deviceProfileUpdateMsg.getFirmwareIdMSB(), deviceProfileUpdateMsg.getFirmwareIdLSB());
- deviceProfile.setFirmwareId(firmwareUUID != null ? new OtaPackageId(firmwareUUID) : null);
-
- UUID softwareUUID = safeGetUUID(deviceProfileUpdateMsg.getSoftwareIdMSB(), deviceProfileUpdateMsg.getSoftwareIdLSB());
- deviceProfile.setSoftwareId(softwareUUID != null ? new OtaPackageId(softwareUUID) : null);
+ RuleChainId ruleChainId = deviceProfile.getDefaultRuleChainId();
+ setDefaultRuleChainId(tenantId, deviceProfile, created ? null : deviceProfileById.getDefaultRuleChainId());
+ setDefaultEdgeRuleChainId(deviceProfile, ruleChainId, deviceProfileUpdateMsg, edgeVersion);
+ setDefaultDashboardId(tenantId, created ? null : deviceProfileById.getDefaultDashboardId(), deviceProfile, deviceProfileUpdateMsg, edgeVersion);
deviceProfileValidator.validate(deviceProfile, DeviceProfile::getTenantId);
if (created) {
deviceProfile.setId(deviceProfileId);
}
deviceProfileService.saveDeviceProfile(deviceProfile, false);
+ if (isDefault) {
+ deviceProfileService.setDefaultDeviceProfile(tenantId, deviceProfileId);
+ }
} catch (Exception e) {
log.error("[{}] Failed to process device profile update msg [{}]", tenantId, deviceProfileUpdateMsg, e);
throw e;
- } finally {
+ } finally {
deviceCreationLock.unlock();
}
return Pair.of(created, deviceProfileNameUpdated);
}
- protected abstract void setDefaultRuleChainId(TenantId tenantId, DeviceProfile deviceProfile, DeviceProfileUpdateMsg deviceProfileUpdateMsg);
+ private DeviceProfile createDeviceProfile(TenantId tenantId, DeviceProfileId deviceProfileId, DeviceProfileUpdateMsg deviceProfileUpdateMsg) {
+ DeviceProfile deviceProfile = new DeviceProfile();
+ deviceProfile.setTenantId(tenantId);
+ deviceProfile.setCreatedTime(Uuids.unixTimestamp(deviceProfileId.getId()));
+ deviceProfile.setName(deviceProfileUpdateMsg.getName());
+ deviceProfile.setDefault(deviceProfileUpdateMsg.getDefault());
+ deviceProfile.setDescription(deviceProfileUpdateMsg.hasDescription() ? deviceProfileUpdateMsg.getDescription() : null);
+ deviceProfile.setType(DeviceProfileType.valueOf(deviceProfileUpdateMsg.getType()));
+ deviceProfile.setTransportType(deviceProfileUpdateMsg.hasTransportType()
+ ? DeviceTransportType.valueOf(deviceProfileUpdateMsg.getTransportType()) : DeviceTransportType.DEFAULT);
+ deviceProfile.setImage(deviceProfileUpdateMsg.hasImage()
+ ? new String(deviceProfileUpdateMsg.getImage().toByteArray(), StandardCharsets.UTF_8) : null);
+ deviceProfile.setProvisionType(deviceProfileUpdateMsg.hasProvisionType()
+ ? DeviceProfileProvisionType.valueOf(deviceProfileUpdateMsg.getProvisionType()) : DeviceProfileProvisionType.DISABLED);
+ deviceProfile.setProvisionDeviceKey(deviceProfileUpdateMsg.hasProvisionDeviceKey()
+ ? deviceProfileUpdateMsg.getProvisionDeviceKey() : null);
+ deviceProfile.setDefaultQueueName(deviceProfileUpdateMsg.getDefaultQueueName());
+
+ Optional profileDataOpt =
+ dataDecodingEncodingService.decode(deviceProfileUpdateMsg.getProfileDataBytes().toByteArray());
+ deviceProfile.setProfileData(profileDataOpt.orElse(null));
+
+ String defaultQueueName = StringUtils.isNotBlank(deviceProfileUpdateMsg.getDefaultQueueName())
+ ? deviceProfileUpdateMsg.getDefaultQueueName() : null;
+ deviceProfile.setDefaultQueueName(defaultQueueName);
+
+ UUID firmwareUUID = safeGetUUID(deviceProfileUpdateMsg.getFirmwareIdMSB(), deviceProfileUpdateMsg.getFirmwareIdLSB());
+ deviceProfile.setFirmwareId(firmwareUUID != null ? new OtaPackageId(firmwareUUID) : null);
+
+ UUID softwareUUID = safeGetUUID(deviceProfileUpdateMsg.getSoftwareIdMSB(), deviceProfileUpdateMsg.getSoftwareIdLSB());
+ deviceProfile.setSoftwareId(softwareUUID != null ? new OtaPackageId(softwareUUID) : null);
+ return deviceProfile;
+ }
+
+ protected abstract void setDefaultRuleChainId(TenantId tenantId, DeviceProfile deviceProfile, RuleChainId ruleChainId);
- protected abstract void setDefaultEdgeRuleChainId(TenantId tenantId, DeviceProfile deviceProfile, DeviceProfileUpdateMsg deviceProfileUpdateMsg);
+ protected abstract void setDefaultEdgeRuleChainId(DeviceProfile deviceProfile, RuleChainId ruleChainId, DeviceProfileUpdateMsg deviceProfileUpdateMsg, EdgeVersion edgeVersion);
- protected abstract void setDefaultDashboardId(TenantId tenantId, DeviceProfile deviceProfile, DeviceProfileUpdateMsg deviceProfileUpdateMsg);
+ protected abstract void setDefaultDashboardId(TenantId tenantId, DashboardId dashboardId, DeviceProfile deviceProfile, DeviceProfileUpdateMsg deviceProfileUpdateMsg, EdgeVersion edgeVersion);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/DeviceEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/DeviceEdgeProcessor.java
index 910be10240..b65ef58e1d 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/DeviceEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/DeviceEdgeProcessor.java
@@ -43,6 +43,7 @@ import org.thingsboard.server.common.msg.TbMsg;
import org.thingsboard.server.common.msg.TbMsgDataType;
import org.thingsboard.server.common.msg.TbMsgMetaData;
import org.thingsboard.server.common.msg.rpc.FromDeviceRpcResponse;
+import org.thingsboard.server.common.msg.rpc.FromDeviceRpcResponseActorMsg;
import org.thingsboard.server.dao.exception.DataValidationException;
import org.thingsboard.server.gen.edge.v1.DeviceCredentialsRequestMsg;
import org.thingsboard.server.gen.edge.v1.DeviceCredentialsUpdateMsg;
@@ -54,7 +55,8 @@ import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.TbQueueCallback;
import org.thingsboard.server.queue.TbQueueMsgMetadata;
import org.thingsboard.server.queue.util.TbCoreComponent;
-import org.thingsboard.server.common.msg.rpc.FromDeviceRpcResponseActorMsg;
+import org.thingsboard.server.service.edge.rpc.constructor.device.DeviceMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@@ -63,7 +65,7 @@ import java.util.UUID;
@TbCoreComponent
public class DeviceEdgeProcessor extends BaseDeviceProcessor {
- public ListenableFuture processDeviceMsgFromEdge(TenantId tenantId, Edge edge, DeviceUpdateMsg deviceUpdateMsg) {
+ public ListenableFuture processDeviceMsgFromEdge(TenantId tenantId, Edge edge, DeviceUpdateMsg deviceUpdateMsg, EdgeVersion edgeVersion) {
log.trace("[{}] executing processDeviceMsgFromEdge [{}] from edge [{}]", tenantId, deviceUpdateMsg, edge.getId());
DeviceId deviceId = new DeviceId(new UUID(deviceUpdateMsg.getIdMSB(), deviceUpdateMsg.getIdLSB()));
try {
@@ -72,7 +74,7 @@ public class DeviceEdgeProcessor extends BaseDeviceProcessor {
switch (deviceUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
- saveOrUpdateDevice(tenantId, deviceId, deviceUpdateMsg, edge);
+ saveOrUpdateDevice(tenantId, deviceId, deviceUpdateMsg, edge, edgeVersion);
return saveEdgeEvent(tenantId, edge.getId(), EdgeEventType.DEVICE, EdgeEventActionType.CREDENTIALS_REQUEST, deviceId, null);
case ENTITY_DELETED_RPC_MESSAGE:
Device deviceToDelete = deviceService.findDeviceById(tenantId, deviceId);
@@ -96,21 +98,20 @@ public class DeviceEdgeProcessor extends BaseDeviceProcessor {
}
}
- public ListenableFuture processDeviceCredentialsMsgFromEdge(TenantId tenantId, EdgeId edgeId, DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg) {
+ public ListenableFuture processDeviceCredentialsMsgFromEdge(TenantId tenantId, EdgeId edgeId, DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg, EdgeVersion edgeVersion) {
log.debug("[{}] Executing processDeviceCredentialsMsgFromEdge, deviceCredentialsUpdateMsg [{}]", tenantId, deviceCredentialsUpdateMsg);
try {
edgeSynchronizationManager.getEdgeId().set(edgeId);
- updateDeviceCredentials(tenantId, deviceCredentialsUpdateMsg);
+ updateDeviceCredentials(tenantId, deviceCredentialsUpdateMsg, edgeVersion);
} finally {
edgeSynchronizationManager.getEdgeId().remove();
}
return Futures.immediateFuture(null);
}
- private void saveOrUpdateDevice(TenantId tenantId, DeviceId deviceId, DeviceUpdateMsg deviceUpdateMsg, Edge edge) {
- CustomerId customerId = safeGetCustomerId(deviceUpdateMsg.getCustomerIdMSB(), deviceUpdateMsg.getCustomerIdLSB());
- Pair resultPair = super.saveOrUpdateDevice(tenantId, deviceId, deviceUpdateMsg, customerId);
+ private void saveOrUpdateDevice(TenantId tenantId, DeviceId deviceId, DeviceUpdateMsg deviceUpdateMsg, Edge edge, EdgeVersion edgeVersion) {
+ Pair resultPair = super.saveOrUpdateDevice(tenantId, deviceId, deviceUpdateMsg, edgeVersion);
Boolean created = resultPair.getFirst();
if (created) {
createRelationFromEdge(tenantId, edge.getId(), deviceId);
@@ -227,23 +228,26 @@ public class DeviceEdgeProcessor extends BaseDeviceProcessor {
Device device = deviceService.findDeviceById(edgeEvent.getTenantId(), deviceId);
if (device != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- DeviceUpdateMsg deviceUpdateMsg =
- deviceMsgConstructor.constructDeviceUpdatedMsg(msgType, device);
+ DeviceUpdateMsg deviceUpdateMsg = ((DeviceMsgConstructor)
+ deviceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructDeviceUpdatedMsg(msgType, device);
DownlinkMsg.Builder builder = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDeviceUpdateMsg(deviceUpdateMsg);
if (UpdateMsgType.ENTITY_CREATED_RPC_MESSAGE.equals(msgType)) {
DeviceProfile deviceProfile = deviceProfileService.findDeviceProfileById(edgeEvent.getTenantId(), device.getDeviceProfileId());
deviceProfile = checkIfDeviceProfileDefaultFieldsAssignedToEdge(edgeEvent.getTenantId(), edgeId, deviceProfile, edgeVersion);
- builder.addDeviceProfileUpdateMsg(deviceProfileMsgConstructor.constructDeviceProfileUpdatedMsg(msgType, deviceProfile));
+ builder.addDeviceProfileUpdateMsg(((DeviceMsgConstructor)
+ deviceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructDeviceProfileUpdatedMsg(msgType, deviceProfile));
}
downlinkMsg = builder.build();
}
break;
case DELETED:
case UNASSIGNED_FROM_EDGE:
- DeviceUpdateMsg deviceUpdateMsg =
- deviceMsgConstructor.constructDeviceDeleteMsg(deviceId);
+ DeviceUpdateMsg deviceUpdateMsg = ((DeviceMsgConstructor)
+ deviceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructDeviceDeleteMsg(deviceId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDeviceUpdateMsg(deviceUpdateMsg)
@@ -252,8 +256,8 @@ public class DeviceEdgeProcessor extends BaseDeviceProcessor {
case CREDENTIALS_UPDATED:
DeviceCredentials deviceCredentials = deviceCredentialsService.findDeviceCredentialsByDeviceId(edgeEvent.getTenantId(), deviceId);
if (deviceCredentials != null) {
- DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg =
- deviceMsgConstructor.constructDeviceCredentialsUpdatedMsg(deviceCredentials);
+ DeviceCredentialsUpdateMsg deviceCredentialsUpdateMsg = ((DeviceMsgConstructor)
+ deviceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructDeviceCredentialsUpdatedMsg(deviceCredentials);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDeviceCredentialsUpdateMsg(deviceCredentialsUpdateMsg)
@@ -261,20 +265,18 @@ public class DeviceEdgeProcessor extends BaseDeviceProcessor {
}
break;
case RPC_CALL:
- return convertRpcCallEventToDownlink(edgeEvent);
+ return DownlinkMsg.newBuilder()
+ .setDownlinkMsgId(EdgeUtils.nextPositiveInt())
+ .addDeviceRpcCallMsg(((DeviceMsgConstructor)
+ deviceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructDeviceRpcCallMsg(edgeEvent.getEntityId(), edgeEvent.getBody()))
+ .build();
case CREDENTIALS_REQUEST:
return convertCredentialsRequestEventToDownlink(edgeEvent);
}
return downlinkMsg;
}
- private DownlinkMsg convertRpcCallEventToDownlink(EdgeEvent edgeEvent) {
- return DownlinkMsg.newBuilder()
- .setDownlinkMsgId(EdgeUtils.nextPositiveInt())
- .addDeviceRpcCallMsg(deviceMsgConstructor.constructDeviceRpcCallMsg(edgeEvent.getEntityId(), edgeEvent.getBody()))
- .build();
- }
-
private DownlinkMsg convertCredentialsRequestEventToDownlink(EdgeEvent edgeEvent) {
DeviceId deviceId = new DeviceId(edgeEvent.getEntityId());
DeviceCredentialsRequestMsg deviceCredentialsRequestMsg = DeviceCredentialsRequestMsg.newBuilder()
@@ -286,4 +288,12 @@ public class DeviceEdgeProcessor extends BaseDeviceProcessor {
.addDeviceCredentialsRequestMsg(deviceCredentialsRequestMsg);
return builder.build();
}
+
+ @Override
+ protected void setCustomerId(TenantId tenantId, CustomerId customerId, Device device, DeviceUpdateMsg deviceUpdateMsg, EdgeVersion edgeVersion) {
+ CustomerId customerUUID = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? safeGetCustomerId(deviceUpdateMsg.getCustomerIdMSB(), deviceUpdateMsg.getCustomerIdLSB())
+ : device.getCustomerId() != null ? device.getCustomerId() : customerId;
+ device.setCustomerId(customerUUID);
+ }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/DeviceProfileEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/DeviceProfileEdgeProcessor.java
index 3ed75bdb41..c4105f9668 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/DeviceProfileEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/device/DeviceProfileEdgeProcessor.java
@@ -40,6 +40,8 @@ import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.device.DeviceMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@@ -48,7 +50,7 @@ import java.util.UUID;
@TbCoreComponent
public class DeviceProfileEdgeProcessor extends BaseDeviceProfileProcessor {
- public ListenableFuture processDeviceProfileMsgFromEdge(TenantId tenantId, Edge edge, DeviceProfileUpdateMsg deviceProfileUpdateMsg) {
+ public ListenableFuture processDeviceProfileMsgFromEdge(TenantId tenantId, Edge edge, DeviceProfileUpdateMsg deviceProfileUpdateMsg, EdgeVersion edgeVersion) {
log.trace("[{}] executing processDeviceProfileMsgFromEdge [{}] from edge [{}]", tenantId, deviceProfileUpdateMsg, edge.getId());
DeviceProfileId deviceProfileId = new DeviceProfileId(new UUID(deviceProfileUpdateMsg.getIdMSB(), deviceProfileUpdateMsg.getIdLSB()));
try {
@@ -57,7 +59,7 @@ public class DeviceProfileEdgeProcessor extends BaseDeviceProfileProcessor {
switch (deviceProfileUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
- saveOrUpdateDeviceProfile(tenantId, deviceProfileId, deviceProfileUpdateMsg, edge);
+ saveOrUpdateDeviceProfile(tenantId, deviceProfileId, deviceProfileUpdateMsg, edge, edgeVersion);
return Futures.immediateFuture(null);
case ENTITY_DELETED_RPC_MESSAGE:
case UNRECOGNIZED:
@@ -72,8 +74,8 @@ public class DeviceProfileEdgeProcessor extends BaseDeviceProfileProcessor {
}
}
- private void saveOrUpdateDeviceProfile(TenantId tenantId, DeviceProfileId deviceProfileId, DeviceProfileUpdateMsg deviceProfileUpdateMsg, Edge edge) {
- Pair resultPair = super.saveOrUpdateDeviceProfile(tenantId, deviceProfileId, deviceProfileUpdateMsg);
+ private void saveOrUpdateDeviceProfile(TenantId tenantId, DeviceProfileId deviceProfileId, DeviceProfileUpdateMsg deviceProfileUpdateMsg, Edge edge, EdgeVersion edgeVersion) {
+ Pair resultPair = super.saveOrUpdateDeviceProfile(tenantId, deviceProfileId, deviceProfileUpdateMsg, edgeVersion);
Boolean created = resultPair.getFirst();
if (created) {
createRelationFromEdge(tenantId, edge.getId(), deviceProfileId);
@@ -106,8 +108,8 @@ public class DeviceProfileEdgeProcessor extends BaseDeviceProfileProcessor {
if (deviceProfile != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
deviceProfile = checkIfDeviceProfileDefaultFieldsAssignedToEdge(edgeEvent.getTenantId(), edgeId, deviceProfile, edgeVersion);
- DeviceProfileUpdateMsg deviceProfileUpdateMsg =
- deviceProfileMsgConstructor.constructDeviceProfileUpdatedMsg(msgType, deviceProfile);
+ DeviceProfileUpdateMsg deviceProfileUpdateMsg = ((DeviceMsgConstructor)
+ deviceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructDeviceProfileUpdatedMsg(msgType, deviceProfile);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDeviceProfileUpdateMsg(deviceProfileUpdateMsg)
@@ -115,8 +117,8 @@ public class DeviceProfileEdgeProcessor extends BaseDeviceProfileProcessor {
}
break;
case DELETED:
- DeviceProfileUpdateMsg deviceProfileUpdateMsg =
- deviceProfileMsgConstructor.constructDeviceProfileDeleteMsg(deviceProfileId);
+ DeviceProfileUpdateMsg deviceProfileUpdateMsg = ((DeviceMsgConstructor)
+ deviceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructDeviceProfileDeleteMsg(deviceProfileId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDeviceProfileUpdateMsg(deviceProfileUpdateMsg)
@@ -127,19 +129,23 @@ public class DeviceProfileEdgeProcessor extends BaseDeviceProfileProcessor {
}
@Override
- protected void setDefaultRuleChainId(TenantId tenantId, DeviceProfile deviceProfile, DeviceProfileUpdateMsg deviceProfileUpdateMsg) {
- // do nothing on cloud
+ protected void setDefaultRuleChainId(TenantId tenantId, DeviceProfile deviceProfile, RuleChainId ruleChainId) {
+ deviceProfile.setDefaultRuleChainId(ruleChainId);
}
@Override
- protected void setDefaultEdgeRuleChainId(TenantId tenantId, DeviceProfile deviceProfile, DeviceProfileUpdateMsg deviceProfileUpdateMsg) {
- UUID defaultEdgeRuleChainUUID = safeGetUUID(deviceProfileUpdateMsg.getDefaultRuleChainIdMSB(), deviceProfileUpdateMsg.getDefaultRuleChainIdLSB());
+ protected void setDefaultEdgeRuleChainId(DeviceProfile deviceProfile, RuleChainId ruleChainId, DeviceProfileUpdateMsg deviceProfileUpdateMsg, EdgeVersion edgeVersion) {
+ UUID defaultEdgeRuleChainUUID = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? safeGetUUID(deviceProfileUpdateMsg.getDefaultRuleChainIdMSB(), deviceProfileUpdateMsg.getDefaultRuleChainIdLSB())
+ : ruleChainId != null ? ruleChainId.getId() : null;
deviceProfile.setDefaultEdgeRuleChainId(defaultEdgeRuleChainUUID != null ? new RuleChainId(defaultEdgeRuleChainUUID) : null);
}
@Override
- protected void setDefaultDashboardId(TenantId tenantId, DeviceProfile deviceProfile, DeviceProfileUpdateMsg deviceProfileUpdateMsg) {
- UUID defaultDashboardUUID = safeGetUUID(deviceProfileUpdateMsg.getDefaultDashboardIdMSB(), deviceProfileUpdateMsg.getDefaultDashboardIdLSB());
+ protected void setDefaultDashboardId(TenantId tenantId, DashboardId dashboardId, DeviceProfile deviceProfile, DeviceProfileUpdateMsg deviceProfileUpdateMsg, EdgeVersion edgeVersion) {
+ UUID defaultDashboardUUID = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? safeGetUUID(deviceProfileUpdateMsg.getDefaultDashboardIdMSB(), deviceProfileUpdateMsg.getDefaultDashboardIdLSB())
+ : deviceProfile.getDefaultDashboardId() != null ? deviceProfile.getDefaultDashboardId().getId() : (dashboardId != null ? dashboardId.getId() : null);
deviceProfile.setDefaultDashboardId(defaultDashboardUUID != null ? new DashboardId(defaultDashboardUUID) : null);
}
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/BaseEntityViewProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/BaseEntityViewProcessor.java
index cca0057707..723f3e0e2f 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/BaseEntityViewProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/BaseEntityViewProcessor.java
@@ -27,50 +27,72 @@ import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.EntityViewId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.gen.edge.v1.EdgeEntityType;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.EntityViewUpdateMsg;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@Slf4j
public abstract class BaseEntityViewProcessor extends BaseEdgeProcessor {
- protected Pair saveOrUpdateEntityView(TenantId tenantId, EntityViewId entityViewId, EntityViewUpdateMsg entityViewUpdateMsg, CustomerId customerId) {
+ protected Pair saveOrUpdateEntityView(TenantId tenantId, EntityViewId entityViewId, EntityViewUpdateMsg entityViewUpdateMsg, EdgeVersion edgeVersion) {
boolean created = false;
boolean entityViewNameUpdated = false;
- EntityView entityView = entityViewService.findEntityViewById(tenantId, entityViewId);
- String entityViewName = entityViewUpdateMsg.getName();
+ EntityView entityView = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createEntityView(tenantId, entityViewId, entityViewUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(entityViewUpdateMsg.getEntity(), EntityView.class);
if (entityView == null) {
+ throw new RuntimeException("[{" + tenantId + "}] entityViewUpdateMsg {" + entityViewUpdateMsg + "} cannot be converted to entity view");
+ }
+ EntityView entityViewById = entityViewService.findEntityViewById(tenantId, entityViewId);
+ if (entityViewById == null) {
created = true;
- entityView = new EntityView();
- entityView.setTenantId(tenantId);
- entityView.setCreatedTime(Uuids.unixTimestamp(entityViewId.getId()));
+ entityView.setId(null);
+ } else {
+ entityView.setId(entityViewId);
}
+ String entityViewName = entityView.getName();
EntityView entityViewByName = entityViewService.findEntityViewByTenantIdAndName(tenantId, entityViewName);
if (entityViewByName != null && !entityViewByName.getId().equals(entityViewId)) {
entityViewName = entityViewName + "_" + StringUtils.randomAlphanumeric(15);
log.warn("[{}] Entity view with name {} already exists. Renaming entity view name to {}",
- tenantId, entityViewUpdateMsg.getName(), entityViewName);
+ tenantId, entityView.getName(), entityViewName);
entityViewNameUpdated = true;
}
entityView.setName(entityViewName);
+ setCustomerId(tenantId, created ? null : entityViewById.getCustomerId(), entityView, entityViewUpdateMsg, edgeVersion);
+
+ entityViewValidator.validate(entityView, EntityView::getTenantId);
+ if (created) {
+ entityView.setId(entityViewId);
+ }
+ entityViewService.saveEntityView(entityView, false);
+ return Pair.of(created, entityViewNameUpdated);
+ }
+
+ private EntityView createEntityView(TenantId tenantId, EntityViewId entityViewId, EntityViewUpdateMsg entityViewUpdateMsg) {
+ EntityView entityView = new EntityView();
+ entityView.setTenantId(tenantId);
+ entityView.setCreatedTime(Uuids.unixTimestamp(entityViewId.getId()));
+ entityView.setName(entityViewUpdateMsg.getName());
entityView.setType(entityViewUpdateMsg.getType());
- entityView.setCustomerId(customerId);
+
entityView.setAdditionalInfo(entityViewUpdateMsg.hasAdditionalInfo() ?
JacksonUtil.toJsonNode(entityViewUpdateMsg.getAdditionalInfo()) : null);
+ CustomerId customerId = safeGetCustomerId(entityViewUpdateMsg.getCustomerIdMSB(), entityViewUpdateMsg.getCustomerIdLSB());
+ entityView.setCustomerId(customerId);
+
UUID entityIdUUID = safeGetUUID(entityViewUpdateMsg.getEntityIdMSB(), entityViewUpdateMsg.getEntityIdLSB());
if (EdgeEntityType.DEVICE.equals(entityViewUpdateMsg.getEntityType())) {
entityView.setEntityId(entityIdUUID != null ? new DeviceId(entityIdUUID) : null);
} else if (EdgeEntityType.ASSET.equals(entityViewUpdateMsg.getEntityType())) {
entityView.setEntityId(entityIdUUID != null ? new AssetId(entityIdUUID) : null);
}
-
- entityViewValidator.validate(entityView, EntityView::getTenantId);
- if (created) {
- entityView.setId(entityViewId);
- }
- entityViewService.saveEntityView(entityView, false);
- return Pair.of(created, entityViewNameUpdated);
+ return entityView;
}
+
+ protected abstract void setCustomerId(TenantId tenantId, CustomerId customerId, EntityView entityView, EntityViewUpdateMsg entityViewUpdateMsg, EdgeVersion edgeVersion);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/EntityViewEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/EntityViewEdgeProcessor.java
index cd3a0b35ad..863c1112e2 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/EntityViewEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/EntityViewEdgeProcessor.java
@@ -34,9 +34,12 @@ import org.thingsboard.server.common.data.msg.TbMsgType;
import org.thingsboard.server.common.msg.TbMsgMetaData;
import org.thingsboard.server.dao.exception.DataValidationException;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.EntityViewUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.entityview.EntityViewMsgConstructor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@@ -45,7 +48,7 @@ import java.util.UUID;
@TbCoreComponent
public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
- public ListenableFuture processEntityViewMsgFromEdge(TenantId tenantId, Edge edge, EntityViewUpdateMsg entityViewUpdateMsg) {
+ public ListenableFuture processEntityViewMsgFromEdge(TenantId tenantId, Edge edge, EntityViewUpdateMsg entityViewUpdateMsg, EdgeVersion edgeVersion) {
log.trace("[{}] executing processEntityViewMsgFromEdge [{}] from edge [{}]", tenantId, entityViewUpdateMsg, edge.getId());
EntityViewId entityViewId = new EntityViewId(new UUID(entityViewUpdateMsg.getIdMSB(), entityViewUpdateMsg.getIdLSB()));
try {
@@ -54,7 +57,7 @@ public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
switch (entityViewUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
- saveOrUpdateEntityView(tenantId, entityViewId, entityViewUpdateMsg, edge);
+ saveOrUpdateEntityView(tenantId, entityViewId, entityViewUpdateMsg, edge, edgeVersion);
return Futures.immediateFuture(null);
case ENTITY_DELETED_RPC_MESSAGE:
EntityView entityViewToDelete = entityViewService.findEntityViewById(tenantId, entityViewId);
@@ -78,9 +81,8 @@ public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
}
}
- private void saveOrUpdateEntityView(TenantId tenantId, EntityViewId entityViewId, EntityViewUpdateMsg entityViewUpdateMsg, Edge edge) {
- CustomerId customerId = safeGetCustomerId(entityViewUpdateMsg.getCustomerIdMSB(), entityViewUpdateMsg.getCustomerIdLSB());
- Pair resultPair = super.saveOrUpdateEntityView(tenantId, entityViewId, entityViewUpdateMsg, customerId);
+ private void saveOrUpdateEntityView(TenantId tenantId, EntityViewId entityViewId, EntityViewUpdateMsg entityViewUpdateMsg, Edge edge, EdgeVersion edgeVersion) {
+ Pair resultPair = super.saveOrUpdateEntityView(tenantId, entityViewId, entityViewUpdateMsg, edgeVersion);
Boolean created = resultPair.getFirst();
if (created) {
createRelationFromEdge(tenantId, edge.getId(), entityViewId);
@@ -104,7 +106,7 @@ public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
}
}
- public DownlinkMsg convertEntityViewEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertEntityViewEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
EntityViewId entityViewId = new EntityViewId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -116,8 +118,8 @@ public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
EntityView entityView = entityViewService.findEntityViewById(edgeEvent.getTenantId(), entityViewId);
if (entityView != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- EntityViewUpdateMsg entityViewUpdateMsg =
- entityViewMsgConstructor.constructEntityViewUpdatedMsg(msgType, entityView);
+ EntityViewUpdateMsg entityViewUpdateMsg = ((EntityViewMsgConstructor)
+ entityViewMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructEntityViewUpdatedMsg(msgType, entityView);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addEntityViewUpdateMsg(entityViewUpdateMsg)
@@ -126,8 +128,8 @@ public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
break;
case DELETED:
case UNASSIGNED_FROM_EDGE:
- EntityViewUpdateMsg entityViewUpdateMsg =
- entityViewMsgConstructor.constructEntityViewDeleteMsg(entityViewId);
+ EntityViewUpdateMsg entityViewUpdateMsg = ((EntityViewMsgConstructor)
+ entityViewMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructEntityViewDeleteMsg(entityViewId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addEntityViewUpdateMsg(entityViewUpdateMsg)
@@ -136,4 +138,12 @@ public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
}
return downlinkMsg;
}
+
+ @Override
+ protected void setCustomerId(TenantId tenantId, CustomerId customerId, EntityView entityView, EntityViewUpdateMsg entityViewUpdateMsg, EdgeVersion edgeVersion) {
+ CustomerId customerUUID = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? safeGetCustomerId(entityViewUpdateMsg.getCustomerIdMSB(), entityViewUpdateMsg.getCustomerIdLSB())
+ : entityView.getCustomerId() != null ? entityView.getCustomerId() : customerId;
+ entityView.setCustomerId(customerUUID);
+ }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/ota/OtaPackageEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/ota/OtaPackageEdgeProcessor.java
index fae6399e3a..247cfe5c15 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/ota/OtaPackageEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/ota/OtaPackageEdgeProcessor.java
@@ -22,9 +22,11 @@ import org.thingsboard.server.common.data.OtaPackage;
import org.thingsboard.server.common.data.edge.EdgeEvent;
import org.thingsboard.server.common.data.id.OtaPackageId;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.OtaPackageUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.ota.OtaPackageMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
@Component
@@ -32,7 +34,7 @@ import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
@TbCoreComponent
public class OtaPackageEdgeProcessor extends BaseEdgeProcessor {
- public DownlinkMsg convertOtaPackageEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertOtaPackageEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
OtaPackageId otaPackageId = new OtaPackageId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -41,8 +43,8 @@ public class OtaPackageEdgeProcessor extends BaseEdgeProcessor {
OtaPackage otaPackage = otaPackageService.findOtaPackageById(edgeEvent.getTenantId(), otaPackageId);
if (otaPackage != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- OtaPackageUpdateMsg otaPackageUpdateMsg =
- otaPackageMsgConstructor.constructOtaPackageUpdatedMsg(msgType, otaPackage);
+ OtaPackageUpdateMsg otaPackageUpdateMsg = ((OtaPackageMsgConstructor)
+ otaPackageMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructOtaPackageUpdatedMsg(msgType, otaPackage);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addOtaPackageUpdateMsg(otaPackageUpdateMsg)
@@ -50,8 +52,8 @@ public class OtaPackageEdgeProcessor extends BaseEdgeProcessor {
}
break;
case DELETED:
- OtaPackageUpdateMsg otaPackageUpdateMsg =
- otaPackageMsgConstructor.constructOtaPackageDeleteMsg(otaPackageId);
+ OtaPackageUpdateMsg otaPackageUpdateMsg = ((OtaPackageMsgConstructor)
+ otaPackageMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructOtaPackageDeleteMsg(otaPackageId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addOtaPackageUpdateMsg(otaPackageUpdateMsg)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/queue/QueueEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/queue/QueueEdgeProcessor.java
index 8562582940..cd595c1699 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/queue/QueueEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/queue/QueueEdgeProcessor.java
@@ -22,17 +22,19 @@ import org.thingsboard.server.common.data.edge.EdgeEvent;
import org.thingsboard.server.common.data.id.QueueId;
import org.thingsboard.server.common.data.queue.Queue;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.QueueUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.queue.QueueMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
-@Component
@Slf4j
+@Component
@TbCoreComponent
public class QueueEdgeProcessor extends BaseEdgeProcessor {
- public DownlinkMsg convertQueueEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertQueueEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
QueueId queueId = new QueueId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -41,8 +43,8 @@ public class QueueEdgeProcessor extends BaseEdgeProcessor {
Queue queue = queueService.findQueueById(edgeEvent.getTenantId(), queueId);
if (queue != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- QueueUpdateMsg queueUpdateMsg =
- queueMsgConstructor.constructQueueUpdatedMsg(msgType, queue);
+ QueueUpdateMsg queueUpdateMsg = ((QueueMsgConstructor)
+ queueMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructQueueUpdatedMsg(msgType, queue);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addQueueUpdateMsg(queueUpdateMsg)
@@ -50,8 +52,8 @@ public class QueueEdgeProcessor extends BaseEdgeProcessor {
}
break;
case DELETED:
- QueueUpdateMsg queueDeleteMsg =
- queueMsgConstructor.constructQueueDeleteMsg(queueId);
+ QueueUpdateMsg queueDeleteMsg = ((QueueMsgConstructor)
+ queueMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructQueueDeleteMsg(queueId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addQueueUpdateMsg(queueDeleteMsg)
@@ -60,5 +62,4 @@ public class QueueEdgeProcessor extends BaseEdgeProcessor {
}
return downlinkMsg;
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/BaseRelationProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/BaseRelationProcessor.java
index 952affdc3d..d673b1a613 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/BaseRelationProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/BaseRelationProcessor.java
@@ -25,41 +25,35 @@ import org.thingsboard.server.common.data.id.EntityIdFactory;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.relation.EntityRelation;
import org.thingsboard.server.common.data.relation.RelationTypeGroup;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.RelationUpdateMsg;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
import java.util.UUID;
@Slf4j
public abstract class BaseRelationProcessor extends BaseEdgeProcessor {
- protected ListenableFuture processRelationMsg(TenantId tenantId, RelationUpdateMsg relationUpdateMsg) {
+ protected ListenableFuture processRelationMsg(TenantId tenantId, RelationUpdateMsg relationUpdateMsg, EdgeVersion edgeVersion) {
+ log.trace("[{}] processRelationMsg [{}]", tenantId, relationUpdateMsg);
try {
- EntityRelation entityRelation = new EntityRelation();
-
- UUID fromUUID = new UUID(relationUpdateMsg.getFromIdMSB(), relationUpdateMsg.getFromIdLSB());
- EntityId fromId = EntityIdFactory.getByTypeAndUuid(EntityType.valueOf(relationUpdateMsg.getFromEntityType()), fromUUID);
- entityRelation.setFrom(fromId);
-
- UUID toUUID = new UUID(relationUpdateMsg.getToIdMSB(), relationUpdateMsg.getToIdLSB());
- EntityId toId = EntityIdFactory.getByTypeAndUuid(EntityType.valueOf(relationUpdateMsg.getToEntityType()), toUUID);
- entityRelation.setTo(toId);
-
- entityRelation.setType(relationUpdateMsg.getType());
- entityRelation.setTypeGroup(relationUpdateMsg.hasTypeGroup()
- ? RelationTypeGroup.valueOf(relationUpdateMsg.getTypeGroup()) : RelationTypeGroup.COMMON);
- entityRelation.setAdditionalInfo(JacksonUtil.toJsonNode(relationUpdateMsg.getAdditionalInfo()));
+ EntityRelation entityRelation = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createEntityRelation(relationUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(relationUpdateMsg.getEntity(), EntityRelation.class);
+ if (entityRelation == null) {
+ throw new RuntimeException("[{" + tenantId + "}] relationUpdateMsg {" + relationUpdateMsg + "} cannot be converted to entity relation");
+ }
switch (relationUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
if (isEntityExists(tenantId, entityRelation.getTo())
&& isEntityExists(tenantId, entityRelation.getFrom())) {
relationService.saveRelation(tenantId, entityRelation);
- break;
} else {
log.warn("[{}] Skipping relating update msg because from/to entity doesn't exists on edge, {}", tenantId, relationUpdateMsg);
- break;
}
+ break;
case ENTITY_DELETED_RPC_MESSAGE:
relationService.deleteRelation(tenantId, entityRelation);
break;
@@ -73,4 +67,22 @@ public abstract class BaseRelationProcessor extends BaseEdgeProcessor {
}
return Futures.immediateFuture(null);
}
+
+ private EntityRelation createEntityRelation(RelationUpdateMsg relationUpdateMsg) {
+ EntityRelation entityRelation = new EntityRelation();
+
+ UUID fromUUID = new UUID(relationUpdateMsg.getFromIdMSB(), relationUpdateMsg.getFromIdLSB());
+ EntityId fromId = EntityIdFactory.getByTypeAndUuid(EntityType.valueOf(relationUpdateMsg.getFromEntityType()), fromUUID);
+ entityRelation.setFrom(fromId);
+
+ UUID toUUID = new UUID(relationUpdateMsg.getToIdMSB(), relationUpdateMsg.getToIdLSB());
+ EntityId toId = EntityIdFactory.getByTypeAndUuid(EntityType.valueOf(relationUpdateMsg.getToEntityType()), toUUID);
+ entityRelation.setTo(toId);
+
+ entityRelation.setType(relationUpdateMsg.getType());
+ entityRelation.setTypeGroup(relationUpdateMsg.hasTypeGroup()
+ ? RelationTypeGroup.valueOf(relationUpdateMsg.getTypeGroup()) : RelationTypeGroup.COMMON);
+ entityRelation.setAdditionalInfo(JacksonUtil.toJsonNode(relationUpdateMsg.getAdditionalInfo()));
+ return entityRelation;
+ }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/RelationEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/RelationEdgeProcessor.java
index b3676e8d82..256d84a1e3 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/RelationEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/RelationEdgeProcessor.java
@@ -30,10 +30,12 @@ import org.thingsboard.server.common.data.id.EdgeId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.relation.EntityRelation;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.RelationUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.gen.transport.TransportProtos;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.relation.RelationMsgConstructor;
import java.util.ArrayList;
import java.util.HashSet;
@@ -45,21 +47,21 @@ import java.util.Set;
@TbCoreComponent
public class RelationEdgeProcessor extends BaseRelationProcessor {
- public ListenableFuture processRelationMsgFromEdge(TenantId tenantId, Edge edge, RelationUpdateMsg relationUpdateMsg) {
+ public ListenableFuture processRelationMsgFromEdge(TenantId tenantId, Edge edge, RelationUpdateMsg relationUpdateMsg, EdgeVersion edgeVersion) {
log.trace("[{}] executing processRelationMsgFromEdge [{}] from edge [{}]", tenantId, relationUpdateMsg, edge.getId());
try {
edgeSynchronizationManager.getEdgeId().set(edge.getId());
-
- return processRelationMsg(tenantId, relationUpdateMsg);
+ return processRelationMsg(tenantId, relationUpdateMsg, edgeVersion);
} finally {
edgeSynchronizationManager.getEdgeId().remove();
}
}
- public DownlinkMsg convertRelationEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertRelationEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
EntityRelation entityRelation = JacksonUtil.convertValue(edgeEvent.getBody(), EntityRelation.class);
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- RelationUpdateMsg relationUpdateMsg = relationMsgConstructor.constructRelationUpdatedMsg(msgType, entityRelation);
+ RelationUpdateMsg relationUpdateMsg = ((RelationMsgConstructor) relationMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructRelationUpdatedMsg(msgType, entityRelation);
return DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addRelationUpdateMsg(relationUpdateMsg)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/BaseResourceProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/BaseResourceProcessor.java
index a00745d8b7..fc1b300322 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/BaseResourceProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/BaseResourceProcessor.java
@@ -17,6 +17,8 @@ package org.thingsboard.server.service.edge.rpc.processor.resource;
import com.datastax.oss.driver.api.core.uuid.Uuids;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.Base64Utils;
+import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.ResourceType;
import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.TbResource;
@@ -24,45 +26,45 @@ import org.thingsboard.server.common.data.TbResourceInfo;
import org.thingsboard.server.common.data.id.TbResourceId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.PageDataIterable;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.ResourceUpdateMsg;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
+import org.thingsboard.server.service.edge.rpc.utils.EdgeVersionUtils;
@Slf4j
public abstract class BaseResourceProcessor extends BaseEdgeProcessor {
- protected boolean saveOrUpdateTbResource(TenantId tenantId, TbResourceId tbResourceId, ResourceUpdateMsg resourceUpdateMsg) {
+ protected boolean saveOrUpdateTbResource(TenantId tenantId, TbResourceId tbResourceId, ResourceUpdateMsg resourceUpdateMsg, EdgeVersion edgeVersion) {
boolean resourceKeyUpdated = false;
try {
- boolean created = false;
- TbResource resource = resourceService.findResourceById(tenantId, tbResourceId);
+ TbResource resource = EdgeVersionUtils.isEdgeVersionOlderThan_3_6_2(edgeVersion)
+ ? createTbResource(tenantId, resourceUpdateMsg)
+ : JacksonUtil.fromStringIgnoreUnknownProperties(resourceUpdateMsg.getEntity(), TbResource.class);
if (resource == null) {
- resource = new TbResource();
- if (resourceUpdateMsg.getIsSystem()) {
- resource.setTenantId(TenantId.SYS_TENANT_ID);
- } else {
- resource.setTenantId(tenantId);
- }
+ throw new RuntimeException("[{" + tenantId + "}] resourceUpdateMsg {" + resourceUpdateMsg + " } cannot be converted to resource");
+ }
+ boolean created = false;
+ TbResource resourceById = resourceService.findResourceById(tenantId, tbResourceId);
+ if (resourceById == null) {
resource.setCreatedTime(Uuids.unixTimestamp(tbResourceId.getId()));
created = true;
+ resource.setId(null);
+ } else {
+ resource.setId(tbResourceId);
}
- String resourceKey = resourceUpdateMsg.getResourceKey();
- ResourceType resourceType = ResourceType.valueOf(resourceUpdateMsg.getResourceType());
+ String resourceKey = resource.getResourceKey();
+ ResourceType resourceType = resource.getResourceType();
PageDataIterable resourcesIterable = new PageDataIterable<>(
link -> resourceService.findTenantResourcesByResourceTypeAndPageLink(tenantId, resourceType, link), 1024);
for (TbResource tbResource : resourcesIterable) {
- if (tbResource.getResourceKey().equals(resourceUpdateMsg.getResourceKey()) && !tbResourceId.equals(tbResource.getId())) {
+ if (tbResource.getResourceKey().equals(resourceKey) && !tbResourceId.equals(tbResource.getId())) {
resourceKey = StringUtils.randomAlphabetic(15) + "_" + resourceKey;
log.warn("[{}] Resource with resource type {} and key {} already exists. Renaming resource key to {}",
- tenantId, resourceType, resourceUpdateMsg.getResourceKey(), resourceKey);
+ tenantId, resourceType, resource.getResourceKey(), resourceKey);
resourceKeyUpdated = true;
}
}
- resource.setTitle(resourceUpdateMsg.getTitle());
resource.setResourceKey(resourceKey);
- resource.setResourceType(resourceType);
- resource.setFileName(resourceUpdateMsg.getFileName());
- resource.setData(resourceUpdateMsg.hasData() ? resourceUpdateMsg.getData() : null);
- resource.setEtag(resourceUpdateMsg.hasEtag() ? resourceUpdateMsg.getEtag() : null);
resourceValidator.validate(resource, TbResourceInfo::getTenantId);
if (created) {
resource.setId(tbResourceId);
@@ -74,4 +76,22 @@ public abstract class BaseResourceProcessor extends BaseEdgeProcessor {
}
return resourceKeyUpdated;
}
+
+ private TbResource createTbResource(TenantId tenantId, ResourceUpdateMsg resourceUpdateMsg) {
+ TbResource resource = new TbResource();
+ if (resourceUpdateMsg.getIsSystem()) {
+ resource.setTenantId(TenantId.SYS_TENANT_ID);
+ } else {
+ resource.setTenantId(tenantId);
+ }
+ resource.setTitle(resourceUpdateMsg.getTitle());
+ resource.setResourceKey(resourceUpdateMsg.getResourceKey());
+ resource.setResourceType(ResourceType.valueOf(resourceUpdateMsg.getResourceType()));
+ resource.setFileName(resourceUpdateMsg.getFileName());
+ if (resourceUpdateMsg.hasData()) {
+ resource.setEncodedData(resourceUpdateMsg.getData());
+ }
+ resource.setEtag(resourceUpdateMsg.hasEtag() ? resourceUpdateMsg.getEtag() : null);
+ return resource;
+ }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/ResourceEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/ResourceEdgeProcessor.java
index ad283826f8..8a91849670 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/ResourceEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/ResourceEdgeProcessor.java
@@ -29,9 +29,11 @@ import org.thingsboard.server.common.data.id.TbResourceId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.dao.exception.DataValidationException;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.ResourceUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.resource.ResourceMsgConstructor;
import java.util.UUID;
@@ -40,7 +42,7 @@ import java.util.UUID;
@TbCoreComponent
public class ResourceEdgeProcessor extends BaseResourceProcessor {
- public ListenableFuture processResourceMsgFromEdge(TenantId tenantId, Edge edge, ResourceUpdateMsg resourceUpdateMsg) {
+ public ListenableFuture processResourceMsgFromEdge(TenantId tenantId, Edge edge, ResourceUpdateMsg resourceUpdateMsg, EdgeVersion edgeVersion) {
TbResourceId tbResourceId = new TbResourceId(new UUID(resourceUpdateMsg.getIdMSB(), resourceUpdateMsg.getIdLSB()));
try {
edgeSynchronizationManager.getEdgeId().set(edge.getId());
@@ -48,7 +50,7 @@ public class ResourceEdgeProcessor extends BaseResourceProcessor {
switch (resourceUpdateMsg.getMsgType()) {
case ENTITY_CREATED_RPC_MESSAGE:
case ENTITY_UPDATED_RPC_MESSAGE:
- boolean resourceKeyUpdated = super.saveOrUpdateTbResource(tenantId, tbResourceId, resourceUpdateMsg);
+ boolean resourceKeyUpdated = super.saveOrUpdateTbResource(tenantId, tbResourceId, resourceUpdateMsg, edgeVersion);
if (resourceKeyUpdated) {
saveEdgeEvent(tenantId, edge.getId(), EdgeEventType.TB_RESOURCE, EdgeEventActionType.UPDATED, tbResourceId, null);
}
@@ -58,7 +60,7 @@ public class ResourceEdgeProcessor extends BaseResourceProcessor {
return handleUnsupportedMsgType(resourceUpdateMsg.getMsgType());
}
} catch (DataValidationException e) {
- if (e.getMessage().contains("files size limit is exhausted")) {
+ if (e.getMessage().contains("exceeds the maximum")) {
log.warn("[{}] Resource data size has been exhausted {}", tenantId, resourceUpdateMsg, e);
return Futures.immediateFuture(null);
} else {
@@ -70,7 +72,7 @@ public class ResourceEdgeProcessor extends BaseResourceProcessor {
return Futures.immediateFuture(null);
}
- public DownlinkMsg convertResourceEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertResourceEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
TbResourceId tbResourceId = new TbResourceId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -79,8 +81,8 @@ public class ResourceEdgeProcessor extends BaseResourceProcessor {
TbResource tbResource = resourceService.findResourceById(edgeEvent.getTenantId(), tbResourceId);
if (tbResource != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- ResourceUpdateMsg resourceUpdateMsg =
- resourceMsgConstructor.constructResourceUpdatedMsg(msgType, tbResource);
+ ResourceUpdateMsg resourceUpdateMsg = ((ResourceMsgConstructor)
+ resourceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructResourceUpdatedMsg(msgType, tbResource);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addResourceUpdateMsg(resourceUpdateMsg)
@@ -88,8 +90,8 @@ public class ResourceEdgeProcessor extends BaseResourceProcessor {
}
break;
case DELETED:
- ResourceUpdateMsg resourceUpdateMsg =
- resourceMsgConstructor.constructResourceDeleteMsg(tbResourceId);
+ ResourceUpdateMsg resourceUpdateMsg = ((ResourceMsgConstructor)
+ resourceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructResourceDeleteMsg(tbResourceId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addResourceUpdateMsg(resourceUpdateMsg)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/rule/RuleChainEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/rule/RuleChainEdgeProcessor.java
index ba6fc1ef97..c17fb8030c 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/rule/RuleChainEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/rule/RuleChainEdgeProcessor.java
@@ -28,6 +28,7 @@ import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
import org.thingsboard.server.gen.edge.v1.RuleChainUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.rule.RuleChainMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
import static org.thingsboard.server.service.edge.DefaultEdgeNotificationService.EDGE_IS_ROOT_BODY_KEY;
@@ -37,7 +38,7 @@ import static org.thingsboard.server.service.edge.DefaultEdgeNotificationService
@TbCoreComponent
public class RuleChainEdgeProcessor extends BaseEdgeProcessor {
- public DownlinkMsg convertRuleChainEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertRuleChainEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
RuleChainId ruleChainId = new RuleChainId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -53,8 +54,9 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor {
} catch (Exception ignored) {}
}
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- RuleChainUpdateMsg ruleChainUpdateMsg =
- ruleChainMsgConstructor.constructRuleChainUpdatedMsg(msgType, ruleChain, isRoot);
+ RuleChainUpdateMsg ruleChainUpdateMsg = ((RuleChainMsgConstructor)
+ ruleChainMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructRuleChainUpdatedMsg(msgType, ruleChain, isRoot);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addRuleChainUpdateMsg(ruleChainUpdateMsg)
@@ -65,7 +67,8 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor {
case UNASSIGNED_FROM_EDGE:
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
- .addRuleChainUpdateMsg(ruleChainMsgConstructor.constructRuleChainDeleteMsg(ruleChainId))
+ .addRuleChainUpdateMsg(((RuleChainMsgConstructor) ruleChainMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructRuleChainDeleteMsg(ruleChainId))
.build();
break;
}
@@ -79,8 +82,9 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor {
if (ruleChain != null) {
RuleChainMetaData ruleChainMetaData = ruleChainService.loadRuleChainMetaData(edgeEvent.getTenantId(), ruleChainId);
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- RuleChainMetadataUpdateMsg ruleChainMetadataUpdateMsg =
- ruleChainMsgConstructor.constructRuleChainMetadataUpdatedMsg(edgeEvent.getTenantId(), msgType, ruleChainMetaData, edgeVersion);
+ RuleChainMetadataUpdateMsg ruleChainMetadataUpdateMsg = ((RuleChainMsgConstructor)
+ ruleChainMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructRuleChainMetadataUpdatedMsg(edgeEvent.getTenantId(), msgType, ruleChainMetaData, edgeVersion);
if (ruleChainMetadataUpdateMsg != null) {
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/settings/AdminSettingsEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/settings/AdminSettingsEdgeProcessor.java
index bbd9edd172..6c201a261c 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/settings/AdminSettingsEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/settings/AdminSettingsEdgeProcessor.java
@@ -23,7 +23,9 @@ import org.thingsboard.server.common.data.EdgeUtils;
import org.thingsboard.server.common.data.edge.EdgeEvent;
import org.thingsboard.server.gen.edge.v1.AdminSettingsUpdateMsg;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.settings.AdminSettingsMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
@Component
@@ -31,16 +33,16 @@ import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
@TbCoreComponent
public class AdminSettingsEdgeProcessor extends BaseEdgeProcessor {
- public DownlinkMsg convertAdminSettingsEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertAdminSettingsEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
AdminSettings adminSettings = JacksonUtil.convertValue(edgeEvent.getBody(), AdminSettings.class);
if (adminSettings == null) {
return null;
}
- AdminSettingsUpdateMsg adminSettingsUpdateMsg = adminSettingsMsgConstructor.constructAdminSettingsUpdateMsg(adminSettings);
+ AdminSettingsUpdateMsg adminSettingsUpdateMsg = ((AdminSettingsMsgConstructor)
+ adminSettingsMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructAdminSettingsUpdateMsg(adminSettings);
return DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addAdminSettingsUpdateMsg(adminSettingsUpdateMsg)
.build();
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/telemetry/BaseTelemetryProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/telemetry/BaseTelemetryProcessor.java
index 974e9267f6..9cea8050b6 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/telemetry/BaseTelemetryProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/telemetry/BaseTelemetryProcessor.java
@@ -15,7 +15,6 @@
*/
package org.thingsboard.server.service.edge.rpc.processor.telemetry;
-import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
@@ -28,7 +27,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.thingsboard.common.util.JacksonUtil;
-import org.thingsboard.server.common.msg.rule.engine.DeviceAttributesEventNotificationMsg;
import org.thingsboard.server.common.data.DataConstants;
import org.thingsboard.server.common.data.Device;
import org.thingsboard.server.common.data.DeviceProfile;
@@ -54,7 +52,8 @@ import org.thingsboard.server.common.msg.TbMsg;
import org.thingsboard.server.common.msg.TbMsgMetaData;
import org.thingsboard.server.common.msg.queue.ServiceType;
import org.thingsboard.server.common.msg.queue.TopicPartitionInfo;
-import org.thingsboard.server.common.transport.adaptor.JsonConverter;
+import org.thingsboard.server.common.adaptor.JsonConverter;
+import org.thingsboard.server.common.msg.rule.engine.DeviceAttributesEventNotificationMsg;
import org.thingsboard.server.common.transport.util.JsonUtils;
import org.thingsboard.server.dao.model.ModelConstants;
import org.thingsboard.server.gen.edge.v1.AttributeDeleteMsg;
@@ -314,7 +313,7 @@ public abstract class BaseTelemetryProcessor extends BaseEdgeProcessor {
EntityType entityType,
UUID entityUUID,
EdgeEventActionType actionType,
- JsonNode body) throws JsonProcessingException {
+ JsonNode body) {
EntityId entityId;
switch (entityType) {
case DEVICE:
@@ -349,5 +348,4 @@ public abstract class BaseTelemetryProcessor extends BaseEdgeProcessor {
return bodyJackson == null ? null :
entityDataMsgConstructor.constructEntityDataMsg(tenantId, entityId, actionType, JsonParser.parseString(bodyJackson));
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/telemetry/TelemetryEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/telemetry/TelemetryEdgeProcessor.java
index 667d661d2e..af9ff3de37 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/telemetry/TelemetryEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/telemetry/TelemetryEdgeProcessor.java
@@ -15,7 +15,6 @@
*/
package org.thingsboard.server.service.edge.rpc.processor.telemetry;
-import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.thingsboard.server.common.data.DataConstants;
@@ -37,7 +36,7 @@ public class TelemetryEdgeProcessor extends BaseTelemetryProcessor {
return DataConstants.EDGE_MSG_SOURCE;
}
- public DownlinkMsg convertTelemetryEventToDownlink(EdgeEvent edgeEvent) throws JsonProcessingException {
+ public DownlinkMsg convertTelemetryEventToDownlink(EdgeEvent edgeEvent) {
if (edgeEvent.getBody() != null) {
String bodyStr = edgeEvent.getBody().toString();
if (bodyStr.length() > 1000) {
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantEdgeProcessor.java
index 9fd08b4447..92b887bf33 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantEdgeProcessor.java
@@ -29,6 +29,7 @@ import org.thingsboard.server.gen.edge.v1.TenantProfileUpdateMsg;
import org.thingsboard.server.gen.edge.v1.TenantUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.tenant.TenantMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
@Component
@@ -43,9 +44,13 @@ public class TenantEdgeProcessor extends BaseEdgeProcessor {
Tenant tenant = tenantService.findTenantById(tenantId);
if (tenant != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- TenantUpdateMsg tenantUpdateMsg = tenantMsgConstructor.constructTenantUpdateMsg(msgType, tenant);
+ TenantUpdateMsg tenantUpdateMsg = ((TenantMsgConstructor)
+ tenantMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructTenantUpdateMsg(msgType, tenant);
TenantProfile tenantProfile = tenantProfileService.findTenantProfileById(tenantId, tenant.getTenantProfileId());
- TenantProfileUpdateMsg tenantProfileUpdateMsg = tenantProfileMsgConstructor.constructTenantProfileUpdateMsg(msgType, tenantProfile, edgeVersion);
+ TenantProfileUpdateMsg tenantProfileUpdateMsg = ((TenantMsgConstructor)
+ tenantMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructTenantProfileUpdateMsg(msgType, tenantProfile, edgeVersion);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addTenantUpdateMsg(tenantUpdateMsg)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantProfileEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantProfileEdgeProcessor.java
index 970ea3a1f6..57c29e8632 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantProfileEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantProfileEdgeProcessor.java
@@ -27,6 +27,7 @@ import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.TenantProfileUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.tenant.TenantMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
@Component
@@ -41,8 +42,9 @@ public class TenantProfileEdgeProcessor extends BaseEdgeProcessor {
TenantProfile tenantProfile = tenantProfileService.findTenantProfileById(edgeEvent.getTenantId(), tenantProfileId);
if (tenantProfile != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
- TenantProfileUpdateMsg tenantProfileUpdateMsg =
- tenantProfileMsgConstructor.constructTenantProfileUpdateMsg(msgType, tenantProfile, edgeVersion);
+ TenantProfileUpdateMsg tenantProfileUpdateMsg = ((TenantMsgConstructor)
+ tenantMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion))
+ .constructTenantProfileUpdateMsg(msgType, tenantProfile, edgeVersion);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addTenantProfileUpdateMsg(tenantProfileUpdateMsg)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/user/UserEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/user/UserEdgeProcessor.java
index de40fdb1a3..c07cbc9414 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/user/UserEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/user/UserEdgeProcessor.java
@@ -23,9 +23,11 @@ import org.thingsboard.server.common.data.edge.EdgeEvent;
import org.thingsboard.server.common.data.id.UserId;
import org.thingsboard.server.common.data.security.UserCredentials;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.gen.edge.v1.UserCredentialsUpdateMsg;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.user.UserMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
@Component
@@ -33,7 +35,7 @@ import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
@TbCoreComponent
public class UserEdgeProcessor extends BaseEdgeProcessor {
- public DownlinkMsg convertUserEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertUserEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
UserId userId = new UserId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -44,21 +46,21 @@ public class UserEdgeProcessor extends BaseEdgeProcessor {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
- .addUserUpdateMsg(userMsgConstructor.constructUserUpdatedMsg(msgType, user))
+ .addUserUpdateMsg(((UserMsgConstructor) userMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructUserUpdatedMsg(msgType, user))
.build();
}
break;
case DELETED:
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
- .addUserUpdateMsg(userMsgConstructor.constructUserDeleteMsg(userId))
+ .addUserUpdateMsg(((UserMsgConstructor) userMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructUserDeleteMsg(userId))
.build();
break;
case CREDENTIALS_UPDATED:
UserCredentials userCredentialsByUserId = userService.findUserCredentialsByUserId(edgeEvent.getTenantId(), userId);
if (userCredentialsByUserId != null && userCredentialsByUserId.isEnabled()) {
UserCredentialsUpdateMsg userCredentialsUpdateMsg =
- userMsgConstructor.constructUserCredentialsUpdatedMsg(userCredentialsByUserId);
+ ((UserMsgConstructor) userMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructUserCredentialsUpdatedMsg(userCredentialsByUserId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addUserCredentialsUpdateMsg(userCredentialsUpdateMsg)
@@ -68,5 +70,4 @@ public class UserEdgeProcessor extends BaseEdgeProcessor {
}
return downlinkMsg;
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetBundleEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetBundleEdgeProcessor.java
index 877ece1b15..28cd3167aa 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetBundleEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetBundleEdgeProcessor.java
@@ -22,9 +22,11 @@ import org.thingsboard.server.common.data.edge.EdgeEvent;
import org.thingsboard.server.common.data.id.WidgetsBundleId;
import org.thingsboard.server.common.data.widget.WidgetsBundle;
import org.thingsboard.server.gen.edge.v1.DownlinkMsg;
+import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.gen.edge.v1.WidgetsBundleUpdateMsg;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.widget.WidgetMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
import java.util.List;
@@ -34,7 +36,7 @@ import java.util.List;
@TbCoreComponent
public class WidgetBundleEdgeProcessor extends BaseEdgeProcessor {
- public DownlinkMsg convertWidgetsBundleEventToDownlink(EdgeEvent edgeEvent) {
+ public DownlinkMsg convertWidgetsBundleEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
WidgetsBundleId widgetsBundleId = new WidgetsBundleId(edgeEvent.getEntityId());
DownlinkMsg downlinkMsg = null;
switch (edgeEvent.getAction()) {
@@ -45,7 +47,7 @@ public class WidgetBundleEdgeProcessor extends BaseEdgeProcessor {
List widgets = widgetTypeService.findWidgetFqnsByWidgetsBundleId(edgeEvent.getTenantId(), widgetsBundleId);
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
WidgetsBundleUpdateMsg widgetsBundleUpdateMsg =
- widgetsBundleMsgConstructor.constructWidgetsBundleUpdateMsg(msgType, widgetsBundle, widgets);
+ ((WidgetMsgConstructor) widgetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructWidgetsBundleUpdateMsg(msgType, widgetsBundle, widgets);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addWidgetsBundleUpdateMsg(widgetsBundleUpdateMsg)
@@ -54,7 +56,7 @@ public class WidgetBundleEdgeProcessor extends BaseEdgeProcessor {
break;
case DELETED:
WidgetsBundleUpdateMsg widgetsBundleUpdateMsg =
- widgetsBundleMsgConstructor.constructWidgetsBundleDeleteMsg(widgetsBundleId);
+ ((WidgetMsgConstructor) widgetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructWidgetsBundleDeleteMsg(widgetsBundleId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addWidgetsBundleUpdateMsg(widgetsBundleUpdateMsg)
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetTypeEdgeProcessor.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetTypeEdgeProcessor.java
index de9617d5d7..40556b5215 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetTypeEdgeProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetTypeEdgeProcessor.java
@@ -26,10 +26,11 @@ import org.thingsboard.server.gen.edge.v1.EdgeVersion;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
import org.thingsboard.server.gen.edge.v1.WidgetTypeUpdateMsg;
import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.edge.rpc.constructor.widget.WidgetMsgConstructor;
import org.thingsboard.server.service.edge.rpc.processor.BaseEdgeProcessor;
-@Component
@Slf4j
+@Component
@TbCoreComponent
public class WidgetTypeEdgeProcessor extends BaseEdgeProcessor {
@@ -43,7 +44,7 @@ public class WidgetTypeEdgeProcessor extends BaseEdgeProcessor {
if (widgetTypeDetails != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
WidgetTypeUpdateMsg widgetTypeUpdateMsg =
- widgetTypeMsgConstructor.constructWidgetTypeUpdateMsg(msgType, widgetTypeDetails, edgeVersion);
+ ((WidgetMsgConstructor) widgetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructWidgetTypeUpdateMsg(msgType, widgetTypeDetails, edgeVersion);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addWidgetTypeUpdateMsg(widgetTypeUpdateMsg)
@@ -52,7 +53,7 @@ public class WidgetTypeEdgeProcessor extends BaseEdgeProcessor {
break;
case DELETED:
WidgetTypeUpdateMsg widgetTypeUpdateMsg =
- widgetTypeMsgConstructor.constructWidgetTypeDeleteMsg(widgetTypeId);
+ ((WidgetMsgConstructor) widgetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion)).constructWidgetTypeDeleteMsg(widgetTypeId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addWidgetTypeUpdateMsg(widgetTypeUpdateMsg)
@@ -61,5 +62,4 @@ public class WidgetTypeEdgeProcessor extends BaseEdgeProcessor {
}
return downlinkMsg;
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/sync/DefaultEdgeRequestsService.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/sync/DefaultEdgeRequestsService.java
index af9f72e819..cd23f19556 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/sync/DefaultEdgeRequestsService.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/sync/DefaultEdgeRequestsService.java
@@ -294,7 +294,7 @@ public class DefaultEdgeRequestsService implements EdgeRequestsService {
private ListenableFuture> findRelationByQuery(TenantId tenantId, Edge edge,
EntityId entityId, EntitySearchDirection direction) {
EntityRelationsQuery query = new EntityRelationsQuery();
- query.setParameters(new RelationsSearchParameters(entityId, direction, -1, false));
+ query.setParameters(new RelationsSearchParameters(entityId, direction, 1, false));
return relationService.findByQuery(tenantId, query);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/edge/rpc/utils/EdgeVersionUtils.java b/application/src/main/java/org/thingsboard/server/service/edge/rpc/utils/EdgeVersionUtils.java
index c9e6987a23..dc66e50748 100644
--- a/application/src/main/java/org/thingsboard/server/service/edge/rpc/utils/EdgeVersionUtils.java
+++ b/application/src/main/java/org/thingsboard/server/service/edge/rpc/utils/EdgeVersionUtils.java
@@ -24,4 +24,8 @@ public final class EdgeVersionUtils {
public static boolean isEdgeVersionOlderThan(EdgeVersion currentVersion, EdgeVersion requiredVersion) {
return currentVersion.ordinal() < requiredVersion.ordinal();
}
+
+ public static boolean isEdgeVersionOlderThan_3_6_2(EdgeVersion currentVersion) {
+ return isEdgeVersionOlderThan(currentVersion, EdgeVersion.V_3_6_2);
+ }
}
diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/DefaultTbNotificationEntityService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/DefaultTbNotificationEntityService.java
index 72e8f44020..8682d18a62 100644
--- a/application/src/main/java/org/thingsboard/server/service/entitiy/DefaultTbNotificationEntityService.java
+++ b/application/src/main/java/org/thingsboard/server/service/entitiy/DefaultTbNotificationEntityService.java
@@ -112,7 +112,7 @@ public class DefaultTbNotificationEntityService implements TbNotificationEntityS
public void notifyDeleteDevice(TenantId tenantId, DeviceId deviceId, CustomerId customerId, Device device,
User user, Object... additionalInfo) {
gatewayNotificationsService.onDeviceDeleted(device);
- tbClusterService.onDeviceDeleted(device, null);
+ tbClusterService.onDeviceDeleted(tenantId, device, null);
logEntityAction(tenantId, deviceId, device, customerId, ActionType.DELETED, user, additionalInfo);
}
@@ -126,6 +126,7 @@ public class DefaultTbNotificationEntityService implements TbNotificationEntityS
@Override
public void notifyAssignDeviceToTenant(TenantId tenantId, TenantId newTenantId, DeviceId deviceId, CustomerId customerId,
Device device, Tenant tenant, User user, Object... additionalInfo) {
+ tbClusterService.onDeviceAssignedToTenant(tenantId, device);
logEntityAction(tenantId, deviceId, device, customerId, ActionType.ASSIGNED_TO_TENANT, user, additionalInfo);
pushAssignedFromNotification(tenant, newTenantId, device);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/dashboard/DefaultTbDashboardService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/dashboard/DefaultTbDashboardService.java
index 70918486a3..8d143d7607 100644
--- a/application/src/main/java/org/thingsboard/server/service/entitiy/dashboard/DefaultTbDashboardService.java
+++ b/application/src/main/java/org/thingsboard/server/service/entitiy/dashboard/DefaultTbDashboardService.java
@@ -30,6 +30,7 @@ import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.EdgeId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.dao.dashboard.DashboardService;
+import org.thingsboard.server.dao.resource.ImageService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.AbstractTbEntityService;
diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/tenant/DefaultTbTenantService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/tenant/DefaultTbTenantService.java
index 19d4126989..3267ed1c17 100644
--- a/application/src/main/java/org/thingsboard/server/service/entitiy/tenant/DefaultTbTenantService.java
+++ b/application/src/main/java/org/thingsboard/server/service/entitiy/tenant/DefaultTbTenantService.java
@@ -54,6 +54,7 @@ public class DefaultTbTenantService extends AbstractTbEntityService implements T
if (created) {
installScripts.createDefaultRuleChains(savedTenant.getId());
installScripts.createDefaultEdgeRuleChains(savedTenant.getId());
+ installScripts.createDefaultTenantDashboards(savedTenant.getId(), null);
}
tenantProfileCache.evict(savedTenant.getId());
notificationEntityService.notifyCreateOrUpdateTenant(savedTenant, created ?
diff --git a/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/type/DefaultWidgetTypeService.java b/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/type/DefaultWidgetTypeService.java
index 1d40e9630c..53afc9fb4f 100644
--- a/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/type/DefaultWidgetTypeService.java
+++ b/application/src/main/java/org/thingsboard/server/service/entitiy/widgets/type/DefaultWidgetTypeService.java
@@ -16,6 +16,7 @@
package org.thingsboard.server.service.entitiy.widgets.type;
import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.StringUtils;
@@ -24,6 +25,7 @@ import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.widget.WidgetType;
import org.thingsboard.server.common.data.widget.WidgetTypeDetails;
+import org.thingsboard.server.dao.resource.ImageService;
import org.thingsboard.server.dao.widget.WidgetTypeService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.AbstractTbEntityService;
@@ -33,6 +35,7 @@ import org.thingsboard.server.service.entitiy.AbstractTbEntityService;
@AllArgsConstructor
public class DefaultWidgetTypeService extends AbstractTbEntityService implements TbWidgetTypeService {
+
private final WidgetTypeService widgetTypeService;
@Override
diff --git a/application/src/main/java/org/thingsboard/server/service/executors/PubSubRuleNodeExecutorProvider.java b/application/src/main/java/org/thingsboard/server/service/executors/PubSubRuleNodeExecutorProvider.java
new file mode 100644
index 0000000000..74e1222acf
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/executors/PubSubRuleNodeExecutorProvider.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.executors;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+import org.thingsboard.common.util.ExecutorProvider;
+import org.thingsboard.common.util.ThingsBoardThreadFactory;
+import org.thingsboard.server.queue.util.TbRuleEngineComponent;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+
+@Lazy
+@TbRuleEngineComponent
+@Component
+public class PubSubRuleNodeExecutorProvider implements ExecutorProvider {
+
+ @Value("${service.rule_engine.pubsub.executor_thread_pool_size}")
+ private Integer threadPoolSize;
+
+ /**
+ * Refers to com.google.cloud.pubsub.v1.Publisher default executor configuration
+ */
+ private static final int THREADS_PER_CPU = 5;
+ private ScheduledExecutorService executor;
+
+ @PostConstruct
+ public void init() {
+ if (threadPoolSize == null) {
+ threadPoolSize = THREADS_PER_CPU * Runtime.getRuntime().availableProcessors();
+ }
+ executor = Executors.newScheduledThreadPool(threadPoolSize, ThingsBoardThreadFactory.forName("pubsub-rule-nodes"));
+ }
+
+ @Override
+ public ScheduledExecutorService getExecutor() {
+ return executor;
+ }
+
+ @PreDestroy
+ private void destroy() {
+ if (executor != null) {
+ executor.shutdownNow();
+ }
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java b/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java
index cf7b779dbe..63771f8165 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java
@@ -530,6 +530,7 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService {
new BaseAttributeKvEntry(System.currentTimeMillis(), new LongDataEntry("humidityAlarmThreshold", (long) 30))));
installScripts.loadDashboards(demoTenant.getId(), null);
+ installScripts.createDefaultTenantDashboards(demoTenant.getId(), null);
}
@Override
diff --git a/application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java b/application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java
index 3e23f9af37..598c3c8965 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/InstallScripts.java
@@ -16,14 +16,15 @@
package org.thingsboard.server.service.install;
import com.fasterxml.jackson.databind.JsonNode;
+import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.Dashboard;
import org.thingsboard.server.common.data.ResourceType;
-import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.TbResource;
import org.thingsboard.server.common.data.exception.ThingsboardException;
import org.thingsboard.server.common.data.id.CustomerId;
@@ -44,6 +45,7 @@ import org.thingsboard.server.dao.resource.ResourceService;
import org.thingsboard.server.dao.rule.RuleChainService;
import org.thingsboard.server.dao.widget.WidgetTypeService;
import org.thingsboard.server.dao.widget.WidgetsBundleService;
+import org.thingsboard.server.service.install.update.ImagesUpdater;
import java.io.IOException;
import java.nio.file.DirectoryStream;
@@ -51,12 +53,12 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
-import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
+import java.util.stream.Stream;
import static org.thingsboard.server.utils.LwM2mObjectModelUtils.toLwm2mResource;
@@ -109,6 +111,9 @@ public class InstallScripts {
@Autowired
private ResourceService resourceService;
+ @Autowired
+ private ImagesUpdater imagesUpdater;
+
Path getTenantRuleChainsDir() {
return Paths.get(getDataDir(), JSON_DIR, TENANT_DIR, RULE_CHAINS_DIR);
}
@@ -153,16 +158,14 @@ public class InstallScripts {
}
private void loadRuleChainsFromPath(TenantId tenantId, Path ruleChainsPath) throws IOException {
- findRuleChainsFromPath(ruleChainsPath)
- .forEach(
- path -> {
- try {
- createRuleChainFromFile(tenantId, path, null);
- } catch (Exception e) {
- log.error("Unable to load rule chain from json: [{}]", path.toString());
- throw new RuntimeException("Unable to load rule chain from json", e);
- }
- });
+ findRuleChainsFromPath(ruleChainsPath).forEach(path -> {
+ try {
+ createRuleChainFromFile(tenantId, path, null);
+ } catch (Exception e) {
+ log.error("Unable to load rule chain from json: [{}]", path.toString());
+ throw new RuntimeException("Unable to load rule chain from json", e);
+ }
+ });
}
List findRuleChainsFromPath(Path ruleChainsPath) throws IOException {
@@ -195,6 +198,7 @@ public class InstallScripts {
}
public void loadSystemWidgets() throws Exception {
+ log.info("Loading system widgets");
Map widgetsBundlesMap = new HashMap<>();
Path widgetBundlesDir = Paths.get(getDataDir(), JSON_DIR, SYSTEM_DIR, WIDGET_BUNDLES_DIR);
try (DirectoryStream dirStream = Files.newDirectoryStream(widgetBundlesDir, path -> path.toString().endsWith(JSON_EXT))) {
@@ -297,8 +301,41 @@ public class InstallScripts {
}
}
+ public void updateImages() {
+ imagesUpdater.updateWidgetsBundlesImages();
+ imagesUpdater.updateWidgetTypesImages();
+ imagesUpdater.updateDashboardsImages();
+ imagesUpdater.updateDeviceProfilesImages();
+ imagesUpdater.updateAssetProfilesImages();
+ }
+
+ @SneakyThrows
+ public void loadSystemImages() {
+ log.info("Loading system images...");
+ Stream dashboardsFiles = Files.list(Paths.get(getDataDir(), JSON_DIR, DEMO_DIR, DASHBOARDS_DIR));
+ try (dashboardsFiles) {
+ dashboardsFiles.forEach(file -> {
+ try {
+ Dashboard dashboard = JacksonUtil.OBJECT_MAPPER.readValue(file.toFile(), Dashboard.class);
+ imagesUpdater.createSystemImages(dashboard);
+ } catch (Exception e) {
+ log.error("Failed to create system images for default dashboard {}", file.getFileName(), e);
+ }
+ });
+ }
+ }
+
public void loadDashboards(TenantId tenantId, CustomerId customerId) throws Exception {
Path dashboardsDir = Paths.get(getDataDir(), JSON_DIR, DEMO_DIR, DASHBOARDS_DIR);
+ loadDashboardsFromDir(tenantId, customerId, dashboardsDir);
+ }
+
+ public void createDefaultTenantDashboards(TenantId tenantId, CustomerId customerId) throws Exception {
+ Path dashboardsDir = Paths.get(getDataDir(), JSON_DIR, TENANT_DIR, DASHBOARDS_DIR);
+ loadDashboardsFromDir(tenantId, customerId, dashboardsDir);
+ }
+
+ private void loadDashboardsFromDir(TenantId tenantId, CustomerId customerId, Path dashboardsDir) throws IOException {
try (DirectoryStream dirStream = Files.newDirectoryStream(dashboardsDir, path -> path.toString().endsWith(JSON_EXT))) {
dirStream.forEach(
path -> {
@@ -359,7 +396,7 @@ public class InstallScripts {
dirStream.forEach(
path -> {
try {
- String data = Base64.getEncoder().encodeToString(Files.readAllBytes(path));
+ byte[] data = Files.readAllBytes(path);
TbResource tbResource = new TbResource();
tbResource.setTenantId(TenantId.SYS_TENANT_ID);
tbResource.setData(data);
@@ -380,15 +417,13 @@ public class InstallScripts {
private void doSaveLwm2mResource(TbResource resource) throws ThingsboardException {
log.trace("Executing saveResource [{}]", resource);
- if (StringUtils.isEmpty(resource.getData())) {
+ if (resource.getData() == null || resource.getData().length == 0) {
throw new DataValidationException("Resource data should be specified!");
}
toLwm2mResource(resource);
- TbResource foundResource =
- resourceService.getResource(TenantId.SYS_TENANT_ID, ResourceType.LWM2M_MODEL, resource.getResourceKey());
+ TbResource foundResource = resourceService.findResourceByTenantIdAndKey(TenantId.SYS_TENANT_ID, ResourceType.LWM2M_MODEL, resource.getResourceKey());
if (foundResource == null) {
resourceService.saveResource(resource);
}
}
}
-
diff --git a/application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseUpgradeService.java b/application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseUpgradeService.java
index c02b7e9cc1..a4e9d61a74 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseUpgradeService.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseUpgradeService.java
@@ -63,6 +63,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
+import java.util.function.Consumer;
import static org.thingsboard.server.service.install.DatabaseHelper.ADDITIONAL_INFO;
import static org.thingsboard.server.service.install.DatabaseHelper.ASSIGNED_CUSTOMERS;
@@ -717,86 +718,73 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService
}
break;
case "3.5.0":
- try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
- log.info("Updating schema ...");
- if (isOldSchema(conn, 3005000)) {
- schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.5.0", SCHEMA_UPDATE_SQL);
- loadSql(schemaUpdateFile, conn);
- conn.createStatement().execute("UPDATE tb_schema_settings SET schema_version = 3005001;");
- }
- log.info("Schema updated.");
- } catch (Exception e) {
- log.error("Failed updating schema!!!", e);
- }
+ updateSchema("3.5.0", 3005000, "3.5.1", 3005001, null);
break;
case "3.5.1":
- try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
- if (isOldSchema(conn, 3005001)) {
- log.info("Updating schema ...");
- schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.5.1", SCHEMA_UPDATE_SQL);
- loadSql(schemaUpdateFile, conn);
-
- String[] entityNames = new String[]{"device", "component_descriptor", "customer", "dashboard", "rule_chain", "rule_node", "ota_package",
- "asset_profile", "asset", "device_profile", "tb_user", "tenant_profile", "tenant", "widgets_bundle", "entity_view", "edge"};
- for (String entityName : entityNames) {
- try {
- conn.createStatement().execute("ALTER TABLE " + entityName + " DROP COLUMN " + SEARCH_TEXT + " CASCADE");
- } catch (Exception e) {
- }
- }
+ updateSchema("3.5.1", 3005001, "3.6.0", 3006000, conn -> {
+ String[] entityNames = new String[]{"device", "component_descriptor", "customer", "dashboard", "rule_chain", "rule_node", "ota_package",
+ "asset_profile", "asset", "device_profile", "tb_user", "tenant_profile", "tenant", "widgets_bundle", "entity_view", "edge"};
+ for (String entityName : entityNames) {
try {
- conn.createStatement().execute("ALTER TABLE component_descriptor ADD COLUMN IF NOT EXISTS configuration_version int DEFAULT 0;");
+ conn.createStatement().execute("ALTER TABLE " + entityName + " DROP COLUMN " + SEARCH_TEXT + " CASCADE");
} catch (Exception e) {
}
- try {
- conn.createStatement().execute("ALTER TABLE rule_node ADD COLUMN IF NOT EXISTS configuration_version int DEFAULT 0;");
- } catch (Exception e) {
- }
- try {
- conn.createStatement().execute("CREATE INDEX IF NOT EXISTS idx_rule_node_type_configuration_version ON rule_node(type, configuration_version);");
- } catch (Exception e) {
- }
- try {
- conn.createStatement().execute("UPDATE rule_node SET " +
- "configuration = (configuration::jsonb || '{\"updateAttributesOnlyOnValueChange\": \"false\"}'::jsonb)::varchar, " +
- "configuration_version = 1 " +
- "WHERE type = 'org.thingsboard.rule.engine.telemetry.TbMsgAttributesNode' AND configuration_version < 1;");
- } catch (Exception e) {
- }
- try {
- conn.createStatement().execute("CREATE INDEX IF NOT EXISTS idx_notification_recipient_id_unread ON notification(recipient_id) WHERE status <> 'READ';");
- } catch (Exception e) {
- }
-
- conn.createStatement().execute("UPDATE tb_schema_settings SET schema_version = 3006000;");
- log.info("Schema updated to version 3.6.0.");
- } else {
- log.info("Skip schema re-update to version 3.6.0. Use env flag 'SKIP_SCHEMA_VERSION_CHECK' to force the re-update.");
}
- } catch (Exception e) {
- log.error("Failed updating schema!!!", e);
- }
+ try {
+ conn.createStatement().execute("ALTER TABLE component_descriptor ADD COLUMN IF NOT EXISTS configuration_version int DEFAULT 0;");
+ } catch (Exception e) {
+ }
+ try {
+ conn.createStatement().execute("ALTER TABLE rule_node ADD COLUMN IF NOT EXISTS configuration_version int DEFAULT 0;");
+ } catch (Exception e) {
+ }
+ try {
+ conn.createStatement().execute("CREATE INDEX IF NOT EXISTS idx_rule_node_type_configuration_version ON rule_node(type, configuration_version);");
+ } catch (Exception e) {
+ }
+ try {
+ conn.createStatement().execute("UPDATE rule_node SET " +
+ "configuration = (configuration::jsonb || '{\"updateAttributesOnlyOnValueChange\": \"false\"}'::jsonb)::varchar, " +
+ "configuration_version = 1 " +
+ "WHERE type = 'org.thingsboard.rule.engine.telemetry.TbMsgAttributesNode' AND configuration_version < 1;");
+ } catch (Exception e) {
+ }
+ try {
+ conn.createStatement().execute("CREATE INDEX IF NOT EXISTS idx_notification_recipient_id_unread ON notification(recipient_id) WHERE status <> 'READ';");
+ } catch (Exception e) {
+ }
+ });
break;
case "3.6.0":
- try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
- if (isOldSchema(conn, 3006000)) {
- log.info("Updating schema ...");
- schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.6.0", SCHEMA_UPDATE_SQL);
- loadSql(schemaUpdateFile, conn);
- conn.createStatement().execute("UPDATE tb_schema_settings SET schema_version = 3006001;");
- log.info("Schema updated to version 3.6.1.");
- } else {
- log.info("Skip schema re-update to version 3.6.1. Use env flag 'SKIP_SCHEMA_VERSION_CHECK' to force the re-update.");
- }
- } catch (Exception e) {
- log.error("Failed updating schema!!!", e);
- }
+ updateSchema("3.6.0", 3006000, "3.6.1", 3006001, null);
+ break;
+ case "3.6.1":
+ updateSchema("3.6.1", 3006001, "3.6.2", 3006002, null);
break;
default:
throw new RuntimeException("Unable to upgrade SQL database, unsupported fromVersion: " + fromVersion);
}
}
+ private void updateSchema(String oldVersionStr, int oldVersion, String newVersionStr, int newVersion, Consumer additionalAction) {
+ try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
+ log.info("Updating schema ...");
+ if (isOldSchema(conn, oldVersion)) {
+ Path schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", oldVersionStr, SCHEMA_UPDATE_SQL);
+ loadSql(schemaUpdateFile, conn);
+ if (additionalAction != null) {
+ additionalAction.accept(conn);
+ }
+ conn.createStatement().execute("UPDATE tb_schema_settings SET schema_version = " + newVersion + ";");
+ log.info("Schema updated to version {}", newVersionStr);
+ } else {
+ log.info("Skip schema re-update to version {}. Use env flag 'SKIP_SCHEMA_VERSION_CHECK' to force the re-update.", newVersionStr);
+ }
+ } catch (Exception e) {
+ log.error("Failed updating schema!!!", e);
+ }
+ }
+
private void runSchemaUpdateScript(Connection connection, String version) throws Exception {
Path schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", version, SCHEMA_UPDATE_SQL);
loadSql(schemaUpdateFile, connection);
diff --git a/application/src/main/java/org/thingsboard/server/service/install/update/ImagesUpdater.java b/application/src/main/java/org/thingsboard/server/service/install/update/ImagesUpdater.java
new file mode 100644
index 0000000000..e711bf2682
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/install/update/ImagesUpdater.java
@@ -0,0 +1,133 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.install.update;
+
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.common.data.Dashboard;
+import org.thingsboard.server.common.data.HasImage;
+import org.thingsboard.server.common.data.id.EntityId;
+import org.thingsboard.server.common.data.id.TenantId;
+import org.thingsboard.server.common.data.page.PageDataIterable;
+import org.thingsboard.server.dao.Dao;
+import org.thingsboard.server.dao.asset.AssetProfileDao;
+import org.thingsboard.server.dao.dashboard.DashboardDao;
+import org.thingsboard.server.dao.device.DeviceProfileDao;
+import org.thingsboard.server.dao.resource.ImageService;
+import org.thingsboard.server.dao.widget.WidgetTypeDao;
+import org.thingsboard.server.dao.widget.WidgetsBundleDao;
+
+import java.util.function.BiFunction;
+import java.util.function.Function;
+
+@Component
+@RequiredArgsConstructor
+@Slf4j
+public class ImagesUpdater {
+ private final ImageService imageService;
+ private final WidgetsBundleDao widgetsBundleDao;
+ private final WidgetTypeDao widgetTypeDao;
+ private final DashboardDao dashboardDao;
+ private final DeviceProfileDao deviceProfileDao;
+ private final AssetProfileDao assetProfileDao;
+
+ public void updateWidgetsBundlesImages() {
+ log.info("Updating widgets bundles images...");
+ var widgetsBundles = new PageDataIterable<>(widgetsBundleDao::findAllWidgetsBundles, 128);
+ updateImages(widgetsBundles, "bundle", imageService::replaceBase64WithImageUrl, widgetsBundleDao);
+ }
+
+ public void updateWidgetTypesImages() {
+ log.info("Updating widget types images...");
+ var widgetTypesIds = new PageDataIterable<>(widgetTypeDao::findAllWidgetTypesIds, 1024);
+ updateImages(widgetTypesIds, "widget type", imageService::replaceBase64WithImageUrl, widgetTypeDao);
+ }
+
+ public void updateDashboardsImages() {
+ log.info("Updating dashboards images...");
+ var dashboardsIds = new PageDataIterable<>(dashboardDao::findAllIds, 1024);
+ updateImages(dashboardsIds, "dashboard", imageService::replaceBase64WithImageUrl, dashboardDao);
+ }
+
+ public void createSystemImages(Dashboard defaultDashboard) {
+ defaultDashboard.setTenantId(TenantId.SYS_TENANT_ID);
+ boolean created = imageService.replaceBase64WithImageUrl(defaultDashboard);
+ if (created) {
+ log.debug("Created system images for default dashboard '{}'", defaultDashboard.getTitle());
+ }
+ }
+
+ public void updateDeviceProfilesImages() {
+ log.info("Updating device profiles images...");
+ var deviceProfiles = new PageDataIterable<>(deviceProfileDao::findAllWithImages, 256);
+ updateImages(deviceProfiles, "device profile", imageService::replaceBase64WithImageUrl, deviceProfileDao);
+ }
+
+ public void updateAssetProfilesImages() {
+ log.info("Updating asset profiles images...");
+ var assetProfiles = new PageDataIterable<>(assetProfileDao::findAllWithImages, 256);
+ updateImages(assetProfiles, "asset profile", imageService::replaceBase64WithImageUrl, assetProfileDao);
+ }
+
+ private void updateImages(Iterable entities, String type,
+ BiFunction updater, Dao dao) {
+ int updatedCount = 0;
+ int totalCount = 0;
+ for (E entity : entities) {
+ totalCount++;
+ try {
+ boolean updated = updater.apply(entity, type);
+ if (updated) {
+ dao.save(entity.getTenantId(), entity);
+ log.debug("[{}][{}] Updated {} images", entity.getTenantId(), entity.getName(), type);
+ updatedCount++;
+ }
+ } catch (Exception e) {
+ log.error("[{}][{}] Failed to update {} images", entity.getTenantId(), entity.getName(), type, e);
+ }
+ if (totalCount % 100 == 0) {
+ log.info("Processed {} {}s so far", totalCount, type);
+ }
+ }
+ log.info("Updated {} {}s out of {}", updatedCount, type, totalCount);
+ }
+
+ private void updateImages(Iterable extends EntityId> entitiesIds, String type,
+ Function updater, Dao dao) {
+ int updatedCount = 0;
+ int totalCount = 0;
+ for (EntityId id : entitiesIds) {
+ totalCount++;
+ E entity = dao.findById(TenantId.SYS_TENANT_ID, id.getId());
+ try {
+ boolean updated = updater.apply(entity);
+ if (updated) {
+ dao.save(entity.getTenantId(), entity);
+ log.debug("[{}][{}] Updated {} images", entity.getTenantId(), entity.getName(), type);
+ updatedCount++;
+ }
+ } catch (Exception e) {
+ log.error("[{}][{}] Failed to update {} images", entity.getTenantId(), entity.getName(), type, e);
+ }
+ if (totalCount % 100 == 0) {
+ log.info("Processed {} {}s so far", totalCount, type);
+ }
+ }
+ log.info("Updated {} {}s out of {}", updatedCount, type, totalCount);
+ }
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java b/application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java
index f96e49930c..14930912d1 100644
--- a/application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java
+++ b/application/src/main/java/org/thingsboard/server/service/queue/DefaultTbClusterService.java
@@ -81,7 +81,7 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
-import static org.thingsboard.server.service.queue.ProtoUtils.toProto;
+import static org.thingsboard.server.common.util.ProtoUtils.toProto;
@Service
@Slf4j
@@ -308,10 +308,17 @@ public class DefaultTbClusterService implements TbClusterService {
}
@Override
- public void onDeviceDeleted(Device device, TbQueueCallback callback) {
- broadcastEntityDeleteToTransport(device.getTenantId(), device.getId(), device.getName(), callback);
- sendDeviceStateServiceEvent(device.getTenantId(), device.getId(), false, false, true);
- broadcastEntityStateChangeEvent(device.getTenantId(), device.getId(), ComponentLifecycleEvent.DELETED);
+ public void onDeviceDeleted(TenantId tenantId, Device device, TbQueueCallback callback) {
+ DeviceId deviceId = device.getId();
+ broadcastEntityDeleteToTransport(tenantId, deviceId, device.getName(), callback);
+ sendDeviceStateServiceEvent(tenantId, deviceId, false, false, true);
+ broadcastEntityStateChangeEvent(tenantId, deviceId, ComponentLifecycleEvent.DELETED);
+ }
+
+ @Override
+ public void onDeviceAssignedToTenant(TenantId oldTenantId, Device device) {
+ onDeviceDeleted(oldTenantId, device, null);
+ sendDeviceStateServiceEvent(device.getTenantId(), device.getId(), true, false, false);
}
@Override
diff --git a/application/src/main/java/org/thingsboard/server/service/queue/DefaultTbCoreConsumerService.java b/application/src/main/java/org/thingsboard/server/service/queue/DefaultTbCoreConsumerService.java
index 754537ef11..5283713126 100644
--- a/application/src/main/java/org/thingsboard/server/service/queue/DefaultTbCoreConsumerService.java
+++ b/application/src/main/java/org/thingsboard/server/service/queue/DefaultTbCoreConsumerService.java
@@ -45,6 +45,7 @@ import org.thingsboard.server.common.msg.queue.ServiceType;
import org.thingsboard.server.common.msg.queue.TbCallback;
import org.thingsboard.server.common.msg.rpc.FromDeviceRpcResponse;
import org.thingsboard.server.common.stats.StatsFactory;
+import org.thingsboard.server.common.util.ProtoUtils;
import org.thingsboard.server.dao.tenant.TbTenantProfileCache;
import org.thingsboard.server.gen.transport.TransportProtos;
import org.thingsboard.server.gen.transport.TransportProtos.DeviceStateServiceMsgProto;
@@ -82,6 +83,8 @@ import org.thingsboard.server.service.profile.TbAssetProfileCache;
import org.thingsboard.server.service.profile.TbDeviceProfileCache;
import org.thingsboard.server.service.queue.processing.AbstractConsumerService;
import org.thingsboard.server.service.queue.processing.IdMsgPair;
+import org.thingsboard.server.dao.resource.ImageCacheKey;
+import org.thingsboard.server.service.resource.TbImageService;
import org.thingsboard.server.service.rpc.TbCoreDeviceRpcService;
import org.thingsboard.server.common.msg.rpc.ToDeviceRpcRequestActorMsg;
import org.thingsboard.server.service.security.auth.jwt.settings.JwtSettingsService;
@@ -140,6 +143,7 @@ public class DefaultTbCoreConsumerService extends AbstractConsumerService> usageStatsConsumer;
private final TbQueueConsumer> firmwareStatesConsumer;
+ private final TbImageService imageService;
protected volatile ExecutorService consumersExecutor;
protected volatile ExecutorService usageStatsExecutor;
@@ -165,7 +169,8 @@ public class DefaultTbCoreConsumerService extends AbstractConsumerService jwtSettingsService,
NotificationSchedulerService notificationSchedulerService,
- NotificationRuleProcessor notificationRuleProcessor) {
+ NotificationRuleProcessor notificationRuleProcessor,
+ TbImageService imageService) {
super(actorContext, encodingService, tenantProfileCache, deviceProfileCache, assetProfileCache, apiUsageStateService, partitionService, eventPublisher, tbCoreQueueFactory.createToCoreNotificationsMsgConsumer(), jwtSettingsService);
this.mainConsumer = tbCoreQueueFactory.createToCoreMsgConsumer();
this.usageStatsConsumer = tbCoreQueueFactory.createToUsageStatsServiceMsgConsumer();
@@ -181,6 +186,7 @@ public class DefaultTbCoreConsumerService extends AbstractConsumerService etagCache;
+
+ public DefaultTbImageService(TbClusterService clusterService, ImageService imageService,
+ @Value("${cache.image.etag.timeToLiveInMinutes:44640}") int cacheTtl,
+ @Value("${cache.image.etag.maxSize:10000}") int cacheMaxSize) {
+ this.clusterService = clusterService;
+ this.imageService = imageService;
+ this.etagCache = Caffeine.newBuilder()
+ .expireAfterAccess(cacheTtl, TimeUnit.MINUTES)
+ .maximumSize(cacheMaxSize)
+ .build();
+ }
+
+ @Override
+ public String getETag(ImageCacheKey imageCacheKey) {
+ return etagCache.getIfPresent(imageCacheKey);
+ }
+
+ @Override
+ public void putETag(ImageCacheKey imageCacheKey, String etag) {
+ etagCache.put(imageCacheKey, etag);
+ }
+
+ @Override
+ public void evictETag(ImageCacheKey imageCacheKey) {
+ etagCache.invalidate(imageCacheKey);
+ }
+
+ @Override
+ public TbResourceInfo save(TbResource image, User user) throws Exception {
+ ActionType actionType = image.getId() == null ? ActionType.ADDED : ActionType.UPDATED;
+ TenantId tenantId = image.getTenantId();
+ try {
+ var oldEtag = getEtag(image);
+ if (image.getId() == null && StringUtils.isNotEmpty(image.getResourceKey())) {
+ var existingImage = imageService.getImageInfoByTenantIdAndKey(tenantId, image.getResourceKey());
+ if (existingImage != null) {
+ image.setId(existingImage.getId());
+ }
+ }
+ TbResourceInfo savedImage = imageService.saveImage(image);
+ notificationEntityService.logEntityAction(tenantId, savedImage.getId(), savedImage, actionType, user);
+ if (oldEtag.isPresent()) {
+ var newEtag = getEtag(savedImage);
+ if (newEtag.isPresent() && !oldEtag.get().equals(newEtag.get())) {
+ evictETag(new ImageCacheKey(image.getTenantId(), image.getResourceKey(), false));
+ evictETag(new ImageCacheKey(image.getTenantId(), image.getResourceKey(), true));
+ clusterService.broadcastToCore(TransportProtos.ToCoreNotificationMsg.newBuilder()
+ .setResourceCacheInvalidateMsg(TransportProtos.ResourceCacheInvalidateMsg.newBuilder()
+ .setTenantIdMSB(tenantId.getId().getMostSignificantBits())
+ .setTenantIdLSB(tenantId.getId().getLeastSignificantBits())
+ .setResourceKey(image.getResourceKey())
+ .build())
+ .build());
+ }
+ }
+ return savedImage;
+ } catch (Exception e) {
+ image.setData(null);
+ notificationEntityService.logEntityAction(tenantId, emptyId(EntityType.TB_RESOURCE), image, actionType, user, e);
+ throw e;
+ }
+ }
+
+ private Optional getEtag(TbResourceInfo image) throws JsonProcessingException {
+ var descriptor = image.getDescriptor(ImageDescriptor.class);
+ return Optional.ofNullable(descriptor != null ? descriptor.getEtag() : null);
+ }
+
+ private Optional getPreviewEtag(TbResourceInfo image) throws JsonProcessingException {
+ var descriptor = image.getDescriptor(ImageDescriptor.class);
+ descriptor = descriptor != null ? descriptor.getPreviewDescriptor() : null;
+ return Optional.ofNullable(descriptor != null ? descriptor.getEtag() : null);
+ }
+
+ @Override
+ public TbResourceInfo save(TbResourceInfo imageInfo, User user) {
+ TenantId tenantId = imageInfo.getTenantId();
+ TbResourceId imageId = imageInfo.getId();
+ try {
+ imageInfo = imageService.saveImageInfo(imageInfo);
+ notificationEntityService.logEntityAction(tenantId, imageId, imageInfo, ActionType.UPDATED, user);
+ return imageInfo;
+ } catch (Exception e) {
+ notificationEntityService.logEntityAction(tenantId, imageId, imageInfo, ActionType.UPDATED, user, e);
+ throw e;
+ }
+ }
+
+ @Override
+ public TbImageDeleteResult delete(TbResourceInfo imageInfo, User user, boolean force) {
+ TenantId tenantId = imageInfo.getTenantId();
+ TbResourceId imageId = imageInfo.getId();
+ try {
+ TbImageDeleteResult result = imageService.deleteImage(imageInfo, force);
+ if (result.isSuccess()) {
+ notificationEntityService.logEntityAction(tenantId, imageId, imageInfo, ActionType.DELETED, user, imageId.toString());
+ }
+ return result;
+ } catch (Exception e) {
+ notificationEntityService.logEntityAction(tenantId, imageId, ActionType.DELETED, user, e, imageId.toString());
+ throw e;
+ }
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/resource/DefaultTbResourceService.java b/application/src/main/java/org/thingsboard/server/service/resource/DefaultTbResourceService.java
index 064511abd9..2705092b04 100644
--- a/application/src/main/java/org/thingsboard/server/service/resource/DefaultTbResourceService.java
+++ b/application/src/main/java/org/thingsboard/server/service/resource/DefaultTbResourceService.java
@@ -15,34 +15,24 @@
*/
package org.thingsboard.server.service.resource;
-import com.google.common.hash.HashCode;
-import com.google.common.hash.Hashing;
+import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.ResourceType;
-import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.TbResource;
-import org.thingsboard.server.common.data.TbResourceInfo;
-import org.thingsboard.server.common.data.TbResourceInfoFilter;
import org.thingsboard.server.common.data.User;
import org.thingsboard.server.common.data.audit.ActionType;
-import org.thingsboard.server.common.data.exception.ThingsboardErrorCode;
import org.thingsboard.server.common.data.exception.ThingsboardException;
import org.thingsboard.server.common.data.id.TbResourceId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.lwm2m.LwM2mObject;
import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
-import org.thingsboard.server.common.data.widget.BaseWidgetType;
-import org.thingsboard.server.common.data.widget.WidgetTypeDetails;
-import org.thingsboard.server.dao.exception.DataValidationException;
import org.thingsboard.server.dao.resource.ResourceService;
-import org.thingsboard.server.dao.widget.WidgetTypeService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.entitiy.AbstractTbEntityService;
-import java.util.Base64;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
@@ -56,39 +46,51 @@ import static org.thingsboard.server.utils.LwM2mObjectModelUtils.toLwm2mResource
@Slf4j
@Service
@TbCoreComponent
+@RequiredArgsConstructor
public class DefaultTbResourceService extends AbstractTbEntityService implements TbResourceService {
private final ResourceService resourceService;
- private final WidgetTypeService widgetTypeService;
-
- public DefaultTbResourceService(ResourceService resourceService, WidgetTypeService widgetTypeService) {
- this.resourceService = resourceService;
- this.widgetTypeService = widgetTypeService;
- }
-
- @Override
- public TbResource getResource(TenantId tenantId, ResourceType resourceType, String resourceId) {
- return resourceService.getResource(tenantId, resourceType, resourceId);
- }
-
- @Override
- public TbResource findResourceById(TenantId tenantId, TbResourceId resourceId) {
- return resourceService.findResourceById(tenantId, resourceId);
- }
-
- @Override
- public TbResourceInfo findResourceInfoById(TenantId tenantId, TbResourceId resourceId) {
- return resourceService.findResourceInfoById(tenantId, resourceId);
- }
@Override
- public PageData findAllTenantResourcesByTenantId(TbResourceInfoFilter filter, PageLink pageLink) {
- return resourceService.findAllTenantResourcesByTenantId(filter, pageLink);
+ public TbResource save(TbResource resource, User user) throws ThingsboardException {
+ if (resource.getResourceType() == ResourceType.IMAGE) {
+ throw new IllegalArgumentException("Image resource type is not supported");
+ }
+ ActionType actionType = resource.getId() == null ? ActionType.ADDED : ActionType.UPDATED;
+ TenantId tenantId = resource.getTenantId();
+ try {
+ if (ResourceType.LWM2M_MODEL.equals(resource.getResourceType())) {
+ toLwm2mResource(resource);
+ } else if (resource.getResourceKey() == null) {
+ resource.setResourceKey(resource.getFileName());
+ }
+ TbResource savedResource = resourceService.saveResource(resource);
+ tbClusterService.onResourceChange(savedResource, null);
+ notificationEntityService.logEntityAction(tenantId, savedResource.getId(), savedResource, actionType, user);
+ return savedResource;
+ } catch (Exception e) {
+ notificationEntityService.logEntityAction(tenantId, emptyId(EntityType.TB_RESOURCE),
+ resource, actionType, user, e);
+ throw e;
+ }
}
@Override
- public PageData findTenantResourcesByTenantId(TbResourceInfoFilter filter, PageLink pageLink) {
- return resourceService.findTenantResourcesByTenantId(filter, pageLink);
+ public void delete(TbResource tbResource, User user) {
+ if (tbResource.getResourceType() == ResourceType.IMAGE) {
+ throw new IllegalArgumentException("Image resource type is not supported");
+ }
+ TbResourceId resourceId = tbResource.getId();
+ TenantId tenantId = tbResource.getTenantId();
+ try {
+ resourceService.deleteResource(tenantId, resourceId);
+ tbClusterService.onResourceDeleted(tbResource, null);
+ notificationEntityService.logEntityAction(tenantId, resourceId, tbResource, ActionType.DELETED, user, resourceId.toString());
+ } catch (Exception e) {
+ notificationEntityService.logEntityAction(tenantId, emptyId(EntityType.TB_RESOURCE),
+ ActionType.DELETED, user, e, resourceId.toString());
+ throw e;
+ }
}
@Override
@@ -114,16 +116,6 @@ public class DefaultTbResourceService extends AbstractTbEntityService implements
.collect(Collectors.toList());
}
- @Override
- public void deleteResourcesByTenantId(TenantId tenantId) {
- resourceService.deleteResourcesByTenantId(tenantId);
- }
-
- @Override
- public long sumDataSizeByTenantId(TenantId tenantId) {
- return resourceService.sumDataSizeByTenantId(tenantId);
- }
-
private Comparator super LwM2mObject> getComparator(String sortProperty, String sortOrder) {
Comparator comparator;
if ("name".equals(sortProperty)) {
@@ -134,50 +126,4 @@ public class DefaultTbResourceService extends AbstractTbEntityService implements
return "DESC".equals(sortOrder) ? comparator.reversed() : comparator;
}
- @Override
- public TbResource save(TbResource tbResource, User user) throws ThingsboardException {
- ActionType actionType = tbResource.getId() == null ? ActionType.ADDED : ActionType.UPDATED;
- TenantId tenantId = tbResource.getTenantId();
- try {
- TbResource savedResource = checkNotNull(doSave(tbResource));
- tbClusterService.onResourceChange(savedResource, null);
- notificationEntityService.logEntityAction(tenantId, savedResource.getId(), savedResource, actionType, user);
- return savedResource;
- } catch (Exception e) {
- notificationEntityService.logEntityAction(tenantId, emptyId(EntityType.TB_RESOURCE),
- tbResource, actionType, user, e);
- throw e;
- }
- }
-
- @Override
- public void delete(TbResource tbResource, User user) {
- TbResourceId resourceId = tbResource.getId();
- TenantId tenantId = tbResource.getTenantId();
- try {
- resourceService.deleteResource(tenantId, resourceId);
- tbClusterService.onResourceDeleted(tbResource, null);
- notificationEntityService.logEntityAction(tenantId, resourceId, tbResource, ActionType.DELETED, user, resourceId.toString());
- } catch (Exception e) {
- notificationEntityService.logEntityAction(tenantId, emptyId(EntityType.TB_RESOURCE),
- ActionType.DELETED, user, e, resourceId.toString());
- throw e;
- }
- }
-
- private TbResource doSave(TbResource resource) throws ThingsboardException {
- log.trace("Executing saveResource [{}]", resource);
- if (StringUtils.isEmpty(resource.getData())) {
- throw new DataValidationException("Resource data should be specified!");
- }
- if (ResourceType.LWM2M_MODEL.equals(resource.getResourceType())) {
- toLwm2mResource(resource);
- } else {
- resource.setResourceKey(resource.getFileName());
- }
- HashCode hashCode = Hashing.sha256().hashBytes(Base64.getDecoder().decode(resource.getData().getBytes()));
- resource.setEtag(hashCode.toString());
- return resourceService.saveResource(resource);
- }
}
-
diff --git a/application/src/main/java/org/thingsboard/server/service/resource/TbImageService.java b/application/src/main/java/org/thingsboard/server/service/resource/TbImageService.java
new file mode 100644
index 0000000000..c29cc6ad3b
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/resource/TbImageService.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.resource;
+
+import org.thingsboard.server.common.data.TbImageDeleteResult;
+import org.thingsboard.server.common.data.TbResource;
+import org.thingsboard.server.common.data.TbResourceInfo;
+import org.thingsboard.server.common.data.User;
+import org.thingsboard.server.dao.resource.ImageCacheKey;
+
+public interface TbImageService {
+
+ TbResourceInfo save(TbResource image, User user) throws Exception;
+
+ TbResourceInfo save(TbResourceInfo imageInfo, User user);
+
+ TbImageDeleteResult delete(TbResourceInfo imageInfo, User user, boolean force);
+
+ String getETag(ImageCacheKey imageCacheKey);
+
+ void putETag(ImageCacheKey imageCacheKey, String etag);
+
+ void evictETag(ImageCacheKey imageCacheKey);
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/resource/TbResourceService.java b/application/src/main/java/org/thingsboard/server/service/resource/TbResourceService.java
index 40fe7dda9a..e6dbc0f071 100644
--- a/application/src/main/java/org/thingsboard/server/service/resource/TbResourceService.java
+++ b/application/src/main/java/org/thingsboard/server/service/resource/TbResourceService.java
@@ -15,14 +15,9 @@
*/
package org.thingsboard.server.service.resource;
-import org.thingsboard.server.common.data.ResourceType;
import org.thingsboard.server.common.data.TbResource;
-import org.thingsboard.server.common.data.TbResourceInfo;
-import org.thingsboard.server.common.data.TbResourceInfoFilter;
-import org.thingsboard.server.common.data.id.TbResourceId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.lwm2m.LwM2mObject;
-import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
import org.thingsboard.server.service.entitiy.SimpleTbEntityService;
@@ -30,16 +25,6 @@ import java.util.List;
public interface TbResourceService extends SimpleTbEntityService {
- TbResource getResource(TenantId tenantId, ResourceType resourceType, String resourceKey);
-
- TbResource findResourceById(TenantId tenantId, TbResourceId resourceId);
-
- TbResourceInfo findResourceInfoById(TenantId tenantId, TbResourceId resourceId);
-
- PageData findAllTenantResourcesByTenantId(TbResourceInfoFilter filter, PageLink pageLink);
-
- PageData findTenantResourcesByTenantId(TbResourceInfoFilter filter, PageLink pageLink);
-
List findLwM2mObject(TenantId tenantId,
String sortOrder,
String sortProperty,
@@ -50,7 +35,4 @@ public interface TbResourceService extends SimpleTbEntityService {
String sortOrder,
PageLink pageLink);
- void deleteResourcesByTenantId(TenantId tenantId);
-
- long sumDataSizeByTenantId(TenantId tenantId);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/HttpCookieOAuth2AuthorizationRequestRepository.java b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/HttpCookieOAuth2AuthorizationRequestRepository.java
index d63f759dd3..98ccb2c1be 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/HttpCookieOAuth2AuthorizationRequestRepository.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/HttpCookieOAuth2AuthorizationRequestRepository.java
@@ -18,11 +18,13 @@ package org.thingsboard.server.service.security.auth.oauth2;
import org.springframework.security.oauth2.client.web.AuthorizationRequestRepository;
import org.springframework.security.oauth2.core.endpoint.OAuth2AuthorizationRequest;
import org.springframework.stereotype.Component;
+import org.thingsboard.server.queue.util.TbCoreComponent;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Component
+@TbCoreComponent
public class HttpCookieOAuth2AuthorizationRequestRepository implements AuthorizationRequestRepository {
public static final String OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME = "oauth2_auth_request";
public static final String PREV_URI_PARAMETER = "prevUri";
diff --git a/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/DefaultExportableEntitiesService.java b/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/DefaultExportableEntitiesService.java
index 3358e5182f..d112075a51 100644
--- a/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/DefaultExportableEntitiesService.java
+++ b/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/DefaultExportableEntitiesService.java
@@ -118,6 +118,16 @@ public class DefaultExportableEntitiesService implements ExportableEntitiesServi
}
}
+ @Override
+ public PageData findEntitiesIdsByTenantId(TenantId tenantId, EntityType entityType, PageLink pageLink) {
+ ExportableEntityDao dao = getExportableEntityDao(entityType);
+ if (dao != null) {
+ return dao.findIdsByTenantId(tenantId.getId(), pageLink);
+ } else {
+ return new PageData<>();
+ }
+ }
+
@Override
public I getExternalIdByInternal(I internalId) {
ExportableEntityDao dao = getExportableEntityDao(internalId.getEntityType());
diff --git a/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/ExportableEntitiesService.java b/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/ExportableEntitiesService.java
index c5c26c4476..eee102961d 100644
--- a/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/ExportableEntitiesService.java
+++ b/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/ExportableEntitiesService.java
@@ -35,6 +35,8 @@ public interface ExportableEntitiesService {
, I extends EntityId> PageData findEntitiesByTenantId(TenantId tenantId, EntityType entityType, PageLink pageLink);
+ PageData findEntitiesIdsByTenantId(TenantId tenantId, EntityType entityType, PageLink pageLink);
+
I getExternalIdByInternal(I internalId);
void removeById(TenantId tenantId, I id);
diff --git a/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/ResourceExportService.java b/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/ResourceExportService.java
new file mode 100644
index 0000000000..45e21f5fb4
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/sync/ie/exporting/impl/ResourceExportService.java
@@ -0,0 +1,36 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.sync.ie.exporting.impl;
+
+import org.springframework.stereotype.Service;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.TbResource;
+import org.thingsboard.server.common.data.id.TbResourceId;
+import org.thingsboard.server.common.data.sync.ie.EntityExportData;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+
+import java.util.Set;
+
+@Service
+@TbCoreComponent
+public class ResourceExportService extends BaseEntityExportService> {
+
+ @Override
+ public Set getSupportedEntityTypes() {
+ return Set.of(EntityType.TB_RESOURCE);
+ }
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/csv/AbstractBulkImportService.java b/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/csv/AbstractBulkImportService.java
index c03dd8dcb7..30765bd959 100644
--- a/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/csv/AbstractBulkImportService.java
+++ b/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/csv/AbstractBulkImportService.java
@@ -47,7 +47,7 @@ import org.thingsboard.server.common.data.sync.ie.importing.csv.BulkImportColumn
import org.thingsboard.server.common.data.sync.ie.importing.csv.BulkImportRequest;
import org.thingsboard.server.common.data.sync.ie.importing.csv.BulkImportResult;
import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration;
-import org.thingsboard.server.common.transport.adaptor.JsonConverter;
+import org.thingsboard.server.common.adaptor.JsonConverter;
import org.thingsboard.server.controller.BaseController;
import org.thingsboard.server.dao.tenant.TbTenantProfileCache;
import org.thingsboard.server.service.action.EntityActionService;
diff --git a/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/ResourceImportService.java b/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/ResourceImportService.java
new file mode 100644
index 0000000000..bc7db18e80
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/ResourceImportService.java
@@ -0,0 +1,83 @@
+/**
+ * Copyright © 2016-2023 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.sync.ie.importing.impl;
+
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.TbResource;
+import org.thingsboard.server.common.data.User;
+import org.thingsboard.server.common.data.exception.ThingsboardException;
+import org.thingsboard.server.common.data.id.TbResourceId;
+import org.thingsboard.server.common.data.id.TenantId;
+import org.thingsboard.server.common.data.sync.ie.EntityExportData;
+import org.thingsboard.server.dao.resource.ResourceService;
+import org.thingsboard.server.queue.util.TbCoreComponent;
+import org.thingsboard.server.service.sync.vc.data.EntitiesImportCtx;
+
+@Service
+@TbCoreComponent
+@RequiredArgsConstructor
+public class ResourceImportService extends BaseEntityImportService> {
+
+ private final ResourceService resourceService;
+
+ @Override
+ protected void setOwner(TenantId tenantId, TbResource resource, IdProvider idProvider) {
+ resource.setTenantId(tenantId);
+ }
+
+ @Override
+ protected TbResource prepare(EntitiesImportCtx ctx, TbResource resource, TbResource oldResource, EntityExportData exportData, IdProvider idProvider) {
+ return resource;
+ }
+
+ @Override
+ protected TbResource findExistingEntity(EntitiesImportCtx ctx, TbResource resource, IdProvider idProvider) {
+ TbResource existingResource = super.findExistingEntity(ctx, resource, idProvider);
+ if (existingResource == null && ctx.isFindExistingByName()) {
+ existingResource = resourceService.findResourceByTenantIdAndKey(ctx.getTenantId(), resource.getResourceType(), resource.getResourceKey());
+ }
+ return existingResource;
+ }
+
+ @Override
+ protected boolean compare(EntitiesImportCtx ctx, EntityExportData exportData, TbResource prepared, TbResource existing) {
+ return true;
+ }
+
+ @Override
+ protected TbResource deepCopy(TbResource resource) {
+ return new TbResource(resource);
+ }
+
+ @Override
+ protected TbResource saveOrUpdate(EntitiesImportCtx ctx, TbResource resource, EntityExportData exportData, IdProvider idProvider) {
+ return resourceService.saveResource(resource);
+ }
+
+ @Override
+ protected void onEntitySaved(User user, TbResource savedResource, TbResource oldResource) throws ThingsboardException {
+ super.onEntitySaved(user, savedResource, oldResource);
+ clusterService.onResourceChange(savedResource, null);
+ }
+
+ @Override
+ public EntityType getEntityType() {
+ return EntityType.TB_RESOURCE;
+ }
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/WidgetTypeImportService.java b/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/WidgetTypeImportService.java
index 88ebbbcee3..78cd9a66f6 100644
--- a/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/WidgetTypeImportService.java
+++ b/application/src/main/java/org/thingsboard/server/service/sync/ie/importing/impl/WidgetTypeImportService.java
@@ -20,13 +20,9 @@ import org.springframework.stereotype.Service;
import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.id.WidgetTypeId;
-import org.thingsboard.server.common.data.id.WidgetsBundleId;
import org.thingsboard.server.common.data.sync.ie.WidgetTypeExportData;
-import org.thingsboard.server.common.data.sync.ie.WidgetsBundleExportData;
import org.thingsboard.server.common.data.widget.WidgetTypeDetails;
-import org.thingsboard.server.common.data.widget.WidgetsBundle;
import org.thingsboard.server.dao.widget.WidgetTypeService;
-import org.thingsboard.server.dao.widget.WidgetsBundleService;
import org.thingsboard.server.queue.util.TbCoreComponent;
import org.thingsboard.server.service.sync.vc.data.EntitiesImportCtx;
diff --git a/application/src/main/java/org/thingsboard/server/service/sync/vc/DefaultEntitiesVersionControlService.java b/application/src/main/java/org/thingsboard/server/service/sync/vc/DefaultEntitiesVersionControlService.java
index 89d5153a81..f98a2ad780 100644
--- a/application/src/main/java/org/thingsboard/server/service/sync/vc/DefaultEntitiesVersionControlService.java
+++ b/application/src/main/java/org/thingsboard/server/service/sync/vc/DefaultEntitiesVersionControlService.java
@@ -208,10 +208,10 @@ public class DefaultEntitiesVersionControlService implements EntitiesVersionCont
}
if (config.isAllEntities()) {
- DaoUtil.processInBatches(pageLink -> exportableEntitiesService.findEntitiesByTenantId(ctx.getTenantId(), entityType, pageLink)
- , 100, entity -> {
+ DaoUtil.processInBatches(pageLink -> exportableEntitiesService.findEntitiesIdsByTenantId(ctx.getTenantId(), entityType, pageLink),
+ 100, entityId -> {
try {
- ctx.add(saveEntityData(ctx, entity.getId()));
+ ctx.add(saveEntityData(ctx, entityId));
} catch (Exception e) {
throw new RuntimeException(e);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/DefaultTelemetrySubscriptionService.java b/application/src/main/java/org/thingsboard/server/service/telemetry/DefaultTelemetrySubscriptionService.java
index df3a15e765..e66029a8a1 100644
--- a/application/src/main/java/org/thingsboard/server/service/telemetry/DefaultTelemetrySubscriptionService.java
+++ b/application/src/main/java/org/thingsboard/server/service/telemetry/DefaultTelemetrySubscriptionService.java
@@ -175,20 +175,21 @@ public class DefaultTelemetrySubscriptionService extends AbstractSubscriptionSer
@Override
public void saveAndNotifyInternal(TenantId tenantId, EntityId entityId, List ts, long ttl, FutureCallback callback) {
ListenableFuture saveFuture = tsService.save(tenantId, entityId, ts, ttl);
- addCallbacks(tenantId, entityId, ts, callback, saveFuture);
+ addMainCallback(saveFuture, callback);
+ addWsCallback(saveFuture, success -> onTimeSeriesUpdate(tenantId, entityId, ts));
+ addEntityViewCallback(tenantId, entityId, ts);
}
private void saveWithoutLatestAndNotifyInternal(TenantId tenantId, EntityId entityId, List ts, long ttl, FutureCallback callback) {
ListenableFuture saveFuture = tsService.saveWithoutLatest(tenantId, entityId, ts, ttl);
- addCallbacks(tenantId, entityId, ts, callback, saveFuture);
- }
-
- private void addCallbacks(TenantId tenantId, EntityId entityId, List ts, FutureCallback callback, ListenableFuture saveFuture) {
addMainCallback(saveFuture, callback);
addWsCallback(saveFuture, success -> onTimeSeriesUpdate(tenantId, entityId, ts));
+ }
+
+ private void addEntityViewCallback(TenantId tenantId, EntityId entityId, List ts) {
if (EntityType.DEVICE.equals(entityId.getEntityType()) || EntityType.ASSET.equals(entityId.getEntityType())) {
Futures.addCallback(this.tbEntityViewService.findEntityViewsByTenantIdAndEntityIdAsync(tenantId, entityId),
- new FutureCallback>() {
+ new FutureCallback<>() {
@Override
public void onSuccess(@Nullable List result) {
if (result != null && !result.isEmpty()) {
@@ -212,7 +213,7 @@ public class DefaultTelemetrySubscriptionService extends AbstractSubscriptionSer
}
}
if (!entityViewLatest.isEmpty()) {
- saveLatestAndNotify(tenantId, entityView.getId(), entityViewLatest, new FutureCallback() {
+ saveLatestAndNotify(tenantId, entityView.getId(), entityViewLatest, new FutureCallback<>() {
@Override
public void onSuccess(@Nullable Void tmp) {
}
diff --git a/application/src/main/java/org/thingsboard/server/service/transport/DefaultTransportApiService.java b/application/src/main/java/org/thingsboard/server/service/transport/DefaultTransportApiService.java
index 3505052fca..f622b1fee0 100644
--- a/application/src/main/java/org/thingsboard/server/service/transport/DefaultTransportApiService.java
+++ b/application/src/main/java/org/thingsboard/server/service/transport/DefaultTransportApiService.java
@@ -78,9 +78,11 @@ import org.thingsboard.server.dao.device.provision.ProvisionFailedException;
import org.thingsboard.server.dao.device.provision.ProvisionRequest;
import org.thingsboard.server.dao.device.provision.ProvisionResponse;
import org.thingsboard.server.dao.device.provision.ProvisionResponseStatus;
+import org.thingsboard.server.dao.exception.EntitiesLimitException;
import org.thingsboard.server.dao.ota.OtaPackageService;
import org.thingsboard.server.dao.queue.QueueService;
import org.thingsboard.server.dao.relation.RelationService;
+import org.thingsboard.server.dao.resource.ResourceService;
import org.thingsboard.server.dao.tenant.TbTenantProfileCache;
import org.thingsboard.server.gen.transport.TransportProtos;
import org.thingsboard.server.gen.transport.TransportProtos.DeviceInfoProto;
@@ -144,7 +146,7 @@ public class DefaultTransportApiService implements TransportApiService {
private final TbClusterService tbClusterService;
private final DataDecodingEncodingService dataDecodingEncodingService;
private final DeviceProvisionService deviceProvisionService;
- private final TbResourceService resourceService;
+ private final ResourceService resourceService;
private final OtaPackageService otaPackageService;
private final OtaPackageDataCache otaPackageDataCache;
private final QueueService queueService;
@@ -164,6 +166,7 @@ public class DefaultTransportApiService implements TransportApiService {
public void init() {
handlerExecutor = MoreExecutors.listeningDecorator(ThingsBoardExecutors.newWorkStealingPool(maxCoreHandlerThreads, "transport-api-service-core-handler"));
}
+
@PreDestroy
public void destroy() {
if (handlerExecutor != null) {
@@ -400,6 +403,13 @@ public class DefaultTransportApiService implements TransportApiService {
} catch (JsonProcessingException e) {
log.warn("[{}] Failed to lookup device by gateway id and name: [{}]", gatewayId, requestMsg.getDeviceName(), e);
throw new RuntimeException(e);
+ } catch (EntitiesLimitException e) {
+ log.warn("[{}][{}] API limit exception: [{}]", e.getTenantId(), gatewayId, e.getMessage());
+ return TransportApiResponseMsg.newBuilder()
+ .setGetOrCreateDeviceResponseMsg(
+ GetOrCreateDeviceFromGatewayResponseMsg.newBuilder()
+ .setError(TransportProtos.TransportApiRequestErrorCode.ENTITY_LIMIT))
+ .build();
} finally {
deviceCreationLock.unlock();
}
@@ -511,10 +521,10 @@ public class DefaultTransportApiService implements TransportApiService {
ResourceType resourceType = ResourceType.valueOf(requestMsg.getResourceType());
String resourceKey = requestMsg.getResourceKey();
TransportProtos.GetResourceResponseMsg.Builder builder = TransportProtos.GetResourceResponseMsg.newBuilder();
- TbResource resource = resourceService.getResource(tenantId, resourceType, resourceKey);
+ TbResource resource = resourceService.findResourceByTenantIdAndKey(tenantId, resourceType, resourceKey);
if (resource == null && !tenantId.equals(TenantId.SYS_TENANT_ID)) {
- resource = resourceService.getResource(TenantId.SYS_TENANT_ID, resourceType, resourceKey);
+ resource = resourceService.findResourceByTenantIdAndKey(TenantId.SYS_TENANT_ID, resourceType, resourceKey);
}
if (resource != null) {
diff --git a/application/src/main/java/org/thingsboard/server/utils/LwM2mObjectModelUtils.java b/application/src/main/java/org/thingsboard/server/utils/LwM2mObjectModelUtils.java
index 0deb2f6bb7..b73ba09541 100644
--- a/application/src/main/java/org/thingsboard/server/utils/LwM2mObjectModelUtils.java
+++ b/application/src/main/java/org/thingsboard/server/utils/LwM2mObjectModelUtils.java
@@ -39,13 +39,13 @@ import static org.thingsboard.server.common.data.lwm2m.LwM2mConstants.LWM2M_SEPA
@Slf4j
public class LwM2mObjectModelUtils {
-
+
private static final TbDDFFileParser ddfFileParser = new TbDDFFileParser();
-
- public static void toLwm2mResource (TbResource resource) throws ThingsboardException {
+
+ public static void toLwm2mResource(TbResource resource) throws ThingsboardException {
try {
List objectModels =
- ddfFileParser.parse(new ByteArrayInputStream(Base64.getDecoder().decode(resource.getData())), resource.getSearchText());
+ ddfFileParser.parse(new ByteArrayInputStream(resource.getData()), resource.getSearchText());
if (!objectModels.isEmpty()) {
ObjectModel objectModel = objectModels.get(0);
@@ -73,7 +73,7 @@ public class LwM2mObjectModelUtils {
public static LwM2mObject toLwM2mObject(TbResource resource, boolean isSave) {
try {
List objectModels =
- ddfFileParser.parse(new ByteArrayInputStream(Base64.getDecoder().decode(resource.getData())), resource.getSearchText());
+ ddfFileParser.parse(new ByteArrayInputStream(resource.getData()), resource.getSearchText());
if (objectModels.size() == 0) {
return null;
} else {
diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml
index bdf0ad8252..93348d02ee 100644
--- a/application/src/main/resources/thingsboard.yml
+++ b/application/src/main/resources/thingsboard.yml
@@ -583,6 +583,15 @@ cache:
rateLimits:
timeToLiveInMinutes: "${CACHE_SPECS_RATE_LIMITS_TTL:120}" # Rate limits cache TTL
maxSize: "${CACHE_SPECS_RATE_LIMITS_MAX_SIZE:200000}" # 0 means the cache is disabled
+ entityLimits:
+ timeToLiveInMinutes: "${CACHE_SPECS_ENTITY_LIMITS_TTL:5}" # Entity limits cache TTL
+ maxSize: "${CACHE_SPECS_ENTITY_LIMITS_MAX_SIZE:100000}" # 0 means the cache is disabled
+ image:
+ etag:
+ timeToLiveInMinutes: "${CACHE_SPECS_IMAGE_ETAGS_TTL:44640}" # Image ETags cache TTL
+ maxSize: "${CACHE_SPECS_IMAGE_ETAGS_MAX_SIZE:10000}" # 0 means the cache is disabled
+ systemImagesBrowserTtlInMinutes: "${CACHE_SPECS_IMAGE_SYSTEM_BROWSER_TTL:0}" # Browser cache TTL for system images in minutes. 0 means the cache is disabled
+ tenantImagesBrowserTtlInMinutes: "${CACHE_SPECS_IMAGE_TENANT_BROWSER_TTL:0}" # Browser cache TTL for tenant images in minutes. 0 means the cache is disabled
# Spring data parameters
spring.data.redis.repositories.enabled: false # Disable this because it is not required.
@@ -875,7 +884,7 @@ transport:
ip_limits_enabled: "${TB_TRANSPORT_IP_RATE_LIMITS_ENABLED:false}"
# Maximum number of connect attempts with invalid credentials
max_wrong_credentials_per_ip: "${TB_TRANSPORT_MAX_WRONG_CREDENTIALS_PER_IP:10}"
- # Timeout to expire block IP addresses
+ # Timeout (in milliseconds) to expire block IP addresses
ip_block_timeout: "${TB_TRANSPORT_IP_BLOCK_TIMEOUT:60000}"
# Local HTTP transport parameters
http:
@@ -1411,6 +1420,8 @@ queue:
max_msg_size: "${TB_QUEUE_PUBSUB_MAX_MSG_SIZE:1048576}"
# Number of messages per consumer
max_messages: "${TB_QUEUE_PUBSUB_MAX_MESSAGES:1000}"
+ # Thread pool size for pubsub queue executor provider. If set to 0 - default pubsub executor provider value will be used (5 * number of available processors)
+ executor_thread_pool_size: "${TB_QUEUE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:0}"
queue-properties:
# Pub/Sub properties for Rule Engine subscribers, messages which will commit after ackDeadlineInSec period can be consumed again
rule-engine: "${TB_QUEUE_PUBSUB_RE_QUEUE_PROPERTIES:ackDeadlineInSec:30;messageRetentionInSec:604800}"
@@ -1639,6 +1650,9 @@ service:
# Comma-separated list of tenant profile ids assigned to this Rule Engine.
# This Rule Engine will only be responsible for tenants with these profiles (in case 'isolation' option is enabled in the profile).
assigned_tenant_profiles: "${TB_RULE_ENGINE_ASSIGNED_TENANT_PROFILES:}"
+ pubsub:
+ # Thread pool size for pubsub rule node executor provider. If not set - default pubsub executor provider value will be used (5 * number of available processors)
+ executor_thread_pool_size: "${TB_RULE_ENGINE_PUBSUB_EXECUTOR_THREAD_POOL_SIZE:0}"
# Metrics parameters
metrics:
diff --git a/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java b/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java
index 151e779ae0..76186e6566 100644
--- a/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/AbstractWebTest.java
@@ -25,6 +25,7 @@ import io.jsonwebtoken.Header;
import io.jsonwebtoken.Jwt;
import io.jsonwebtoken.Jwts;
import lombok.extern.slf4j.Slf4j;
+import org.apache.http.HttpStatus;
import org.awaitility.Awaitility;
import org.hamcrest.Matcher;
import org.hibernate.exception.ConstraintViolationException;
@@ -177,6 +178,7 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
* and {@link org.springframework.mock.web.MockAsyncContext#getTimeout()}
*/
private static final long DEFAULT_TIMEOUT = -1L;
+ private static final int CLEANUP_TENANT_RETRIES_COUNT = 3;
protected MediaType contentType = MediaType.APPLICATION_JSON;
@@ -330,10 +332,8 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
log.debug("Executing web test teardown");
loginSysAdmin();
- doDelete("/api/tenant/" + tenantId.getId().toString())
- .andExpect(status().isOk());
+ deleteTenant(tenantId);
deleteDifferentTenant();
-
verifyNoTenantsLeft();
tenantProfileService.deleteTenantProfiles(TenantId.SYS_TENANT_ID);
@@ -341,7 +341,34 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
log.info("Executed web test teardown");
}
- void verifyNoTenantsLeft() throws Exception {
+ private void verifyNoTenantsLeft() throws Exception {
+ List loadedTenants = getAllTenants();
+ if (!loadedTenants.isEmpty()) {
+ loadedTenants.forEach(tenant -> deleteTenant(tenant.getId()));
+ loadedTenants = getAllTenants();
+ }
+ assertThat(loadedTenants).as("All tenants expected to be deleted, but some tenants left in the database").isEmpty();
+ }
+
+ private void deleteTenant(TenantId tenantId) {
+ int status = 0;
+ int retries = 0;
+ while (status != HttpStatus.SC_OK && retries < CLEANUP_TENANT_RETRIES_COUNT) {
+ retries++;
+ try {
+ status = doDelete("/api/tenant/" + tenantId.getId().toString())
+ .andReturn().getResponse().getStatus();
+ if (status != HttpStatus.SC_OK) {
+ log.warn("Tenant deletion failed, tenantId: {}", tenantId.getId().toString());
+ Thread.sleep(1000L);
+ }
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ private List getAllTenants() throws Exception {
List loadedTenants = new ArrayList<>();
PageLink pageLink = new PageLink(10);
PageData pageData;
@@ -353,8 +380,7 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
pageLink = pageLink.nextPageLink();
}
} while (pageData.hasNext());
-
- assertThat(loadedTenants).as("All tenants expected to be deleted, but some tenants left in the database").isEmpty();
+ return loadedTenants;
}
protected void loginSysAdmin() throws Exception {
@@ -465,8 +491,7 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
protected void deleteDifferentTenant() throws Exception {
if (savedDifferentTenant != null) {
loginSysAdmin();
- doDelete("/api/tenant/" + savedDifferentTenant.getId().getId().toString())
- .andExpect(status().isOk());
+ deleteTenant(savedDifferentTenant.getId());
savedDifferentTenant = null;
}
}
@@ -777,7 +802,7 @@ public abstract class AbstractWebTest extends AbstractInMemoryStorageTest {
return readResponse(doPostAsync(urlTemplate, content, DEFAULT_TIMEOUT, params).andExpect(resultMatcher), responseClass);
}
- protected T doPut(String urlTemplate, T content, Class responseClass, String... params) {
+ protected T doPut(String urlTemplate, Object content, Class responseClass, String... params) {
try {
return readResponse(doPut(urlTemplate, content, params).andExpect(status().isOk()), responseClass);
} catch (Exception e) {
diff --git a/application/src/test/java/org/thingsboard/server/controller/DashboardControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/DashboardControllerTest.java
index 6f0d6f9465..fb8064d6d5 100644
--- a/application/src/test/java/org/thingsboard/server/controller/DashboardControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/DashboardControllerTest.java
@@ -327,7 +327,18 @@ public class DashboardControllerTest extends AbstractControllerTest {
@Test
public void testFindTenantDashboards() throws Exception {
- List dashboards = new ArrayList<>();
+ List expectedDashboards = new ArrayList<>();
+ PageLink pageLink = new PageLink(24);
+ PageData pageData = null;
+ do {
+ pageData = doGetTypedWithPageLink("/api/tenant/dashboards?",
+ new TypeReference>() {
+ }, pageLink);
+ expectedDashboards.addAll(pageData.getData());
+ if (pageData.hasNext()) {
+ pageLink = pageLink.nextPageLink();
+ }
+ } while (pageData.hasNext());
Mockito.reset(tbClusterService, auditLogService);
@@ -335,7 +346,7 @@ public class DashboardControllerTest extends AbstractControllerTest {
for (int i = 0; i < cntEntity; i++) {
Dashboard dashboard = new Dashboard();
dashboard.setTitle("Dashboard" + i);
- dashboards.add(new DashboardInfo(doPost("/api/dashboard", dashboard, Dashboard.class)));
+ expectedDashboards.add(new DashboardInfo(doPost("/api/dashboard", dashboard, Dashboard.class)));
}
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(new Dashboard(), new Dashboard(),
@@ -343,8 +354,6 @@ public class DashboardControllerTest extends AbstractControllerTest {
ActionType.ADDED, cntEntity, cntEntity, cntEntity);
List loadedDashboards = new ArrayList<>();
- PageLink pageLink = new PageLink(24);
- PageData pageData = null;
do {
pageData = doGetTypedWithPageLink("/api/tenant/dashboards?",
new TypeReference>() {
@@ -355,10 +364,10 @@ public class DashboardControllerTest extends AbstractControllerTest {
}
} while (pageData.hasNext());
- dashboards.sort(idComparator);
+ expectedDashboards.sort(idComparator);
loadedDashboards.sort(idComparator);
- Assert.assertEquals(dashboards, loadedDashboards);
+ Assert.assertEquals(expectedDashboards, loadedDashboards);
}
@Test
diff --git a/application/src/test/java/org/thingsboard/server/controller/DeviceConnectivityControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/DeviceConnectivityControllerTest.java
index 227d37f483..8d21057b8e 100644
--- a/application/src/test/java/org/thingsboard/server/controller/DeviceConnectivityControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/DeviceConnectivityControllerTest.java
@@ -18,8 +18,6 @@ package org.thingsboard.server.controller;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
-import com.google.common.util.concurrent.ListeningExecutorService;
-import com.google.common.util.concurrent.MoreExecutors;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -32,7 +30,6 @@ import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.thingsboard.common.util.JacksonUtil;
-import org.thingsboard.common.util.ThingsBoardExecutors;
import org.thingsboard.server.common.data.AdminSettings;
import org.thingsboard.server.common.data.Device;
import org.thingsboard.server.common.data.DeviceProfile;
@@ -46,7 +43,6 @@ import org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileCon
import org.thingsboard.server.common.data.device.profile.DeviceProfileData;
import org.thingsboard.server.common.data.device.profile.MqttDeviceProfileTransportConfiguration;
import org.thingsboard.server.common.data.id.DeviceProfileId;
-import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.security.Authority;
import org.thingsboard.server.common.data.security.DeviceCredentials;
import org.thingsboard.server.common.data.security.DeviceCredentialsType;
@@ -58,14 +54,16 @@ import java.nio.file.Path;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.CA_ROOT_CERT_PEM;
import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.COAP;
import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.COAPS;
import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.DOCKER;
import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.HTTP;
import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.HTTPS;
+import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.LINUX;
import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.MQTT;
import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.MQTTS;
-import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.CA_ROOT_CERT_PEM;
+import static org.thingsboard.server.dao.util.DeviceConnectivityUtil.WINDOWS;
@TestPropertySource(properties = {
"device.connectivity.mqtts.pem_cert_file=/tmp/" + CA_ROOT_CERT_PEM
@@ -241,12 +239,12 @@ public class DeviceConnectivityControllerTest extends AbstractControllerTest {
"-t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"", credentials.getCredentialsId()));
JsonNode dockerMqttCommands = commands.get(MQTT).get(DOCKER);
- assertThat(dockerMqttCommands.get(MQTT).asText()).isEqualTo(String.format("docker run --rm -it --network=host thingsboard/mosquitto-clients mosquitto_pub -d -q 1 -h localhost" +
+ assertThat(dockerMqttCommands.get(MQTT).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway thingsboard/mosquitto-clients mosquitto_pub -d -q 1 -h host.docker.internal" +
" -p 1883 -t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"",
credentials.getCredentialsId()));
- assertThat(dockerMqttCommands.get(MQTTS).asText()).isEqualTo(String.format("docker run --rm -it --network=host thingsboard/mosquitto-clients " +
+ assertThat(dockerMqttCommands.get(MQTTS).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway thingsboard/mosquitto-clients " +
"/bin/sh -c \"curl -f -S -o ca-root.pem http://localhost:80/api/device-connectivity/mqtts/certificate/download && " +
- "mosquitto_pub -d -q 1 --cafile ca-root.pem -h localhost -p 8883 -t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"\"",
+ "mosquitto_pub -d -q 1 --cafile ca-root.pem -h host.docker.internal -p 8883 -t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"\"",
credentials.getCredentialsId()));
JsonNode linuxCoapCommands = commands.get(COAP);
@@ -256,10 +254,10 @@ public class DeviceConnectivityControllerTest extends AbstractControllerTest {
" -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
JsonNode dockerCoapCommands = commands.get(COAP).get(DOCKER);
- assertThat(dockerCoapCommands.get(COAP).asText()).isEqualTo(String.format("docker run --rm -it --network=host" +
- " thingsboard/coap-clients coap-client -v 6 -m POST coap://localhost:5683/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
- assertThat(dockerCoapCommands.get(COAPS).asText()).isEqualTo(String.format("docker run --rm -it --network=host" +
- " thingsboard/coap-clients coap-client-openssl -v 6 -m POST coaps://localhost:5684/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(dockerCoapCommands.get(COAP).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway" +
+ " thingsboard/coap-clients coap-client -v 6 -m POST coap://host.docker.internal:5683/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(dockerCoapCommands.get(COAPS).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway" +
+ " thingsboard/coap-clients coap-client-openssl -v 6 -m POST coaps://host.docker.internal:5684/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
}
@Test
@@ -285,15 +283,152 @@ public class DeviceConnectivityControllerTest extends AbstractControllerTest {
"-t %s -u \"%s\" -m \"{temperature:25}\"", DEVICE_TELEMETRY_TOPIC, credentials.getCredentialsId()));
JsonNode dockerMqttCommands = commands.get(MQTT).get(DOCKER);
- assertThat(dockerMqttCommands.get(MQTT).asText()).isEqualTo(String.format("docker run --rm -it --network=host thingsboard/mosquitto-clients mosquitto_pub -d -q 1 -h localhost" +
+ assertThat(dockerMqttCommands.get(MQTT).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway thingsboard/mosquitto-clients mosquitto_pub -d -q 1 -h host.docker.internal" +
" -p 1883 -t %s -u \"%s\" -m \"{temperature:25}\"",
DEVICE_TELEMETRY_TOPIC, credentials.getCredentialsId()));
- assertThat(dockerMqttCommands.get(MQTTS).asText()).isEqualTo(String.format("docker run --rm -it --network=host thingsboard/mosquitto-clients " +
+ assertThat(dockerMqttCommands.get(MQTTS).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway thingsboard/mosquitto-clients " +
"/bin/sh -c \"curl -f -S -o ca-root.pem http://localhost:80/api/device-connectivity/mqtts/certificate/download && " +
- "mosquitto_pub -d -q 1 --cafile ca-root.pem -h localhost -p 8883 -t %s -u \"%s\" -m \"{temperature:25}\"\"",
+ "mosquitto_pub -d -q 1 --cafile ca-root.pem -h host.docker.internal -p 8883 -t %s -u \"%s\" -m \"{temperature:25}\"\"",
DEVICE_TELEMETRY_TOPIC, credentials.getCredentialsId()));
}
+ @Test
+ public void testFetchGatewayLaunchCommands() throws Exception {
+ String deviceName = "My device";
+ Device device = new Device();
+ device.setName(deviceName);
+ device.setType("default");
+ ObjectNode additionalInfo = JacksonUtil.newObjectNode();
+ additionalInfo.put("gateway", true);
+ device.setAdditionalInfo(additionalInfo);
+ Device savedDevice = doPost("/api/device", device, Device.class);
+ DeviceCredentials credentials =
+ doGet("/api/device/" + savedDevice.getId().getId() + "/credentials", DeviceCredentials.class);
+
+ JsonNode commands =
+ doGetTyped("/api/device-connectivity/gateway-launch/" + savedDevice.getId().getId(), new TypeReference<>() {
+ });
+
+ String expectedContainerName = deviceName.replaceAll("[^A-Za-z0-9_.-]", "");;
+
+ JsonNode dockerMqttCommands = commands.get(MQTT);
+ assertThat(dockerMqttCommands.get(LINUX).asText()).isEqualTo(String.format("docker run -it -v ~/.tb-gateway/logs:/thingsboard_gateway/logs -v ~/.tb-gateway/extensions:/thingsboard_gateway/extensions -v ~/.tb-gateway/config:/thingsboard_gateway/config --name " + expectedContainerName + " --add-host=host.docker.internal:host-gateway -p 60000-61000:60000-61000 -e host=host.docker.internal -e port=1883 -e accessToken=%s --restart always thingsboard/tb-gateway", credentials.getCredentialsId()));
+ assertThat(dockerMqttCommands.get(WINDOWS).asText()).isEqualTo("docker run -it -v %HOMEDRIVE%%HOMEPATH%\\tb-gateway\\logs:/thingsboard_gateway/logs -v %HOMEDRIVE%%HOMEPATH%\\tb-gateway\\extensions:/thingsboard_gateway/extensions -v %HOMEDRIVE%%HOMEPATH%\\tb-gateway\\config:/thingsboard_gateway/config --name " + expectedContainerName + " --add-host=host.docker.internal:host-gateway -p 60000-61000:60000-61000 -e host=host.docker.internal -e port=1883 -e accessToken=" + credentials.getCredentialsId() + " --restart always thingsboard/tb-gateway");
+
+ JsonNode dockerMqttsCommands = commands.get(MQTTS);
+ assertThat(dockerMqttsCommands.get(LINUX).asText()).isEqualTo(String.format("docker run -it -v ~/.tb-gateway/logs:/thingsboard_gateway/logs -v ~/.tb-gateway/extensions:/thingsboard_gateway/extensions -v ~/.tb-gateway/config:/thingsboard_gateway/config --name " + expectedContainerName + " --add-host=host.docker.internal:host-gateway -p 60000-61000:60000-61000 -e host=host.docker.internal -e port=8883 -e accessToken=%s --restart always thingsboard/tb-gateway", credentials.getCredentialsId()));
+ assertThat(dockerMqttsCommands.get(WINDOWS).asText()).isEqualTo("docker run -it -v %HOMEDRIVE%%HOMEPATH%\\tb-gateway\\logs:/thingsboard_gateway/logs -v %HOMEDRIVE%%HOMEPATH%\\tb-gateway\\extensions:/thingsboard_gateway/extensions -v %HOMEDRIVE%%HOMEPATH%\\tb-gateway\\config:/thingsboard_gateway/config --name " + expectedContainerName + " --add-host=host.docker.internal:host-gateway -p 60000-61000:60000-61000 -e host=host.docker.internal -e port=8883 -e accessToken=" + credentials.getCredentialsId() + " --restart always thingsboard/tb-gateway");
+ }
+
+ @Test
+ public void testFetchPublishTelemetryCommandsForDeviceWithIpV6LocalhostAddress() throws Exception {
+ loginSysAdmin();
+ setConnectivityHost("::1");
+ loginTenantAdmin();
+
+ Device device = new Device();
+ device.setName("My device");
+ device.setType("default");
+ Device savedDevice = doPost("/api/device", device, Device.class);
+ DeviceCredentials credentials =
+ doGet("/api/device/" + savedDevice.getId().getId() + "/credentials", DeviceCredentials.class);
+
+ JsonNode commands =
+ doGetTyped("/api/device-connectivity/" + savedDevice.getId().getId(), new TypeReference<>() {
+ });
+
+ assertThat(commands).hasSize(3);
+ JsonNode httpCommands = commands.get(HTTP);
+ assertThat(httpCommands.get(HTTP).asText()).isEqualTo(String.format("curl -v -X POST http://[::1]:8080/api/v1/%s/telemetry " +
+ "--header Content-Type:application/json --data \"{temperature:25}\"",
+ credentials.getCredentialsId()));
+ assertThat(httpCommands.get(HTTPS).asText()).isEqualTo(String.format("curl -v -X POST https://[::1]/api/v1/%s/telemetry " +
+ "--header Content-Type:application/json --data \"{temperature:25}\"",
+ credentials.getCredentialsId()));
+
+ JsonNode mqttCommands = commands.get(MQTT);
+ assertThat(mqttCommands.get(MQTT).asText()).isEqualTo(String.format("mosquitto_pub -d -q 1 -h ::1 -p 1883 -t v1/devices/me/telemetry " +
+ "-u \"%s\" -m \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(mqttCommands.get(MQTTS).get(0).asText()).isEqualTo("curl -f -S -o ca-root.pem http://localhost:80/api/device-connectivity/mqtts/certificate/download");
+ assertThat(mqttCommands.get(MQTTS).get(1).asText()).isEqualTo(String.format("mosquitto_pub -d -q 1 --cafile ca-root.pem -h ::1 -p 8883 " +
+ "-t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"", credentials.getCredentialsId()));
+
+ JsonNode dockerMqttCommands = commands.get(MQTT).get(DOCKER);
+ assertThat(dockerMqttCommands.get(MQTT).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway thingsboard/mosquitto-clients mosquitto_pub -d -q 1 -h host.docker.internal" +
+ " -p 1883 -t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(dockerMqttCommands.get(MQTTS).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway thingsboard/mosquitto-clients " +
+ "/bin/sh -c \"curl -f -S -o ca-root.pem http://localhost:80/api/device-connectivity/mqtts/certificate/download && " +
+ "mosquitto_pub -d -q 1 --cafile ca-root.pem -h host.docker.internal -p 8883 -t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"\"",
+ credentials.getCredentialsId()));
+
+ JsonNode linuxCoapCommands = commands.get(COAP);
+ assertThat(linuxCoapCommands.get(COAP).asText()).isEqualTo(String.format("coap-client -v 6 -m POST coap://[::1]:5683/api/v1/%s/telemetry " +
+ "-t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(linuxCoapCommands.get(COAPS).asText()).isEqualTo(String.format("coap-client-openssl -v 6 -m POST coaps://[::1]:5684/api/v1/%s/telemetry" +
+ " -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+
+ JsonNode dockerCoapCommands = commands.get(COAP).get(DOCKER);
+ assertThat(dockerCoapCommands.get(COAP).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway" +
+ " thingsboard/coap-clients coap-client -v 6 -m POST coap://host.docker.internal:5683/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(dockerCoapCommands.get(COAPS).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway" +
+ " thingsboard/coap-clients coap-client-openssl -v 6 -m POST coaps://host.docker.internal:5684/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+ }
+
+ @Test
+ public void testFetchPublishTelemetryCommandsForDeviceWithIpV6Address() throws Exception {
+
+ loginSysAdmin();
+ setConnectivityHost("1:1:1:1:1:1:1:1");
+ loginTenantAdmin();
+
+ Device device = new Device();
+ device.setName("My device");
+ device.setType("default");
+ Device savedDevice = doPost("/api/device", device, Device.class);
+ DeviceCredentials credentials =
+ doGet("/api/device/" + savedDevice.getId().getId() + "/credentials", DeviceCredentials.class);
+
+ JsonNode commands =
+ doGetTyped("/api/device-connectivity/" + savedDevice.getId().getId(), new TypeReference<>() {
+ });
+ assertThat(commands).hasSize(3);
+ JsonNode httpCommands = commands.get(HTTP);
+ assertThat(httpCommands.get(HTTP).asText()).isEqualTo(String.format("curl -v -X POST http://[1:1:1:1:1:1:1:1]:8080/api/v1/%s/telemetry " +
+ "--header Content-Type:application/json --data \"{temperature:25}\"",
+ credentials.getCredentialsId()));
+ assertThat(httpCommands.get(HTTPS).asText()).isEqualTo(String.format("curl -v -X POST https://[1:1:1:1:1:1:1:1]/api/v1/%s/telemetry " +
+ "--header Content-Type:application/json --data \"{temperature:25}\"",
+ credentials.getCredentialsId()));
+
+ JsonNode mqttCommands = commands.get(MQTT);
+ assertThat(mqttCommands.get(MQTT).asText()).isEqualTo(String.format("mosquitto_pub -d -q 1 -h 1:1:1:1:1:1:1:1 -p 1883 -t v1/devices/me/telemetry " +
+ "-u \"%s\" -m \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(mqttCommands.get(MQTTS).get(0).asText()).isEqualTo("curl -f -S -o ca-root.pem http://localhost:80/api/device-connectivity/mqtts/certificate/download");
+ assertThat(mqttCommands.get(MQTTS).get(1).asText()).isEqualTo(String.format("mosquitto_pub -d -q 1 --cafile ca-root.pem -h 1:1:1:1:1:1:1:1 -p 8883 " +
+ "-t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"", credentials.getCredentialsId()));
+
+ JsonNode dockerMqttCommands = commands.get(MQTT).get(DOCKER);
+ assertThat(dockerMqttCommands.get(MQTT).asText()).isEqualTo(String.format("docker run --rm -it thingsboard/mosquitto-clients mosquitto_pub -d -q 1 -h 1:1:1:1:1:1:1:1" +
+ " -p 1883 -t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(dockerMqttCommands.get(MQTTS).asText()).isEqualTo(String.format("docker run --rm -it thingsboard/mosquitto-clients " +
+ "/bin/sh -c \"curl -f -S -o ca-root.pem http://localhost:80/api/device-connectivity/mqtts/certificate/download && " +
+ "mosquitto_pub -d -q 1 --cafile ca-root.pem -h 1:1:1:1:1:1:1:1 -p 8883 -t v1/devices/me/telemetry -u \"%s\" -m \"{temperature:25}\"\"",
+ credentials.getCredentialsId()));
+
+ JsonNode linuxCoapCommands = commands.get(COAP);
+ assertThat(linuxCoapCommands.get(COAP).asText()).isEqualTo(String.format("coap-client -v 6 -m POST coap://[1:1:1:1:1:1:1:1]:5683/api/v1/%s/telemetry " +
+ "-t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(linuxCoapCommands.get(COAPS).asText()).isEqualTo(String.format("coap-client-openssl -v 6 -m POST coaps://[1:1:1:1:1:1:1:1]:5684/api/v1/%s/telemetry" +
+ " -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+
+ JsonNode dockerCoapCommands = commands.get(COAP).get(DOCKER);
+ assertThat(dockerCoapCommands.get(COAP).asText()).isEqualTo(String.format("docker run --rm -it" +
+ " thingsboard/coap-clients coap-client -v 6 -m POST coap://[1:1:1:1:1:1:1:1]:5683/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+ assertThat(dockerCoapCommands.get(COAPS).asText()).isEqualTo(String.format("docker run --rm -it" +
+ " thingsboard/coap-clients coap-client-openssl -v 6 -m POST coaps://[1:1:1:1:1:1:1:1]:5684/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
+
+ }
+
@Test
public void testFetchPublishTelemetryCommandsForDeviceWithMqttBasicCreds() throws Exception {
Device device = new Device();
@@ -329,12 +464,12 @@ public class DeviceConnectivityControllerTest extends AbstractControllerTest {
"-t %s -i \"%s\" -u \"%s\" -P \"%s\" -m \"{temperature:25}\"", DEVICE_TELEMETRY_TOPIC, clientId, userName, password));
JsonNode dockerMqttCommands = commands.get(MQTT).get(DOCKER);
- assertThat(dockerMqttCommands.get(MQTT).asText()).isEqualTo(String.format("docker run --rm -it --network=host thingsboard/mosquitto-clients mosquitto_pub -d -q 1 -h localhost" +
+ assertThat(dockerMqttCommands.get(MQTT).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway thingsboard/mosquitto-clients mosquitto_pub -d -q 1 -h host.docker.internal" +
" -p 1883 -t %s -i \"%s\" -u \"%s\" -P \"%s\" -m \"{temperature:25}\"",
DEVICE_TELEMETRY_TOPIC, clientId, userName, password));
- assertThat(dockerMqttCommands.get(MQTTS).asText()).isEqualTo(String.format("docker run --rm -it --network=host thingsboard/mosquitto-clients " +
+ assertThat(dockerMqttCommands.get(MQTTS).asText()).isEqualTo(String.format("docker run --rm -it --add-host=host.docker.internal:host-gateway thingsboard/mosquitto-clients " +
"/bin/sh -c \"curl -f -S -o ca-root.pem http://localhost:80/api/device-connectivity/mqtts/certificate/download && " +
- "mosquitto_pub -d -q 1 --cafile ca-root.pem -h localhost -p 8883 -t %s -i \"%s\" -u \"%s\" -P \"%s\" -m \"{temperature:25}\"\"",
+ "mosquitto_pub -d -q 1 --cafile ca-root.pem -h host.docker.internal -p 8883 -t %s -i \"%s\" -u \"%s\" -P \"%s\" -m \"{temperature:25}\"\"",
DEVICE_TELEMETRY_TOPIC, clientId, userName, password));
}
@@ -518,47 +653,7 @@ public class DeviceConnectivityControllerTest extends AbstractControllerTest {
public void testFetchPublishTelemetryCommandsForDefaultDeviceIfHostIsNotLocalhost() throws Exception {
loginSysAdmin();
- ObjectNode config = JacksonUtil.newObjectNode();
-
- ObjectNode http = JacksonUtil.newObjectNode();
- http.put("enabled", true);
- http.put("host", "test.domain");
- http.put("port", 8080);
- config.set("http", http);
-
- ObjectNode https = JacksonUtil.newObjectNode();
- https.put("enabled", true);
- https.put("host", "test.domain");
- https.put("port", 443);
- config.set("https", https);
-
- ObjectNode mqtt = JacksonUtil.newObjectNode();
- mqtt.put("enabled", true);
- mqtt.put("host", "test.domain");
- mqtt.put("port", 1883);
- config.set("mqtt", mqtt);
-
- ObjectNode mqtts = JacksonUtil.newObjectNode();
- mqtts.put("enabled", true);
- mqtts.put("host", "test.domain");
- mqtts.put("port", 8883);
- config.set("mqtts", mqtts);
-
- ObjectNode coap = JacksonUtil.newObjectNode();
- coap.put("enabled", true);
- coap.put("host", "test.domain");
- coap.put("port", 5683);
- config.set("coap", coap);
-
- ObjectNode coaps = JacksonUtil.newObjectNode();
- coaps.put("enabled", true);
- coaps.put("host", "test.domain");
- coaps.put("port", 5684);
- config.set("coaps", coaps);
-
- AdminSettings adminSettings = doGet("/api/admin/settings/connectivity", AdminSettings.class);
- adminSettings.setJsonValue(config);
- doPost("/api/admin/settings", adminSettings).andExpect(status().isOk());
+ setConnectivityHost("test.domain");
login("tenant2@thingsboard.org", "testPassword1");
@@ -612,4 +707,49 @@ public class DeviceConnectivityControllerTest extends AbstractControllerTest {
assertThat(dockerCoapCommands.get(COAPS).asText()).isEqualTo(String.format("docker run --rm -it " +
"thingsboard/coap-clients coap-client-openssl -v 6 -m POST coaps://test.domain:5684/api/v1/%s/telemetry -t json -e \"{temperature:25}\"", credentials.getCredentialsId()));
}
+
+
+ private void setConnectivityHost(String host) throws Exception {
+ ObjectNode config = JacksonUtil.newObjectNode();
+
+ ObjectNode http = JacksonUtil.newObjectNode();
+ http.put("enabled", true);
+ http.put("host", host);
+ http.put("port", 8080);
+ config.set("http", http);
+
+ ObjectNode https = JacksonUtil.newObjectNode();
+ https.put("enabled", true);
+ https.put("host", host);
+ https.put("port", 443);
+ config.set("https", https);
+
+ ObjectNode mqtt = JacksonUtil.newObjectNode();
+ mqtt.put("enabled", true);
+ mqtt.put("host", host);
+ mqtt.put("port", 1883);
+ config.set("mqtt", mqtt);
+
+ ObjectNode mqtts = JacksonUtil.newObjectNode();
+ mqtts.put("enabled", true);
+ mqtts.put("host", host);
+ mqtts.put("port", 8883);
+ config.set("mqtts", mqtts);
+
+ ObjectNode coap = JacksonUtil.newObjectNode();
+ coap.put("enabled", true);
+ coap.put("host", host);
+ coap.put("port", 5683);
+ config.set("coap", coap);
+
+ ObjectNode coaps = JacksonUtil.newObjectNode();
+ coaps.put("enabled", true);
+ coaps.put("host", host);
+ coaps.put("port", 5684);
+ config.set("coaps", coaps);
+
+ AdminSettings adminSettings = doGet("/api/admin/settings/connectivity", AdminSettings.class);
+ adminSettings.setJsonValue(config);
+ doPost("/api/admin/settings", adminSettings).andExpect(status().isOk());
+ }
}
diff --git a/application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java
index 778a11a552..7cafe2bbcb 100644
--- a/application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java
@@ -28,12 +28,14 @@ import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.mockito.AdditionalAnswers;
+import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.test.context.ContextConfiguration;
+import org.testcontainers.shaded.org.awaitility.Awaitility;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.common.util.ThingsBoardExecutors;
import org.thingsboard.server.common.data.Customer;
@@ -51,7 +53,6 @@ import org.thingsboard.server.common.data.User;
import org.thingsboard.server.common.data.alarm.Alarm;
import org.thingsboard.server.common.data.alarm.AlarmInfo;
import org.thingsboard.server.common.data.alarm.AlarmSeverity;
-import org.thingsboard.server.common.data.asset.Asset;
import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.edge.Edge;
import org.thingsboard.server.common.data.id.CustomerId;
@@ -73,7 +74,9 @@ import org.thingsboard.server.dao.exception.DataValidationException;
import org.thingsboard.server.dao.exception.DeviceCredentialsValidationException;
import org.thingsboard.server.dao.model.ModelConstants;
import org.thingsboard.server.dao.service.DaoSqlTest;
+import org.thingsboard.server.gen.transport.TransportProtos;
import org.thingsboard.server.service.gateway_device.GatewayNotificationsService;
+import org.thingsboard.server.service.state.DeviceStateService;
import java.util.ArrayList;
import java.util.List;
@@ -82,6 +85,7 @@ import java.util.concurrent.TimeUnit;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.containsString;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -106,6 +110,9 @@ public class DeviceControllerTest extends AbstractControllerTest {
@SpyBean
private GatewayNotificationsService gatewayNotificationsService;
+ @SpyBean
+ private DeviceStateService deviceStateService;
+
@Autowired
private DeviceDao deviceDao;
@@ -1340,6 +1347,28 @@ public class DeviceControllerTest extends AbstractControllerTest {
ActionType.ASSIGNED_TO_TENANT, savedDifferentTenant.getId().getId().toString(), savedDifferentTenant.getTitle());
testNotificationUpdateGatewayNever();
+ ArgumentCaptor protoCaptor = ArgumentCaptor.forClass(TransportProtos.DeviceStateServiceMsgProto.class);
+
+ Awaitility.await().atMost(5, TimeUnit.SECONDS).until(() -> {
+ Mockito.verify(deviceStateService, Mockito.atLeastOnce()).onQueueMsg(protoCaptor.capture(), any());
+ return protoCaptor.getAllValues().stream().anyMatch(proto ->
+ proto.getTenantIdMSB() == savedTenant.getUuidId().getMostSignificantBits() &&
+ proto.getTenantIdLSB() == savedTenant.getUuidId().getLeastSignificantBits() &&
+ proto.getDeviceIdMSB() == savedDevice.getUuidId().getMostSignificantBits() &&
+ proto.getDeviceIdLSB() == savedDevice.getUuidId().getLeastSignificantBits() &&
+ proto.getDeleted());
+ });
+
+ Awaitility.await().atMost(5, TimeUnit.SECONDS).until(() -> {
+ Mockito.verify(deviceStateService, Mockito.atLeastOnce()).onQueueMsg(protoCaptor.capture(), any());
+ return protoCaptor.getAllValues().stream().anyMatch(proto ->
+ proto.getTenantIdMSB() == savedDifferentTenant.getUuidId().getMostSignificantBits() &&
+ proto.getTenantIdLSB() == savedDifferentTenant.getUuidId().getLeastSignificantBits() &&
+ proto.getDeviceIdMSB() == savedDevice.getUuidId().getMostSignificantBits() &&
+ proto.getDeviceIdLSB() == savedDevice.getUuidId().getLeastSignificantBits() &&
+ proto.getAdded());
+ });
+
login("tenant9@thingsboard.org", "testPassword1");
Device foundDevice1 = doGet("/api/device/" + assignedDevice.getId().getId(), Device.class);
diff --git a/application/src/test/java/org/thingsboard/server/controller/EdgeControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/EdgeControllerTest.java
index f0c47bb53a..530c8634d7 100644
--- a/application/src/test/java/org/thingsboard/server/controller/EdgeControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/EdgeControllerTest.java
@@ -23,6 +23,8 @@ import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.AbstractMessage;
+import lombok.extern.slf4j.Slf4j;
+import org.awaitility.Awaitility;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -37,14 +39,18 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.common.util.ThingsBoardExecutors;
+import org.thingsboard.server.common.data.AdminSettings;
import org.thingsboard.server.common.data.Customer;
import org.thingsboard.server.common.data.DataConstants;
import org.thingsboard.server.common.data.Device;
+import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.EntitySubtype;
import org.thingsboard.server.common.data.StringUtils;
import org.thingsboard.server.common.data.Tenant;
+import org.thingsboard.server.common.data.TenantProfile;
import org.thingsboard.server.common.data.User;
import org.thingsboard.server.common.data.asset.Asset;
+import org.thingsboard.server.common.data.asset.AssetProfile;
import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.edge.Edge;
import org.thingsboard.server.common.data.id.CustomerId;
@@ -53,6 +59,8 @@ import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.id.TenantProfileId;
import org.thingsboard.server.common.data.page.PageData;
import org.thingsboard.server.common.data.page.PageLink;
+import org.thingsboard.server.common.data.queue.Queue;
+import org.thingsboard.server.common.data.rule.RuleChain;
import org.thingsboard.server.common.data.security.Authority;
import org.thingsboard.server.common.data.security.model.JwtSettings;
import org.thingsboard.server.dao.edge.EdgeDao;
@@ -78,10 +86,10 @@ import org.thingsboard.server.gen.edge.v1.UserUpdateMsg;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import java.util.UUID;
+import java.util.Map;
+import java.util.Optional;
import java.util.concurrent.TimeUnit;
-import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID;
@@ -92,6 +100,7 @@ import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID;
})
@ContextConfiguration(classes = {EdgeControllerTest.Config.class})
@DaoSqlTest
+@Slf4j
public class EdgeControllerTest extends AbstractControllerTest {
public static final String EDGE_HOST = "localhost";
@@ -121,7 +130,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
}
@After
- public void teardownEdgeTest() throws Exception {
+ public void teardownEdgeTest() {
executor.shutdownNow();
}
@@ -204,15 +213,13 @@ public class EdgeControllerTest extends AbstractControllerTest {
@Test
public void testFindEdgeTypesByTenantId() throws Exception {
- List edges = new ArrayList<>();
-
int cntEntity = 3;
Mockito.reset(tbClusterService, auditLogService);
for (int i = 0; i < cntEntity; i++) {
Edge edge = constructEdge("My edge B" + i, "typeB");
- edges.add(doPost("/api/edge", edge, Edge.class));
+ doPost("/api/edge", edge, Edge.class);
}
testNotifyManyEntityManyTimeMsgToEdgeServiceNeverAdditionalInfoAny(new Edge(), new Edge(),
@@ -221,11 +228,11 @@ public class EdgeControllerTest extends AbstractControllerTest {
for (int i = 0; i < 7; i++) {
Edge edge = constructEdge("My edge C" + i, "typeC");
- edges.add(doPost("/api/edge", edge, Edge.class));
+ doPost("/api/edge", edge, Edge.class);
}
for (int i = 0; i < 9; i++) {
Edge edge = constructEdge("My edge A" + i, "typeA");
- edges.add(doPost("/api/edge", edge, Edge.class));
+ doPost("/api/edge", edge, Edge.class);
}
List edgeTypes = doGetTyped("/api/edge/types",
new TypeReference<>() {
@@ -395,7 +402,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
List edges = new ArrayList<>(Futures.allAsList(futures).get(TIMEOUT, TimeUnit.SECONDS));
List loadedEdges = new ArrayList<>();
PageLink pageLink = new PageLink(23);
- PageData pageData = null;
+ PageData pageData;
do {
pageData = doGetTypedWithPageLink("/api/tenant/edges?",
new TypeReference<>() {
@@ -442,10 +449,10 @@ public class EdgeControllerTest extends AbstractControllerTest {
List loadedEdgesTitle1 = new ArrayList<>();
PageLink pageLink = new PageLink(15, 0, title1);
- PageData pageData = null;
+ PageData pageData;
do {
pageData = doGetTypedWithPageLink("/api/tenant/edges?",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink);
loadedEdgesTitle1.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -462,7 +469,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4, 0, title2);
do {
pageData = doGetTypedWithPageLink("/api/tenant/edges?",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink);
loadedEdgesTitle2.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -532,10 +539,10 @@ public class EdgeControllerTest extends AbstractControllerTest {
List loadedEdgesType1 = new ArrayList<>();
PageLink pageLink = new PageLink(15);
- PageData pageData = null;
+ PageData pageData;
do {
pageData = doGetTypedWithPageLink("/api/tenant/edges?type={type}&",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink, type1);
loadedEdgesType1.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -552,7 +559,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4);
do {
pageData = doGetTypedWithPageLink("/api/tenant/edges?type={type}&",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink, type2);
loadedEdgesType2.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -572,7 +579,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4);
pageData = doGetTypedWithPageLink("/api/tenant/edges?type={type}&",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink, type1);
Assert.assertFalse(pageData.hasNext());
Assert.assertEquals(0, pageData.getData().size());
@@ -584,7 +591,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4);
pageData = doGetTypedWithPageLink("/api/tenant/edges?type={type}&",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink, type2);
Assert.assertFalse(pageData.hasNext());
Assert.assertEquals(0, pageData.getData().size());
@@ -613,15 +620,14 @@ public class EdgeControllerTest extends AbstractControllerTest {
testNotifyManyEntityManyTimeMsgToEdgeServiceEntityEqAny(new Edge(), new Edge(),
tenantId, customerId, tenantAdminUser.getId(), tenantAdminUser.getEmail(),
- ActionType.ASSIGNED_TO_CUSTOMER, cntEntity, cntEntity, cntEntity * 2,
- new String(), new String(), new String());
+ ActionType.ASSIGNED_TO_CUSTOMER, cntEntity, cntEntity, cntEntity * 2, "", "", "");
List loadedEdges = new ArrayList<>();
PageLink pageLink = new PageLink(23);
PageData pageData = null;
do {
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink);
loadedEdges.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -679,7 +685,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
PageData pageData = null;
do {
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink);
loadedEdgesTitle1.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -696,7 +702,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4, 0, title2);
do {
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink);
loadedEdgesTitle2.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -723,7 +729,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4, 0, title1);
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink);
Assert.assertFalse(pageData.hasNext());
Assert.assertEquals(0, pageData.getData().size());
@@ -735,7 +741,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4, 0, title2);
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink);
Assert.assertFalse(pageData.hasNext());
Assert.assertEquals(0, pageData.getData().size());
@@ -784,10 +790,10 @@ public class EdgeControllerTest extends AbstractControllerTest {
List loadedEdgesType1 = new ArrayList<>();
PageLink pageLink = new PageLink(15, 0, title1);
- PageData pageData = null;
+ PageData pageData;
do {
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?type={type}&",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink, type1);
loadedEdgesType1.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -804,7 +810,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4, 0, title2);
do {
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?type={type}&",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink, type2);
loadedEdgesType2.addAll(pageData.getData());
if (pageData.hasNext()) {
@@ -824,7 +830,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4, 0, title1);
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?type={type}&",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink, type1);
Assert.assertFalse(pageData.hasNext());
Assert.assertEquals(0, pageData.getData().size());
@@ -836,7 +842,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
pageLink = new PageLink(4, 0, title2);
pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/edges?type={type}&",
- new TypeReference>() {
+ new TypeReference<>() {
}, pageLink, type2);
Assert.assertFalse(pageData.hasNext());
Assert.assertEquals(0, pageData.getData().size());
@@ -863,10 +869,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
Edge edge = doPost("/api/edge", constructEdge("Test Sync Edge", "test"), Edge.class);
- // simulate edge activation
- ObjectNode attributes = JacksonUtil.newObjectNode();
- attributes.put("active", true);
- doPost("/api/plugins/telemetry/EDGE/" + edge.getId() + "/attributes/" + DataConstants.SERVER_SCOPE, attributes);
+ simulateEdgeActivation(edge);
doPost("/api/edge/" + edge.getId().getId().toString()
+ "/device/" + savedDevice.getId().getId().toString(), Device.class);
@@ -878,7 +881,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
edgeImitator.expectMessageAmount(24);
edgeImitator.connect();
- assertThat(edgeImitator.waitForMessages()).as("await for messages on first connect").isTrue();
+ waitForMessages(edgeImitator);
verifyFetchersMsgs(edgeImitator);
// verify queue msgs
@@ -890,7 +893,7 @@ public class EdgeControllerTest extends AbstractControllerTest {
edgeImitator.expectMessageAmount(20);
doPost("/api/edge/sync/" + edge.getId());
- assertThat(edgeImitator.waitForMessages()).as("await for messages after edge sync rest api call").isTrue();
+ waitForMessages(edgeImitator);
verifyFetchersMsgs(edgeImitator);
Assert.assertTrue(edgeImitator.getDownlinkMsgs().isEmpty());
@@ -909,6 +912,35 @@ public class EdgeControllerTest extends AbstractControllerTest {
.andExpect(status().isOk());
}
+ private void simulateEdgeActivation(Edge edge) throws Exception {
+ ObjectNode attributes = JacksonUtil.newObjectNode();
+ attributes.put("active", true);
+ doPost("/api/plugins/telemetry/EDGE/" + edge.getId() + "/attributes/" + DataConstants.SERVER_SCOPE, attributes);
+ Awaitility.await()
+ .atMost(30, TimeUnit.SECONDS)
+ .until(() -> {
+ List