diff --git a/application/src/main/data/json/system/widget_bundles/cards.json b/application/src/main/data/json/system/widget_bundles/cards.json index 0d97afd5e7..437d56678e 100644 --- a/application/src/main/data/json/system/widget_bundles/cards.json +++ b/application/src/main/data/json/system/widget_bundles/cards.json @@ -47,7 +47,7 @@ "resources": [], "templateHtml": "\n", "templateCss": "", - "controllerScript": "self.onInit = function() {\n}\n\nself.onDataUpdated = function() {\n self.ctx.$scope.timeseriesTableWidget.onDataUpdated();\n}\n\nself.actionSources = function() {\n return {\n 'actionCellButton': {\n name: 'widget-action.action-cell-button',\n multiple: true\n },\n 'rowClick': {\n name: 'widget-action.row-click',\n multiple: false\n }\n };\n}\n\nself.onDestroy = function() {\n}", + "controllerScript": "self.onInit = function() {\n}\n\nself.onDataUpdated = function() {\n self.ctx.$scope.timeseriesTableWidget.onDataUpdated();\n}\n\nself.typeParameters = function() {\n return {\n ignoreDataUpdateOnIntervalTick: true\n };\n}\n\nself.actionSources = function() {\n return {\n 'actionCellButton': {\n name: 'widget-action.action-cell-button',\n multiple: true\n },\n 'rowClick': {\n name: 'widget-action.row-click',\n multiple: false\n }\n };\n}\n\nself.onDestroy = function() {\n}", "settingsSchema": "{\n \"schema\": {\n \"type\": \"object\",\n \"title\": \"TimeseriesTableSettings\",\n \"properties\": {\n \"showTimestamp\": {\n \"title\": \"Display timestamp column\",\n \"type\": \"boolean\",\n \"default\": true\n },\n \"showMilliseconds\": {\n \"title\": \"Display timestamp milliseconds\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"displayPagination\": {\n \"title\": \"Display pagination\",\n \"type\": \"boolean\",\n \"default\": true\n }, \n \"defaultPageSize\": {\n \"title\": \"Default page size\",\n \"type\": \"number\",\n \"default\": 10\n },\n \"hideEmptyLines\": {\n \"title\": \"Hide empty lines\",\n \"type\": \"boolean\",\n \"default\": false\n }\n },\n \"required\": []\n },\n \"form\": [\n \"showTimestamp\",\n \"showMilliseconds\",\n \"displayPagination\",\n \"defaultPageSize\",\n \"hideEmptyLines\"\n ]\n}", "dataKeySettingsSchema": "{\n \"schema\": {\n \"type\": \"object\",\n \"title\": \"DataKeySettings\",\n \"properties\": {\n \"useCellStyleFunction\": {\n \"title\": \"Use cell style function\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"cellStyleFunction\": {\n \"title\": \"Cell style function: f(value)\",\n \"type\": \"string\",\n \"default\": \"\"\n },\n \"useCellContentFunction\": {\n \"title\": \"Use cell content function\",\n \"type\": \"boolean\",\n \"default\": false\n },\n \"cellContentFunction\": {\n \"title\": \"Cell content function: f(value, rowData, ctx)\",\n \"type\": \"string\",\n \"default\": \"\"\n }\n },\n \"required\": []\n },\n \"form\": [\n \"useCellStyleFunction\",\n {\n \"key\": \"cellStyleFunction\",\n \"type\": \"javascript\"\n },\n \"useCellContentFunction\",\n {\n \"key\": \"cellContentFunction\",\n \"type\": \"javascript\"\n }\n ]\n}", "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Temperature °C\",\"color\":\"#2196f3\",\"settings\":{\"useCellStyleFunction\":true,\"cellStyleFunction\":\"if (value) {\\n var percent = (value + 60)/120 * 100;\\n var color = tinycolor.mix('blue', 'red', amount = percent);\\n color.setAlpha(.5);\\n return {\\n paddingLeft: '20px',\\n color: '#ffffff',\\n background: color.toRgbString(),\\n fontSize: '18px'\\n };\\n} else {\\n return {};\\n}\"},\"_hash\":0.8587686344902596,\"funcBody\":\"var value = prevValue + Math.random() * 40 - 20;\\nvar multiplier = Math.pow(10, 1 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < -60) {\\n\\tvalue = -60;\\n} else if (value > 60) {\\n\\tvalue = 60;\\n}\\nreturn value;\"},{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"Humidity, %\",\"color\":\"#ffc107\",\"settings\":{\"useCellStyleFunction\":true,\"cellStyleFunction\":\"if (value) {\\n var percent = value;\\n var backgroundColor = tinycolor('blue');\\n backgroundColor.setAlpha(value/100);\\n var color = 'blue';\\n if (value > 50) {\\n color = 'white';\\n }\\n \\n return {\\n paddingLeft: '20px',\\n color: color,\\n background: backgroundColor.toRgbString(),\\n fontSize: '18px'\\n };\\n} else {\\n return {};\\n}\",\"useCellContentFunction\":false},\"_hash\":0.12775350966079668,\"funcBody\":\"var value = prevValue + Math.random() * 20 - 10;\\nvar multiplier = Math.pow(10, 1 || 0);\\nvar value = Math.round(value * multiplier) / multiplier;\\nif (value < 5) {\\n\\tvalue = 5;\\n} else if (value > 100) {\\n\\tvalue = 100;\\n}\\nreturn value;\"}]}],\"timewindow\":{\"realtime\":{\"interval\":1000,\"timewindowMs\":60000},\"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\":\"Timeseries table\",\"dropShadow\":true,\"enableFullscreen\":true,\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400,\"padding\":\"5px 10px 5px 10px\"},\"useDashboardTimewindow\":false,\"showLegend\":false,\"widgetStyle\":{},\"actions\":{},\"showTitleIcon\":false,\"iconColor\":\"rgba(0, 0, 0, 0.87)\",\"iconSize\":\"24px\"}" @@ -134,4 +134,4 @@ } } ] -} \ No newline at end of file +} diff --git a/application/src/main/data/upgrade/2.4.3/schema_update_psql_drop_partitions.sql b/application/src/main/data/upgrade/2.4.3/schema_update_psql_drop_partitions.sql index a650244d5a..3c2d43e197 100644 --- a/application/src/main/data/upgrade/2.4.3/schema_update_psql_drop_partitions.sql +++ b/application/src/main/data/upgrade/2.4.3/schema_update_psql_drop_partitions.sql @@ -84,11 +84,12 @@ BEGIN END IF; END IF; END IF; - END IF; - IF partition_to_delete IS NOT NULL THEN - RAISE NOTICE 'Partition to delete by max ttl: %', partition_to_delete; - EXECUTE format('DROP TABLE %I', partition_to_delete); - deleted := deleted + 1; + IF partition_to_delete IS NOT NULL THEN + RAISE NOTICE 'Partition to delete by max ttl: %', partition_to_delete; + EXECUTE format('DROP TABLE IF EXISTS %I', partition_to_delete); + partition_to_delete := NULL; + deleted := deleted + 1; + END IF; END IF; END LOOP; END IF; diff --git a/application/src/main/data/upgrade/3.2.1/schema_update.sql b/application/src/main/data/upgrade/3.2.2/schema_update.sql similarity index 100% rename from application/src/main/data/upgrade/3.2.1/schema_update.sql rename to application/src/main/data/upgrade/3.2.2/schema_update.sql diff --git a/application/src/main/data/upgrade/3.2.1/schema_update_ttl.sql b/application/src/main/data/upgrade/3.2.2/schema_update_ttl.sql similarity index 100% rename from application/src/main/data/upgrade/3.2.1/schema_update_ttl.sql rename to application/src/main/data/upgrade/3.2.2/schema_update_ttl.sql 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 34252cd7d7..ae7d8c492e 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 @@ -37,6 +37,7 @@ 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.EntityType; import org.thingsboard.server.common.data.TenantProfile; import org.thingsboard.server.common.data.alarm.Alarm; import org.thingsboard.server.common.data.asset.Asset; @@ -281,7 +282,21 @@ class DefaultTbContext implements TbContext { } public TbMsg deviceCreatedMsg(Device device, RuleNodeId ruleNodeId) { - return entityActionMsg(device, device.getId(), ruleNodeId, DataConstants.ENTITY_CREATED); + RuleChainId ruleChainId = null; + String queueName = ServiceQueue.MAIN; + if (device.getDeviceProfileId() != null) { + DeviceProfile deviceProfile = mainCtx.getDeviceProfileCache().find(device.getDeviceProfileId()); + if (deviceProfile == null) { + log.warn("[{}] Device profile is null!", device.getDeviceProfileId()); + ruleChainId = null; + queueName = ServiceQueue.MAIN; + } else { + ruleChainId = deviceProfile.getDefaultRuleChainId(); + String defaultQueueName = deviceProfile.getDefaultQueueName(); + queueName = defaultQueueName != null ? defaultQueueName : ServiceQueue.MAIN; + } + } + return entityActionMsg(device, device.getId(), ruleNodeId, DataConstants.ENTITY_CREATED, queueName, ruleChainId); } public TbMsg assetCreatedMsg(Asset asset, RuleNodeId ruleNodeId) { @@ -289,7 +304,22 @@ class DefaultTbContext implements TbContext { } public TbMsg alarmActionMsg(Alarm alarm, RuleNodeId ruleNodeId, String action) { - return entityActionMsg(alarm, alarm.getId(), ruleNodeId, action); + RuleChainId ruleChainId = null; + String queueName = ServiceQueue.MAIN; + if (EntityType.DEVICE.equals(alarm.getOriginator().getEntityType())) { + DeviceId deviceId = new DeviceId(alarm.getOriginator().getId()); + DeviceProfile deviceProfile = mainCtx.getDeviceProfileCache().get(getTenantId(), deviceId); + if (deviceProfile == null) { + log.warn("[{}] Device profile is null!", deviceId); + ruleChainId = null; + queueName = ServiceQueue.MAIN; + } else { + ruleChainId = deviceProfile.getDefaultRuleChainId(); + String defaultQueueName = deviceProfile.getDefaultQueueName(); + queueName = defaultQueueName != null ? defaultQueueName : ServiceQueue.MAIN; + } + } + return entityActionMsg(alarm, alarm.getId(), ruleNodeId, action, queueName, ruleChainId); } @Override @@ -298,8 +328,12 @@ class DefaultTbContext implements TbContext { } public TbMsg entityActionMsg(E entity, I id, RuleNodeId ruleNodeId, String action) { + return entityActionMsg(entity, id, ruleNodeId, action, ServiceQueue.MAIN, null); + } + + public TbMsg entityActionMsg(E entity, I id, RuleNodeId ruleNodeId, String action, String queueName, RuleChainId ruleChainId) { try { - return TbMsg.newMsg(action, id, getActionMetaData(ruleNodeId), mapper.writeValueAsString(mapper.valueToTree(entity))); + return TbMsg.newMsg(queueName, action, id, getActionMetaData(ruleNodeId), mapper.writeValueAsString(mapper.valueToTree(entity)), ruleChainId, null); } catch (JsonProcessingException | IllegalArgumentException e) { throw new RuntimeException("Failed to process " + id.getEntityType().name().toLowerCase() + " " + action + " msg: " + e); } diff --git a/application/src/main/java/org/thingsboard/server/config/JwtSettings.java b/application/src/main/java/org/thingsboard/server/config/JwtSettings.java index 6e19cfb729..04a6f5a9b4 100644 --- a/application/src/main/java/org/thingsboard/server/config/JwtSettings.java +++ b/application/src/main/java/org/thingsboard/server/config/JwtSettings.java @@ -17,7 +17,7 @@ package org.thingsboard.server.config; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; -import org.thingsboard.server.service.security.model.token.JwtToken; +import org.thingsboard.server.common.data.security.model.JwtToken; @Configuration @ConfigurationProperties(prefix = "security.jwt") diff --git a/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java b/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java index 86fb136385..2718b455b9 100644 --- a/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java +++ b/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java @@ -48,6 +48,7 @@ import org.thingsboard.server.service.security.auth.jwt.RefreshTokenAuthenticati import org.thingsboard.server.service.security.auth.jwt.RefreshTokenProcessingFilter; import org.thingsboard.server.service.security.auth.jwt.SkipPathRequestMatcher; import org.thingsboard.server.service.security.auth.jwt.extractor.TokenExtractor; +import org.thingsboard.server.service.security.auth.oauth2.HttpCookieOAuth2AuthorizationRequestRepository; import org.thingsboard.server.service.security.auth.rest.RestAuthenticationProvider; import org.thingsboard.server.service.security.auth.rest.RestLoginProcessingFilter; import org.thingsboard.server.service.security.auth.rest.RestPublicLoginProcessingFilter; @@ -84,6 +85,9 @@ public class ThingsboardSecurityConfiguration extends WebSecurityConfigurerAdapt @Qualifier("oauth2AuthenticationFailureHandler") private AuthenticationFailureHandler oauth2AuthenticationFailureHandler; + @Autowired(required = false) + private HttpCookieOAuth2AuthorizationRequestRepository httpCookieOAuth2AuthorizationRequestRepository; + @Autowired @Qualifier("defaultAuthenticationSuccessHandler") private AuthenticationSuccessHandler successHandler; @@ -213,7 +217,9 @@ public class ThingsboardSecurityConfiguration extends WebSecurityConfigurerAdapt .addFilterAfter(rateLimitProcessingFilter, UsernamePasswordAuthenticationFilter.class); if (oauth2Configuration != null) { http.oauth2Login() - .authorizationEndpoint().authorizationRequestResolver(oAuth2AuthorizationRequestResolver) + .authorizationEndpoint() + .authorizationRequestRepository(httpCookieOAuth2AuthorizationRequestRepository) + .authorizationRequestResolver(oAuth2AuthorizationRequestResolver) .and() .loginPage("/oauth2Login") .loginProcessingUrl(oauth2Configuration.getLoginProcessingUrl()) diff --git a/application/src/main/java/org/thingsboard/server/controller/AuthController.java b/application/src/main/java/org/thingsboard/server/controller/AuthController.java index 621f39c7c3..f41e40ef89 100644 --- a/application/src/main/java/org/thingsboard/server/controller/AuthController.java +++ b/application/src/main/java/org/thingsboard/server/controller/AuthController.java @@ -18,8 +18,9 @@ package org.thingsboard.server.controller; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; +import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.rule.engine.api.MailService; import org.thingsboard.server.common.data.User; import org.thingsboard.server.common.data.audit.ActionType; @@ -40,6 +42,8 @@ import org.thingsboard.server.common.data.exception.ThingsboardErrorCode; import org.thingsboard.server.common.data.exception.ThingsboardException; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.security.UserCredentials; +import org.thingsboard.server.common.data.security.event.UserAuthDataChangedEvent; +import org.thingsboard.server.common.data.security.model.JwtToken; import org.thingsboard.server.common.data.security.model.SecuritySettings; import org.thingsboard.server.common.data.security.model.UserPasswordPolicy; import org.thingsboard.server.dao.audit.AuditLogService; @@ -48,7 +52,6 @@ import org.thingsboard.server.service.security.auth.jwt.RefreshTokenRepository; import org.thingsboard.server.service.security.auth.rest.RestAuthenticationDetails; import org.thingsboard.server.service.security.model.SecurityUser; import org.thingsboard.server.service.security.model.UserPrincipal; -import org.thingsboard.server.service.security.model.token.JwtToken; import org.thingsboard.server.service.security.model.token.JwtTokenFactory; import org.thingsboard.server.service.security.system.SystemSecurityService; import ua_parser.Client; @@ -61,25 +64,15 @@ import java.net.URISyntaxException; @TbCoreComponent @RequestMapping("/api") @Slf4j +@RequiredArgsConstructor public class AuthController extends BaseController { - - @Autowired - private BCryptPasswordEncoder passwordEncoder; - - @Autowired - private JwtTokenFactory tokenFactory; - - @Autowired - private RefreshTokenRepository refreshTokenRepository; - - @Autowired - private MailService mailService; - - @Autowired - private SystemSecurityService systemSecurityService; - - @Autowired - private AuditLogService auditLogService; + private final BCryptPasswordEncoder passwordEncoder; + private final JwtTokenFactory tokenFactory; + private final RefreshTokenRepository refreshTokenRepository; + private final MailService mailService; + private final SystemSecurityService systemSecurityService; + private final AuditLogService auditLogService; + private final ApplicationEventPublisher eventPublisher; @PreAuthorize("isAuthenticated()") @RequestMapping(value = "/auth/user", method = RequestMethod.GET) @@ -102,8 +95,7 @@ public class AuthController extends BaseController { @PreAuthorize("isAuthenticated()") @RequestMapping(value = "/auth/changePassword", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.OK) - public void changePassword ( - @RequestBody JsonNode changePasswordRequest) throws ThingsboardException { + public ObjectNode changePassword(@RequestBody JsonNode changePasswordRequest) throws ThingsboardException { try { String currentPassword = changePasswordRequest.get("currentPassword").asText(); String newPassword = changePasswordRequest.get("newPassword").asText(); @@ -121,6 +113,11 @@ public class AuthController extends BaseController { sendEntityNotificationMsg(getTenantId(), userCredentials.getUserId(), EdgeEventActionType.CREDENTIALS_UPDATED); + eventPublisher.publishEvent(new UserAuthDataChangedEvent(securityUser.getId())); + ObjectNode response = JacksonUtil.newObjectNode(); + response.put("token", tokenFactory.createAccessJwtToken(securityUser).getToken()); + response.put("refreshToken", tokenFactory.createRefreshToken(securityUser).getToken()); + return response; } catch (Exception e) { throw handleException(e); } @@ -137,7 +134,7 @@ public class AuthController extends BaseController { throw handleException(e); } } - + @RequestMapping(value = "/noauth/activate", params = { "activateToken" }, method = RequestMethod.GET) public ResponseEntity checkActivateToken( @RequestParam(value = "activateToken") String activateToken) { @@ -159,7 +156,7 @@ public class AuthController extends BaseController { } return new ResponseEntity<>(headers, responseStatus); } - + @RequestMapping(value = "/noauth/resetPasswordByEmail", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.OK) public void requestResetPasswordByEmail ( @@ -172,13 +169,13 @@ public class AuthController extends BaseController { String baseUrl = systemSecurityService.getBaseUrl(user.getTenantId(), user.getCustomerId(), request); String resetUrl = String.format("%s/api/noauth/resetPassword?resetToken=%s", baseUrl, userCredentials.getResetToken()); - + mailService.sendResetPasswordEmail(resetUrl, email); } catch (Exception e) { throw handleException(e); } } - + @RequestMapping(value = "/noauth/resetPassword", params = { "resetToken" }, method = RequestMethod.GET) public ResponseEntity checkResetToken( @RequestParam(value = "resetToken") String resetToken) { @@ -200,7 +197,7 @@ public class AuthController extends BaseController { } return new ResponseEntity<>(headers, responseStatus); } - + @RequestMapping(value = "/noauth/activate", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.OK) @ResponseBody @@ -217,6 +214,7 @@ public class AuthController extends BaseController { User user = userService.findUserById(TenantId.SYS_TENANT_ID, credentials.getUserId()); UserPrincipal principal = new UserPrincipal(UserPrincipal.Type.USER_NAME, user.getEmail()); SecurityUser securityUser = new SecurityUser(user, credentials.isEnabled(), principal); + userService.setUserCredentialsEnabled(user.getTenantId(), user.getId(), true); String baseUrl = systemSecurityService.getBaseUrl(user.getTenantId(), user.getCustomerId(), request); String loginUrl = String.format("%s/login", baseUrl); String email = user.getEmail(); @@ -243,7 +241,7 @@ public class AuthController extends BaseController { throw handleException(e); } } - + @RequestMapping(value = "/noauth/resetPassword", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.OK) @ResponseBody @@ -271,6 +269,7 @@ public class AuthController extends BaseController { String email = user.getEmail(); mailService.sendPasswordWasResetEmail(loginUrl, email); + eventPublisher.publishEvent(new UserAuthDataChangedEvent(securityUser.getId())); JwtToken accessToken = tokenFactory.createAccessJwtToken(securityUser); JwtToken refreshToken = refreshTokenRepository.requestRefreshToken(securityUser); diff --git a/application/src/main/java/org/thingsboard/server/controller/ResourceController.java b/application/src/main/java/org/thingsboard/server/controller/ResourceController.java new file mode 100644 index 0000000000..1277a32fd6 --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/controller/ResourceController.java @@ -0,0 +1,90 @@ +/** + * Copyright © 2016-2021 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 lombok.extern.slf4j.Slf4j; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.PathVariable; +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.Resource; +import org.thingsboard.server.common.data.ResourceType; +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.dao.resource.ResourceService; +import org.thingsboard.server.queue.util.TbCoreComponent; + +@Slf4j +@RestController +@TbCoreComponent +@RequestMapping("/api") +public class ResourceController extends BaseController { + + private final ResourceService resourceService; + + public ResourceController(ResourceService resourceService) { + this.resourceService = resourceService; + } + + @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')") + @RequestMapping(value = "/resource", method = RequestMethod.POST) + @ResponseBody + public Resource saveResource(Resource resource) throws ThingsboardException { + try { + resource.setTenantId(getTenantId()); + Resource savedResource = checkNotNull(resourceService.saveResource(resource)); + tbClusterService.onResourceChange(savedResource, null); + return savedResource; + } catch (Exception e) { + throw handleException(e); + } + } + + @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')") + @RequestMapping(value = "/resource", method = RequestMethod.GET) + @ResponseBody + public PageData getResources(@RequestParam(required = false) boolean system, + @RequestParam int pageSize, + @RequestParam int page, + @RequestParam(required = false) String sortProperty, + @RequestParam(required = false) String sortOrder) throws ThingsboardException { + try { + PageLink pageLink = createPageLink(pageSize, page, null, sortProperty, sortOrder); + return checkNotNull(resourceService.findResourcesByTenantId(system ? TenantId.SYS_TENANT_ID : getTenantId(), pageLink)); + } catch (Exception e) { + throw handleException(e); + } + } + + @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')") + @RequestMapping(value = "/resource/{resourceType}/{resourceId}", method = RequestMethod.DELETE) + @ResponseBody + public void deleteResource(@PathVariable("resourceType") ResourceType resourceType, + @PathVariable("resourceId") String resourceId) throws ThingsboardException { + try { + Resource resource = checkNotNull(resourceService.getResource(getTenantId(), resourceType, resourceId)); + resourceService.deleteResource(getTenantId(), resourceType, resourceId); + tbClusterService.onResourceDeleted(resource, null); + } catch (Exception e) { + throw handleException(e); + } + } +} diff --git a/application/src/main/java/org/thingsboard/server/controller/UserController.java b/application/src/main/java/org/thingsboard/server/controller/UserController.java index 2a1ec5810e..f254414902 100644 --- a/application/src/main/java/org/thingsboard/server/controller/UserController.java +++ b/application/src/main/java/org/thingsboard/server/controller/UserController.java @@ -19,8 +19,9 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.Getter; -import org.springframework.beans.factory.annotation.Autowired; +import lombok.RequiredArgsConstructor; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationEventPublisher; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.PathVariable; @@ -46,11 +47,12 @@ 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.security.UserCredentials; +import org.thingsboard.server.common.data.security.event.UserAuthDataChangedEvent; +import org.thingsboard.server.common.data.security.model.JwtToken; import org.thingsboard.server.queue.util.TbCoreComponent; import org.thingsboard.server.service.security.auth.jwt.RefreshTokenRepository; import org.thingsboard.server.service.security.model.SecurityUser; import org.thingsboard.server.service.security.model.UserPrincipal; -import org.thingsboard.server.service.security.model.token.JwtToken; import org.thingsboard.server.service.security.model.token.JwtTokenFactory; import org.thingsboard.server.service.security.permission.Operation; import org.thingsboard.server.service.security.permission.Resource; @@ -59,6 +61,7 @@ import org.thingsboard.server.service.security.system.SystemSecurityService; import javax.servlet.http.HttpServletRequest; import java.util.List; +@RequiredArgsConstructor @RestController @TbCoreComponent @RequestMapping("/api") @@ -72,18 +75,11 @@ public class UserController extends BaseController { @Getter private boolean userTokenAccessEnabled; - @Autowired - private MailService mailService; - - @Autowired - private JwtTokenFactory tokenFactory; - - @Autowired - private RefreshTokenRepository refreshTokenRepository; - - @Autowired - private SystemSecurityService systemSecurityService; - + private final MailService mailService; + private final JwtTokenFactory tokenFactory; + private final RefreshTokenRepository refreshTokenRepository; + private final SystemSecurityService systemSecurityService; + private final ApplicationEventPublisher eventPublisher; @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN', 'CUSTOMER_USER')") @RequestMapping(value = "/user/{userId}", method = RequestMethod.GET) @@ -97,12 +93,24 @@ public class UserController extends BaseController { processDashboardIdFromAdditionalInfo((ObjectNode) user.getAdditionalInfo(), DEFAULT_DASHBOARD); processDashboardIdFromAdditionalInfo((ObjectNode) user.getAdditionalInfo(), HOME_DASHBOARD); } + UserCredentials userCredentials = userService.findUserCredentialsByUserId(user.getTenantId(), user.getId()); + if(userCredentials.isEnabled()) { + addUserCredentialsEnabled((ObjectNode) user.getAdditionalInfo()); + } return user; } catch (Exception e) { throw handleException(e); } } + private void addUserCredentialsEnabled(ObjectNode additionalInfo) { + if(!additionalInfo.isNull()) { + if(!additionalInfo.has("userCredentialsEnabled")) { + additionalInfo.put("userCredentialsEnabled", true); + } + } + } + @PreAuthorize("hasAnyAuthority('SYS_ADMIN', 'TENANT_ADMIN')") @RequestMapping(value = "/user/tokenAccessEnabled", method = RequestMethod.GET) @ResponseBody @@ -199,13 +207,13 @@ public class UserController extends BaseController { user.getId(), user); UserCredentials userCredentials = userService.findUserCredentialsByUserId(getCurrentUser().getTenantId(), user.getId()); - if (!userCredentials.isEnabled()) { + if (!userCredentials.isEnabled() && userCredentials.getActivateToken() != null) { String baseUrl = systemSecurityService.getBaseUrl(getTenantId(), getCurrentUser().getCustomerId(), request); String activateUrl = String.format(ACTIVATE_URL_PATTERN, baseUrl, userCredentials.getActivateToken()); mailService.sendActivationEmail(activateUrl, email); } else { - throw new ThingsboardException("User is already active!", ThingsboardErrorCode.BAD_REQUEST_PARAMS); + throw new ThingsboardException("User is already activated!", ThingsboardErrorCode.BAD_REQUEST_PARAMS); } } catch (Exception e) { throw handleException(e); @@ -224,13 +232,13 @@ public class UserController extends BaseController { User user = checkUserId(userId, Operation.READ); SecurityUser authUser = getCurrentUser(); UserCredentials userCredentials = userService.findUserCredentialsByUserId(authUser.getTenantId(), user.getId()); - if (!userCredentials.isEnabled()) { + if (!userCredentials.isEnabled() && userCredentials.getActivateToken() != null) { String baseUrl = systemSecurityService.getBaseUrl(getTenantId(), getCurrentUser().getCustomerId(), request); String activateUrl = String.format(ACTIVATE_URL_PATTERN, baseUrl, userCredentials.getActivateToken()); return activateUrl; } else { - throw new ThingsboardException("User is already active!", ThingsboardErrorCode.BAD_REQUEST_PARAMS); + throw new ThingsboardException("User is already activated!", ThingsboardErrorCode.BAD_REQUEST_PARAMS); } } catch (Exception e) { throw handleException(e); @@ -340,6 +348,10 @@ public class UserController extends BaseController { User user = checkUserId(userId, Operation.WRITE); TenantId tenantId = getCurrentUser().getTenantId(); userService.setUserCredentialsEnabled(tenantId, userId, userCredentialsEnabled); + + if (!userCredentialsEnabled) { + eventPublisher.publishEvent(new UserAuthDataChangedEvent(userId)); + } } catch (Exception e) { throw handleException(e); } diff --git a/application/src/main/java/org/thingsboard/server/controller/plugin/TbWebSocketHandler.java b/application/src/main/java/org/thingsboard/server/controller/plugin/TbWebSocketHandler.java index ade9797be0..166403f417 100644 --- a/application/src/main/java/org/thingsboard/server/controller/plugin/TbWebSocketHandler.java +++ b/application/src/main/java/org/thingsboard/server/controller/plugin/TbWebSocketHandler.java @@ -41,9 +41,13 @@ import org.thingsboard.server.service.telemetry.TelemetryWebSocketMsgEndpoint; import org.thingsboard.server.service.telemetry.TelemetryWebSocketService; import org.thingsboard.server.service.telemetry.TelemetryWebSocketSessionRef; -import javax.websocket.*; +import javax.websocket.RemoteEndpoint; +import javax.websocket.SendHandler; +import javax.websocket.SendResult; +import javax.websocket.Session; import java.io.IOException; import java.net.URI; +import java.nio.ByteBuffer; import java.security.InvalidParameterException; import java.util.Queue; import java.util.Set; @@ -79,6 +83,9 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr @Value("${server.ws.limits.max_updates_per_session:}") private String perSessionUpdatesConfiguration; + @Value("${server.ws.ping_timeout:30000}") + private long pingTimeout; + private ConcurrentMap blacklistedSessions = new ConcurrentHashMap<>(); private ConcurrentMap perSessionUpdateLimits = new ConcurrentHashMap<>(); @@ -120,6 +127,7 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr return; } internalSessionMap.put(internalSessionId, new SessionMetaData(session, sessionRef, maxMsgQueuePerSession)); + externalSessionMap.put(externalSessionId, internalSessionId); processInWebSocketService(sessionRef, SessionEvent.onEstablished()); log.info("[{}][{}][{}] Session is opened", sessionRef.getSecurityCtx().getTenantId(), externalSessionId, session.getId()); @@ -189,6 +197,8 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr private volatile boolean isSending = false; private final Queue msgQueue; + private volatile long lastActivityTime; + SessionMetaData(WebSocketSession session, TelemetryWebSocketSessionRef sessionRef, int maxMsgQueuePerSession) { super(); this.session = session; @@ -196,6 +206,23 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr this.asyncRemote = nativeSession.getAsyncRemote(); this.sessionRef = sessionRef; this.msgQueue = new LinkedBlockingQueue<>(maxMsgQueuePerSession); + this.lastActivityTime = System.currentTimeMillis(); + } + + synchronized void sendPing(long currentTime) { + try { + if (currentTime - lastActivityTime >= pingTimeout) { + this.asyncRemote.sendPing(ByteBuffer.wrap(new byte[]{})); + lastActivityTime = currentTime; + } + } catch (Exception e) { + log.trace("[{}] Failed to send ping msg", session.getId(), e); + try { + close(this.sessionRef, CloseStatus.SESSION_NOT_RELIABLE); + } catch (IOException ioe) { + log.trace("[{}] Session transport error", session.getId(), ioe); + } + } } synchronized void sendMsg(String msg) { @@ -243,6 +270,7 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr log.trace("[{}] Session transport error", session.getId(), ioe); } } else { + lastActivityTime = System.currentTimeMillis(); String msg = msgQueue.poll(); if (msg != null) { sendMsgInternal(msg); @@ -284,6 +312,22 @@ public class TbWebSocketHandler extends TextWebSocketHandler implements Telemetr } } + @Override + public void sendPing(TelemetryWebSocketSessionRef sessionRef, long currentTime) throws IOException { + String externalId = sessionRef.getSessionId(); + String internalId = externalSessionMap.get(externalId); + if (internalId != null) { + SessionMetaData sessionMd = internalSessionMap.get(internalId); + if (sessionMd != null) { + sessionMd.sendPing(currentTime); + } else { + log.warn("[{}][{}] Failed to find session by internal id", externalId, internalId); + } + } else { + log.warn("[{}] Failed to find session by external id", externalId); + } + } + @Override public void close(TelemetryWebSocketSessionRef sessionRef, CloseStatus reason) throws IOException { String externalId = sessionRef.getSessionId(); 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 eac7028b85..7bcd54632c 100644 --- a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java +++ b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java @@ -186,15 +186,22 @@ public class ThingsboardInstallService { log.info("Upgrading ThingsBoard from version 3.2.0 to 3.2.1 ..."); databaseEntitiesUpgradeService.upgradeDatabase("3.2.0"); case "3.2.1": - log.info("Upgrading ThingsBoard from version 3.2.1 to 3.3.0 ..."); + log.info("Upgrading ThingsBoard from version 3.2.1 to 3.2.2 ..."); if (databaseTsUpgradeService != null) { databaseTsUpgradeService.upgradeDatabase("3.2.1"); } - databaseEntitiesUpgradeService.upgradeDatabase("3.2.1"); - dataUpdateService.updateData("3.2.1"); + log.info("Updating system data..."); systemDataLoaderService.updateSystemWidgets(); break; + case "3.2.2": + log.info("Upgrading ThingsBoard from version 3.2.2 to 3.3.0 ..."); + databaseEntitiesUpgradeService.upgradeDatabase("3.2.2"); + + dataUpdateService.updateData("3.2.2"); + + log.info("Updating system data..."); + break; default: throw new RuntimeException("Unable to upgrade ThingsBoard, unsupported fromVersion: " + upgradeFromVersion); @@ -227,6 +234,7 @@ public class ThingsboardInstallService { systemDataLoaderService.createAdminSettings(); systemDataLoaderService.loadSystemWidgets(); systemDataLoaderService.createOAuth2Templates(); + systemDataLoaderService.loadSystemLwm2mResources(); // systemDataLoaderService.loadSystemPlugins(); // systemDataLoaderService.loadSystemRules(); diff --git a/application/src/main/java/org/thingsboard/server/service/install/CassandraTsDatabaseUpgradeService.java b/application/src/main/java/org/thingsboard/server/service/install/CassandraTsDatabaseUpgradeService.java index 2e107af6b8..0a64a59a08 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/CassandraTsDatabaseUpgradeService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/CassandraTsDatabaseUpgradeService.java @@ -49,10 +49,7 @@ public class CassandraTsDatabaseUpgradeService extends AbstractCassandraDatabase log.info("Schema updated."); break; case "2.5.0": - case "2.5.4": - case "2.5.5": case "3.1.1": - case "3.2.0": case "3.2.1": break; default: 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 9b3e9fd1c4..3d21c66e23 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 @@ -36,6 +36,9 @@ import org.thingsboard.server.common.data.TenantProfile; import org.thingsboard.server.common.data.User; import org.thingsboard.server.common.data.alarm.AlarmSeverity; import org.thingsboard.server.common.data.device.profile.AlarmCondition; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilter; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; +import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; import org.thingsboard.server.common.data.device.profile.AlarmRule; import org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileConfiguration; import org.thingsboard.server.common.data.device.profile.DefaultDeviceProfileTransportConfiguration; @@ -291,16 +294,16 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { AlarmCondition temperatureCondition = new AlarmCondition(); temperatureCondition.setSpec(new SimpleAlarmConditionSpec()); - KeyFilter temperatureAlarmFlagAttributeFilter = new KeyFilter(); - temperatureAlarmFlagAttributeFilter.setKey(new EntityKey(EntityKeyType.ATTRIBUTE, "temperatureAlarmFlag")); + AlarmConditionFilter temperatureAlarmFlagAttributeFilter = new AlarmConditionFilter(); + temperatureAlarmFlagAttributeFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.ATTRIBUTE, "temperatureAlarmFlag")); temperatureAlarmFlagAttributeFilter.setValueType(EntityKeyValueType.BOOLEAN); BooleanFilterPredicate temperatureAlarmFlagAttributePredicate = new BooleanFilterPredicate(); temperatureAlarmFlagAttributePredicate.setOperation(BooleanFilterPredicate.BooleanOperation.EQUAL); temperatureAlarmFlagAttributePredicate.setValue(new FilterPredicateValue<>(Boolean.TRUE)); temperatureAlarmFlagAttributeFilter.setPredicate(temperatureAlarmFlagAttributePredicate); - KeyFilter temperatureTimeseriesFilter = new KeyFilter(); - temperatureTimeseriesFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter temperatureTimeseriesFilter = new AlarmConditionFilter(); + temperatureTimeseriesFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); temperatureTimeseriesFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate temperatureTimeseriesFilterPredicate = new NumericFilterPredicate(); temperatureTimeseriesFilterPredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER); @@ -318,8 +321,8 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { AlarmCondition clearTemperatureCondition = new AlarmCondition(); clearTemperatureCondition.setSpec(new SimpleAlarmConditionSpec()); - KeyFilter clearTemperatureTimeseriesFilter = new KeyFilter(); - clearTemperatureTimeseriesFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter clearTemperatureTimeseriesFilter = new AlarmConditionFilter(); + clearTemperatureTimeseriesFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); clearTemperatureTimeseriesFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate clearTemperatureTimeseriesFilterPredicate = new NumericFilterPredicate(); clearTemperatureTimeseriesFilterPredicate.setOperation(NumericFilterPredicate.NumericOperation.LESS_OR_EQUAL); @@ -341,16 +344,16 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { AlarmCondition humidityCondition = new AlarmCondition(); humidityCondition.setSpec(new SimpleAlarmConditionSpec()); - KeyFilter humidityAlarmFlagAttributeFilter = new KeyFilter(); - humidityAlarmFlagAttributeFilter.setKey(new EntityKey(EntityKeyType.ATTRIBUTE, "humidityAlarmFlag")); + AlarmConditionFilter humidityAlarmFlagAttributeFilter = new AlarmConditionFilter(); + humidityAlarmFlagAttributeFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.ATTRIBUTE, "humidityAlarmFlag")); humidityAlarmFlagAttributeFilter.setValueType(EntityKeyValueType.BOOLEAN); BooleanFilterPredicate humidityAlarmFlagAttributePredicate = new BooleanFilterPredicate(); humidityAlarmFlagAttributePredicate.setOperation(BooleanFilterPredicate.BooleanOperation.EQUAL); humidityAlarmFlagAttributePredicate.setValue(new FilterPredicateValue<>(Boolean.TRUE)); humidityAlarmFlagAttributeFilter.setPredicate(humidityAlarmFlagAttributePredicate); - KeyFilter humidityTimeseriesFilter = new KeyFilter(); - humidityTimeseriesFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "humidity")); + AlarmConditionFilter humidityTimeseriesFilter = new AlarmConditionFilter(); + humidityTimeseriesFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "humidity")); humidityTimeseriesFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate humidityTimeseriesFilterPredicate = new NumericFilterPredicate(); humidityTimeseriesFilterPredicate.setOperation(NumericFilterPredicate.NumericOperation.LESS); @@ -369,8 +372,8 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { AlarmCondition clearHumidityCondition = new AlarmCondition(); clearHumidityCondition.setSpec(new SimpleAlarmConditionSpec()); - KeyFilter clearHumidityTimeseriesFilter = new KeyFilter(); - clearHumidityTimeseriesFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "humidity")); + AlarmConditionFilter clearHumidityTimeseriesFilter = new AlarmConditionFilter(); + clearHumidityTimeseriesFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "humidity")); clearHumidityTimeseriesFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate clearHumidityTimeseriesFilterPredicate = new NumericFilterPredicate(); clearHumidityTimeseriesFilterPredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER_OR_EQUAL); @@ -444,6 +447,11 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService { installScripts.loadSystemWidgets(); } + @Override + public void loadSystemLwm2mResources() throws Exception { + installScripts.loadSystemLwm2mResources(); + } + private User createUser(Authority authority, TenantId tenantId, CustomerId customerId, 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 351aa8330f..7cd3e0d56a 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 @@ -17,14 +17,19 @@ package org.thingsboard.server.service.install; import com.fasterxml.jackson.databind.JsonNode; import lombok.extern.slf4j.Slf4j; +import org.eclipse.leshan.core.model.DDFFileParser; +import org.eclipse.leshan.core.model.DefaultDDFFileValidator; +import org.eclipse.leshan.core.model.InvalidDDFFileException; +import org.eclipse.leshan.core.model.ObjectModel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; import org.thingsboard.server.common.data.Dashboard; +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.EntityId; -import org.thingsboard.server.common.data.id.RuleChainId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.oauth2.OAuth2ClientRegistrationTemplate; import org.thingsboard.server.common.data.rule.RuleChain; @@ -33,15 +38,19 @@ import org.thingsboard.server.common.data.widget.WidgetType; import org.thingsboard.server.common.data.widget.WidgetsBundle; import org.thingsboard.server.dao.dashboard.DashboardService; import org.thingsboard.server.dao.oauth2.OAuth2ConfigTemplateService; +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 java.io.ByteArrayInputStream; +import java.io.File; import java.io.IOException; import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.util.Base64; import java.util.Optional; import static org.thingsboard.server.service.install.DatabaseHelper.objectMapper; @@ -66,10 +75,13 @@ public class InstallScripts { public static final String WIDGET_BUNDLES_DIR = "widget_bundles"; public static final String OAUTH2_CONFIG_TEMPLATES_DIR = "oauth2_config_templates"; public static final String DASHBOARDS_DIR = "dashboards"; + public static final String MODELS_DIR = "models"; + public static final String CREDENTIALS_DIR = "credentials"; public static final String EDGE_MANAGEMENT = "edge_management"; public static final String JSON_EXT = ".json"; + public static final String XML_EXT = ".xml"; @Value("${install.data_dir:}") private String dataDir; @@ -89,6 +101,9 @@ public class InstallScripts { @Autowired private OAuth2ConfigTemplateService oAuth2TemplateService; + @Autowired + private ResourceService resourceService; + private Path getTenantRuleChainsDir() { return Paths.get(getDataDir(), JSON_DIR, TENANT_DIR, RULE_CHAINS_DIR); } @@ -200,6 +215,73 @@ public class InstallScripts { } } + public void loadSystemLwm2mResources() throws Exception { +// Path modelsDir = Paths.get("/home/nick/Igor_project/thingsboard_ce_3_2_docker/thingsboard/common/transport/lwm2m/src/main/resources/models/"); + Path modelsDir = Paths.get(getDataDir(), MODELS_DIR); + if (Files.isDirectory(modelsDir)) { + try (DirectoryStream dirStream = Files.newDirectoryStream(modelsDir, path -> path.toString().endsWith(XML_EXT))) { + dirStream.forEach( + path -> { + try { + byte[] fileBytes = Files.readAllBytes(path); + String key = getObjectModelLwm2mValid(fileBytes, path.getFileName().toString(), new DefaultDDFFileValidator()); + if (key != null) { + Resource resource = new Resource(); + resource.setTenantId(TenantId.SYS_TENANT_ID); + resource.setResourceType(ResourceType.LWM2M_MODEL); + resource.setResourceId(key); + resource.setValue(Base64.getEncoder().encodeToString(fileBytes)); + resourceService.saveResource(resource); + } + } catch (Exception e) { + log.error("Unable to load lwm2m model [{}]", path.toString()); + throw new RuntimeException("Unable to load lwm2m model", e); + } + } + ); + } + } + + Path jksPath = Paths.get(getDataDir(), CREDENTIALS_DIR, "serverKeyStore.jks"); + try { + Resource resource = new Resource(); + resource.setTenantId(TenantId.SYS_TENANT_ID); + resource.setResourceType(ResourceType.JKS); + resource.setResourceId(jksPath.getFileName().toString()); + resource.setValue(Base64.getEncoder().encodeToString(Files.readAllBytes(jksPath))); + resourceService.saveResource(resource); + } catch (Exception e) { + log.error("Unable to load lwm2m serverKeyStore [{}]", jksPath.toString()); + throw new RuntimeException("Unable to load l2m2m serverKeyStore", e); + } + } + + private String getObjectModelLwm2mValid(byte[] xmlByte, String streamName, DefaultDDFFileValidator ddfValidator) { + try { + DDFFileParser ddfFileParser = new DDFFileParser(ddfValidator); + ObjectModel objectModel = ddfFileParser.parseEx(new ByteArrayInputStream(xmlByte), streamName).get(0); + return objectModel.id + "##" + objectModel.getVersion(); + } catch (IOException | InvalidDDFFileException e) { + log.error("Could not parse the XML file [{}]", streamName, e); + return null; + } + + } + + private void removeFile(Path modelsDir, String nameFile, byte[] fileBytes) { + String path = "/home/nick/Igor_project/thingsboard_ce_3_2_docker/thingsboard/common/transport/lwm2m/src/main/resources/models/"; + File file = new File(path + nameFile); + if (!file.isDirectory()) { + try { + Files.write(Paths.get(path + "server/" + nameFile), fileBytes); + file.delete(); + } catch (IOException e) { + e.printStackTrace(); + } + + } + } + public void loadDashboards(TenantId tenantId, CustomerId customerId) throws Exception { Path dashboardsDir = Paths.get(getDataDir(), JSON_DIR, DEMO_DIR, DASHBOARDS_DIR); try (DirectoryStream dirStream = Files.newDirectoryStream(dashboardsDir, path -> path.toString().endsWith(JSON_EXT))) { diff --git a/application/src/main/java/org/thingsboard/server/service/install/PsqlTsDatabaseUpgradeService.java b/application/src/main/java/org/thingsboard/server/service/install/PsqlTsDatabaseUpgradeService.java index 76973b475f..53d1f52989 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/PsqlTsDatabaseUpgradeService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/PsqlTsDatabaseUpgradeService.java @@ -196,17 +196,23 @@ public class PsqlTsDatabaseUpgradeService extends AbstractSqlTsDatabaseUpgradeSe } break; case "3.1.1": + case "3.2.1": try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) { log.info("Load TTL functions ..."); loadSql(conn, "2.4.3", LOAD_TTL_FUNCTIONS_SQL); log.info("Load Drop Partitions functions ..."); loadSql(conn, "2.4.3", LOAD_DROP_PARTITIONS_FUNCTIONS_SQL); + + executeQuery(conn, "DROP PROCEDURE IF EXISTS cleanup_timeseries_by_ttl(character varying, bigint, bigint);"); + executeQuery(conn, "DROP FUNCTION IF EXISTS delete_asset_records_from_ts_kv(character varying, character varying, bigint);"); + executeQuery(conn, "DROP FUNCTION IF EXISTS delete_device_records_from_ts_kv(character varying, character varying, bigint);"); + executeQuery(conn, "DROP FUNCTION IF EXISTS delete_customer_records_from_ts_kv(character varying, character varying, bigint);"); } break; - case "3.2.1": + case "3.2.2": try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) { log.info("Load Edge TTL functions ..."); - loadSql(conn, "3.2.1", LOAD_TTL_FUNCTIONS_SQL); + loadSql(conn, "3.2.2", LOAD_TTL_FUNCTIONS_SQL); } break; default: 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 07f06e2575..5315380a35 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 @@ -434,14 +434,29 @@ public class SqlDatabaseUpgradeService implements DatabaseEntitiesUpgradeService log.info("Schema updated."); } break; - case "3.2.1": + case "3.2.2": try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) { log.info("Updating schema ..."); - schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.2.1", SCHEMA_UPDATE_SQL); - loadSql(schemaUpdateFile, conn); try { - conn.createStatement().execute("ALTER TABLE rule_chain ADD type varchar(255) DEFAULT 'CORE'"); //NOSONAR, ignoring because method used to execute thingsboard database upgrade script - } catch (Exception e) {} + schemaUpdateFile = Paths.get(installScripts.getDataDir(), "upgrade", "3.2.2", SCHEMA_UPDATE_SQL); + loadSql(schemaUpdateFile, conn); + try { + conn.createStatement().execute("ALTER TABLE rule_chain ADD type varchar(255) DEFAULT 'CORE'"); //NOSONAR, ignoring because method used to execute thingsboard database upgrade script + } catch (Exception e) {} + + conn.createStatement().execute("CREATE TABLE IF NOT EXISTS resource (" + + " tenant_id uuid NOT NULL," + + " resource_type varchar(32) NOT NULL," + + " resource_id varchar(255) NOT NULL," + + " resource_value varchar," + + " CONSTRAINT resource_unq_key UNIQUE (tenant_id, resource_type, resource_id)" + + " );"); + + conn.createStatement().execute("UPDATE tb_schema_settings SET schema_version = 3003000;"); + installScripts.loadSystemLwm2mResources(); + } catch (Exception e) { + log.error("Failed updating schema!!!", e); + } log.info("Schema updated."); } break; diff --git a/application/src/main/java/org/thingsboard/server/service/install/SystemDataLoaderService.java b/application/src/main/java/org/thingsboard/server/service/install/SystemDataLoaderService.java index 73e2b6ea57..a6f33f476f 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/SystemDataLoaderService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/SystemDataLoaderService.java @@ -33,4 +33,6 @@ public interface SystemDataLoaderService { void deleteSystemWidgetBundle(String bundleAlias) throws Exception; + void loadSystemLwm2mResources() throws Exception; + } diff --git a/application/src/main/java/org/thingsboard/server/service/install/TimescaleTsDatabaseUpgradeService.java b/application/src/main/java/org/thingsboard/server/service/install/TimescaleTsDatabaseUpgradeService.java index f6f635db5e..8c6ec59f12 100644 --- a/application/src/main/java/org/thingsboard/server/service/install/TimescaleTsDatabaseUpgradeService.java +++ b/application/src/main/java/org/thingsboard/server/service/install/TimescaleTsDatabaseUpgradeService.java @@ -178,9 +178,6 @@ public class TimescaleTsDatabaseUpgradeService extends AbstractSqlTsDatabaseUpgr } break; case "3.1.1": - break; - case "3.2.0": - break; case "3.2.1": break; default: diff --git a/application/src/main/java/org/thingsboard/server/service/lwm2m/LwM2MModelsRepository.java b/application/src/main/java/org/thingsboard/server/service/lwm2m/LwM2MModelsRepository.java index 5057893d5c..228562a039 100644 --- a/application/src/main/java/org/thingsboard/server/service/lwm2m/LwM2MModelsRepository.java +++ b/application/src/main/java/org/thingsboard/server/service/lwm2m/LwM2MModelsRepository.java @@ -101,8 +101,8 @@ public class LwM2MModelsRepository { */ private List getLwm2mObjects(Predicate predicate, String sortProperty, String sortOrder) { List lwM2mObjects = new ArrayList<>(); - List listObjects = (predicate == null) ? this.contextServer.getModelsValue() : - contextServer.getModelsValue().stream() + List listObjects = (predicate == null) ? this.contextServer.getModelsValueCommon() : + contextServer.getModelsValueCommon().stream() .filter(predicate) .collect(Collectors.toList()); 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 ef342e9d24..00b4def397 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 @@ -26,6 +26,7 @@ import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.HasName; +import org.thingsboard.server.common.data.Resource; import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.TenantProfile; import org.thingsboard.server.common.data.id.DeviceId; @@ -147,7 +148,7 @@ public class DefaultTbClusterService implements TbClusterService { tbMsg = transformMsg(tbMsg, deviceProfileCache.get(tenantId, new DeviceProfileId(entityId.getId()))); } } - TopicPartitionInfo tpi = partitionService.resolve(ServiceType.TB_RULE_ENGINE, tenantId, entityId); + TopicPartitionInfo tpi = partitionService.resolve(ServiceType.TB_RULE_ENGINE, tbMsg.getQueueName(), tenantId, entityId); log.trace("PUSHING msg: {} to:{}", tbMsg, tpi); ToRuleEngineMsg msg = ToRuleEngineMsg.newBuilder() .setTenantIdMSB(tenantId.getId().getMostSignificantBits()) @@ -249,6 +250,34 @@ public class DefaultTbClusterService implements TbClusterService { onEntityDelete(entity.getTenantId(), entity.getId(), entity.getName(), callback); } + @Override + public void onResourceChange(Resource resource, TbQueueCallback callback) { + TenantId tenantId = resource.getTenantId(); + log.trace("[{}][{}][{}] Processing change resource", tenantId, resource.getResourceType(), resource.getResourceId()); + TransportProtos.ResourceUpdateMsg resourceUpdateMsg = TransportProtos.ResourceUpdateMsg.newBuilder() + .setTenantIdMSB(tenantId.getId().getMostSignificantBits()) + .setTenantIdLSB(tenantId.getId().getLeastSignificantBits()) + .setResourceType(resource.getResourceType().name()) + .setResourceId(resource.getResourceId()) + .build(); + ToTransportMsg transportMsg = ToTransportMsg.newBuilder().setResourceUpdateMsg(resourceUpdateMsg).build(); + broadcast(transportMsg, callback); + } + + @Override + public void onResourceDeleted(Resource resource, TbQueueCallback callback) { + TenantId tenantId = resource.getTenantId(); + log.trace("[{}][{}][{}] Processing delete resource", tenantId, resource.getResourceType(), resource.getResourceId()); + TransportProtos.ResourceDeleteMsg resourceUpdateMsg = TransportProtos.ResourceDeleteMsg.newBuilder() + .setTenantIdMSB(tenantId.getId().getMostSignificantBits()) + .setTenantIdLSB(tenantId.getId().getLeastSignificantBits()) + .setResourceType(resource.getResourceType().name()) + .setResourceId(resource.getResourceId()) + .build(); + ToTransportMsg transportMsg = ToTransportMsg.newBuilder().setResourceDeleteMsg(resourceUpdateMsg).build(); + broadcast(transportMsg, callback); + } + public void onEntityChange(TenantId tenantId, EntityId entityid, T entity, TbQueueCallback callback) { String entityName = (entity instanceof HasName) ? ((HasName) entity).getName() : entity.getClass().getName(); log.trace("[{}][{}][{}] Processing [{}] change event", tenantId, entityid.getEntityType(), entityid.getId(), entityName); diff --git a/application/src/main/java/org/thingsboard/server/service/queue/TbClusterService.java b/application/src/main/java/org/thingsboard/server/service/queue/TbClusterService.java index 2ba943c762..d91afa63f1 100644 --- a/application/src/main/java/org/thingsboard/server/service/queue/TbClusterService.java +++ b/application/src/main/java/org/thingsboard/server/service/queue/TbClusterService.java @@ -19,6 +19,7 @@ import org.thingsboard.rule.engine.api.msg.ToDeviceActorNotificationMsg; import org.thingsboard.server.common.data.ApiUsageState; import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.DeviceProfile; +import org.thingsboard.server.common.data.Resource; import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.TenantProfile; import org.thingsboard.server.common.data.id.EdgeId; @@ -72,6 +73,11 @@ public interface TbClusterService { void onDeviceChange(Device device, TbQueueCallback callback); void onDeviceDeleted(Device device, TbQueueCallback callback); + + void onResourceChange(Resource resource, TbQueueCallback callback); + + void onResourceDeleted(Resource resource, TbQueueCallback callback); + void onEdgeEventUpdate(TenantId tenantId, EdgeId edgeId); } diff --git a/application/src/main/java/org/thingsboard/server/service/queue/TbCoreConsumerStats.java b/application/src/main/java/org/thingsboard/server/service/queue/TbCoreConsumerStats.java index 8f860595b3..7d68bdf974 100644 --- a/application/src/main/java/org/thingsboard/server/service/queue/TbCoreConsumerStats.java +++ b/application/src/main/java/org/thingsboard/server/service/queue/TbCoreConsumerStats.java @@ -58,32 +58,23 @@ public class TbCoreConsumerStats { public TbCoreConsumerStats(StatsFactory statsFactory) { String statsKey = StatsType.CORE.getName(); - this.totalCounter = statsFactory.createStatsCounter(statsKey, TOTAL_MSGS); - this.sessionEventCounter = statsFactory.createStatsCounter(statsKey, SESSION_EVENTS); - this.getAttributesCounter = statsFactory.createStatsCounter(statsKey, GET_ATTRIBUTE); - this.subscribeToAttributesCounter = statsFactory.createStatsCounter(statsKey, ATTRIBUTE_SUBSCRIBES); - this.subscribeToRPCCounter = statsFactory.createStatsCounter(statsKey, RPC_SUBSCRIBES); - this.toDeviceRPCCallResponseCounter = statsFactory.createStatsCounter(statsKey, TO_DEVICE_RPC_CALL_RESPONSES); - this.subscriptionInfoCounter = statsFactory.createStatsCounter(statsKey, SUBSCRIPTION_INFO); - this.claimDeviceCounter = statsFactory.createStatsCounter(statsKey, DEVICE_CLAIMS); - this.deviceStateCounter = statsFactory.createStatsCounter(statsKey, DEVICE_STATES); - this.subscriptionMsgCounter = statsFactory.createStatsCounter(statsKey, SUBSCRIPTION_MSGS); - this.toCoreNotificationsCounter = statsFactory.createStatsCounter(statsKey, TO_CORE_NOTIFICATIONS); - this.edgeNotificationsCounter = statsFactory.createStatsCounter(statsKey, EDGE_NOTIFICATIONS); - - counters.add(totalCounter); - counters.add(sessionEventCounter); - counters.add(getAttributesCounter); - counters.add(subscribeToAttributesCounter); - counters.add(subscribeToRPCCounter); - counters.add(toDeviceRPCCallResponseCounter); - counters.add(subscriptionInfoCounter); - counters.add(claimDeviceCounter); - - counters.add(deviceStateCounter); - counters.add(subscriptionMsgCounter); - counters.add(toCoreNotificationsCounter); - counters.add(edgeNotificationsCounter); + this.totalCounter = register(statsFactory.createStatsCounter(statsKey, TOTAL_MSGS)); + this.sessionEventCounter = register(statsFactory.createStatsCounter(statsKey, SESSION_EVENTS)); + this.getAttributesCounter = register(statsFactory.createStatsCounter(statsKey, GET_ATTRIBUTE)); + this.subscribeToAttributesCounter = register(statsFactory.createStatsCounter(statsKey, ATTRIBUTE_SUBSCRIBES)); + this.subscribeToRPCCounter = register(statsFactory.createStatsCounter(statsKey, RPC_SUBSCRIBES)); + this.toDeviceRPCCallResponseCounter = register(statsFactory.createStatsCounter(statsKey, TO_DEVICE_RPC_CALL_RESPONSES)); + this.subscriptionInfoCounter = register(statsFactory.createStatsCounter(statsKey, SUBSCRIPTION_INFO)); + this.claimDeviceCounter = register(statsFactory.createStatsCounter(statsKey, DEVICE_CLAIMS)); + this.deviceStateCounter = register(statsFactory.createStatsCounter(statsKey, DEVICE_STATES)); + this.subscriptionMsgCounter = register(statsFactory.createStatsCounter(statsKey, SUBSCRIPTION_MSGS)); + this.toCoreNotificationsCounter = register(statsFactory.createStatsCounter(statsKey, TO_CORE_NOTIFICATIONS)); + this.edgeNotificationsCounter = register(statsFactory.createStatsCounter(statsKey, EDGE_NOTIFICATIONS)); + } + + private StatsCounter register(StatsCounter counter){ + counters.add(counter); + return counter; } public void log(TransportProtos.TransportToDeviceActorMsg msg) { diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/TokenOutdatingService.java b/application/src/main/java/org/thingsboard/server/service/security/auth/TokenOutdatingService.java new file mode 100644 index 0000000000..175242b09a --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/TokenOutdatingService.java @@ -0,0 +1,85 @@ +/** + * Copyright © 2016-2021 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.security.auth; + +import io.jsonwebtoken.Claims; +import lombok.RequiredArgsConstructor; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.context.event.EventListener; +import org.springframework.stereotype.Service; +import org.thingsboard.server.common.data.CacheConstants; +import org.thingsboard.server.common.data.id.UserId; +import org.thingsboard.server.common.data.security.event.UserAuthDataChangedEvent; +import org.thingsboard.server.common.data.security.model.JwtToken; +import org.thingsboard.server.config.JwtSettings; +import org.thingsboard.server.service.security.model.token.JwtTokenFactory; + +import javax.annotation.PostConstruct; +import java.util.Optional; + +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; + +@Service +@RequiredArgsConstructor +public class TokenOutdatingService { + private final CacheManager cacheManager; + private final JwtTokenFactory tokenFactory; + private final JwtSettings jwtSettings; + private Cache tokenOutdatageTimeCache; + + @PostConstruct + protected void initCache() { + tokenOutdatageTimeCache = cacheManager.getCache(CacheConstants.TOKEN_OUTDATAGE_TIME_CACHE); + } + + @EventListener(classes = UserAuthDataChangedEvent.class) + public void onUserAuthDataChanged(UserAuthDataChangedEvent userAuthDataChangedEvent) { + outdateOldUserTokens(userAuthDataChangedEvent.getUserId()); + } + + public boolean isOutdated(JwtToken token, UserId userId) { + Claims claims = tokenFactory.parseTokenClaims(token).getBody(); + long issueTime = claims.getIssuedAt().getTime(); + + return Optional.ofNullable(tokenOutdatageTimeCache.get(toKey(userId), Long.class)) + .map(outdatageTime -> { + if (System.currentTimeMillis() - outdatageTime <= SECONDS.toMillis(jwtSettings.getRefreshTokenExpTime())) { + return MILLISECONDS.toSeconds(issueTime) < MILLISECONDS.toSeconds(outdatageTime); + } else { + /* + * Means that since the outdating has passed more than + * the lifetime of refresh token (the longest lived) + * and there is no need to store outdatage time anymore + * as all the tokens issued before the outdatage time + * are now expired by themselves + * */ + tokenOutdatageTimeCache.evict(toKey(userId)); + return false; + } + }) + .orElse(false); + } + + public void outdateOldUserTokens(UserId userId) { + tokenOutdatageTimeCache.put(toKey(userId), System.currentTimeMillis()); + } + + private String toKey(UserId userId) { + return userId.getId().toString(); + } +} diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtAuthenticationProvider.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtAuthenticationProvider.java index ac11e8b48d..68291c9ac0 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtAuthenticationProvider.java +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtAuthenticationProvider.java @@ -15,31 +15,34 @@ */ package org.thingsboard.server.service.security.auth.jwt; -import org.springframework.beans.factory.annotation.Autowired; +import lombok.RequiredArgsConstructor; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.core.Authentication; import org.springframework.security.core.AuthenticationException; import org.springframework.stereotype.Component; +import org.thingsboard.server.service.security.auth.TokenOutdatingService; import org.thingsboard.server.service.security.auth.JwtAuthenticationToken; +import org.thingsboard.server.service.security.exception.JwtExpiredTokenException; import org.thingsboard.server.service.security.model.SecurityUser; import org.thingsboard.server.service.security.model.token.JwtTokenFactory; import org.thingsboard.server.service.security.model.token.RawAccessJwtToken; @Component -@SuppressWarnings("unchecked") +@RequiredArgsConstructor public class JwtAuthenticationProvider implements AuthenticationProvider { private final JwtTokenFactory tokenFactory; - - @Autowired - public JwtAuthenticationProvider(JwtTokenFactory tokenFactory) { - this.tokenFactory = tokenFactory; - } + private final TokenOutdatingService tokenOutdatingService; @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { RawAccessJwtToken rawAccessToken = (RawAccessJwtToken) authentication.getCredentials(); SecurityUser securityUser = tokenFactory.parseAccessJwtToken(rawAccessToken); + + if (tokenOutdatingService.isOutdated(rawAccessToken, securityUser.getId())) { + throw new JwtExpiredTokenException("Token is outdated"); + } + return new JwtAuthenticationToken(securityUser); } diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenAuthenticationProvider.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenAuthenticationProvider.java index e697ada876..7899c15b70 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenAuthenticationProvider.java +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenAuthenticationProvider.java @@ -15,9 +15,10 @@ */ package org.thingsboard.server.service.security.auth.jwt; -import org.springframework.beans.factory.annotation.Autowired; +import lombok.RequiredArgsConstructor; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.CredentialsExpiredException; import org.springframework.security.authentication.DisabledException; import org.springframework.security.authentication.InsufficientAuthenticationException; import org.springframework.security.core.Authentication; @@ -32,6 +33,7 @@ import org.thingsboard.server.common.data.id.EntityId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.id.UserId; import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.service.security.auth.TokenOutdatingService; import org.thingsboard.server.common.data.security.UserCredentials; import org.thingsboard.server.dao.customer.CustomerService; import org.thingsboard.server.dao.user.UserService; @@ -44,18 +46,12 @@ import org.thingsboard.server.service.security.model.token.RawAccessJwtToken; import java.util.UUID; @Component +@RequiredArgsConstructor public class RefreshTokenAuthenticationProvider implements AuthenticationProvider { - private final JwtTokenFactory tokenFactory; private final UserService userService; private final CustomerService customerService; - - @Autowired - public RefreshTokenAuthenticationProvider(final UserService userService, final CustomerService customerService, final JwtTokenFactory tokenFactory) { - this.userService = userService; - this.customerService = customerService; - this.tokenFactory = tokenFactory; - } + private final TokenOutdatingService tokenOutdatingService; @Override public Authentication authenticate(Authentication authentication) throws AuthenticationException { @@ -63,12 +59,18 @@ public class RefreshTokenAuthenticationProvider implements AuthenticationProvide RawAccessJwtToken rawAccessToken = (RawAccessJwtToken) authentication.getCredentials(); SecurityUser unsafeUser = tokenFactory.parseRefreshToken(rawAccessToken); UserPrincipal principal = unsafeUser.getUserPrincipal(); + SecurityUser securityUser; if (principal.getType() == UserPrincipal.Type.USER_NAME) { securityUser = authenticateByUserId(unsafeUser.getId()); } else { securityUser = authenticateByPublicId(principal.getValue()); } + + if (tokenOutdatingService.isOutdated(rawAccessToken, securityUser.getId())) { + throw new CredentialsExpiredException("Token is outdated"); + } + return new RefreshAuthenticationToken(securityUser); } @@ -91,7 +93,6 @@ public class RefreshTokenAuthenticationProvider implements AuthenticationProvide if (user.getAuthority() == null) throw new InsufficientAuthenticationException("User has no authority assigned"); UserPrincipal userPrincipal = new UserPrincipal(UserPrincipal.Type.USER_NAME, user.getEmail()); - SecurityUser securityUser = new SecurityUser(user, userCredentials.isEnabled(), userPrincipal); return securityUser; diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRepository.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRepository.java index be24f927c8..0860229e28 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRepository.java +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRepository.java @@ -17,8 +17,8 @@ package org.thingsboard.server.service.security.auth.jwt; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.thingsboard.server.common.data.security.model.JwtToken; import org.thingsboard.server.service.security.model.SecurityUser; -import org.thingsboard.server.service.security.model.token.JwtToken; import org.thingsboard.server.service.security.model.token.JwtTokenFactory; @Component diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/CookieUtils.java b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/CookieUtils.java new file mode 100644 index 0000000000..dc66bcca8e --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/CookieUtils.java @@ -0,0 +1,72 @@ +/** + * Copyright © 2016-2021 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.security.auth.oauth2; + +import org.springframework.util.SerializationUtils; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Base64; +import java.util.Optional; + +public class CookieUtils { + + public static Optional getCookie(HttpServletRequest request, String name) { + Cookie[] cookies = request.getCookies(); + + if (cookies != null && cookies.length > 0) { + for (Cookie cookie : cookies) { + if (cookie.getName().equals(name)) { + return Optional.of(cookie); + } + } + } + + return Optional.empty(); + } + + public static void addCookie(HttpServletResponse response, String name, String value, int maxAge) { + Cookie cookie = new Cookie(name, value); + cookie.setPath("/"); + cookie.setHttpOnly(true); + cookie.setMaxAge(maxAge); + response.addCookie(cookie); + } + + public static void deleteCookie(HttpServletRequest request, HttpServletResponse response, String name) { + Cookie[] cookies = request.getCookies(); + if (cookies != null && cookies.length > 0) { + for (Cookie cookie: cookies) { + if (cookie.getName().equals(name)) { + cookie.setValue(""); + cookie.setPath("/"); + cookie.setMaxAge(0); + response.addCookie(cookie); + } + } + } + } + + public static String serialize(Object object) { + return Base64.getUrlEncoder() + .encodeToString(SerializationUtils.serialize(object)); + } + + public static T deserialize(Cookie cookie, Class cls) { + return cls.cast(SerializationUtils.deserialize( + Base64.getUrlDecoder().decode(cookie.getValue()))); + } +} 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 new file mode 100644 index 0000000000..27534fe33c --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/HttpCookieOAuth2AuthorizationRequestRepository.java @@ -0,0 +1,55 @@ +/** + * Copyright © 2016-2021 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.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 javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +@Component +public class HttpCookieOAuth2AuthorizationRequestRepository implements AuthorizationRequestRepository { + public static final String OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME = "oauth2_auth_request"; + private static final int cookieExpireSeconds = 180; + + @Override + public OAuth2AuthorizationRequest loadAuthorizationRequest(HttpServletRequest request) { + return CookieUtils.getCookie(request, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME) + .map(cookie -> CookieUtils.deserialize(cookie, OAuth2AuthorizationRequest.class)) + .orElse(null); + } + + @Override + public void saveAuthorizationRequest(OAuth2AuthorizationRequest authorizationRequest, HttpServletRequest request, HttpServletResponse response) { + if (authorizationRequest == null) { + CookieUtils.deleteCookie(request, response, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME); + return; + } + CookieUtils.addCookie(response, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME, CookieUtils.serialize(authorizationRequest), cookieExpireSeconds); + } + + @SuppressWarnings("deprecation") + @Override + public OAuth2AuthorizationRequest removeAuthorizationRequest(HttpServletRequest request) { + return this.loadAuthorizationRequest(request); + } + + public void removeAuthorizationRequestCookies(HttpServletRequest request, HttpServletResponse response) { + CookieUtils.deleteCookie(request, response, OAUTH2_AUTHORIZATION_REQUEST_COOKIE_NAME); + } +} diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/Oauth2AuthenticationFailureHandler.java b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/Oauth2AuthenticationFailureHandler.java index 98d7fd9a20..b6345f1618 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/Oauth2AuthenticationFailureHandler.java +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/Oauth2AuthenticationFailureHandler.java @@ -37,10 +37,13 @@ import java.nio.charset.StandardCharsets; @ConditionalOnProperty(prefix = "security.oauth2", value = "enabled", havingValue = "true") public class Oauth2AuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler { + private final HttpCookieOAuth2AuthorizationRequestRepository httpCookieOAuth2AuthorizationRequestRepository; private final SystemSecurityService systemSecurityService; @Autowired - public Oauth2AuthenticationFailureHandler(final SystemSecurityService systemSecurityService) { + public Oauth2AuthenticationFailureHandler(final HttpCookieOAuth2AuthorizationRequestRepository httpCookieOAuth2AuthorizationRequestRepository, + final SystemSecurityService systemSecurityService) { + this.httpCookieOAuth2AuthorizationRequestRepository = httpCookieOAuth2AuthorizationRequestRepository; this.systemSecurityService = systemSecurityService; } @@ -49,6 +52,7 @@ public class Oauth2AuthenticationFailureHandler extends SimpleUrlAuthenticationF HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException { String baseUrl = this.systemSecurityService.getBaseUrl(TenantId.SYS_TENANT_ID, new CustomerId(EntityId.NULL_UUID), request); + httpCookieOAuth2AuthorizationRequestRepository.removeAuthorizationRequestCookies(request, response); getRedirectStrategy().sendRedirect(request, response, baseUrl + "/login?loginError=" + URLEncoder.encode(exception.getMessage(), StandardCharsets.UTF_8.toString())); } diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/Oauth2AuthenticationSuccessHandler.java b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/Oauth2AuthenticationSuccessHandler.java index 29ef86bcc0..72a6c65f7c 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/Oauth2AuthenticationSuccessHandler.java +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/oauth2/Oauth2AuthenticationSuccessHandler.java @@ -26,13 +26,12 @@ import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.EntityId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.oauth2.OAuth2ClientRegistrationInfo; +import org.thingsboard.server.common.data.security.model.JwtToken; import org.thingsboard.server.dao.oauth2.OAuth2Service; import org.thingsboard.server.service.security.auth.jwt.RefreshTokenRepository; import org.thingsboard.server.service.security.model.SecurityUser; -import org.thingsboard.server.service.security.model.token.JwtToken; import org.thingsboard.server.service.security.model.token.JwtTokenFactory; import org.thingsboard.server.service.security.system.SystemSecurityService; -import org.thingsboard.server.utils.MiscUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -49,6 +48,7 @@ public class Oauth2AuthenticationSuccessHandler extends SimpleUrlAuthenticationS private final OAuth2ClientMapperProvider oauth2ClientMapperProvider; private final OAuth2Service oAuth2Service; private final OAuth2AuthorizedClientService oAuth2AuthorizedClientService; + private final HttpCookieOAuth2AuthorizationRequestRepository httpCookieOAuth2AuthorizationRequestRepository; private final SystemSecurityService systemSecurityService; @Autowired @@ -56,12 +56,15 @@ public class Oauth2AuthenticationSuccessHandler extends SimpleUrlAuthenticationS final RefreshTokenRepository refreshTokenRepository, final OAuth2ClientMapperProvider oauth2ClientMapperProvider, final OAuth2Service oAuth2Service, - final OAuth2AuthorizedClientService oAuth2AuthorizedClientService, final SystemSecurityService systemSecurityService) { + final OAuth2AuthorizedClientService oAuth2AuthorizedClientService, + final HttpCookieOAuth2AuthorizationRequestRepository httpCookieOAuth2AuthorizationRequestRepository, + final SystemSecurityService systemSecurityService) { this.tokenFactory = tokenFactory; this.refreshTokenRepository = refreshTokenRepository; this.oauth2ClientMapperProvider = oauth2ClientMapperProvider; this.oAuth2Service = oAuth2Service; this.oAuth2AuthorizedClientService = oAuth2AuthorizedClientService; + this.httpCookieOAuth2AuthorizationRequestRepository = httpCookieOAuth2AuthorizationRequestRepository; this.systemSecurityService = systemSecurityService; } @@ -84,10 +87,17 @@ public class Oauth2AuthenticationSuccessHandler extends SimpleUrlAuthenticationS JwtToken accessToken = tokenFactory.createAccessJwtToken(securityUser); JwtToken refreshToken = refreshTokenRepository.requestRefreshToken(securityUser); + clearAuthenticationAttributes(request, response); getRedirectStrategy().sendRedirect(request, response, baseUrl + "/?accessToken=" + accessToken.getToken() + "&refreshToken=" + refreshToken.getToken()); } catch (Exception e) { + clearAuthenticationAttributes(request, response); getRedirectStrategy().sendRedirect(request, response, baseUrl + "/login?loginError=" + URLEncoder.encode(e.getMessage(), StandardCharsets.UTF_8.toString())); } } + + protected void clearAuthenticationAttributes(HttpServletRequest request, HttpServletResponse response) { + super.clearAuthenticationAttributes(request); + httpCookieOAuth2AuthorizationRequestRepository.removeAuthorizationRequestCookies(request, response); + } } diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationSuccessHandler.java b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationSuccessHandler.java index a393161292..116fbe09e4 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationSuccessHandler.java +++ b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationSuccessHandler.java @@ -23,9 +23,9 @@ import org.springframework.security.core.Authentication; import org.springframework.security.web.WebAttributes; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.stereotype.Component; +import org.thingsboard.server.common.data.security.model.JwtToken; import org.thingsboard.server.service.security.auth.jwt.RefreshTokenRepository; import org.thingsboard.server.service.security.model.SecurityUser; -import org.thingsboard.server.service.security.model.token.JwtToken; import org.thingsboard.server.service.security.model.token.JwtTokenFactory; import javax.servlet.ServletException; diff --git a/application/src/main/java/org/thingsboard/server/service/security/exception/JwtExpiredTokenException.java b/application/src/main/java/org/thingsboard/server/service/security/exception/JwtExpiredTokenException.java index 47bd5220a3..dc4b04e87e 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/exception/JwtExpiredTokenException.java +++ b/application/src/main/java/org/thingsboard/server/service/security/exception/JwtExpiredTokenException.java @@ -16,7 +16,7 @@ package org.thingsboard.server.service.security.exception; import org.springframework.security.core.AuthenticationException; -import org.thingsboard.server.service.security.model.token.JwtToken; +import org.thingsboard.server.common.data.security.model.JwtToken; public class JwtExpiredTokenException extends AuthenticationException { private static final long serialVersionUID = -5959543783324224864L; diff --git a/application/src/main/java/org/thingsboard/server/service/security/model/token/AccessJwtToken.java b/application/src/main/java/org/thingsboard/server/service/security/model/token/AccessJwtToken.java index 4bf16d135b..a8ab344295 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/model/token/AccessJwtToken.java +++ b/application/src/main/java/org/thingsboard/server/service/security/model/token/AccessJwtToken.java @@ -17,6 +17,7 @@ package org.thingsboard.server.service.security.model.token; import com.fasterxml.jackson.annotation.JsonIgnore; import io.jsonwebtoken.Claims; +import org.thingsboard.server.common.data.security.model.JwtToken; public final class AccessJwtToken implements JwtToken { private final String rawToken; diff --git a/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtTokenFactory.java b/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtTokenFactory.java index cfbf051cad..9315b3bcc1 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtTokenFactory.java +++ b/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtTokenFactory.java @@ -16,18 +16,26 @@ package org.thingsboard.server.service.security.model.token; import io.jsonwebtoken.Claims; +import io.jsonwebtoken.ExpiredJwtException; import io.jsonwebtoken.Jws; import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.MalformedJwtException; import io.jsonwebtoken.SignatureAlgorithm; +import io.jsonwebtoken.SignatureException; +import io.jsonwebtoken.UnsupportedJwtException; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.core.GrantedAuthority; import org.springframework.stereotype.Component; import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.id.UserId; import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.common.data.security.model.JwtToken; import org.thingsboard.server.config.JwtSettings; +import org.thingsboard.server.service.security.exception.JwtExpiredTokenException; import org.thingsboard.server.service.security.model.SecurityUser; import org.thingsboard.server.service.security.model.UserPrincipal; @@ -39,6 +47,7 @@ import java.util.UUID; import java.util.stream.Collectors; @Component +@Slf4j public class JwtTokenFactory { private static final String SCOPES = "scopes"; @@ -97,7 +106,7 @@ public class JwtTokenFactory { } public SecurityUser parseAccessJwtToken(RawAccessJwtToken rawAccessToken) { - Jws jwsClaims = rawAccessToken.parseClaims(settings.getTokenSigningKey()); + Jws jwsClaims = parseTokenClaims(rawAccessToken); Claims claims = jwsClaims.getBody(); String subject = claims.getSubject(); @SuppressWarnings("unchecked") @@ -153,7 +162,7 @@ public class JwtTokenFactory { } public SecurityUser parseRefreshToken(RawAccessJwtToken rawAccessToken) { - Jws jwsClaims = rawAccessToken.parseClaims(settings.getTokenSigningKey()); + Jws jwsClaims = parseTokenClaims(rawAccessToken); Claims claims = jwsClaims.getBody(); String subject = claims.getSubject(); @SuppressWarnings("unchecked") @@ -171,4 +180,17 @@ public class JwtTokenFactory { return securityUser; } + public Jws parseTokenClaims(JwtToken token) { + try { + return Jwts.parser() + .setSigningKey(settings.getTokenSigningKey()) + .parseClaimsJws(token.getToken()); + } catch (UnsupportedJwtException | MalformedJwtException | IllegalArgumentException | SignatureException ex) { + log.debug("Invalid JWT Token", ex); + throw new BadCredentialsException("Invalid JWT token: ", ex); + } catch (ExpiredJwtException expiredEx) { + log.debug("JWT Token is expired", expiredEx); + throw new JwtExpiredTokenException(token, "JWT Token expired", expiredEx); + } + } } diff --git a/application/src/main/java/org/thingsboard/server/service/security/model/token/RawAccessJwtToken.java b/application/src/main/java/org/thingsboard/server/service/security/model/token/RawAccessJwtToken.java index 0e966fe678..af67706659 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/model/token/RawAccessJwtToken.java +++ b/application/src/main/java/org/thingsboard/server/service/security/model/token/RawAccessJwtToken.java @@ -15,22 +15,10 @@ */ package org.thingsboard.server.service.security.model.token; -import io.jsonwebtoken.Claims; -import io.jsonwebtoken.ExpiredJwtException; -import io.jsonwebtoken.Jws; -import io.jsonwebtoken.Jwts; -import io.jsonwebtoken.MalformedJwtException; -import io.jsonwebtoken.SignatureException; -import io.jsonwebtoken.UnsupportedJwtException; -import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.authentication.BadCredentialsException; -import org.thingsboard.server.service.security.exception.JwtExpiredTokenException; +import org.thingsboard.server.common.data.security.model.JwtToken; import java.io.Serializable; -@Slf4j public class RawAccessJwtToken implements JwtToken, Serializable { private static final long serialVersionUID = -797397445703066079L; @@ -41,25 +29,6 @@ public class RawAccessJwtToken implements JwtToken, Serializable { this.token = token; } - /** - * Parses and validates JWT Token signature. - * - * @throws BadCredentialsException - * @throws JwtExpiredTokenException - * - */ - public Jws parseClaims(String signingKey) { - try { - return Jwts.parser().setSigningKey(signingKey).parseClaimsJws(this.token); - } catch (UnsupportedJwtException | MalformedJwtException | IllegalArgumentException | SignatureException ex) { - log.debug("Invalid JWT Token", ex); - throw new BadCredentialsException("Invalid JWT token: ", ex); - } catch (ExpiredJwtException expiredEx) { - log.debug("JWT Token is expired", expiredEx); - throw new JwtExpiredTokenException(this, "JWT Token expired", expiredEx); - } - } - @Override public String getToken() { return token; diff --git a/application/src/main/java/org/thingsboard/server/service/sms/AbstractSmsSender.java b/application/src/main/java/org/thingsboard/server/service/sms/AbstractSmsSender.java index 1a7619aec8..84aa972e8a 100644 --- a/application/src/main/java/org/thingsboard/server/service/sms/AbstractSmsSender.java +++ b/application/src/main/java/org/thingsboard/server/service/sms/AbstractSmsSender.java @@ -24,7 +24,7 @@ import java.util.regex.Pattern; @Slf4j public abstract class AbstractSmsSender implements SmsSender { - private static final Pattern E_164_PHONE_NUMBER_PATTERN = Pattern.compile("^\\+[1-9]\\d{1,14}$"); + protected static final Pattern E_164_PHONE_NUMBER_PATTERN = Pattern.compile("^\\+[1-9]\\d{1,14}$"); private static final int MAX_SMS_MESSAGE_LENGTH = 1600; private static final int MAX_SMS_SEGMENT_LENGTH = 70; diff --git a/application/src/main/java/org/thingsboard/server/service/sms/twilio/TwilioSmsSender.java b/application/src/main/java/org/thingsboard/server/service/sms/twilio/TwilioSmsSender.java index 27c441410c..1988013fb0 100644 --- a/application/src/main/java/org/thingsboard/server/service/sms/twilio/TwilioSmsSender.java +++ b/application/src/main/java/org/thingsboard/server/service/sms/twilio/TwilioSmsSender.java @@ -19,21 +19,34 @@ import com.twilio.http.TwilioRestClient; import com.twilio.rest.api.v2010.account.Message; import com.twilio.type.PhoneNumber; import org.apache.commons.lang3.StringUtils; +import org.thingsboard.rule.engine.api.sms.exception.SmsParseException; import org.thingsboard.server.common.data.sms.config.TwilioSmsProviderConfiguration; import org.thingsboard.rule.engine.api.sms.exception.SmsException; import org.thingsboard.rule.engine.api.sms.exception.SmsSendException; import org.thingsboard.server.service.sms.AbstractSmsSender; +import java.util.regex.Pattern; + public class TwilioSmsSender extends AbstractSmsSender { + private static final Pattern PHONE_NUMBERS_SID_MESSAGE_SERVICE_SID = Pattern.compile("^(PN|MG).*$"); + private TwilioRestClient twilioRestClient; private String numberFrom; + private String validatePhoneTwilioNumber(String phoneNumber) throws SmsParseException { + phoneNumber = phoneNumber.trim(); + if (!E_164_PHONE_NUMBER_PATTERN.matcher(phoneNumber).matches() && !PHONE_NUMBERS_SID_MESSAGE_SERVICE_SID.matcher(phoneNumber).matches()) { + throw new SmsParseException("Invalid phone number format. Phone number must be in E.164 format/Phone Number's SID/Messaging Service SID."); + } + return phoneNumber; + } + public TwilioSmsSender(TwilioSmsProviderConfiguration config) { if (StringUtils.isEmpty(config.getAccountSid()) || StringUtils.isEmpty(config.getAccountToken()) || StringUtils.isEmpty(config.getNumberFrom())) { throw new IllegalArgumentException("Invalid twilio sms provider configuration: accountSid, accountToken and numberFrom should be specified!"); } - this.numberFrom = this.validatePhoneNumber(config.getNumberFrom()); + this.numberFrom = this.validatePhoneTwilioNumber(config.getNumberFrom()); this.twilioRestClient = new TwilioRestClient.Builder(config.getAccountSid(), config.getAccountToken()).build(); } diff --git a/application/src/main/java/org/thingsboard/server/service/subscription/DefaultTbEntityDataSubscriptionService.java b/application/src/main/java/org/thingsboard/server/service/subscription/DefaultTbEntityDataSubscriptionService.java index 689f80f757..330b096b78 100644 --- a/application/src/main/java/org/thingsboard/server/service/subscription/DefaultTbEntityDataSubscriptionService.java +++ b/application/src/main/java/org/thingsboard/server/service/subscription/DefaultTbEntityDataSubscriptionService.java @@ -54,6 +54,7 @@ import org.thingsboard.server.service.telemetry.TelemetryWebSocketService; import org.thingsboard.server.service.telemetry.TelemetryWebSocketSessionRef; import org.thingsboard.server.service.telemetry.cmd.v2.AlarmDataCmd; import org.thingsboard.server.service.telemetry.cmd.v2.AlarmDataUpdate; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityCountCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate; import org.thingsboard.server.service.telemetry.cmd.v2.EntityHistoryCmd; @@ -92,7 +93,7 @@ import java.util.stream.Collectors; public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubscriptionService { private static final int DEFAULT_LIMIT = 100; - private final Map> subscriptionsBySessionId = new ConcurrentHashMap<>(); + private final Map> subscriptionsBySessionId = new ConcurrentHashMap<>(); @Autowired private TelemetryWebSocketService wsService; @@ -202,7 +203,7 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc //TODO: validate number of dynamic page links against rate limits. Ignore dynamic flag if limit is reached. TbEntityDataSubCtx finalCtx = ctx; ScheduledFuture task = scheduler.scheduleWithFixedDelay( - () -> refreshDynamicQuery(tenantId, customerId, finalCtx), + () -> refreshDynamicQuery(finalCtx), dynamicPageLinkRefreshInterval, dynamicPageLinkRefreshInterval, TimeUnit.SECONDS); finalCtx.setRefreshTask(task); } @@ -235,6 +236,26 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc }, wsCallBackExecutor); } + @Override + public void handleCmd(TelemetryWebSocketSessionRef session, EntityCountCmd cmd) { + TbEntityCountSubCtx ctx = getSubCtx(session.getSessionId(), cmd.getCmdId()); + if (ctx == null) { + ctx = createSubCtx(session, cmd); + long start = System.currentTimeMillis(); + ctx.fetchData(); + long end = System.currentTimeMillis(); + stats.getRegularQueryInvocationCnt().incrementAndGet(); + stats.getRegularQueryTimeSpent().addAndGet(end - start); + TbEntityCountSubCtx finalCtx = ctx; + ScheduledFuture task = scheduler.scheduleWithFixedDelay( + () -> refreshDynamicQuery(finalCtx), + dynamicPageLinkRefreshInterval, dynamicPageLinkRefreshInterval, TimeUnit.SECONDS); + finalCtx.setRefreshTask(task); + } else { + log.debug("[{}][{}] Received duplicate command: {}", session.getSessionId(), cmd.getCmdId(), cmd); + } + } + @Override public void handleCmd(TelemetryWebSocketSessionRef session, AlarmDataCmd cmd) { TbAlarmDataSubCtx ctx = getSubCtx(session.getSessionId(), cmd.getCmdId()); @@ -267,7 +288,7 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc } } - private void refreshDynamicQuery(TenantId tenantId, CustomerId customerId, TbEntityDataSubCtx finalCtx) { + private void refreshDynamicQuery(TbAbstractSubCtx finalCtx) { try { long start = System.currentTimeMillis(); finalCtx.update(); @@ -299,7 +320,7 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc } private TbEntityDataSubCtx createSubCtx(TelemetryWebSocketSessionRef sessionRef, EntityDataCmd cmd) { - Map sessionSubs = subscriptionsBySessionId.computeIfAbsent(sessionRef.getSessionId(), k -> new HashMap<>()); + Map sessionSubs = subscriptionsBySessionId.computeIfAbsent(sessionRef.getSessionId(), k -> new HashMap<>()); TbEntityDataSubCtx ctx = new TbEntityDataSubCtx(serviceId, wsService, entityService, localSubscriptionService, attributesService, stats, sessionRef, cmd.getCmdId(), maxEntitiesPerDataSubscription); if (cmd.getQuery() != null) { @@ -309,8 +330,20 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc return ctx; } + private TbEntityCountSubCtx createSubCtx(TelemetryWebSocketSessionRef sessionRef, EntityCountCmd cmd) { + Map sessionSubs = subscriptionsBySessionId.computeIfAbsent(sessionRef.getSessionId(), k -> new HashMap<>()); + TbEntityCountSubCtx ctx = new TbEntityCountSubCtx(serviceId, wsService, entityService, localSubscriptionService, + attributesService, stats, sessionRef, cmd.getCmdId()); + if (cmd.getQuery() != null) { + ctx.setAndResolveQuery(cmd.getQuery()); + } + sessionSubs.put(cmd.getCmdId(), ctx); + return ctx; + } + + private TbAlarmDataSubCtx createSubCtx(TelemetryWebSocketSessionRef sessionRef, AlarmDataCmd cmd) { - Map sessionSubs = subscriptionsBySessionId.computeIfAbsent(sessionRef.getSessionId(), k -> new HashMap<>()); + Map sessionSubs = subscriptionsBySessionId.computeIfAbsent(sessionRef.getSessionId(), k -> new HashMap<>()); TbAlarmDataSubCtx ctx = new TbAlarmDataSubCtx(serviceId, wsService, entityService, localSubscriptionService, attributesService, stats, alarmService, sessionRef, cmd.getCmdId(), maxEntitiesPerAlarmSubscription); ctx.setAndResolveQuery(cmd.getQuery()); @@ -319,8 +352,8 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc } @SuppressWarnings("unchecked") - private T getSubCtx(String sessionId, int cmdId) { - Map sessionSubs = subscriptionsBySessionId.get(sessionId); + private T getSubCtx(String sessionId, int cmdId) { + Map sessionSubs = subscriptionsBySessionId.get(sessionId); if (sessionSubs != null) { return (T) sessionSubs.get(cmdId); } else { @@ -464,17 +497,16 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc cleanupAndCancel(getSubCtx(sessionId, cmd.getCmdId())); } - private void cleanupAndCancel(TbAbstractDataSubCtx ctx) { + private void cleanupAndCancel(TbAbstractSubCtx ctx) { if (ctx != null) { ctx.cancelTasks(); - ctx.clearEntitySubscriptions(); - ctx.clearDynamicValueSubscriptions(); + ctx.clearSubscriptions(); } } @Override public void cancelAllSessionSubscriptions(String sessionId) { - Map sessionSubs = subscriptionsBySessionId.remove(sessionId); + Map sessionSubs = subscriptionsBySessionId.remove(sessionId); if (sessionSubs != null) { sessionSubs.values().forEach(this::cleanupAndCancel); } diff --git a/application/src/main/java/org/thingsboard/server/service/subscription/TbAbstractDataSubCtx.java b/application/src/main/java/org/thingsboard/server/service/subscription/TbAbstractDataSubCtx.java index a200f31a3f..08f7bfa1a6 100644 --- a/application/src/main/java/org/thingsboard/server/service/subscription/TbAbstractDataSubCtx.java +++ b/application/src/main/java/org/thingsboard/server/service/subscription/TbAbstractDataSubCtx.java @@ -15,32 +15,16 @@ */ package org.thingsboard.server.service.subscription; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.MoreExecutors; -import lombok.Data; import lombok.Getter; -import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.thingsboard.server.common.data.id.CustomerId; import org.thingsboard.server.common.data.id.EntityId; -import org.thingsboard.server.common.data.id.TenantId; -import org.thingsboard.server.common.data.id.UserId; -import org.thingsboard.server.common.data.kv.AttributeKvEntry; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.query.AbstractDataQuery; -import org.thingsboard.server.common.data.query.ComplexFilterPredicate; -import org.thingsboard.server.common.data.query.DynamicValue; -import org.thingsboard.server.common.data.query.DynamicValueSourceType; import org.thingsboard.server.common.data.query.EntityData; import org.thingsboard.server.common.data.query.EntityDataPageLink; import org.thingsboard.server.common.data.query.EntityDataQuery; import org.thingsboard.server.common.data.query.EntityKey; import org.thingsboard.server.common.data.query.EntityKeyType; -import org.thingsboard.server.common.data.query.FilterPredicateType; -import org.thingsboard.server.common.data.query.KeyFilter; -import org.thingsboard.server.common.data.query.KeyFilterPredicate; -import org.thingsboard.server.common.data.query.SimpleKeyFilterPredicate; import org.thingsboard.server.common.data.query.TsValue; import org.thingsboard.server.dao.attributes.AttributesService; import org.thingsboard.server.dao.entity.EntityService; @@ -52,140 +36,25 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Optional; -import java.util.Set; import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ScheduledFuture; import java.util.function.Function; import java.util.stream.Collectors; @Slf4j -@Data -public abstract class TbAbstractDataSubCtx> { +public abstract class TbAbstractDataSubCtx> extends TbAbstractSubCtx { - protected final String serviceId; - protected final SubscriptionServiceStatistics stats; - protected final TelemetryWebSocketService wsService; - protected final EntityService entityService; - protected final TbLocalSubscriptionService localSubscriptionService; - protected final AttributesService attributesService; - protected final TelemetryWebSocketSessionRef sessionRef; - protected final int cmdId; protected final Map subToEntityIdMap; - protected final Set subToDynamicValueKeySet; - @Getter - protected final Map> dynamicValues; @Getter protected PageData data; - @Getter - @Setter - protected T query; - @Setter - protected volatile ScheduledFuture refreshTask; public TbAbstractDataSubCtx(String serviceId, TelemetryWebSocketService wsService, EntityService entityService, TbLocalSubscriptionService localSubscriptionService, AttributesService attributesService, SubscriptionServiceStatistics stats, TelemetryWebSocketSessionRef sessionRef, int cmdId) { - this.serviceId = serviceId; - this.wsService = wsService; - this.entityService = entityService; - this.localSubscriptionService = localSubscriptionService; - this.attributesService = attributesService; - this.stats = stats; - this.sessionRef = sessionRef; - this.cmdId = cmdId; + super(serviceId, wsService, entityService, localSubscriptionService, attributesService, stats, sessionRef, cmdId); this.subToEntityIdMap = new ConcurrentHashMap<>(); - this.subToDynamicValueKeySet = ConcurrentHashMap.newKeySet(); - this.dynamicValues = new ConcurrentHashMap<>(); - } - - public void setAndResolveQuery(T query) { - dynamicValues.clear(); - this.query = query; - if (query != null && query.getKeyFilters() != null) { - for (KeyFilter filter : query.getKeyFilters()) { - registerDynamicValues(filter.getPredicate()); - } - } - resolve(getTenantId(), getCustomerId(), getUserId()); - } - - public void resolve(TenantId tenantId, CustomerId customerId, UserId userId) { - List> futures = new ArrayList<>(); - for (DynamicValueKey key : dynamicValues.keySet()) { - switch (key.getSourceType()) { - case CURRENT_TENANT: - futures.add(resolveEntityValue(tenantId, tenantId, key)); - break; - case CURRENT_CUSTOMER: - if (customerId != null && !customerId.isNullUid()) { - futures.add(resolveEntityValue(tenantId, customerId, key)); - } - break; - case CURRENT_USER: - if (userId != null && !userId.isNullUid()) { - futures.add(resolveEntityValue(tenantId, userId, key)); - } - break; - } - } - try { - Map> tmpSubMap = new HashMap<>(); - for (DynamicValueKeySub sub : Futures.successfulAsList(futures).get()) { - tmpSubMap.computeIfAbsent(sub.getEntityId(), tmp -> new HashMap<>()).put(sub.getKey().getSourceAttribute(), sub); - } - for (EntityId entityId : tmpSubMap.keySet()) { - Map keyStates = new HashMap<>(); - Map dynamicValueKeySubMap = tmpSubMap.get(entityId); - dynamicValueKeySubMap.forEach((k, v) -> keyStates.put(k, v.getLastUpdateTs())); - int subIdx = sessionRef.getSessionSubIdSeq().incrementAndGet(); - TbAttributeSubscription sub = TbAttributeSubscription.builder() - .serviceId(serviceId) - .sessionId(sessionRef.getSessionId()) - .subscriptionId(subIdx) - .tenantId(sessionRef.getSecurityCtx().getTenantId()) - .entityId(entityId) - .updateConsumer((s, subscriptionUpdate) -> dynamicValueSubUpdate(s, subscriptionUpdate, dynamicValueKeySubMap)) - .allKeys(false) - .keyStates(keyStates) - .scope(TbAttributeSubscriptionScope.SERVER_SCOPE) - .build(); - subToDynamicValueKeySet.add(subIdx); - localSubscriptionService.addSubscription(sub); - } - } catch (InterruptedException | ExecutionException e) { - log.info("[{}][{}][{}] Failed to resolve dynamic values: {}", tenantId, customerId, userId, dynamicValues.keySet()); - } - - } - - private void dynamicValueSubUpdate(String sessionId, TelemetrySubscriptionUpdate subscriptionUpdate, - Map dynamicValueKeySubMap) { - Map latestUpdate = new HashMap<>(); - subscriptionUpdate.getData().forEach((k, v) -> { - Object[] data = (Object[]) v.get(0); - latestUpdate.put(k, new TsValue((Long) data[0], (String) data[1])); - }); - - boolean invalidateFilter = false; - for (Map.Entry entry : latestUpdate.entrySet()) { - String k = entry.getKey(); - TsValue tsValue = entry.getValue(); - DynamicValueKeySub sub = dynamicValueKeySubMap.get(k); - if (sub.updateValue(tsValue)) { - invalidateFilter = true; - updateDynamicValuesByKey(sub, tsValue); - } - } - - if (invalidateFilter) { - update(); - } } public void fetchData() { @@ -231,104 +100,10 @@ public abstract class TbAbstractDataSubCtx lastUpdateTs && (lastUpdateValue == null || !lastUpdateValue.equals(value.getValue()))) { - this.lastUpdateTs = value.getTs(); - this.lastUpdateValue = value.getValue(); - return true; - } else { - return false; - } - } - } - - private ListenableFuture resolveEntityValue(TenantId tenantId, EntityId entityId, DynamicValueKey key) { - ListenableFuture> entry = attributesService.find(tenantId, entityId, - TbAttributeSubscriptionScope.SERVER_SCOPE.name(), key.getSourceAttribute()); - return Futures.transform(entry, attributeOpt -> { - DynamicValueKeySub sub = new DynamicValueKeySub(key, entityId); - if (attributeOpt.isPresent()) { - AttributeKvEntry attribute = attributeOpt.get(); - sub.setLastUpdateTs(attribute.getLastUpdateTs()); - sub.setLastUpdateValue(attribute.getValueAsString()); - updateDynamicValuesByKey(sub, new TsValue(attribute.getLastUpdateTs(), attribute.getValueAsString())); - } - return sub; - }, MoreExecutors.directExecutor()); - } - - @SuppressWarnings("unchecked") - private void updateDynamicValuesByKey(DynamicValueKeySub sub, TsValue tsValue) { - DynamicValueKey dvk = sub.getKey(); - switch (dvk.getPredicateType()) { - case STRING: - dynamicValues.get(dvk).forEach(dynamicValue -> dynamicValue.setResolvedValue(tsValue.getValue())); - break; - case NUMERIC: - try { - Double dValue = Double.parseDouble(tsValue.getValue()); - dynamicValues.get(dvk).forEach(dynamicValue -> dynamicValue.setResolvedValue(dValue)); - } catch (NumberFormatException e) { - dynamicValues.get(dvk).forEach(dynamicValue -> dynamicValue.setResolvedValue(null)); - } - break; - case BOOLEAN: - Boolean bValue = Boolean.parseBoolean(tsValue.getValue()); - dynamicValues.get(dvk).forEach(dynamicValue -> dynamicValue.setResolvedValue(bValue)); - break; - } - } - - @SuppressWarnings("unchecked") - private void registerDynamicValues(KeyFilterPredicate predicate) { - switch (predicate.getType()) { - case STRING: - case NUMERIC: - case BOOLEAN: - Optional value = getDynamicValueFromSimplePredicate((SimpleKeyFilterPredicate) predicate); - if (value.isPresent()) { - DynamicValue dynamicValue = value.get(); - DynamicValueKey key = new DynamicValueKey( - predicate.getType(), - dynamicValue.getSourceType(), - dynamicValue.getSourceAttribute()); - dynamicValues.computeIfAbsent(key, tmp -> new ArrayList<>()).add(dynamicValue); - } - break; - case COMPLEX: - ((ComplexFilterPredicate) predicate).getPredicates().forEach(this::registerDynamicValues); - } - } - - private Optional> getDynamicValueFromSimplePredicate(SimpleKeyFilterPredicate predicate) { - if (predicate.getValue().getUserValue() == null) { - return Optional.ofNullable(predicate.getValue().getDynamicValue()); - } else { - return Optional.empty(); - } - } - - public String getSessionId() { - return sessionRef.getSessionId(); - } - - public TenantId getTenantId() { - return sessionRef.getSecurityCtx().getTenantId(); - } - - public CustomerId getCustomerId() { - return sessionRef.getSecurityCtx().getCustomerId(); - } - - public UserId getUserId() { - return sessionRef.getSecurityCtx().getId(); + @Override + public void clearSubscriptions() { + clearEntitySubscriptions(); + super.clearSubscriptions(); } public void clearEntitySubscriptions() { @@ -340,26 +115,6 @@ public abstract class TbAbstractDataSubCtx task) { - this.refreshTask = task; - } - - public void cancelTasks() { - if (this.refreshTask != null) { - log.trace("[{}][{}] Canceling old refresh task", sessionRef.getSessionId(), cmdId); - this.refreshTask.cancel(true); - } - } - public void createSubscriptions(List keys, boolean resultToLatestValues) { Map> keysByType = getEntityKeyByTypeMap(keys); for (EntityData entityData : data.getData()) { @@ -459,14 +214,4 @@ public abstract class TbAbstractDataSubCtx { + + protected final String serviceId; + protected final SubscriptionServiceStatistics stats; + protected final TelemetryWebSocketService wsService; + protected final EntityService entityService; + protected final TbLocalSubscriptionService localSubscriptionService; + protected final AttributesService attributesService; + protected final TelemetryWebSocketSessionRef sessionRef; + protected final int cmdId; + protected final Set subToDynamicValueKeySet; + @Getter + protected final Map> dynamicValues; + @Getter + @Setter + protected T query; + @Setter + protected volatile ScheduledFuture refreshTask; + + public TbAbstractSubCtx(String serviceId, TelemetryWebSocketService wsService, + EntityService entityService, TbLocalSubscriptionService localSubscriptionService, + AttributesService attributesService, SubscriptionServiceStatistics stats, + TelemetryWebSocketSessionRef sessionRef, int cmdId) { + this.serviceId = serviceId; + this.wsService = wsService; + this.entityService = entityService; + this.localSubscriptionService = localSubscriptionService; + this.attributesService = attributesService; + this.stats = stats; + this.sessionRef = sessionRef; + this.cmdId = cmdId; + this.subToDynamicValueKeySet = ConcurrentHashMap.newKeySet(); + this.dynamicValues = new ConcurrentHashMap<>(); + } + + public void setAndResolveQuery(T query) { + dynamicValues.clear(); + this.query = query; + if (query != null && query.getKeyFilters() != null) { + for (KeyFilter filter : query.getKeyFilters()) { + registerDynamicValues(filter.getPredicate()); + } + } + resolve(getTenantId(), getCustomerId(), getUserId()); + } + + public void resolve(TenantId tenantId, CustomerId customerId, UserId userId) { + List> futures = new ArrayList<>(); + for (DynamicValueKey key : dynamicValues.keySet()) { + switch (key.getSourceType()) { + case CURRENT_TENANT: + futures.add(resolveEntityValue(tenantId, tenantId, key)); + break; + case CURRENT_CUSTOMER: + if (customerId != null && !customerId.isNullUid()) { + futures.add(resolveEntityValue(tenantId, customerId, key)); + } + break; + case CURRENT_USER: + if (userId != null && !userId.isNullUid()) { + futures.add(resolveEntityValue(tenantId, userId, key)); + } + break; + } + } + try { + Map> tmpSubMap = new HashMap<>(); + for (DynamicValueKeySub sub : Futures.successfulAsList(futures).get()) { + tmpSubMap.computeIfAbsent(sub.getEntityId(), tmp -> new HashMap<>()).put(sub.getKey().getSourceAttribute(), sub); + } + for (EntityId entityId : tmpSubMap.keySet()) { + Map keyStates = new HashMap<>(); + Map dynamicValueKeySubMap = tmpSubMap.get(entityId); + dynamicValueKeySubMap.forEach((k, v) -> keyStates.put(k, v.getLastUpdateTs())); + int subIdx = sessionRef.getSessionSubIdSeq().incrementAndGet(); + TbAttributeSubscription sub = TbAttributeSubscription.builder() + .serviceId(serviceId) + .sessionId(sessionRef.getSessionId()) + .subscriptionId(subIdx) + .tenantId(sessionRef.getSecurityCtx().getTenantId()) + .entityId(entityId) + .updateConsumer((s, subscriptionUpdate) -> dynamicValueSubUpdate(s, subscriptionUpdate, dynamicValueKeySubMap)) + .allKeys(false) + .keyStates(keyStates) + .scope(TbAttributeSubscriptionScope.SERVER_SCOPE) + .build(); + subToDynamicValueKeySet.add(subIdx); + localSubscriptionService.addSubscription(sub); + } + } catch (InterruptedException | ExecutionException e) { + log.info("[{}][{}][{}] Failed to resolve dynamic values: {}", tenantId, customerId, userId, dynamicValues.keySet()); + } + + } + + private void dynamicValueSubUpdate(String sessionId, TelemetrySubscriptionUpdate subscriptionUpdate, + Map dynamicValueKeySubMap) { + Map latestUpdate = new HashMap<>(); + subscriptionUpdate.getData().forEach((k, v) -> { + Object[] data = (Object[]) v.get(0); + latestUpdate.put(k, new TsValue((Long) data[0], (String) data[1])); + }); + + boolean invalidateFilter = false; + for (Map.Entry entry : latestUpdate.entrySet()) { + String k = entry.getKey(); + TsValue tsValue = entry.getValue(); + DynamicValueKeySub sub = dynamicValueKeySubMap.get(k); + if (sub.updateValue(tsValue)) { + invalidateFilter = true; + updateDynamicValuesByKey(sub, tsValue); + } + } + + if (invalidateFilter) { + update(); + } + } + + public abstract void fetchData(); + + protected abstract void update(); + + public void clearSubscriptions() { + clearDynamicValueSubscriptions(); + } + + @Data + private static class DynamicValueKeySub { + private final DynamicValueKey key; + private final EntityId entityId; + private long lastUpdateTs; + private String lastUpdateValue; + + boolean updateValue(TsValue value) { + if (value.getTs() > lastUpdateTs && (lastUpdateValue == null || !lastUpdateValue.equals(value.getValue()))) { + this.lastUpdateTs = value.getTs(); + this.lastUpdateValue = value.getValue(); + return true; + } else { + return false; + } + } + } + + private ListenableFuture resolveEntityValue(TenantId tenantId, EntityId entityId, DynamicValueKey key) { + ListenableFuture> entry = attributesService.find(tenantId, entityId, + TbAttributeSubscriptionScope.SERVER_SCOPE.name(), key.getSourceAttribute()); + return Futures.transform(entry, attributeOpt -> { + DynamicValueKeySub sub = new DynamicValueKeySub(key, entityId); + if (attributeOpt.isPresent()) { + AttributeKvEntry attribute = attributeOpt.get(); + sub.setLastUpdateTs(attribute.getLastUpdateTs()); + sub.setLastUpdateValue(attribute.getValueAsString()); + updateDynamicValuesByKey(sub, new TsValue(attribute.getLastUpdateTs(), attribute.getValueAsString())); + } + return sub; + }, MoreExecutors.directExecutor()); + } + + @SuppressWarnings("unchecked") + protected void updateDynamicValuesByKey(DynamicValueKeySub sub, TsValue tsValue) { + DynamicValueKey dvk = sub.getKey(); + switch (dvk.getPredicateType()) { + case STRING: + dynamicValues.get(dvk).forEach(dynamicValue -> dynamicValue.setResolvedValue(tsValue.getValue())); + break; + case NUMERIC: + try { + Double dValue = Double.parseDouble(tsValue.getValue()); + dynamicValues.get(dvk).forEach(dynamicValue -> dynamicValue.setResolvedValue(dValue)); + } catch (NumberFormatException e) { + dynamicValues.get(dvk).forEach(dynamicValue -> dynamicValue.setResolvedValue(null)); + } + break; + case BOOLEAN: + Boolean bValue = Boolean.parseBoolean(tsValue.getValue()); + dynamicValues.get(dvk).forEach(dynamicValue -> dynamicValue.setResolvedValue(bValue)); + break; + } + } + + @SuppressWarnings("unchecked") + private void registerDynamicValues(KeyFilterPredicate predicate) { + switch (predicate.getType()) { + case STRING: + case NUMERIC: + case BOOLEAN: + Optional value = getDynamicValueFromSimplePredicate((SimpleKeyFilterPredicate) predicate); + if (value.isPresent()) { + DynamicValue dynamicValue = value.get(); + DynamicValueKey key = new DynamicValueKey( + predicate.getType(), + dynamicValue.getSourceType(), + dynamicValue.getSourceAttribute()); + dynamicValues.computeIfAbsent(key, tmp -> new ArrayList<>()).add(dynamicValue); + } + break; + case COMPLEX: + ((ComplexFilterPredicate) predicate).getPredicates().forEach(this::registerDynamicValues); + } + } + + private Optional> getDynamicValueFromSimplePredicate(SimpleKeyFilterPredicate predicate) { + if (predicate.getValue().getUserValue() == null) { + return Optional.ofNullable(predicate.getValue().getDynamicValue()); + } else { + return Optional.empty(); + } + } + + public String getSessionId() { + return sessionRef.getSessionId(); + } + + public TenantId getTenantId() { + return sessionRef.getSecurityCtx().getTenantId(); + } + + public CustomerId getCustomerId() { + return sessionRef.getSecurityCtx().getCustomerId(); + } + + public UserId getUserId() { + return sessionRef.getSecurityCtx().getId(); + } + + protected void clearDynamicValueSubscriptions() { + if (subToDynamicValueKeySet != null) { + for (Integer subId : subToDynamicValueKeySet) { + localSubscriptionService.cancelSubscription(sessionRef.getSessionId(), subId); + } + subToDynamicValueKeySet.clear(); + } + } + + public void setRefreshTask(ScheduledFuture task) { + this.refreshTask = task; + } + + public void cancelTasks() { + if (this.refreshTask != null) { + log.trace("[{}][{}] Canceling old refresh task", sessionRef.getSessionId(), cmdId); + this.refreshTask.cancel(true); + } + } + + @Data + public static class DynamicValueKey { + @Getter + private final FilterPredicateType predicateType; + @Getter + private final DynamicValueSourceType sourceType; + @Getter + private final String sourceAttribute; + } + +} diff --git a/application/src/main/java/org/thingsboard/server/service/subscription/TbAlarmDataSubCtx.java b/application/src/main/java/org/thingsboard/server/service/subscription/TbAlarmDataSubCtx.java index 95f15fcb3f..8af9ba2330 100644 --- a/application/src/main/java/org/thingsboard/server/service/subscription/TbAlarmDataSubCtx.java +++ b/application/src/main/java/org/thingsboard/server/service/subscription/TbAlarmDataSubCtx.java @@ -90,8 +90,7 @@ public class TbAlarmDataSubCtx extends TbAbstractDataSubCtx { AlarmDataUpdate update; if (!entitiesMap.isEmpty()) { long start = System.currentTimeMillis(); - PageData alarms = alarmService.findAlarmDataByQueryForEntities(getTenantId(), getCustomerId(), - query, getOrderedEntityIds()); + PageData alarms = alarmService.findAlarmDataByQueryForEntities(getTenantId(), getCustomerId(), query, getOrderedEntityIds()); long end = System.currentTimeMillis(); stats.getAlarmQueryInvocationCnt().incrementAndGet(); stats.getAlarmQueryTimeSpent().addAndGet(end - start); diff --git a/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityCountSubCtx.java b/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityCountSubCtx.java new file mode 100644 index 0000000000..e97892a37d --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityCountSubCtx.java @@ -0,0 +1,55 @@ +/** + * Copyright © 2016-2021 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.subscription; + +import lombok.extern.slf4j.Slf4j; +import org.thingsboard.server.common.data.query.EntityCountQuery; +import org.thingsboard.server.common.data.query.EntityKeyType; +import org.thingsboard.server.dao.attributes.AttributesService; +import org.thingsboard.server.dao.entity.EntityService; +import org.thingsboard.server.service.telemetry.TelemetryWebSocketService; +import org.thingsboard.server.service.telemetry.TelemetryWebSocketSessionRef; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityCountUpdate; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate; +import org.thingsboard.server.service.telemetry.sub.TelemetrySubscriptionUpdate; + +@Slf4j +public class TbEntityCountSubCtx extends TbAbstractSubCtx { + + private volatile int result; + + public TbEntityCountSubCtx(String serviceId, TelemetryWebSocketService wsService, EntityService entityService, + TbLocalSubscriptionService localSubscriptionService, AttributesService attributesService, + SubscriptionServiceStatistics stats, TelemetryWebSocketSessionRef sessionRef, int cmdId) { + super(serviceId, wsService, entityService, localSubscriptionService, attributesService, stats, sessionRef, cmdId); + } + + @Override + public void fetchData() { + result = (int) entityService.countEntitiesByQuery(getTenantId(), getCustomerId(), query); + wsService.sendWsMsg(sessionRef.getSessionId(), new EntityCountUpdate(cmdId, result)); + } + + @Override + protected void update() { + int newCount = (int) entityService.countEntitiesByQuery(getTenantId(), getCustomerId(), query); + if (newCount != result) { + result = newCount; + wsService.sendWsMsg(sessionRef.getSessionId(), new EntityCountUpdate(cmdId, result)); + } + } + +} diff --git a/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityDataSubscriptionService.java b/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityDataSubscriptionService.java index 60abdeaa9c..8760997bfd 100644 --- a/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityDataSubscriptionService.java +++ b/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityDataSubscriptionService.java @@ -17,6 +17,7 @@ package org.thingsboard.server.service.subscription; import org.thingsboard.server.service.telemetry.TelemetryWebSocketSessionRef; import org.thingsboard.server.service.telemetry.cmd.v2.AlarmDataCmd; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityCountCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUnsubscribeCmd; import org.thingsboard.server.service.telemetry.cmd.v2.UnsubscribeCmd; @@ -25,6 +26,8 @@ public interface TbEntityDataSubscriptionService { void handleCmd(TelemetryWebSocketSessionRef sessionId, EntityDataCmd cmd); + void handleCmd(TelemetryWebSocketSessionRef sessionId, EntityCountCmd cmd); + void handleCmd(TelemetryWebSocketSessionRef sessionId, AlarmDataCmd cmd); void cancelSubscription(String sessionId, UnsubscribeCmd subscriptionId); diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/DefaultTelemetryWebSocketService.java b/application/src/main/java/org/thingsboard/server/service/telemetry/DefaultTelemetryWebSocketService.java index 2efbc2d0a8..f8f4afd823 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/DefaultTelemetryWebSocketService.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/DefaultTelemetryWebSocketService.java @@ -51,22 +51,21 @@ import org.thingsboard.server.service.security.ValidationResult; import org.thingsboard.server.service.security.ValidationResultCode; import org.thingsboard.server.service.security.model.UserPrincipal; import org.thingsboard.server.service.security.permission.Operation; +import org.thingsboard.server.service.subscription.TbAttributeSubscription; +import org.thingsboard.server.service.subscription.TbAttributeSubscriptionScope; import org.thingsboard.server.service.subscription.TbEntityDataSubscriptionService; import org.thingsboard.server.service.subscription.TbLocalSubscriptionService; -import org.thingsboard.server.service.subscription.TbAttributeSubscriptionScope; -import org.thingsboard.server.service.subscription.TbAttributeSubscription; import org.thingsboard.server.service.subscription.TbTimeseriesSubscription; +import org.thingsboard.server.service.telemetry.cmd.TelemetryPluginCmdsWrapper; import org.thingsboard.server.service.telemetry.cmd.v1.AttributesSubscriptionCmd; import org.thingsboard.server.service.telemetry.cmd.v1.GetHistoryCmd; import org.thingsboard.server.service.telemetry.cmd.v1.SubscriptionCmd; import org.thingsboard.server.service.telemetry.cmd.v1.TelemetryPluginCmd; -import org.thingsboard.server.service.telemetry.cmd.TelemetryPluginCmdsWrapper; import org.thingsboard.server.service.telemetry.cmd.v1.TimeseriesSubscriptionCmd; import org.thingsboard.server.service.telemetry.cmd.v2.AlarmDataCmd; -import org.thingsboard.server.service.telemetry.cmd.v2.AlarmDataUnsubscribeCmd; -import org.thingsboard.server.service.telemetry.cmd.v2.DataUpdate; +import org.thingsboard.server.service.telemetry.cmd.v2.CmdUpdate; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityCountCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd; -import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUnsubscribeCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate; import org.thingsboard.server.service.telemetry.cmd.v2.UnsubscribeCmd; import org.thingsboard.server.service.telemetry.exception.UnauthorizedException; @@ -89,6 +88,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.stream.Collectors; @@ -151,14 +152,23 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi private ExecutorService executor; private String serviceId; + private ScheduledExecutorService pingExecutor; + @PostConstruct public void initExecutor() { serviceId = serviceInfoProvider.getServiceId(); executor = Executors.newWorkStealingPool(50); + + pingExecutor = Executors.newSingleThreadScheduledExecutor(); + pingExecutor.scheduleWithFixedDelay(this::sendPing, 10000, 10000, TimeUnit.MILLISECONDS); } @PreDestroy public void shutdownExecutor() { + if (pingExecutor != null) { + pingExecutor.shutdownNow(); + } + if (executor != null) { executor.shutdownNow(); } @@ -216,12 +226,18 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi if (cmdsWrapper.getAlarmDataCmds() != null) { cmdsWrapper.getAlarmDataCmds().forEach(cmd -> handleWsAlarmDataCmd(sessionRef, cmd)); } + if (cmdsWrapper.getEntityCountCmds() != null) { + cmdsWrapper.getEntityCountCmds().forEach(cmd -> handleWsEntityCountCmd(sessionRef, cmd)); + } if (cmdsWrapper.getEntityDataUnsubscribeCmds() != null) { cmdsWrapper.getEntityDataUnsubscribeCmds().forEach(cmd -> handleWsDataUnsubscribeCmd(sessionRef, cmd)); } if (cmdsWrapper.getAlarmDataUnsubscribeCmds() != null) { cmdsWrapper.getAlarmDataUnsubscribeCmds().forEach(cmd -> handleWsDataUnsubscribeCmd(sessionRef, cmd)); } + if (cmdsWrapper.getEntityCountUnsubscribeCmds() != null) { + cmdsWrapper.getEntityCountUnsubscribeCmds().forEach(cmd -> handleWsDataUnsubscribeCmd(sessionRef, cmd)); + } } } catch (IOException e) { log.warn("Failed to decode subscription cmd: {}", e.getMessage(), e); @@ -239,6 +255,16 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi } } + private void handleWsEntityCountCmd(TelemetryWebSocketSessionRef sessionRef, EntityCountCmd cmd) { + String sessionId = sessionRef.getSessionId(); + log.debug("[{}] Processing: {}", sessionId, cmd); + + if (validateSessionMetadata(sessionRef, cmd.getCmdId(), sessionId) + && validateSubscriptionCmd(sessionRef, cmd)) { + entityDataSubService.handleCmd(sessionRef, cmd); + } + } + private void handleWsAlarmDataCmd(TelemetryWebSocketSessionRef sessionRef, AlarmDataCmd cmd) { String sessionId = sessionRef.getSessionId(); log.debug("[{}] Processing: {}", sessionId, cmd); @@ -264,7 +290,7 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi } @Override - public void sendWsMsg(String sessionId, DataUpdate update) { + public void sendWsMsg(String sessionId, CmdUpdate update) { sendWsMsg(sessionId, update.getCmdId(), update); } @@ -679,6 +705,20 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi return true; } + private boolean validateSubscriptionCmd(TelemetryWebSocketSessionRef sessionRef, EntityCountCmd cmd) { + if (cmd.getCmdId() < 0) { + TelemetrySubscriptionUpdate update = new TelemetrySubscriptionUpdate(cmd.getCmdId(), SubscriptionErrorCode.BAD_REQUEST, + "Cmd id is negative value!"); + sendWsMsg(sessionRef, update); + return false; + } else if (cmd.getQuery() == null) { + TelemetrySubscriptionUpdate update = new TelemetrySubscriptionUpdate(cmd.getCmdId(), SubscriptionErrorCode.BAD_REQUEST, "Query is empty!"); + sendWsMsg(sessionRef, update); + return false; + } + return true; + } + private boolean validateSubscriptionCmd(TelemetryWebSocketSessionRef sessionRef, AlarmDataCmd cmd) { if (cmd.getCmdId() < 0) { TelemetrySubscriptionUpdate update = new TelemetrySubscriptionUpdate(cmd.getCmdId(), SubscriptionErrorCode.BAD_REQUEST, @@ -744,6 +784,17 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi } } + private void sendPing() { + long currentTime = System.currentTimeMillis(); + wsSessionsMap.values().forEach(md -> + executor.submit(() -> { + try { + msgEndpoint.sendPing(md.getSessionRef(), currentTime); + } catch (IOException e) { + log.warn("[{}] Failed to send ping: {}", md.getSessionRef().getSessionId(), e); + } + })); + } private static Optional> getKeys(TelemetryPluginCmd cmd) { if (!StringUtils.isEmpty(cmd.getKeys())) { diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/TelemetryWebSocketMsgEndpoint.java b/application/src/main/java/org/thingsboard/server/service/telemetry/TelemetryWebSocketMsgEndpoint.java index 2c132c745c..f10038f116 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/TelemetryWebSocketMsgEndpoint.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/TelemetryWebSocketMsgEndpoint.java @@ -26,5 +26,7 @@ public interface TelemetryWebSocketMsgEndpoint { void send(TelemetryWebSocketSessionRef sessionRef, int subscriptionId, String msg) throws IOException; + void sendPing(TelemetryWebSocketSessionRef sessionRef, long currentTime) throws IOException; + void close(TelemetryWebSocketSessionRef sessionRef, CloseStatus withReason) throws IOException; } diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/TelemetryWebSocketService.java b/application/src/main/java/org/thingsboard/server/service/telemetry/TelemetryWebSocketService.java index 6834d26b4d..c8cdbd06af 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/TelemetryWebSocketService.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/TelemetryWebSocketService.java @@ -15,6 +15,7 @@ */ package org.thingsboard.server.service.telemetry; +import org.thingsboard.server.service.telemetry.cmd.v2.CmdUpdate; import org.thingsboard.server.service.telemetry.cmd.v2.DataUpdate; import org.thingsboard.server.service.telemetry.sub.TelemetrySubscriptionUpdate; @@ -29,6 +30,6 @@ public interface TelemetryWebSocketService { void sendWsMsg(String sessionId, TelemetrySubscriptionUpdate update); - void sendWsMsg(String sessionId, DataUpdate update); + void sendWsMsg(String sessionId, CmdUpdate update); } diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/TelemetryPluginCmdsWrapper.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/TelemetryPluginCmdsWrapper.java index 896babdb6a..1d2de2584d 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/TelemetryPluginCmdsWrapper.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/TelemetryPluginCmdsWrapper.java @@ -21,6 +21,8 @@ import org.thingsboard.server.service.telemetry.cmd.v1.GetHistoryCmd; import org.thingsboard.server.service.telemetry.cmd.v1.TimeseriesSubscriptionCmd; import org.thingsboard.server.service.telemetry.cmd.v2.AlarmDataCmd; import org.thingsboard.server.service.telemetry.cmd.v2.AlarmDataUnsubscribeCmd; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityCountCmd; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityCountUnsubscribeCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUnsubscribeCmd; @@ -46,4 +48,8 @@ public class TelemetryPluginCmdsWrapper { private List alarmDataUnsubscribeCmds; + private List entityCountCmds; + + private List entityCountUnsubscribeCmds; + } diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/AlarmDataUpdate.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/AlarmDataUpdate.java index 5a2ea4ff00..f23484f71f 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/AlarmDataUpdate.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/AlarmDataUpdate.java @@ -18,14 +18,14 @@ package org.thingsboard.server.service.telemetry.cmd.v2; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; -import lombok.NoArgsConstructor; +import lombok.ToString; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.query.AlarmData; -import org.thingsboard.server.common.data.query.EntityData; import org.thingsboard.server.service.telemetry.sub.SubscriptionErrorCode; import java.util.List; +@ToString public class AlarmDataUpdate extends DataUpdate { @Getter @@ -44,8 +44,8 @@ public class AlarmDataUpdate extends DataUpdate { } @Override - public DataUpdateType getDataUpdateType() { - return DataUpdateType.ALARM_DATA; + public CmdUpdateType getCmdUpdateType() { + return CmdUpdateType.ALARM_DATA; } @JsonCreator diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/CmdUpdate.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/CmdUpdate.java new file mode 100644 index 0000000000..351dfec15c --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/CmdUpdate.java @@ -0,0 +1,33 @@ +/** + * Copyright © 2016-2021 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.telemetry.cmd.v2; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +@JsonIgnoreProperties(ignoreUnknown = true) +public abstract class CmdUpdate { + + private final int cmdId; + private final int errorCode; + private final String errorMsg; + + public abstract CmdUpdateType getCmdUpdateType(); + +} diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/DataUpdateType.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/CmdUpdateType.java similarity index 92% rename from application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/DataUpdateType.java rename to application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/CmdUpdateType.java index 2a9930e2b1..9df281cbb9 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/DataUpdateType.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/CmdUpdateType.java @@ -15,7 +15,8 @@ */ package org.thingsboard.server.service.telemetry.cmd.v2; -public enum DataUpdateType { +public enum CmdUpdateType { ENTITY_DATA, - ALARM_DATA + ALARM_DATA, + COUNT_DATA } diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/DataUpdate.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/DataUpdate.java index 5540acd782..d0658044d0 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/DataUpdate.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/DataUpdate.java @@ -15,24 +15,24 @@ */ package org.thingsboard.server.service.telemetry.cmd.v2; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import lombok.AllArgsConstructor; -import lombok.Data; +import lombok.Getter; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.service.telemetry.sub.SubscriptionErrorCode; import java.util.List; -@Data -@AllArgsConstructor -@JsonIgnoreProperties(ignoreUnknown = true) -public abstract class DataUpdate { +public abstract class DataUpdate extends CmdUpdate { - private final int cmdId; + @Getter private final PageData data; + @Getter private final List update; - private final int errorCode; - private final String errorMsg; + + public DataUpdate(int cmdId, PageData data, List update, int errorCode, String errorMsg) { + super(cmdId, errorCode, errorMsg); + this.data = data; + this.update = update; + } public DataUpdate(int cmdId, PageData data, List update) { this(cmdId, data, update, SubscriptionErrorCode.NO_ERROR.getCode(), null); @@ -42,5 +42,4 @@ public abstract class DataUpdate { this(cmdId, null, null, errorCode, errorMsg); } - public abstract DataUpdateType getDataUpdateType(); } diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountCmd.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountCmd.java new file mode 100644 index 0000000000..d0b7fc8454 --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountCmd.java @@ -0,0 +1,35 @@ +/** + * Copyright © 2016-2021 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.telemetry.cmd.v2; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import org.thingsboard.server.common.data.query.EntityCountQuery; +import org.thingsboard.server.common.data.query.EntityDataQuery; + +public class EntityCountCmd extends DataCmd { + + @Getter + private final EntityCountQuery query; + + @JsonCreator + public EntityCountCmd(@JsonProperty("cmdId") int cmdId, + @JsonProperty("query") EntityCountQuery query) { + super(cmdId); + this.query = query; + } +} diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountUnsubscribeCmd.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountUnsubscribeCmd.java new file mode 100644 index 0000000000..c597fa6634 --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountUnsubscribeCmd.java @@ -0,0 +1,25 @@ +/** + * Copyright © 2016-2021 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.telemetry.cmd.v2; + +import lombok.Data; + +@Data +public class EntityCountUnsubscribeCmd implements UnsubscribeCmd { + + private final int cmdId; + +} diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountUpdate.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountUpdate.java new file mode 100644 index 0000000000..6617f8e63c --- /dev/null +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityCountUpdate.java @@ -0,0 +1,57 @@ +/** + * Copyright © 2016-2021 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.telemetry.cmd.v2; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.ToString; +import org.thingsboard.server.common.data.page.PageData; +import org.thingsboard.server.common.data.query.EntityData; +import org.thingsboard.server.service.telemetry.sub.SubscriptionErrorCode; + +import java.util.List; + +@ToString +public class EntityCountUpdate extends CmdUpdate { + + @Getter + private int count; + + public EntityCountUpdate(int cmdId, int count) { + super(cmdId, SubscriptionErrorCode.NO_ERROR.getCode(), null); + this.count = count; + } + + public EntityCountUpdate(int cmdId, int errorCode, String errorMsg) { + super(cmdId, errorCode, errorMsg); + } + + @Override + public CmdUpdateType getCmdUpdateType() { + return CmdUpdateType.COUNT_DATA; + } + + @JsonCreator + public EntityCountUpdate(@JsonProperty("cmdId") int cmdId, + @JsonProperty("count") int count, + @JsonProperty("errorCode") int errorCode, + @JsonProperty("errorMsg") String errorMsg) { + super(cmdId, errorCode, errorMsg); + this.count = count; + } + +} diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityDataUpdate.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityDataUpdate.java index f08dee8ba3..0af6f85697 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityDataUpdate.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/EntityDataUpdate.java @@ -16,16 +16,16 @@ package org.thingsboard.server.service.telemetry.cmd.v2; import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Getter; +import lombok.ToString; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.query.EntityData; import org.thingsboard.server.service.telemetry.sub.SubscriptionErrorCode; import java.util.List; - +@ToString public class EntityDataUpdate extends DataUpdate { @Getter @@ -41,8 +41,8 @@ public class EntityDataUpdate extends DataUpdate { } @Override - public DataUpdateType getDataUpdateType() { - return DataUpdateType.ENTITY_DATA; + public CmdUpdateType getCmdUpdateType() { + return CmdUpdateType.ENTITY_DATA; } @JsonCreator diff --git a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/UnsubscribeCmd.java b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/UnsubscribeCmd.java index d34f5c6fdf..5e046ee581 100644 --- a/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/UnsubscribeCmd.java +++ b/application/src/main/java/org/thingsboard/server/service/telemetry/cmd/v2/UnsubscribeCmd.java @@ -15,8 +15,6 @@ */ package org.thingsboard.server.service.telemetry.cmd.v2; -import lombok.Data; - public interface UnsubscribeCmd { int getCmdId(); 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 b157e0d0a7..9110bf07ba 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 @@ -25,11 +25,14 @@ import com.google.protobuf.ByteString; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; +import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.common.data.ApiUsageState; 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.EntityType; +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; import org.thingsboard.server.common.data.TenantProfile; import org.thingsboard.server.common.data.device.credentials.BasicMqttCredentials; import org.thingsboard.server.common.data.device.credentials.ProvisionDeviceCredentialsData; @@ -53,14 +56,15 @@ 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.relation.RelationService; +import org.thingsboard.server.dao.resource.ResourceService; import org.thingsboard.server.dao.tenant.TbTenantProfileCache; -import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.server.gen.transport.TransportProtos; import org.thingsboard.server.gen.transport.TransportProtos.DeviceInfoProto; import org.thingsboard.server.gen.transport.TransportProtos.GetEntityProfileRequestMsg; import org.thingsboard.server.gen.transport.TransportProtos.GetEntityProfileResponseMsg; import org.thingsboard.server.gen.transport.TransportProtos.GetOrCreateDeviceFromGatewayRequestMsg; import org.thingsboard.server.gen.transport.TransportProtos.GetOrCreateDeviceFromGatewayResponseMsg; +import org.thingsboard.server.gen.transport.TransportProtos.GetResourceRequestMsg; import org.thingsboard.server.gen.transport.TransportProtos.ProvisionDeviceRequestMsg; import org.thingsboard.server.gen.transport.TransportProtos.ProvisionResponseStatus; import org.thingsboard.server.gen.transport.TransportProtos.TransportApiRequestMsg; @@ -104,6 +108,7 @@ public class DefaultTransportApiService implements TransportApiService { private final TbClusterService tbClusterService; private final DataDecodingEncodingService dataDecodingEncodingService; private final DeviceProvisionService deviceProvisionService; + private final ResourceService resourceService; private final ConcurrentMap deviceCreationLocks = new ConcurrentHashMap<>(); @@ -112,7 +117,7 @@ public class DefaultTransportApiService implements TransportApiService { RelationService relationService, DeviceCredentialsService deviceCredentialsService, DeviceStateService deviceStateService, DbCallbackExecutorService dbCallbackExecutorService, TbClusterService tbClusterService, DataDecodingEncodingService dataDecodingEncodingService, - DeviceProvisionService deviceProvisionService) { + DeviceProvisionService deviceProvisionService, ResourceService resourceService) { this.deviceProfileCache = deviceProfileCache; this.tenantProfileCache = tenantProfileCache; this.apiUsageStateService = apiUsageStateService; @@ -124,6 +129,7 @@ public class DefaultTransportApiService implements TransportApiService { this.tbClusterService = tbClusterService; this.dataDecodingEncodingService = dataDecodingEncodingService; this.deviceProvisionService = deviceProvisionService; + this.resourceService = resourceService; } @Override @@ -157,6 +163,9 @@ public class DefaultTransportApiService implements TransportApiService { } else if (transportApiRequestMsg.hasProvisionDeviceRequestMsg()) { return Futures.transform(handle(transportApiRequestMsg.getProvisionDeviceRequestMsg()), value -> new TbProtoQueueMsg<>(tbProtoQueueMsg.getKey(), value, tbProtoQueueMsg.getHeaders()), MoreExecutors.directExecutor()); + } else if (transportApiRequestMsg.hasResourceRequestMsg()) { + return Futures.transform(handle(transportApiRequestMsg.getResourceRequestMsg()), + value -> new TbProtoQueueMsg<>(tbProtoQueueMsg.getKey(), value, tbProtoQueueMsg.getHeaders()), MoreExecutors.directExecutor()); } return Futures.transform(getEmptyTransportApiResponseFuture(), value -> new TbProtoQueueMsg<>(tbProtoQueueMsg.getKey(), value, tbProtoQueueMsg.getHeaders()), MoreExecutors.directExecutor()); @@ -315,9 +324,9 @@ public class DefaultTransportApiService implements TransportApiService { return TransportApiResponseMsg.newBuilder().setProvisionDeviceResponseMsg(TransportProtos.ProvisionDeviceResponseMsg.newBuilder().setStatus(status).build()).build(); } TransportProtos.ProvisionDeviceResponseMsg.Builder provisionResponse = TransportProtos.ProvisionDeviceResponseMsg.newBuilder() - .setCredentialsType(TransportProtos.CredentialsType.valueOf(deviceCredentials.getCredentialsType().name())) - .setStatus(status); - switch (deviceCredentials.getCredentialsType()){ + .setCredentialsType(TransportProtos.CredentialsType.valueOf(deviceCredentials.getCredentialsType().name())) + .setStatus(status); + switch (deviceCredentials.getCredentialsType()) { case ACCESS_TOKEN: provisionResponse.setCredentialsValue(deviceCredentials.getCredentialsId()); break; @@ -353,6 +362,24 @@ public class DefaultTransportApiService implements TransportApiService { return Futures.immediateFuture(TransportApiResponseMsg.newBuilder().setEntityProfileResponseMsg(builder).build()); } + private ListenableFuture handle(GetResourceRequestMsg requestMsg) { + TenantId tenantId = new TenantId(new UUID(requestMsg.getTenantIdMSB(), requestMsg.getTenantIdLSB())); + ResourceType resourceType = ResourceType.valueOf(requestMsg.getResourceType()); + String resourceId = requestMsg.getResourceId(); + TransportProtos.GetResourceResponseMsg.Builder builder = TransportProtos.GetResourceResponseMsg.newBuilder(); + Resource resource = resourceService.getResource(tenantId, resourceType, resourceId); + + if (resource == null && !tenantId.equals(TenantId.SYS_TENANT_ID)) { + resource = resourceService.getResource(TenantId.SYS_TENANT_ID, resourceType, resourceId); + } + + if (resource != null) { + builder.setResource(ByteString.copyFrom(dataDecodingEncodingService.encode(resource))); + } + + return Futures.immediateFuture(TransportApiResponseMsg.newBuilder().setResourceResponseMsg(builder).build()); + } + private ListenableFuture getDeviceInfo(DeviceId deviceId, DeviceCredentials credentials) { return Futures.transform(deviceService.findDeviceByIdAsync(TenantId.SYS_TENANT_ID, deviceId), device -> { if (device == null) { diff --git a/application/src/main/resources/logback.xml b/application/src/main/resources/logback.xml index 0d1f431a59..2aca9b227a 100644 --- a/application/src/main/resources/logback.xml +++ b/application/src/main/resources/logback.xml @@ -30,7 +30,7 @@ - + diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml index c204174306..6a104384de 100644 --- a/application/src/main/resources/thingsboard.yml +++ b/application/src/main/resources/thingsboard.yml @@ -34,6 +34,7 @@ server: log_controller_error_stack_trace: "${HTTP_LOG_CONTROLLER_ERROR_STACK_TRACE:false}" ws: send_timeout: "${TB_SERVER_WS_SEND_TIMEOUT:5000}" + ping_timeout: "${TB_SERVER_WS_PING_TIMEOUT:30000}" limits: # Limit the amount of sessions and subscriptions available on each server. Put values to zero to disable particular limitation max_sessions_per_tenant: "${TB_SERVER_WS_TENANT_RATE_LIMITS_MAX_SESSIONS_PER_TENANT:0}" @@ -326,6 +327,9 @@ actors: cache: # caffeine or redis type: "${CACHE_TYPE:caffeine}" + attributes: + # make sure that if cache.type is 'redis' and cache.attributes.enabled is 'true' that you change 'maxmemory-policy' Redis config property to 'allkeys-lru', 'allkeys-lfu' or 'allkeys-random' + enabled: "${CACHE_ATTRIBUTES_ENABLED:true}" caffeine: specs: @@ -359,6 +363,12 @@ caffeine: deviceProfiles: timeToLiveInMinutes: 1440 maxSize: 0 + attributes: + timeToLiveInMinutes: 1440 + maxSize: 100000 + tokensOutdatageTime: + timeToLiveInMinutes: 20000 + maxSize: 10000 edges: timeToLiveInMinutes: 1440 maxSize: 0 @@ -547,6 +557,7 @@ transport: http: enabled: "${HTTP_ENABLED:true}" request_timeout: "${HTTP_REQUEST_TIMEOUT:60000}" + max_request_timeout: "${HTTP_MAX_REQUEST_TIMEOUT:300000}" # Local MQTT transport parameters mqtt: # Enable/disable mqtt transport protocol. diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseEntityQueryControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseEntityQueryControllerTest.java index d4e4b4e0d6..b2fe4a563b 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseEntityQueryControllerTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/BaseEntityQueryControllerTest.java @@ -16,16 +16,10 @@ package org.thingsboard.server.controller; import com.fasterxml.jackson.core.type.TypeReference; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.apache.http.conn.ssl.TrustStrategy; -import org.apache.http.ssl.SSLContextBuilder; -import org.apache.http.ssl.SSLContexts; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.springframework.boot.web.server.LocalServerPort; import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.EntityType; @@ -33,7 +27,6 @@ import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.User; import org.thingsboard.server.common.data.id.DeviceId; import org.thingsboard.server.common.data.id.EntityId; -import org.thingsboard.server.common.data.kv.Aggregation; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.query.DeviceTypeFilter; import org.thingsboard.server.common.data.query.EntityCountQuery; @@ -44,20 +37,15 @@ import org.thingsboard.server.common.data.query.EntityDataSortOrder; import org.thingsboard.server.common.data.query.EntityKey; import org.thingsboard.server.common.data.query.EntityKeyType; import org.thingsboard.server.common.data.query.EntityListFilter; +import org.thingsboard.server.common.data.query.EntityTypeFilter; import org.thingsboard.server.common.data.query.FilterPredicateValue; import org.thingsboard.server.common.data.query.KeyFilter; import org.thingsboard.server.common.data.query.NumericFilterPredicate; import org.thingsboard.server.common.data.security.Authority; -import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd; -import org.thingsboard.server.service.telemetry.cmd.v2.EntityHistoryCmd; -import java.net.URI; -import java.net.URISyntaxException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.List; -import java.util.Random; import java.util.stream.Collectors; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @@ -132,6 +120,14 @@ public abstract class BaseEntityQueryControllerTest extends AbstractControllerTe count = doPostWithResponse("/api/entitiesQuery/count", countQuery, Long.class); Assert.assertEquals(97, count.longValue()); + + EntityTypeFilter filter2 = new EntityTypeFilter(); + filter2.setEntityType(EntityType.DEVICE); + + EntityCountQuery countQuery2 = new EntityCountQuery(filter2); + + Long count2 = doPostWithResponse("/api/entitiesQuery/count", countQuery2, Long.class); + Assert.assertEquals(97, count2.longValue()); } @Test @@ -198,11 +194,31 @@ public abstract class BaseEntityQueryControllerTest extends AbstractControllerTe Assert.assertEquals(11, data.getTotalElements()); Assert.assertEquals("Device19", data.getData().get(0).getLatest().get(EntityKeyType.ENTITY_FIELD).get("name").getValue()); + + EntityTypeFilter filter2 = new EntityTypeFilter(); + filter2.setEntityType(EntityType.DEVICE); + + EntityDataSortOrder sortOrder2 = new EntityDataSortOrder( + new EntityKey(EntityKeyType.ENTITY_FIELD, "createdTime"), EntityDataSortOrder.Direction.ASC + ); + EntityDataPageLink pageLink2 = new EntityDataPageLink(10, 0, null, sortOrder2); + List entityFields2 = Collections.singletonList(new EntityKey(EntityKeyType.ENTITY_FIELD, "name")); + + EntityDataQuery query2 = new EntityDataQuery(filter2, pageLink2, entityFields2, null, null); + + PageData data2 = + doPostWithTypedResponse("/api/entitiesQuery/find", query2, new TypeReference>() { + }); + + Assert.assertEquals(97, data2.getTotalElements()); + Assert.assertEquals(10, data2.getTotalPages()); + Assert.assertTrue(data2.hasNext()); + Assert.assertEquals(10, data2.getData().size()); + } @Test public void testFindEntityDataByQueryWithAttributes() throws Exception { - List devices = new ArrayList<>(); List temperatures = new ArrayList<>(); List highTemperatures = new ArrayList<>(); diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java index 299413d9c9..2249940c48 100644 --- a/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java +++ b/application/src/test/java/org/thingsboard/server/controller/BaseWebsocketApiTest.java @@ -35,16 +35,23 @@ import org.thingsboard.server.common.data.kv.LongDataEntry; import org.thingsboard.server.common.data.kv.TsKvEntry; import org.thingsboard.server.common.data.page.PageData; import org.thingsboard.server.common.data.query.DeviceTypeFilter; +import org.thingsboard.server.common.data.query.EntityCountQuery; import org.thingsboard.server.common.data.query.EntityData; import org.thingsboard.server.common.data.query.EntityDataPageLink; import org.thingsboard.server.common.data.query.EntityDataQuery; import org.thingsboard.server.common.data.query.EntityKey; import org.thingsboard.server.common.data.query.EntityKeyType; +import org.thingsboard.server.common.data.query.EntityKeyValueType; +import org.thingsboard.server.common.data.query.FilterPredicateValue; +import org.thingsboard.server.common.data.query.KeyFilter; +import org.thingsboard.server.common.data.query.NumericFilterPredicate; import org.thingsboard.server.common.data.query.TsValue; import org.thingsboard.server.common.data.security.Authority; import org.thingsboard.server.service.subscription.TbAttributeSubscriptionScope; import org.thingsboard.server.service.telemetry.TelemetrySubscriptionService; import org.thingsboard.server.service.telemetry.cmd.TelemetryPluginCmdsWrapper; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityCountCmd; +import org.thingsboard.server.service.telemetry.cmd.v2.EntityCountUpdate; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataCmd; import org.thingsboard.server.service.telemetry.cmd.v2.EntityDataUpdate; import org.thingsboard.server.service.telemetry.cmd.v2.EntityHistoryCmd; @@ -243,6 +250,98 @@ public class BaseWebsocketApiTest extends AbstractWebsocketTest { Assert.assertEquals(new TsValue(dataPoint4.getTs(), dataPoint4.getValueAsString()), tsValues[0]); } + @Test + public void testEntityCountWsCmd() throws Exception { + Device device = new Device(); + device.setName("Device"); + device.setType("default"); + device.setLabel("testLabel" + (int) (Math.random() * 1000)); + device = doPost("/api/device", device, Device.class); + + AttributeKvEntry dataPoint1 = new BaseAttributeKvEntry(System.currentTimeMillis(), new LongDataEntry("temperature", 42L)); + sendAttributes(device, TbAttributeSubscriptionScope.SERVER_SCOPE, Collections.singletonList(dataPoint1)); + + DeviceTypeFilter dtf1 = new DeviceTypeFilter(); + dtf1.setDeviceNameFilter("D"); + dtf1.setDeviceType("default"); + EntityCountQuery edq1 = new EntityCountQuery(dtf1, Collections.emptyList()); + + EntityCountCmd cmd1 = new EntityCountCmd(1, edq1); + + TelemetryPluginCmdsWrapper wrapper1 = new TelemetryPluginCmdsWrapper(); + wrapper1.setEntityCountCmds(Collections.singletonList(cmd1)); + + wsClient.send(mapper.writeValueAsString(wrapper1)); + String msg1 = wsClient.waitForReply(); + EntityCountUpdate update1 = mapper.readValue(msg1, EntityCountUpdate.class); + Assert.assertEquals(1, update1.getCmdId()); + Assert.assertEquals(1, update1.getCount()); + + DeviceTypeFilter dtf2 = new DeviceTypeFilter(); + dtf2.setDeviceNameFilter("D"); + dtf2.setDeviceType("non-existing-device-type"); + EntityCountQuery edq2 = new EntityCountQuery(dtf2, Collections.emptyList()); + + EntityCountCmd cmd2 = new EntityCountCmd(2, edq2); + + TelemetryPluginCmdsWrapper wrapper2 = new TelemetryPluginCmdsWrapper(); + wrapper2.setEntityCountCmds(Collections.singletonList(cmd2)); + wsClient.send(mapper.writeValueAsString(wrapper2)); + + String msg2 = wsClient.waitForReply(); + EntityCountUpdate update2 = mapper.readValue(msg2, EntityCountUpdate.class); + Assert.assertEquals(2, update2.getCmdId()); + Assert.assertEquals(0, update2.getCount()); + + KeyFilter highTemperatureFilter = new KeyFilter(); + highTemperatureFilter.setKey(new EntityKey(EntityKeyType.ATTRIBUTE, "temperature")); + NumericFilterPredicate predicate = new NumericFilterPredicate(); + predicate.setValue(FilterPredicateValue.fromDouble(40)); + predicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER); + highTemperatureFilter.setPredicate(predicate); + highTemperatureFilter.setValueType(EntityKeyValueType.NUMERIC); + + DeviceTypeFilter dtf3 = new DeviceTypeFilter(); + dtf3.setDeviceNameFilter("D"); + dtf3.setDeviceType("default"); + EntityCountQuery edq3 = new EntityCountQuery(dtf3, Collections.singletonList(highTemperatureFilter)); + + EntityCountCmd cmd3 = new EntityCountCmd(3, edq3); + + TelemetryPluginCmdsWrapper wrapper3 = new TelemetryPluginCmdsWrapper(); + wrapper3.setEntityCountCmds(Collections.singletonList(cmd3)); + wsClient.send(mapper.writeValueAsString(wrapper3)); + + String msg3 = wsClient.waitForReply(); + EntityCountUpdate update3 = mapper.readValue(msg3, EntityCountUpdate.class); + Assert.assertEquals(3, update3.getCmdId()); + Assert.assertEquals(1, update3.getCount()); + + KeyFilter highTemperatureFilter2 = new KeyFilter(); + highTemperatureFilter2.setKey(new EntityKey(EntityKeyType.ATTRIBUTE, "temperature")); + NumericFilterPredicate predicate2 = new NumericFilterPredicate(); + predicate2.setValue(FilterPredicateValue.fromDouble(50)); + predicate2.setOperation(NumericFilterPredicate.NumericOperation.GREATER); + highTemperatureFilter2.setPredicate(predicate2); + highTemperatureFilter2.setValueType(EntityKeyValueType.NUMERIC); + + DeviceTypeFilter dtf4 = new DeviceTypeFilter(); + dtf4.setDeviceNameFilter("D"); + dtf4.setDeviceType("default"); + EntityCountQuery edq4 = new EntityCountQuery(dtf4, Collections.singletonList(highTemperatureFilter2)); + + EntityCountCmd cmd4 = new EntityCountCmd(4, edq4); + + TelemetryPluginCmdsWrapper wrapper4 = new TelemetryPluginCmdsWrapper(); + wrapper4.setEntityCountCmds(Collections.singletonList(cmd4)); + wsClient.send(mapper.writeValueAsString(wrapper4)); + + String msg4 = wsClient.waitForReply(); + EntityCountUpdate update4 = mapper.readValue(msg4, EntityCountUpdate.class); + Assert.assertEquals(4, update4.getCmdId()); + Assert.assertEquals(0, update4.getCount()); + } + @Test public void testEntityDataLatestWidgetFlow() throws Exception { Device device = new Device(); diff --git a/application/src/test/java/org/thingsboard/server/controller/ControllerSqlTestSuite.java b/application/src/test/java/org/thingsboard/server/controller/ControllerSqlTestSuite.java index 3186765130..0f969a848f 100644 --- a/application/src/test/java/org/thingsboard/server/controller/ControllerSqlTestSuite.java +++ b/application/src/test/java/org/thingsboard/server/controller/ControllerSqlTestSuite.java @@ -27,7 +27,7 @@ import java.util.Arrays; @RunWith(ClasspathSuite.class) @ClasspathSuite.ClassnameFilters({ // "org.thingsboard.server.controller.sql.WebsocketApiSqlTest", -// "org.thingsboard.server.controller.sql.TenantProfileControllerSqlTest", +// "org.thingsboard.server.controller.sql.EntityQueryControllerSqlTest", "org.thingsboard.server.controller.sql.*Test", }) public class ControllerSqlTestSuite { diff --git a/application/src/test/java/org/thingsboard/server/service/security/auth/TokenOutdatingTest.java b/application/src/test/java/org/thingsboard/server/service/security/auth/TokenOutdatingTest.java new file mode 100644 index 0000000000..39abc09365 --- /dev/null +++ b/application/src/test/java/org/thingsboard/server/service/security/auth/TokenOutdatingTest.java @@ -0,0 +1,184 @@ +/** + * Copyright © 2016-2021 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.security.auth; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.cache.concurrent.ConcurrentMapCacheManager; +import org.springframework.security.authentication.CredentialsExpiredException; +import org.thingsboard.server.common.data.CacheConstants; +import org.thingsboard.server.common.data.User; +import org.thingsboard.server.common.data.id.UserId; +import org.thingsboard.server.common.data.security.Authority; +import org.thingsboard.server.common.data.security.UserCredentials; +import org.thingsboard.server.common.data.security.model.JwtToken; +import org.thingsboard.server.config.JwtSettings; +import org.thingsboard.server.dao.customer.CustomerService; +import org.thingsboard.server.dao.user.UserService; +import org.thingsboard.server.service.security.auth.jwt.JwtAuthenticationProvider; +import org.thingsboard.server.service.security.auth.jwt.RefreshTokenAuthenticationProvider; +import org.thingsboard.server.service.security.exception.JwtExpiredTokenException; +import org.thingsboard.server.service.security.model.SecurityUser; +import org.thingsboard.server.service.security.model.UserPrincipal; +import org.thingsboard.server.service.security.model.token.JwtTokenFactory; +import org.thingsboard.server.service.security.model.token.RawAccessJwtToken; + +import java.util.UUID; + +import static java.util.concurrent.TimeUnit.DAYS; +import static java.util.concurrent.TimeUnit.MINUTES; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +public class TokenOutdatingTest { + private JwtAuthenticationProvider accessTokenAuthenticationProvider; + private RefreshTokenAuthenticationProvider refreshTokenAuthenticationProvider; + + private TokenOutdatingService tokenOutdatingService; + private ConcurrentMapCacheManager cacheManager; + private JwtTokenFactory tokenFactory; + private JwtSettings jwtSettings; + + private UserId userId; + + @BeforeEach + public void setUp() { + jwtSettings = new JwtSettings(); + jwtSettings.setTokenIssuer("test.io"); + jwtSettings.setTokenExpirationTime((int) MINUTES.toSeconds(10)); + jwtSettings.setRefreshTokenExpTime((int) DAYS.toSeconds(7)); + jwtSettings.setTokenSigningKey("secret"); + tokenFactory = new JwtTokenFactory(jwtSettings); + + cacheManager = new ConcurrentMapCacheManager(); + tokenOutdatingService = new TokenOutdatingService(cacheManager, tokenFactory, jwtSettings); + tokenOutdatingService.initCache(); + + userId = new UserId(UUID.randomUUID()); + + UserService userService = mock(UserService.class); + + User user = new User(); + user.setId(userId); + user.setAuthority(Authority.TENANT_ADMIN); + user.setEmail("email"); + when(userService.findUserById(any(), eq(userId))).thenReturn(user); + + UserCredentials userCredentials = new UserCredentials(); + userCredentials.setEnabled(true); + when(userService.findUserCredentialsByUserId(any(), eq(userId))).thenReturn(userCredentials); + + accessTokenAuthenticationProvider = new JwtAuthenticationProvider(tokenFactory, tokenOutdatingService); + refreshTokenAuthenticationProvider = new RefreshTokenAuthenticationProvider(tokenFactory, userService, mock(CustomerService.class), tokenOutdatingService); + } + + @Test + public void testOutdateOldUserTokens() throws Exception { + JwtToken jwtToken = createAccessJwtToken(userId); + + SECONDS.sleep(1); // need to wait before outdating so that outdatage time is strictly after token issue time + tokenOutdatingService.outdateOldUserTokens(userId); + assertTrue(tokenOutdatingService.isOutdated(jwtToken, userId)); + + SECONDS.sleep(1); + + JwtToken newJwtToken = tokenFactory.createAccessJwtToken(createMockSecurityUser(userId)); + assertFalse(tokenOutdatingService.isOutdated(newJwtToken, userId)); + } + + @Test + public void testAuthenticateWithOutdatedAccessToken() throws InterruptedException { + RawAccessJwtToken accessJwtToken = getRawJwtToken(createAccessJwtToken(userId)); + + assertDoesNotThrow(() -> { + accessTokenAuthenticationProvider.authenticate(new JwtAuthenticationToken(accessJwtToken)); + }); + + SECONDS.sleep(1); + tokenOutdatingService.outdateOldUserTokens(userId); + + assertThrows(JwtExpiredTokenException.class, () -> { + accessTokenAuthenticationProvider.authenticate(new JwtAuthenticationToken(accessJwtToken)); + }); + } + + @Test + public void testAuthenticateWithOutdatedRefreshToken() throws InterruptedException { + RawAccessJwtToken refreshJwtToken = getRawJwtToken(createRefreshJwtToken(userId)); + + assertDoesNotThrow(() -> { + refreshTokenAuthenticationProvider.authenticate(new RefreshAuthenticationToken(refreshJwtToken)); + }); + + SECONDS.sleep(1); + tokenOutdatingService.outdateOldUserTokens(userId); + + assertThrows(CredentialsExpiredException.class, () -> { + refreshTokenAuthenticationProvider.authenticate(new RefreshAuthenticationToken(refreshJwtToken)); + }); + } + + @Test + public void testTokensOutdatageTimeRemovalFromCache() throws Exception { + JwtToken jwtToken = createAccessJwtToken(userId); + + SECONDS.sleep(1); + tokenOutdatingService.outdateOldUserTokens(userId); + + int refreshTokenExpirationTime = 5; + jwtSettings.setRefreshTokenExpTime(refreshTokenExpirationTime); + + SECONDS.sleep(refreshTokenExpirationTime - 2); + + assertTrue(tokenOutdatingService.isOutdated(jwtToken, userId)); + assertNotNull(cacheManager.getCache(CacheConstants.TOKEN_OUTDATAGE_TIME_CACHE).get(userId.getId().toString())); + + SECONDS.sleep(3); + + assertFalse(tokenOutdatingService.isOutdated(jwtToken, userId)); + assertNull(cacheManager.getCache(CacheConstants.TOKEN_OUTDATAGE_TIME_CACHE).get(userId.getId().toString())); + } + + private JwtToken createAccessJwtToken(UserId userId) { + return tokenFactory.createAccessJwtToken(createMockSecurityUser(userId)); + } + + private JwtToken createRefreshJwtToken(UserId userId) { + return tokenFactory.createRefreshToken(createMockSecurityUser(userId)); + } + + private RawAccessJwtToken getRawJwtToken(JwtToken token) { + return new RawAccessJwtToken(token.getToken()); + } + + private SecurityUser createMockSecurityUser(UserId userId) { + SecurityUser securityUser = new SecurityUser(); + securityUser.setEmail("email"); + securityUser.setUserPrincipal(new UserPrincipal(UserPrincipal.Type.USER_NAME, securityUser.getEmail())); + securityUser.setAuthority(Authority.CUSTOMER_USER); + securityUser.setId(userId); + return securityUser; + } +} diff --git a/common/dao-api/src/main/java/org/thingsboard/server/dao/resource/ResourceService.java b/common/dao-api/src/main/java/org/thingsboard/server/dao/resource/ResourceService.java new file mode 100644 index 0000000000..8d84af6e6c --- /dev/null +++ b/common/dao-api/src/main/java/org/thingsboard/server/dao/resource/ResourceService.java @@ -0,0 +1,39 @@ +/** + * Copyright © 2016-2021 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.dao.resource; + +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; +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 java.util.List; + + +public interface ResourceService { + Resource saveResource(Resource resource); + + Resource getResource(TenantId tenantId, ResourceType resourceType, String resourceId); + + PageData findResourcesByTenantId(TenantId tenantId, PageLink pageLink); + + List findResourcesByTenantIdResourceType(TenantId tenantId, ResourceType resourceType); + + void deleteResource(TenantId tenantId, ResourceType resourceType, String resourceId); + + void deleteResourcesByTenantId(TenantId tenantId); +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/CacheConstants.java b/common/data/src/main/java/org/thingsboard/server/common/data/CacheConstants.java index 3745556db3..e587f611c5 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/CacheConstants.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/CacheConstants.java @@ -27,4 +27,6 @@ public class CacheConstants { public static final String SECURITY_SETTINGS_CACHE = "securitySettings"; public static final String TENANT_PROFILE_CACHE = "tenantProfiles"; public static final String DEVICE_PROFILE_CACHE = "deviceProfiles"; + public static final String ATTRIBUTES_CACHE = "attributes"; + public static final String TOKEN_OUTDATAGE_TIME_CACHE = "tokensOutdatageTime"; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java b/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java index d0a27fdbc6..c6a9488c51 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/DataConstants.java @@ -33,6 +33,8 @@ public class DataConstants { public static final String IS_EXISTING_ALARM = "isExistingAlarm"; public static final String IS_SEVERITY_UPDATED_ALARM = "isSeverityUpdated"; public static final String IS_CLEARED_ALARM = "isClearedAlarm"; + public static final String ALARM_CONDITION_REPEATS = "alarmConditionRepeats"; + public static final String ALARM_CONDITION_DURATION = "alarmConditionDuration"; public static final String[] allScopes() { return new String[]{CLIENT_SCOPE, SHARED_SCOPE, SERVER_SCOPE}; diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/Resource.java b/common/data/src/main/java/org/thingsboard/server/common/data/Resource.java new file mode 100644 index 0000000000..2e7cde8185 --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/Resource.java @@ -0,0 +1,41 @@ +/** + * Copyright © 2016-2021 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.common.data; + +import lombok.Data; +import org.thingsboard.server.common.data.id.TenantId; + +import java.io.Serializable; + +@Data +public class Resource implements HasTenantId, Serializable { + + private static final long serialVersionUID = 7379609705527272306L; + + private TenantId tenantId; + private ResourceType resourceType; + private String resourceId; + private String value; + + @Override + public String toString() { + return "Resource{" + + "tenantId=" + tenantId + + ", resourceType=" + resourceType + + ", resourceId='" + resourceId + '\'' + + '}'; + } +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/ResourceType.java b/common/data/src/main/java/org/thingsboard/server/common/data/ResourceType.java new file mode 100644 index 0000000000..a9bb27432a --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/ResourceType.java @@ -0,0 +1,20 @@ +/** + * Copyright © 2016-2021 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.common.data; + +public enum ResourceType { + LWM2M_MODEL, JKS, PKCS_12 +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/asset/AssetSearchQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/asset/AssetSearchQuery.java index 0fcb942de4..fe916f0eaa 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/asset/AssetSearchQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/asset/AssetSearchQuery.java @@ -19,7 +19,7 @@ import lombok.Data; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntityRelationsQuery; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationsSearchParameters; import java.util.Collections; @@ -39,7 +39,7 @@ public class AssetSearchQuery { EntityRelationsQuery query = new EntityRelationsQuery(); query.setParameters(parameters); query.setFilters( - Collections.singletonList(new EntityTypeFilter(relationType == null ? EntityRelation.CONTAINS_TYPE : relationType, + Collections.singletonList(new RelationEntityTypeFilter(relationType == null ? EntityRelation.CONTAINS_TYPE : relationType, Collections.singletonList(EntityType.ASSET)))); return query; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/device/DeviceSearchQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/device/DeviceSearchQuery.java index 2423bda7db..9143fdfece 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/device/DeviceSearchQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/device/DeviceSearchQuery.java @@ -19,7 +19,7 @@ import lombok.Data; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntityRelationsQuery; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationsSearchParameters; import java.util.Collections; @@ -36,7 +36,7 @@ public class DeviceSearchQuery { EntityRelationsQuery query = new EntityRelationsQuery(); query.setParameters(parameters); query.setFilters( - Collections.singletonList(new EntityTypeFilter(relationType == null ? EntityRelation.CONTAINS_TYPE : relationType, + Collections.singletonList(new RelationEntityTypeFilter(relationType == null ? EntityRelation.CONTAINS_TYPE : relationType, Collections.singletonList(EntityType.DEVICE)))); return query; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmCondition.java b/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmCondition.java index 3d23995b92..49004073d3 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmCondition.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmCondition.java @@ -26,7 +26,7 @@ import java.util.List; @JsonIgnoreProperties(ignoreUnknown = true) public class AlarmCondition implements Serializable { - private List condition; + private List condition; private AlarmConditionSpec spec; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionFilter.java new file mode 100644 index 0000000000..86aafc19e5 --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionFilter.java @@ -0,0 +1,30 @@ +/** + * Copyright © 2016-2021 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.common.data.device.profile; + +import lombok.Data; +import org.thingsboard.server.common.data.query.EntityKeyValueType; +import org.thingsboard.server.common.data.query.KeyFilterPredicate; + +@Data +public class AlarmConditionFilter { + + private AlarmConditionFilterKey key; + private EntityKeyValueType valueType; + private Object value; + private KeyFilterPredicate predicate; + +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionFilterKey.java b/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionFilterKey.java new file mode 100644 index 0000000000..33ee0b0628 --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionFilterKey.java @@ -0,0 +1,26 @@ +/** + * Copyright © 2016-2021 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.common.data.device.profile; + +import lombok.Data; + +@Data +public class AlarmConditionFilterKey { + + private final AlarmConditionKeyType type; + private final String key; + +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionKeyType.java b/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionKeyType.java new file mode 100644 index 0000000000..d607df8e35 --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/device/profile/AlarmConditionKeyType.java @@ -0,0 +1,23 @@ +/** + * Copyright © 2016-2021 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.common.data.device.profile; + +public enum AlarmConditionKeyType { + ATTRIBUTE, + TIME_SERIES, + ENTITY_FIELD, + CONSTANT +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/edge/EdgeSearchQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/edge/EdgeSearchQuery.java index 5f9eb0de1e..0da7fd08af 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/edge/EdgeSearchQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/edge/EdgeSearchQuery.java @@ -19,7 +19,7 @@ import lombok.Data; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntityRelationsQuery; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationsSearchParameters; import java.util.Collections; @@ -36,7 +36,7 @@ public class EdgeSearchQuery { EntityRelationsQuery query = new EntityRelationsQuery(); query.setParameters(parameters); query.setFilters( - Collections.singletonList(new EntityTypeFilter(relationType == null ? EntityRelation.CONTAINS_TYPE : relationType, + Collections.singletonList(new RelationEntityTypeFilter(relationType == null ? EntityRelation.CONTAINS_TYPE : relationType, Collections.singletonList(EntityType.EDGE)))); return query; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/entityview/EntityViewSearchQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/entityview/EntityViewSearchQuery.java index 363832c5ce..348f7725b0 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/entityview/EntityViewSearchQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/entityview/EntityViewSearchQuery.java @@ -19,7 +19,7 @@ import lombok.Data; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntityRelationsQuery; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationsSearchParameters; import java.util.Collections; @@ -36,7 +36,7 @@ public class EntityViewSearchQuery { EntityRelationsQuery query = new EntityRelationsQuery(); query.setParameters(parameters); query.setFilters( - Collections.singletonList(new EntityTypeFilter(relationType == null ? EntityRelation.CONTAINS_TYPE : relationType, + Collections.singletonList(new RelationEntityTypeFilter(relationType == null ? EntityRelation.CONTAINS_TYPE : relationType, Collections.singletonList(EntityType.ENTITY_VIEW)))); return query; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/AbstractDataQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/AbstractDataQuery.java index 8a85158853..0e807f8c37 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/AbstractDataQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/AbstractDataQuery.java @@ -29,15 +29,13 @@ public abstract class AbstractDataQuery extends En protected List entityFields; @Getter protected List latestValues; - @Getter - protected List keyFilters; public AbstractDataQuery() { super(); } - public AbstractDataQuery(EntityFilter entityFilter) { - super(entityFilter); + public AbstractDataQuery(EntityFilter entityFilter, List keyFilters) { + super(entityFilter, keyFilters); } public AbstractDataQuery(EntityFilter entityFilter, @@ -45,11 +43,10 @@ public abstract class AbstractDataQuery extends En List entityFields, List latestValues, List keyFilters) { - super(entityFilter); + super(entityFilter, keyFilters); this.pageLink = pageLink; this.entityFields = entityFields; this.latestValues = latestValues; - this.keyFilters = keyFilters; } } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/AlarmDataQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/AlarmDataQuery.java index 590073410c..655ef7ecfd 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/AlarmDataQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/AlarmDataQuery.java @@ -30,8 +30,8 @@ public class AlarmDataQuery extends AbstractDataQuery { public AlarmDataQuery() { } - public AlarmDataQuery(EntityFilter entityFilter) { - super(entityFilter); + public AlarmDataQuery(EntityFilter entityFilter, List keyFilters) { + super(entityFilter, keyFilters); } public AlarmDataQuery(EntityFilter entityFilter, AlarmDataPageLink pageLink, List entityFields, List latestValues, List keyFilters, List alarmFields) { diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityCountQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityCountQuery.java index b056b31dac..07878a3347 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityCountQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityCountQuery.java @@ -17,14 +17,26 @@ package org.thingsboard.server.common.data.query; import lombok.Getter; +import java.util.Collections; +import java.util.List; + public class EntityCountQuery { @Getter private EntityFilter entityFilter; - public EntityCountQuery() {} + @Getter + protected List keyFilters; + + public EntityCountQuery() { + } public EntityCountQuery(EntityFilter entityFilter) { + this(entityFilter, Collections.emptyList()); + } + + public EntityCountQuery(EntityFilter entityFilter, List keyFilters) { this.entityFilter = entityFilter; + this.keyFilters = keyFilters; } } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityDataQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityDataQuery.java index a7342d13f3..aca8437fe8 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityDataQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityDataQuery.java @@ -27,8 +27,8 @@ public class EntityDataQuery extends AbstractDataQuery { public EntityDataQuery() { } - public EntityDataQuery(EntityFilter entityFilter) { - super(entityFilter); + public EntityDataQuery(EntityFilter entityFilter, List keyFilters) { + super(entityFilter, keyFilters); } public EntityDataQuery(EntityFilter entityFilter, EntityDataPageLink pageLink, List entityFields, List latestValues, List keyFilters) { diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityFilter.java index a580ba27c2..958b8367ed 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityFilter.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityFilter.java @@ -29,6 +29,7 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo; @JsonSubTypes.Type(value = SingleEntityFilter.class, name = "singleEntity"), @JsonSubTypes.Type(value = EntityListFilter.class, name = "entityList"), @JsonSubTypes.Type(value = EntityNameFilter.class, name = "entityName"), + @JsonSubTypes.Type(value = EntityTypeFilter.class, name = "entityType"), @JsonSubTypes.Type(value = AssetTypeFilter.class, name = "assetType"), @JsonSubTypes.Type(value = DeviceTypeFilter.class, name = "deviceType"), @JsonSubTypes.Type(value = EdgeTypeFilter.class, name = "edgeType"), diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityFilterType.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityFilterType.java index 8ad5ba1bdb..1a843c7b0f 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityFilterType.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityFilterType.java @@ -19,6 +19,7 @@ public enum EntityFilterType { SINGLE_ENTITY("singleEntity"), ENTITY_LIST("entityList"), ENTITY_NAME("entityName"), + ENTITY_TYPE("entityType"), ASSET_TYPE("assetType"), DEVICE_TYPE("deviceType"), ENTITY_VIEW_TYPE("entityViewType"), diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityTypeFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityTypeFilter.java new file mode 100644 index 0000000000..22c2212a84 --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/EntityTypeFilter.java @@ -0,0 +1,30 @@ +/** + * Copyright © 2016-2021 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.common.data.query; + +import lombok.Data; +import org.thingsboard.server.common.data.EntityType; + +@Data +public class EntityTypeFilter implements EntityFilter { + @Override + public EntityFilterType getType() { + return EntityFilterType.ENTITY_TYPE; + } + + private EntityType entityType; + +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/query/RelationsQueryFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/query/RelationsQueryFilter.java index 0890f48c3a..9c113eb793 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/query/RelationsQueryFilter.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/query/RelationsQueryFilter.java @@ -18,8 +18,7 @@ package org.thingsboard.server.common.data.query; import lombok.Data; import org.thingsboard.server.common.data.id.EntityId; import org.thingsboard.server.common.data.relation.EntitySearchDirection; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; -import org.thingsboard.server.common.data.relation.RelationTypeGroup; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import java.util.List; @@ -33,7 +32,7 @@ public class RelationsQueryFilter implements EntityFilter { private EntityId rootEntity; private EntitySearchDirection direction; - private List filters; + private List filters; private int maxLevel; private boolean fetchLastLevelOnly; diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationsQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationsQuery.java index b673f60462..1a5415d3c7 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationsQuery.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationsQuery.java @@ -26,6 +26,6 @@ import java.util.List; public class EntityRelationsQuery { private RelationsSearchParameters parameters; - private List filters; + private List filters; } diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityTypeFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationEntityTypeFilter.java similarity index 95% rename from common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityTypeFilter.java rename to common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationEntityTypeFilter.java index 8b9849d6a1..1e817dda14 100644 --- a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityTypeFilter.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationEntityTypeFilter.java @@ -26,7 +26,7 @@ import java.util.List; */ @Data @AllArgsConstructor -public class EntityTypeFilter { +public class RelationEntityTypeFilter { private String relationType; diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/event/UserAuthDataChangedEvent.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/event/UserAuthDataChangedEvent.java new file mode 100644 index 0000000000..27a43670b5 --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/event/UserAuthDataChangedEvent.java @@ -0,0 +1,30 @@ +/** + * Copyright © 2016-2021 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.common.data.security.event; + +import org.thingsboard.server.common.data.id.UserId; + +public class UserAuthDataChangedEvent { + private final UserId userId; + + public UserAuthDataChangedEvent(UserId userId) { + this.userId = userId; + } + + public UserId getUserId() { + return userId; + } +} diff --git a/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtToken.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/model/JwtToken.java similarity index 92% rename from application/src/main/java/org/thingsboard/server/service/security/model/token/JwtToken.java rename to common/data/src/main/java/org/thingsboard/server/common/data/security/model/JwtToken.java index ca4c969bcf..d11522cf9a 100644 --- a/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtToken.java +++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/model/JwtToken.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.thingsboard.server.service.security.model.token; +package org.thingsboard.server.common.data.security.model; import java.io.Serializable; diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/transport/resource/Resource.java b/common/data/src/main/java/org/thingsboard/server/common/data/transport/resource/Resource.java new file mode 100644 index 0000000000..c29b704b04 --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/transport/resource/Resource.java @@ -0,0 +1,37 @@ +/** + * Copyright © 2016-2021 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.common.data.transport.resource; + +import lombok.Data; +import org.thingsboard.server.common.data.HasTenantId; +import org.thingsboard.server.common.data.id.TenantId; + +@Data +public class Resource implements HasTenantId { + private TenantId tenantId; + private ResourceType resourceType; + private String resourceId; + private String value; + + @Override + public String toString() { + return "Resource{" + + "tenantId=" + tenantId + + ", resourceType=" + resourceType + + ", resourceId='" + resourceId + '\'' + + '}'; + } +} diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/transport/resource/ResourceType.java b/common/data/src/main/java/org/thingsboard/server/common/data/transport/resource/ResourceType.java new file mode 100644 index 0000000000..c43f1997da --- /dev/null +++ b/common/data/src/main/java/org/thingsboard/server/common/data/transport/resource/ResourceType.java @@ -0,0 +1,20 @@ +/** + * Copyright © 2016-2021 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.common.data.transport.resource; + +public enum ResourceType { + LWM2M_MODEL, JKS, PKCS_12 +} diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/TbMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/TbMsg.java index 348e8021e4..66a3670ddd 100644 --- a/common/message/src/main/java/org/thingsboard/server/common/msg/TbMsg.java +++ b/common/message/src/main/java/org/thingsboard/server/common/msg/TbMsg.java @@ -120,7 +120,7 @@ public final class TbMsg implements Serializable { private TbMsg(String queueName, UUID id, long ts, String type, EntityId originator, TbMsgMetaData metaData, TbMsgDataType dataType, String data, RuleChainId ruleChainId, RuleNodeId ruleNodeId, int ruleNodeExecCounter, TbMsgCallback callback) { this.id = id; - this.queueName = queueName; + this.queueName = queueName != null ? queueName : ServiceQueue.MAIN; if (ts > 0) { this.ts = ts; } else { diff --git a/common/queue/src/main/java/org/thingsboard/server/queue/util/TbLwM2mTransportComponent.java b/common/queue/src/main/java/org/thingsboard/server/queue/util/TbLwM2mTransportComponent.java index 3bc4d494f2..638f9f6fb2 100644 --- a/common/queue/src/main/java/org/thingsboard/server/queue/util/TbLwM2mTransportComponent.java +++ b/common/queue/src/main/java/org/thingsboard/server/queue/util/TbLwM2mTransportComponent.java @@ -21,6 +21,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.RUNTIME) -@ConditionalOnExpression("('${service.type:null}'=='tb-transport' && '${transport.lwm2m.enabled:false}'=='true' ) || ('${service.type:null}'=='monolith' && '${transport.lwm2m.enabled}'=='true')") +@ConditionalOnExpression("('${service.type:null}'=='tb-transport' && '${transport.lwm2m.enabled:false}'=='true') || ('${service.type:null}'=='monolith' && '${transport.lwm2m.enabled}'=='true')") public @interface TbLwM2mTransportComponent { } diff --git a/common/queue/src/main/proto/queue.proto b/common/queue/src/main/proto/queue.proto index b9fd492ccf..2b40259238 100644 --- a/common/queue/src/main/proto/queue.proto +++ b/common/queue/src/main/proto/queue.proto @@ -201,6 +201,17 @@ message LwM2MResponseMsg { LwM2MRegistrationResponseMsg registrationMsg = 1; } +message GetResourceRequestMsg { + int64 tenantIdMSB = 1; + int64 tenantIdLSB = 2; + string resourceType = 3; + string resourceId = 4; +} + +message GetResourceResponseMsg { + bytes resource = 1; +} + message ValidateDeviceLwM2MCredentialsRequestMsg { string credentialsId = 1; } @@ -242,6 +253,20 @@ message EntityDeleteMsg { int64 entityIdLSB = 3; } +message ResourceUpdateMsg { + int64 tenantIdMSB = 1; + int64 tenantIdLSB = 2; + string resourceType = 3; + string resourceId = 4; +} + +message ResourceDeleteMsg { + int64 tenantIdMSB = 1; + int64 tenantIdLSB = 2; + string resourceType = 3; + string resourceId = 4; +} + message SessionCloseNotificationProto { string message = 1; } @@ -540,6 +565,7 @@ message TransportApiRequestMsg { ValidateBasicMqttCredRequestMsg validateBasicMqttCredRequestMsg = 6; ProvisionDeviceRequestMsg provisionDeviceRequestMsg = 7; ValidateDeviceLwM2MCredentialsRequestMsg validateDeviceLwM2MCredentialsRequestMsg = 8; + GetResourceRequestMsg resourceRequestMsg = 9; } /* Response from ThingsBoard Core Service to Transport Service */ @@ -549,6 +575,7 @@ message TransportApiResponseMsg { GetEntityProfileResponseMsg entityProfileResponseMsg = 3; ProvisionDeviceResponseMsg provisionDeviceResponseMsg = 4; LwM2MResponseMsg lwM2MResponseMsg = 6; + GetResourceResponseMsg resourceResponseMsg = 7; } /* Messages that are handled by ThingsBoard Core Service */ @@ -595,6 +622,8 @@ message ToTransportMsg { EntityDeleteMsg entityDeleteMsg = 9; ProvisionDeviceResponseMsg provisionResponse = 10; ToTransportUpdateCredentialsProto toTransportUpdateCredentialsNotification = 11; + ResourceUpdateMsg resourceUpdateMsg = 12; + ResourceDeleteMsg resourceDeleteMsg = 13; } message UsageStatsKVProto{ diff --git a/common/transport/http/src/main/java/org/thingsboard/server/transport/http/HttpTransportContext.java b/common/transport/http/src/main/java/org/thingsboard/server/transport/http/HttpTransportContext.java index aad01c7c2f..13f38bfc80 100644 --- a/common/transport/http/src/main/java/org/thingsboard/server/transport/http/HttpTransportContext.java +++ b/common/transport/http/src/main/java/org/thingsboard/server/transport/http/HttpTransportContext.java @@ -17,9 +17,13 @@ package org.thingsboard.server.transport.http; import lombok.Getter; import lombok.extern.slf4j.Slf4j; +import org.apache.coyote.ProtocolHandler; +import org.apache.coyote.http11.Http11NioProtocol; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; +import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; import org.thingsboard.server.common.transport.TransportContext; @@ -37,4 +41,18 @@ public class HttpTransportContext extends TransportContext { @Value("${transport.http.request_timeout}") private long defaultTimeout; + @Getter + @Value("${transport.http.max_request_timeout}") + private long maxRequestTimeout; + + @Bean + public TomcatConnectorCustomizer tomcatAsyncTimeoutConnectorCustomizer() { + return connector -> { + ProtocolHandler handler = connector.getProtocolHandler(); + if (handler instanceof Http11NioProtocol) { + log.trace("Setting async max request timeout {}", maxRequestTimeout); + connector.setAsyncTimeout(maxRequestTimeout); + } + }; + } } diff --git a/common/transport/lwm2m/pom.xml b/common/transport/lwm2m/pom.xml index ee3d5fc759..fe19dae329 100644 --- a/common/transport/lwm2m/pom.xml +++ b/common/transport/lwm2m/pom.xml @@ -14,24 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. ---> - - diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/bootstrap/LwM2MTransportBootstrapServerConfiguration.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/bootstrap/LwM2MTransportBootstrapServerConfiguration.java index 757b91956b..e531de3628 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/bootstrap/LwM2MTransportBootstrapServerConfiguration.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/bootstrap/LwM2MTransportBootstrapServerConfiguration.java @@ -17,7 +17,6 @@ package org.thingsboard.server.transport.lwm2m.bootstrap; import lombok.extern.slf4j.Slf4j; import org.eclipse.californium.scandium.config.DtlsConnectorConfig; -import org.eclipse.leshan.core.model.StaticModel; import org.eclipse.leshan.core.util.Hex; import org.eclipse.leshan.server.bootstrap.BootstrapSessionManager; import org.eclipse.leshan.server.californium.bootstrap.LeshanBootstrapServer; @@ -94,7 +93,7 @@ public class LwM2MTransportBootstrapServerConfiguration { builder.setCoapConfig(getCoapConfig(bootstrapPortNoSec, bootstrapSecurePort)); /** Define model provider (Create Models )*/ - builder.setModel(new StaticModel(contextS.getLwM2MTransportConfigServer().getModelsValue())); +// builder.setModel(new StaticModel(contextS.getLwM2MTransportConfigServer().getModelsValueCommon())); /** Create credentials */ this.setServerWithCredentials(builder); diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mServerListener.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mServerListener.java index 933b3865a8..f89f7ec952 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mServerListener.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mServerListener.java @@ -18,7 +18,6 @@ package org.thingsboard.server.transport.lwm2m.server; import lombok.extern.slf4j.Slf4j; import org.eclipse.leshan.core.observation.Observation; import org.eclipse.leshan.core.response.ObserveResponse; -import org.eclipse.leshan.server.californium.LeshanServer; import org.eclipse.leshan.server.observation.ObservationListener; import org.eclipse.leshan.server.queue.PresenceListener; import org.eclipse.leshan.server.registration.Registration; @@ -30,11 +29,9 @@ import java.util.Collection; @Slf4j public class LwM2mServerListener { - private final LeshanServer lhServer; private final LwM2mTransportServiceImpl service; - public LwM2mServerListener(LeshanServer lhServer, LwM2mTransportServiceImpl service) { - this.lhServer = lhServer; + public LwM2mServerListener(LwM2mTransportServiceImpl service) { this.service = service; } @@ -45,7 +42,7 @@ public class LwM2mServerListener { @Override public void registered(Registration registration, Registration previousReg, Collection previousObservations) { - service.onRegistered(lhServer, registration, previousObservations); + service.onRegistered(registration, previousObservations); } /** @@ -54,7 +51,7 @@ public class LwM2mServerListener { @Override public void updated(RegistrationUpdate update, Registration updatedRegistration, Registration previousRegistration) { - service.updatedReg(lhServer, updatedRegistration); + service.updatedReg(updatedRegistration); } /** @@ -63,7 +60,7 @@ public class LwM2mServerListener { @Override public void unregistered(Registration registration, Collection observations, boolean expired, Registration newReg) { - service.unReg(lhServer, registration, observations); + service.unReg(registration, observations); } }; diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportContextServer.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportContextServer.java index 062c0f1148..2fffd17a4c 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportContextServer.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportContextServer.java @@ -16,13 +16,13 @@ package org.thingsboard.server.transport.lwm2m.server; /** * Copyright © 2016-2020 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. @@ -34,16 +34,27 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import lombok.Getter; import lombok.extern.slf4j.Slf4j; +import org.eclipse.leshan.core.model.DDFFileParser; +import org.eclipse.leshan.core.model.DefaultDDFFileValidator; +import org.eclipse.leshan.core.model.InvalidDDFFileException; +import org.eclipse.leshan.core.model.ObjectModel; import org.springframework.stereotype.Component; import org.thingsboard.server.common.transport.TransportContext; +import org.thingsboard.server.common.transport.TransportResourceCache; import org.thingsboard.server.common.transport.TransportService; import org.thingsboard.server.common.transport.TransportServiceCallback; import org.thingsboard.server.common.transport.adaptor.AdaptorException; import org.thingsboard.server.common.transport.lwm2m.LwM2MTransportConfigServer; -import org.thingsboard.server.gen.transport.TransportProtos; +import org.thingsboard.server.gen.transport.TransportProtos.PostAttributeMsg; +import org.thingsboard.server.gen.transport.TransportProtos.PostTelemetryMsg; +import org.thingsboard.server.gen.transport.TransportProtos.SessionInfoProto; +import org.thingsboard.server.gen.transport.TransportProtos.ValidateDeviceCredentialsResponseMsg; import org.thingsboard.server.queue.util.TbLwM2mTransportComponent; import org.thingsboard.server.transport.lwm2m.server.adaptors.LwM2MJsonAdaptor; +import java.io.ByteArrayInputStream; +import java.io.IOException; + import static org.thingsboard.server.transport.lwm2m.server.LwM2mTransportHandler.LOG_LW2M_TELEMETRY; @Slf4j @@ -56,12 +67,16 @@ public class LwM2mTransportContextServer extends TransportContext { private final TransportService transportService; + private final TransportResourceCache transportResourceCache; + + @Getter private final LwM2MJsonAdaptor adaptor; - public LwM2mTransportContextServer(LwM2MTransportConfigServer lwM2MTransportConfigServer, TransportService transportService, LwM2MJsonAdaptor adaptor) { + public LwM2mTransportContextServer(LwM2MTransportConfigServer lwM2MTransportConfigServer, TransportService transportService, TransportResourceCache transportResourceCache, LwM2MJsonAdaptor adaptor) { this.lwM2MTransportConfigServer = lwM2MTransportConfigServer; this.transportService = transportService; + this.transportResourceCache = transportResourceCache; this.adaptor = adaptor; } @@ -69,6 +84,10 @@ public class LwM2mTransportContextServer extends TransportContext { return this.lwM2MTransportConfigServer; } + public TransportResourceCache getTransportResourceCache() { + return this.transportResourceCache; + } + /** * Sent to Thingsboard Attribute || Telemetry * @@ -89,14 +108,14 @@ public class LwM2mTransportContextServer extends TransportContext { }; } - public void sentParametersOnThingsboard(JsonElement msg, String topicName, TransportProtos.SessionInfoProto sessionInfo) { + public void sentParametersOnThingsboard(JsonElement msg, String topicName, SessionInfoProto sessionInfo) { try { if (topicName.equals(LwM2mTransportHandler.DEVICE_ATTRIBUTES_TOPIC)) { - TransportProtos.PostAttributeMsg postAttributeMsg = adaptor.convertToPostAttributes(msg); + PostAttributeMsg postAttributeMsg = adaptor.convertToPostAttributes(msg); TransportServiceCallback call = this.getPubAckCallbackSentAttrTelemetry(postAttributeMsg); transportService.process(sessionInfo, postAttributeMsg, this.getPubAckCallbackSentAttrTelemetry(call)); } else if (topicName.equals(LwM2mTransportHandler.DEVICE_TELEMETRY_TOPIC)) { - TransportProtos.PostTelemetryMsg postTelemetryMsg = adaptor.convertToPostTelemetry(msg); + PostTelemetryMsg postTelemetryMsg = adaptor.convertToPostTelemetry(msg); TransportServiceCallback call = this.getPubAckCallbackSentAttrTelemetry(postTelemetryMsg); transportService.process(sessionInfo, postTelemetryMsg, this.getPubAckCallbackSentAttrTelemetry(call)); } @@ -115,8 +134,8 @@ public class LwM2mTransportContextServer extends TransportContext { /** * @return - sessionInfo after access connect client */ - public TransportProtos.SessionInfoProto getValidateSessionInfo(TransportProtos.ValidateDeviceCredentialsResponseMsg msg, long mostSignificantBits, long leastSignificantBits) { - return TransportProtos.SessionInfoProto.newBuilder() + public SessionInfoProto getValidateSessionInfo(ValidateDeviceCredentialsResponseMsg msg, long mostSignificantBits, long leastSignificantBits) { + return SessionInfoProto.newBuilder() .setNodeId(this.getNodeId()) .setSessionIdMSB(mostSignificantBits) .setSessionIdLSB(leastSignificantBits) @@ -131,4 +150,13 @@ public class LwM2mTransportContextServer extends TransportContext { .build(); } + public ObjectModel parseFromXmlToObjectModel(byte[] xmlByte, String streamName, DefaultDDFFileValidator ddfValidator) { + try { + DDFFileParser ddfFileParser = new DDFFileParser(ddfValidator); + return ddfFileParser.parseEx(new ByteArrayInputStream(xmlByte), streamName).get(0); + } catch (IOException | InvalidDDFFileException e) { + log.error("Could not parse the XML file [{}]", streamName, e); + return null; + } + } } diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportHandler.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportHandler.java index 8d660b3c22..5b6ec23a6e 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportHandler.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportHandler.java @@ -35,9 +35,10 @@ import org.eclipse.leshan.server.californium.LeshanServerBuilder; import org.nustaq.serialization.FSTConfiguration; import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.device.profile.Lwm2mDeviceProfileTransportConfiguration; +import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.transport.TransportServiceCallback; -import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClientProfile; import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient; +import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClientProfile; import java.io.File; import java.io.IOException; @@ -188,8 +189,9 @@ public class LwM2mTransportHandler { return null; } - public static LwM2mClientProfile getNewProfileParameters(JsonObject profilesConfigData) { + public static LwM2mClientProfile getNewProfileParameters(JsonObject profilesConfigData, TenantId tenantId) { LwM2mClientProfile lwM2MClientProfile = new LwM2mClientProfile(); + lwM2MClientProfile.setTenantId(tenantId); lwM2MClientProfile.setPostClientLwM2mSettings(profilesConfigData.get(CLIENT_LWM2M_SETTINGS).getAsJsonObject()); lwM2MClientProfile.setPostKeyNameProfile(profilesConfigData.get(OBSERVE_ATTRIBUTE_TELEMETRY).getAsJsonObject().get(KEY_NAME).getAsJsonObject()); lwM2MClientProfile.setPostAttributeProfile(profilesConfigData.get(OBSERVE_ATTRIBUTE_TELEMETRY).getAsJsonObject().get(ATTRIBUTE).getAsJsonArray()); @@ -221,7 +223,7 @@ public class LwM2mTransportHandler { ObjectMapper mapper = new ObjectMapper(); String profileStr = mapper.writeValueAsString(profile); JsonObject profileJson = (profileStr != null) ? validateJson(profileStr) : null; - return (getValidateCredentialsBodyFromThingsboard(profileJson)) ? LwM2mTransportHandler.getNewProfileParameters(profileJson) : null; + return (getValidateCredentialsBodyFromThingsboard(profileJson)) ? LwM2mTransportHandler.getNewProfileParameters(profileJson, deviceProfile.getTenantId()) : null; } catch (IOException e) { log.error("", e); } @@ -244,11 +246,6 @@ public class LwM2mTransportHandler { return null; } - public static boolean getClientUpdateValueAfterConnect (LwM2mClientProfile profile) { - return profile.getPostClientLwM2mSettings().getAsJsonObject().has("clientUpdateValueAfterConnect") && - profile.getPostClientLwM2mSettings().getAsJsonObject().get("clientUpdateValueAfterConnect").getAsBoolean(); - } - public static boolean getClientOnlyObserveAfterConnect (LwM2mClientProfile profile) { return profile.getPostClientLwM2mSettings().getAsJsonObject().has("clientOnlyObserveAfterConnect") && profile.getPostClientLwM2mSettings().getAsJsonObject().get("clientOnlyObserveAfterConnect").getAsBoolean(); diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportRequest.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportRequest.java index c58d2c35e0..fa7f0d68b8 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportRequest.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportRequest.java @@ -47,7 +47,6 @@ import org.eclipse.leshan.core.util.Hex; import org.eclipse.leshan.core.util.NamedThreadFactory; import org.eclipse.leshan.server.californium.LeshanServer; import org.eclipse.leshan.server.registration.Registration; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.thingsboard.server.queue.util.TbLwM2mTransportComponent; import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClient; @@ -55,10 +54,7 @@ import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClientContext; import org.thingsboard.server.transport.lwm2m.utils.LwM2mValueConverterImpl; import javax.annotation.PostConstruct; -import java.util.ArrayList; -import java.util.Collection; import java.util.Date; -import java.util.Iterator; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -78,21 +74,27 @@ import static org.thingsboard.server.transport.lwm2m.server.LwM2mTransportHandle import static org.thingsboard.server.transport.lwm2m.server.LwM2mTransportHandler.RESPONSE_CHANNEL; @Slf4j -@Service("LwM2mTransportRequest") +@Service @TbLwM2mTransportComponent public class LwM2mTransportRequest { private ExecutorService executorResponse; private LwM2mValueConverterImpl converter; - @Autowired - private LwM2mTransportServiceImpl service; + private final LwM2mTransportContextServer context; - @Autowired - private LwM2mTransportContextServer context; + private final LwM2mClientContext lwM2mClientContext; - @Autowired - private LwM2mClientContext lwM2mClientContext; + private final LeshanServer leshanServer; + + private final LwM2mTransportServiceImpl serviceImpl; + + public LwM2mTransportRequest(LwM2mTransportContextServer context, LwM2mClientContext lwM2mClientContext, LeshanServer leshanServer, LwM2mTransportServiceImpl serviceImpl) { + this.context = context; + this.lwM2mClientContext = lwM2mClientContext; + this.leshanServer = leshanServer; + this.serviceImpl = serviceImpl; + } @PostConstruct public void init() { @@ -101,32 +103,22 @@ public class LwM2mTransportRequest { new NamedThreadFactory(String.format("LwM2M %s channel response", RESPONSE_CHANNEL))); } - public Collection doGetRegistrations(LeshanServer lwServer) { - Collection registrations = new ArrayList<>(); - for (Iterator iterator = lwServer.getRegistrationService().getAllRegistrations(); iterator - .hasNext(); ) { - registrations.add(iterator.next()); - } - return registrations; - } - /** * Device management and service enablement, including Read, Write, Execute, Discover, Create, Delete and Write-Attributes * - * @param lwServer - * @param registration - * @param target - * @param typeOper - * @param contentFormatParam - * @param observation - */ - public void sendAllRequest(LeshanServer lwServer, Registration registration, String target, String typeOper, + public void sendAllRequest(Registration registration, String target, String typeOper, String contentFormatParam, Observation observation, Object params, long timeoutInMs) { LwM2mPath resultIds = new LwM2mPath(target); if (registration != null && resultIds.getObjectId() >= 0) { DownlinkRequest request = null; ContentFormat contentFormat = contentFormatParam != null ? ContentFormat.fromName(contentFormatParam.toUpperCase()) : null; - ResourceModel resource = service.context.getLwM2MTransportConfigServer().getResourceModel(registration, resultIds); + ResourceModel resource = serviceImpl.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getResourceModel(registration, resultIds); timeoutInMs = timeoutInMs > 0 ? timeoutInMs : DEFAULT_TIMEOUT; switch (typeOper) { case GET_TYPE_OPER_READ: @@ -156,7 +148,7 @@ public class LwM2mTransportRequest { break; case POST_TYPE_OPER_WRITE_REPLACE: // Request to write a String Single-Instance Resource using the TLV content format. - if (resource != null) { + if (resource != null && contentFormat != null) { if (contentFormat.equals(ContentFormat.TLV) && !resource.multiple) { request = this.getWriteRequestSingleResource(null, resultIds.getObjectId(), resultIds.getObjectInstanceId(), resultIds.getResourceId(), params, resource.type, registration); } @@ -168,8 +160,8 @@ public class LwM2mTransportRequest { break; case PUT_TYPE_OPER_WRITE_UPDATE: if (resultIds.getResourceId() >= 0) { - ResourceModel resourceModel = lwServer.getModelProvider().getObjectModel(registration).getObjectModel(resultIds.getObjectId()).resources.get(resultIds.getResourceId()); - ResourceModel.Type typeRes = resourceModel.type; +// ResourceModel resourceModel = leshanServer.getModelProvider().getObjectModel(registration).getObjectModel(resultIds.getObjectId()).resources.get(resultIds.getResourceId()); +// ResourceModel.Type typeRes = resourceModel.type; LwM2mNode node = LwM2mSingleResource.newStringResource(resultIds.getResourceId(), (String) this.converter.convertValue(params, resource.type, ResourceModel.Type.STRING, resultIds)); request = new WriteRequest(WriteRequest.Mode.UPDATE, contentFormat, target, node); } @@ -206,7 +198,7 @@ public class LwM2mTransportRequest { * Attribute pmax = new Attribute(MAXIMUM_PERIOD, "60"); * Attribute [] attrs = {gt, st}; */ - Attribute pmin = new Attribute(MINIMUM_PERIOD, Integer.toUnsignedLong(Integer.valueOf("1"))); + Attribute pmin = new Attribute(MINIMUM_PERIOD, Integer.toUnsignedLong(Integer.parseInt("1"))); Attribute[] attrs = {pmin}; AttributeSet attrSet = new AttributeSet(attrs); if (resultIds.isResource()) { @@ -221,25 +213,25 @@ public class LwM2mTransportRequest { } if (request != null) { - this.sendRequest(lwServer, registration, request, timeoutInMs); + this.sendRequest(registration, request, timeoutInMs); } } } /** * - * @param lwServer - * @param registration - * @param request - * @param timeoutInMs - */ @SuppressWarnings("unchecked") - private void sendRequest(LeshanServer lwServer, Registration registration, DownlinkRequest request, long timeoutInMs) { + private void sendRequest(Registration registration, DownlinkRequest request, long timeoutInMs) { LwM2mClient lwM2MClient = lwM2mClientContext.getLwM2mClientWithReg(registration, null); - lwServer.send(registration, request, timeoutInMs, (ResponseCallback) response -> { + leshanServer.send(registration, request, timeoutInMs, (ResponseCallback) response -> { + if (!lwM2MClient.isInit()) { - lwM2MClient.initValue(this.service, request.getPath().toString()); + lwM2MClient.initValue(this.serviceImpl, request.getPath().toString()); } if (isSuccess(((Response) response.getCoapResponse()).getCode())) { this.handleResponse(registration, request.getPath().toString(), response, request); @@ -247,23 +239,23 @@ public class LwM2mTransportRequest { String msg = String.format("%s: sendRequest Replace: CoapCde - %s Lwm2m code - %d name - %s Resource path - %s value - %s SendRequest to Client", LOG_LW2M_INFO, ((Response) response.getCoapResponse()).getCode(), response.getCode().getCode(), response.getCode().getName(), request.getPath().toString(), ((LwM2mSingleResource) ((WriteRequest) request).getNode()).getValue().toString()); - service.sentLogsToThingsboard(msg, registration); + serviceImpl.sentLogsToThingsboard(msg, registration); log.info("[{}] [{}] - [{}] [{}] Update SendRequest[{}]", registration.getEndpoint(), ((Response) response.getCoapResponse()).getCode(), response.getCode(), request.getPath().toString(), ((LwM2mSingleResource) ((WriteRequest) request).getNode()).getValue()); } } else { String msg = String.format("%s: sendRequest: CoapCode - %s Lwm2m code - %d name - %s Resource path - %s SendRequest to Client", LOG_LW2M_ERROR, ((Response) response.getCoapResponse()).getCode(), response.getCode().getCode(), response.getCode().getName(), request.getPath().toString()); - service.sentLogsToThingsboard(msg, registration); - log.error("[{}] - [{}] [{}] error SendRequest", ((Response) response.getCoapResponse()).getCode(), response.getCode(), request.getPath().toString()); + serviceImpl.sentLogsToThingsboard(msg, registration); + log.error("[{}], [{}] - [{}] [{}] error SendRequest", registration.getEndpoint(), ((Response) response.getCoapResponse()).getCode(), response.getCode(), request.getPath().toString()); } }, e -> { if (!lwM2MClient.isInit()) { - lwM2MClient.initValue(this.service, request.getPath().toString()); + lwM2MClient.initValue(this.serviceImpl, request.getPath().toString()); } String msg = String.format("%s: sendRequest: Resource path - %s msg error - %s SendRequest to Client", LOG_LW2M_ERROR, request.getPath().toString(), e.toString()); - service.sentLogsToThingsboard(msg, registration); + serviceImpl.sentLogsToThingsboard(msg, registration); log.error("[{}] - [{}] error SendRequest", request.getPath().toString(), e.toString()); }); @@ -275,15 +267,17 @@ public class LwM2mTransportRequest { case STRING: // String return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, value.toString()) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, value.toString()); case INTEGER: // Long - return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, Integer.toUnsignedLong(Integer.valueOf(value.toString()))) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, Integer.toUnsignedLong(Integer.valueOf(value.toString()))); + final long valueInt = Integer.toUnsignedLong(Integer.parseInt(value.toString())); + return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, valueInt) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, valueInt); case OBJLNK: // ObjectLink return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, ObjectLink.fromPath(value.toString())) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, ObjectLink.fromPath(value.toString())); case BOOLEAN: // Boolean - return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, Boolean.valueOf(value.toString())) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, Boolean.valueOf(value.toString())); + return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, Boolean.parseBoolean(value.toString())) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, Boolean.parseBoolean(value.toString())); case FLOAT: // Double - return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, Double.valueOf(value.toString())) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, Double.valueOf(value.toString())); + return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, Double.parseDouble(value.toString())) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, Double.parseDouble(value.toString())); case TIME: // Date - return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, new Date(Long.decode(value.toString()))) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, new Date((Long) Integer.toUnsignedLong(Integer.valueOf(value.toString())))); + Date date = new Date(Long.decode(value.toString())); + return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, date) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, date); case OPAQUE: // byte[] value, base64 return (contentFormat == null) ? new WriteRequest(objectId, instanceId, resourceId, Hex.decodeHex(value.toString().toCharArray())) : new WriteRequest(contentFormat, objectId, instanceId, resourceId, Hex.decodeHex(value.toString().toCharArray())); default: @@ -293,7 +287,7 @@ public class LwM2mTransportRequest { String patn = "/" + objectId + "/" + instanceId + "/" + resourceId; String msg = String.format(LOG_LW2M_ERROR + ": NumberFormatException: Resource path - %s type - %s value - %s msg error - %s SendRequest to Client", patn, type, value, e.toString()); - service.sentLogsToThingsboard(msg, registration); + serviceImpl.sentLogsToThingsboard(msg, registration); log.error("Path: [{}] type: [{}] value: [{}] errorMsg: [{}]]", patn, type, value, e.toString()); return null; } @@ -317,7 +311,7 @@ public class LwM2mTransportRequest { */ private void sendResponse(Registration registration, String path, LwM2mResponse response, DownlinkRequest request) { if (response instanceof ReadResponse) { - service.onObservationResponse(registration, path, (ReadResponse) response); + serviceImpl.onObservationResponse(registration, path, (ReadResponse) response); } else if (response instanceof CancelObservationResponse) { log.info("[{}] Path [{}] CancelObservationResponse 3_Send", path, response); } else if (response instanceof DeleteResponse) { @@ -330,7 +324,7 @@ public class LwM2mTransportRequest { log.info("[{}] Path [{}] WriteAttributesResponse 8_Send", path, response); } else if (response instanceof WriteResponse) { log.info("[{}] Path [{}] WriteAttributesResponse 9_Send", path, response); - service.onWriteResponseOk(registration, path, (WriteRequest) request); + serviceImpl.onWriteResponseOk(registration, path, (WriteRequest) request); } } } diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServerConfiguration.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServerConfiguration.java index ace2fb4896..0af20b3e51 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServerConfiguration.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServerConfiguration.java @@ -24,14 +24,13 @@ import org.eclipse.leshan.server.californium.LeshanServer; import org.eclipse.leshan.server.californium.LeshanServerBuilder; import org.eclipse.leshan.server.californium.registration.CaliforniumRegistrationStore; import org.eclipse.leshan.server.model.LwM2mModelProvider; -import org.eclipse.leshan.server.model.VersionedModelProvider; import org.eclipse.leshan.server.security.DefaultAuthorizer; import org.eclipse.leshan.server.security.EditableSecurityStore; import org.eclipse.leshan.server.security.SecurityChecker; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.stereotype.Component; import org.thingsboard.server.queue.util.TbLwM2mTransportComponent; +import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClientContext; import org.thingsboard.server.transport.lwm2m.utils.LwM2mValueConverterImpl; import java.math.BigInteger; @@ -61,21 +60,23 @@ import static org.eclipse.californium.scandium.dtls.cipher.CipherSuite.TLS_PSK_W import static org.thingsboard.server.transport.lwm2m.server.LwM2mTransportHandler.getCoapConfig; @Slf4j -@Component("LwM2MTransportServerConfiguration") +@Component @TbLwM2mTransportComponent public class LwM2mTransportServerConfiguration { private PublicKey publicKey; private PrivateKey privateKey; private boolean pskMode = false; + private final LwM2mTransportContextServer context; + private final CaliforniumRegistrationStore registrationStore; + private final EditableSecurityStore securityStore; + private final LwM2mClientContext lwM2mClientContext; - @Autowired - private LwM2mTransportContextServer context; - - @Autowired - private CaliforniumRegistrationStore registrationStore; - - @Autowired - private EditableSecurityStore securityStore; + public LwM2mTransportServerConfiguration(LwM2mTransportContextServer context, CaliforniumRegistrationStore registrationStore, EditableSecurityStore securityStore, LwM2mClientContext lwM2mClientContext) { + this.context = context; + this.registrationStore = registrationStore; + this.securityStore = securityStore; + this.lwM2mClientContext = lwM2mClientContext; + } @Bean public LeshanServer getLeshanServer() { @@ -95,7 +96,8 @@ public class LwM2mTransportServerConfiguration { builder.setCoapConfig(getCoapConfig(serverPortNoSec, serverSecurePort)); /** Define model provider (Create Models )*/ - LwM2mModelProvider modelProvider = new VersionedModelProvider(this.context.getLwM2MTransportConfigServer().getModelsValue()); + LwM2mModelProvider modelProvider = new LwM2mVersionedModelProvider(this.lwM2mClientContext, this.context); + this.context.getLwM2MTransportConfigServer().setModelProvider(modelProvider); builder.setObjectModelProvider(modelProvider); /** Create credentials */ diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServerInitializer.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServerInitializer.java index 9c8d62f1e0..4fad90910a 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServerInitializer.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServerInitializer.java @@ -33,7 +33,7 @@ public class LwM2mTransportServerInitializer { @Autowired private LwM2mTransportServiceImpl service; - @Autowired(required = false) + @Autowired private LeshanServer leshanServer; @Autowired @@ -49,7 +49,7 @@ public class LwM2mTransportServerInitializer { private void startLhServer() { this.leshanServer.start(); - LwM2mServerListener lhServerCertListener = new LwM2mServerListener(this.leshanServer, service); + LwM2mServerListener lhServerCertListener = new LwM2mServerListener(service); this.leshanServer.getRegistrationService().addListener(lhServerCertListener.registrationListener); this.leshanServer.getPresenceService().addListener(lhServerCertListener.presenceListener); this.leshanServer.getObservationService().addListener(lhServerCertListener.observationListener); diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportService.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportService.java index 46c9cf5e64..8d1aff37b5 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportService.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportService.java @@ -17,7 +17,6 @@ package org.thingsboard.server.transport.lwm2m.server; import org.eclipse.leshan.core.observation.Observation; import org.eclipse.leshan.core.response.ReadResponse; -import org.eclipse.leshan.server.californium.LeshanServer; import org.eclipse.leshan.server.registration.Registration; import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.DeviceProfile; @@ -28,17 +27,17 @@ import java.util.Optional; public interface LwM2mTransportService { - void onRegistered(LeshanServer lwServer, Registration registration, Collection previousObsersations); + void onRegistered(Registration registration, Collection previousObsersations); - void updatedReg(LeshanServer lwServer, Registration registration); + void updatedReg(Registration registration); - void unReg(LeshanServer lwServer, Registration registration, Collection observations); + void unReg(Registration registration, Collection observations); void onSleepingDev(Registration registration); - void setCancelObservations(LeshanServer lwServer, Registration registration); + void setCancelObservations(Registration registration); - void setCancelObservationRecourse(LeshanServer lwServer, Registration registration, String path); + void setCancelObservationRecourse(Registration registration, String path); void onObservationResponse(Registration registration, String path, ReadResponse response); @@ -48,7 +47,7 @@ public interface LwM2mTransportService { void onDeviceUpdate(TransportProtos.SessionInfoProto sessionInfo, Device device, Optional deviceProfileOpt); - void doTrigger(LeshanServer lwServer, Registration registration, String path); + void doTrigger(Registration registration, String path); void doDisconnect(TransportProtos.SessionInfoProto sessionInfo); diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServiceImpl.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServiceImpl.java index 87a7fcbc07..1af4e8bfd8 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServiceImpl.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mTransportServiceImpl.java @@ -16,7 +16,7 @@ package org.thingsboard.server.transport.lwm2m.server; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.Sets; import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; @@ -35,8 +35,9 @@ import org.eclipse.leshan.core.response.ReadResponse; import org.eclipse.leshan.core.util.NamedThreadFactory; import org.eclipse.leshan.server.californium.LeshanServer; import org.eclipse.leshan.server.registration.Registration; -import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; +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.transport.TransportService; @@ -56,7 +57,6 @@ import org.thingsboard.server.transport.lwm2m.server.client.ResultsAnalyzerParam import org.thingsboard.server.transport.lwm2m.utils.LwM2mValueConverterImpl; import javax.annotation.PostConstruct; -import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -105,29 +105,32 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { protected final ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); protected final Lock writeLock = readWriteLock.writeLock(); - @Autowired - private TransportService transportService; + private final TransportService transportService; - @Autowired - public LwM2mTransportContextServer context; + public final LwM2mTransportContextServer lwM2mTransportContextServer; - @Autowired - private LwM2mTransportRequest lwM2mTransportRequest; + private final LwM2mClientContext lwM2mClientContext; - @Autowired - private LwM2mClientContext lwM2mClientContext; + private final LeshanServer leshanServer; - @Autowired(required = false) - private LeshanServer leshanServer; + private final LwM2mTransportRequest lwM2mTransportRequest; + + public LwM2mTransportServiceImpl(TransportService transportService, LwM2mTransportContextServer lwM2mTransportContextServer, LwM2mClientContext lwM2mClientContext, LeshanServer leshanServer, @Lazy LwM2mTransportRequest lwM2mTransportRequest) { + this.transportService = transportService; + this.lwM2mTransportContextServer = lwM2mTransportContextServer; + this.lwM2mClientContext = lwM2mClientContext; + this.leshanServer = leshanServer; + this.lwM2mTransportRequest = lwM2mTransportRequest; + } @PostConstruct public void init() { - this.context.getScheduler().scheduleAtFixedRate(this::checkInactivityAndReportActivity, new Random().nextInt((int) context.getLwM2MTransportConfigServer().getSessionReportTimeout()), context.getLwM2MTransportConfigServer().getSessionReportTimeout(), TimeUnit.MILLISECONDS); - this.executorRegistered = Executors.newFixedThreadPool(this.context.getLwM2MTransportConfigServer().getRegisteredPoolSize(), + this.lwM2mTransportContextServer.getScheduler().scheduleAtFixedRate(this::checkInactivityAndReportActivity, new Random().nextInt((int) lwM2mTransportContextServer.getLwM2MTransportConfigServer().getSessionReportTimeout()), lwM2mTransportContextServer.getLwM2MTransportConfigServer().getSessionReportTimeout(), TimeUnit.MILLISECONDS); + this.executorRegistered = Executors.newFixedThreadPool(this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getRegisteredPoolSize(), new NamedThreadFactory(String.format("LwM2M %s channel registered", SERVICE_CHANNEL))); - this.executorUpdateRegistered = Executors.newFixedThreadPool(this.context.getLwM2MTransportConfigServer().getUpdateRegisteredPoolSize(), + this.executorUpdateRegistered = Executors.newFixedThreadPool(this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getUpdateRegisteredPoolSize(), new NamedThreadFactory(String.format("LwM2M %s channel update registered", SERVICE_CHANNEL))); - this.executorUnRegistered = Executors.newFixedThreadPool(this.context.getLwM2MTransportConfigServer().getUnRegisteredPoolSize(), + this.executorUnRegistered = Executors.newFixedThreadPool(this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getUnRegisteredPoolSize(), new NamedThreadFactory(String.format("LwM2M %s channel un registered", SERVICE_CHANNEL))); this.converter = LwM2mValueConverterImpl.getInstance(); } @@ -143,17 +146,15 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { * 1.2 Remove from sessions Model by enpPoint * Next -> Create new LwM2MClient for current session -> setModelClient... * - * @param lwServer - LeshanServer * @param registration - Registration LwM2M Client * @param previousObsersations - may be null */ - public void onRegistered(LeshanServer lwServer, Registration registration, Collection previousObsersations) { + public void onRegistered(Registration registration, Collection previousObsersations) { executorRegistered.submit(() -> { try { log.warn("[{}] [{{}] Client: create after Registration", registration.getEndpoint(), registration.getId()); LwM2mClient lwM2MClient = this.lwM2mClientContext.updateInSessionsLwM2MClient(registration); if (lwM2MClient != null) { - this.sentLogsToThingsboard(LOG_LW2M_INFO + ": Client Registered", registration); SessionInfoProto sessionInfo = this.getValidateSessionInfo(registration); if (sessionInfo != null) { lwM2MClient.setDeviceId(new UUID(sessionInfo.getDeviceIdMSB(), sessionInfo.getDeviceIdLSB())); @@ -163,9 +164,8 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { transportService.registerAsyncSession(sessionInfo, new LwM2mSessionMsgListener(this, sessionInfo)); transportService.process(sessionInfo, DefaultTransportService.getSessionEventMsg(SessionEvent.OPEN), null); transportService.process(sessionInfo, TransportProtos.SubscribeToAttributeUpdatesMsg.newBuilder().build(), null); - this.sentLogsToThingsboard(LOG_LW2M_INFO + ": Client create after Registration", registration); - this.initLwM2mFromClientValue(lwServer, registration, lwM2MClient); - + this.sentLogsToThingsboard(LOG_LW2M_INFO + ": Client create after Registration", registration); + this.initLwM2mFromClientValue(registration, lwM2MClient); } else { log.error("Client: [{}] onRegistered [{}] name [{}] sessionInfo ", registration.getId(), registration.getEndpoint(), null); } @@ -181,10 +181,9 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { /** * if sessionInfo removed from sessions, then new registerAsyncSession * - * @param lwServer - LeshanServer * @param registration - Registration LwM2M Client */ - public void updatedReg(LeshanServer lwServer, Registration registration) { + public void updatedReg(Registration registration) { executorUpdateRegistered.submit(() -> { try { SessionInfoProto sessionInfo = this.getValidateSessionInfo(registration); @@ -205,10 +204,10 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { * @param observations - All paths observations before unReg * !!! Warn: if have not finishing unReg, then this operation will be finished on next Client`s connect */ - public void unReg(LeshanServer lwServer, Registration registration, Collection observations) { + public void unReg(Registration registration, Collection observations) { executorUnRegistered.submit(() -> { try { - this.setCancelObservations(lwServer, registration); + this.setCancelObservations(registration); this.sentLogsToThingsboard(LOG_LW2M_INFO + ": Client unRegistration", registration); this.closeClientSession(registration); } catch (Throwable t) { @@ -238,10 +237,10 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { } @Override - public void setCancelObservations(LeshanServer lwServer, Registration registration) { + public void setCancelObservations(Registration registration) { if (registration != null) { - Set observations = lwServer.getObservationService().getObservations(registration); - observations.forEach(observation -> this.setCancelObservationRecourse(lwServer, registration, observation.getPath().toString())); + Set observations = leshanServer.getObservationService().getObservations(registration); + observations.forEach(observation -> this.setCancelObservationRecourse(registration, observation.getPath().toString())); } } @@ -251,8 +250,8 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { * {@code ObservationService#cancelObservation()} */ @Override - public void setCancelObservationRecourse(LeshanServer lwServer, Registration registration, String path) { - lwServer.getObservationService().cancelObservations(registration, path); + public void setCancelObservationRecourse(Registration registration, String path) { + leshanServer.getObservationService().cancelObservations(registration, path); } /** @@ -294,12 +293,12 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { String path = this.getPathAttributeUpdate(sessionInfo, de.getKey()); String value = de.getValue().getAsString(); LwM2mClient lwM2MClient = lwM2mClientContext.getLwM2mClient(new UUID(sessionInfo.getSessionIdMSB(), sessionInfo.getSessionIdLSB())); - LwM2mClientProfile profile = lwM2mClientContext.getProfile(new UUID(sessionInfo.getDeviceProfileIdMSB(), sessionInfo.getDeviceProfileIdLSB())); - ResourceModel resourceModel = context.getLwM2MTransportConfigServer().getResourceModel(lwM2MClient.getRegistration(), new LwM2mPath(path)); - if (!path.isEmpty() && (this.validatePathInAttrProfile(profile, path) || this.validatePathInTelemetryProfile(profile, path))) { + LwM2mClientProfile clientProfile = lwM2mClientContext.getProfile(new UUID(sessionInfo.getDeviceProfileIdMSB(), sessionInfo.getDeviceProfileIdLSB())); + if (path != null && !path.isEmpty() && (this.validatePathInAttrProfile(clientProfile, path) || this.validatePathInTelemetryProfile(clientProfile, path))) { + ResourceModel resourceModel = lwM2mTransportContextServer.getLwM2MTransportConfigServer().getResourceModel(lwM2MClient.getRegistration(), new LwM2mPath(path)); if (resourceModel != null && resourceModel.operations.isWritable()) { - lwM2mTransportRequest.sendAllRequest(leshanServer, lwM2MClient.getRegistration(), path, POST_TYPE_OPER_WRITE_REPLACE, - ContentFormat.TLV.getName(), null, value, this.context.getLwM2MTransportConfigServer().getTimeout()); + lwM2mTransportRequest.sendAllRequest(lwM2MClient.getRegistration(), path, POST_TYPE_OPER_WRITE_REPLACE, + ContentFormat.TLV.getName(), null, value, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout()); } else { log.error("Resource path - [{}] value - [{}] is not Writable and cannot be updated", path, value); String logMsg = String.format("%s: attributeUpdate: Resource path - %s value - %s is not Writable and cannot be updated", @@ -353,9 +352,9 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { * Trigger bootStrap path = "/1/0/9" - have to implemented on client */ @Override - public void doTrigger(LeshanServer lwServer, Registration registration, String path) { - lwM2mTransportRequest.sendAllRequest(lwServer, registration, path, POST_TYPE_OPER_EXECUTE, - ContentFormat.TLV.getName(), null, null, this.context.getLwM2MTransportConfigServer().getTimeout()); + public void doTrigger(Registration registration, String path) { + lwM2mTransportRequest.sendAllRequest(registration, path, POST_TYPE_OPER_EXECUTE, + ContentFormat.TLV.getName(), null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout()); } /** @@ -438,47 +437,35 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { public void updateParametersOnThingsboard(JsonElement msg, String topicName, Registration registration) { SessionInfoProto sessionInfo = this.getValidateSessionInfo(registration); if (sessionInfo != null) { - context.sentParametersOnThingsboard(msg, topicName, sessionInfo); + lwM2mTransportContextServer.sentParametersOnThingsboard(msg, topicName, sessionInfo); } else { log.error("Client: [{}] updateParametersOnThingsboard [{}] sessionInfo ", registration, null); } } /** - * #1 сlientOnlyObserveAfterConnect == true + * #1 clientOnlyObserveAfterConnect == true * - Only Observe Request to the client marked as observe from the profile configuration. - * #2. сlientOnlyObserveAfterConnect == false & clientUpdateValueAfterConnect == false - * - Request to the client after registration to read the values of the resources marked as attribute or telemetry from the profile configuration. - * - then Observe Request to the client marked as observe from the profile configuration. - * #3. сlientOnlyObserveAfterConnect == false & clientUpdateValueAfterConnect == true - * После регистрации отправляю запрос на read всех ресурсов, котрые послк регистрации, а затем запрос на observe (edited) - * - Request to the client after registration to read all resource values for all objects + * #2. clientOnlyObserveAfterConnect == false + * После регистрации отправляю запрос на read всех ресурсов, которые после регистрации есть у клиента, + * а затем запрос на observe (edited) + * - Read Request to the client after registration to read all resource values for all objects * - then Observe Request to the client marked as observe from the profile configuration. * - * @param lwServer - LeshanServer * @param registration - Registration LwM2M Client * @param lwM2MClient - object with All parameters off client */ - private void initLwM2mFromClientValue(LeshanServer lwServer, Registration registration, LwM2mClient lwM2MClient) { + private void initLwM2mFromClientValue(Registration registration, LwM2mClient lwM2MClient) { LwM2mClientProfile lwM2MClientProfile = lwM2mClientContext.getProfile(registration); Set clientObjects = this.getAllOjectsInClient(registration); if (clientObjects != null && !LwM2mTransportHandler.getClientOnlyObserveAfterConnect(lwM2MClientProfile)) { // #2 - if (!LwM2mTransportHandler.getClientUpdateValueAfterConnect(lwM2MClientProfile)) { - this.initReadAttrTelemetryObserveToClient(lwServer, registration, lwM2MClient, GET_TYPE_OPER_READ); - - } - // #3 - else { - lwM2MClient.getPendingRequests().addAll(clientObjects); - clientObjects.forEach(path -> { - lwM2mTransportRequest.sendAllRequest(lwServer, registration, path, GET_TYPE_OPER_READ, ContentFormat.TLV.getName(), - null, null, this.context.getLwM2MTransportConfigServer().getTimeout()); - }); - } + lwM2MClient.getPendingRequests().addAll(clientObjects); + clientObjects.forEach(path -> lwM2mTransportRequest.sendAllRequest(registration, path, GET_TYPE_OPER_READ, ContentFormat.TLV.getName(), + null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout())); } // #1 - this.initReadAttrTelemetryObserveToClient(lwServer, registration, lwM2MClient, GET_TYPE_OPER_OBSERVE); + this.initReadAttrTelemetryObserveToClient(registration, lwM2MClient, GET_TYPE_OPER_OBSERVE); } /** @@ -513,8 +500,7 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { * #2 Update new Resources (replace old Resource Value on new Resource Value) * * @param registration - Registration LwM2M Client - * @param - LwM2mSingleResource response.getContent() - * @param - LwM2mSingleResource response.getContent() + * @param lwM2mResource - LwM2mSingleResource response.getContent() * @param path - resource */ private void updateResourcesValue(Registration registration, LwM2mResource lwM2mResource, String path) { @@ -522,31 +508,21 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { lwM2MClient.updateResourceValue(path, lwM2mResource); Set paths = new HashSet<>(); paths.add(path); - this.updateAttrTelemetry(registration, false, paths); + this.updateAttrTelemetry(registration, paths); } /** * Sent Attribute and Telemetry to Thingsboard - * #1 - get AttrName/TelemetryName with value: - * #1.1 from Client - * #1.2 from LwM2MClient: + * #1 - get AttrName/TelemetryName with value from LwM2MClient: * -- resourceId == path from LwM2MClientProfile.postAttributeProfile/postTelemetryProfile/postObserveProfile * -- AttrName/TelemetryName == resourceName from ModelObject.objectModel, value from ModelObject.instance.resource(resourceId) * #2 - set Attribute/Telemetry * * @param registration - Registration LwM2M Client */ - private void updateAttrTelemetry(Registration registration, boolean start, Set paths) { + private void updateAttrTelemetry(Registration registration, Set paths) { JsonObject attributes = new JsonObject(); JsonObject telemetries = new JsonObject(); - if (start) { - // #1.1 - JsonObject attributeClient = this.getAttributeClient(registration); - if (attributeClient != null) { - attributeClient.entrySet().forEach(p -> attributes.add(p.getKey(), p.getValue())); - } - } - // #1.2 try { writeLock.lock(); this.getParametersFromProfile(attributes, telemetries, registration, paths); @@ -562,25 +538,35 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { } /** - * @param profile - + * @param clientProfile - * @param path - * @return true if path isPresent in postAttributeProfile */ - private boolean validatePathInAttrProfile(LwM2mClientProfile profile, String path) { - Set attributesSet = new Gson().fromJson(profile.getPostAttributeProfile(), new TypeToken<>() { - }.getType()); - return attributesSet.stream().filter(p -> p.equals(path)).findFirst().isPresent(); + private boolean validatePathInAttrProfile(LwM2mClientProfile clientProfile, String path) { + try { + List attributesSet = new Gson().fromJson(clientProfile.getPostAttributeProfile(), new TypeToken<>() { + }.getType()); + return attributesSet.stream().anyMatch(p -> p.equals(path)); + } catch (Exception e) { + log.error("Fail Validate Path [{}] ClientProfile.Attribute", path, e); + return false; + } } /** - * @param profile - + * @param clientProfile - * @param path - * @return true if path isPresent in postAttributeProfile */ - private boolean validatePathInTelemetryProfile(LwM2mClientProfile profile, String path) { - Set telemetriesSet = new Gson().fromJson(profile.getPostTelemetryProfile(), new TypeToken<>() { - }.getType()); - return telemetriesSet.stream().filter(p -> p.equals(path)).findFirst().isPresent(); + private boolean validatePathInTelemetryProfile(LwM2mClientProfile clientProfile, String path) { + try { + List telemetriesSet = new Gson().fromJson(clientProfile.getPostTelemetryProfile(), new TypeToken<>() { + }.getType()); + return telemetriesSet.stream().anyMatch(p -> p.equals(path)); + } catch (Exception e) { + log.error("Fail Validate Path [{}] ClientProfile.Telemetry", path, e); + return false; + } } /** @@ -588,43 +574,32 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { * #1 - Analyze: * #1.1 path in resource profile == client resource * - * @param lwServer - * @param registration - */ - private void initReadAttrTelemetryObserveToClient(LeshanServer lwServer, Registration registration, LwM2mClient lwM2MClient, String typeOper) { - try { - LwM2mClientProfile lwM2MClientProfile = lwM2mClientContext.getProfile(registration); - Set clientInstances = this.getAllInstancesInClient(registration); - Set result; - if (GET_TYPE_OPER_READ.equals(typeOper)) { - result = new ObjectMapper().readValue(lwM2MClientProfile.getPostAttributeProfile().getAsJsonArray().toString().getBytes(), new TypeReference<>() { - }); - result.addAll(new ObjectMapper().readValue(lwM2MClientProfile.getPostTelemetryProfile().getAsJsonArray().toString().getBytes(), new TypeReference<>() { - })); - } else { - result = new ObjectMapper().readValue(lwM2MClientProfile.getPostObserveProfile().getAsJsonArray().toString().getBytes(), new TypeReference<>() { - }); - } - Set pathSent = ConcurrentHashMap.newKeySet(); - result.forEach(p -> { - // #1.1 - String target = p; - String[] resPath = target.split("/"); - String instance = "/" + resPath[1] + "/" + resPath[2]; - if (clientInstances.contains(instance)) { - pathSent.add(target); - } - }); - lwM2MClient.getPendingRequests().addAll(pathSent); - pathSent.forEach(target -> { - lwM2mTransportRequest.sendAllRequest(lwServer, registration, target, typeOper, ContentFormat.TLV.getName(), - null, null, this.context.getLwM2MTransportConfigServer().getTimeout()); - }); - if (GET_TYPE_OPER_OBSERVE.equals(typeOper)) { - lwM2MClient.initValue(this, null); + private void initReadAttrTelemetryObserveToClient(Registration registration, LwM2mClient lwM2MClient, String typeOper) { + LwM2mClientProfile lwM2MClientProfile = lwM2mClientContext.getProfile(registration); + Set clientInstances = this.getAllInstancesInClient(registration); + Set result; + if (GET_TYPE_OPER_READ.equals(typeOper)) { + result = JacksonUtil.fromString(lwM2MClientProfile.getPostAttributeProfile().toString(), new TypeReference<>() {}); + result.addAll(JacksonUtil.fromString(lwM2MClientProfile.getPostTelemetryProfile().toString(), new TypeReference<>() {})); + } else { + result = JacksonUtil.fromString(lwM2MClientProfile.getPostObserveProfile().toString(), new TypeReference<>() {}); + } + Set pathSent = ConcurrentHashMap.newKeySet(); + result.forEach(target -> { + // #1.1 + String[] resPath = target.split("/"); + String instance = "/" + resPath[1] + "/" + resPath[2]; + if (clientInstances != null && clientInstances.size() > 0 && clientInstances.contains(instance)) { + pathSent.add(target); } - } catch (IOException e) { - e.printStackTrace(); + }); + lwM2MClient.getPendingRequests().addAll(pathSent); + pathSent.forEach(target -> lwM2mTransportRequest.sendAllRequest(registration, target, typeOper, ContentFormat.TLV.getName(), + null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout())); + if (GET_TYPE_OPER_OBSERVE.equals(typeOper)) { + lwM2MClient.initValue(this, null); } } @@ -677,26 +652,11 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { return (clientInstances.size() > 0) ? clientInstances : null; } - /** - * get AttrName/TelemetryName with value from Client - * - * @param registration - - * @return - JsonObject, format: {name: value}} - */ - private JsonObject getAttributeClient(Registration registration) { - if (registration.getAdditionalRegistrationAttributes().size() > 0) { - JsonObject resNameValues = new JsonObject(); - registration.getAdditionalRegistrationAttributes().forEach(resNameValues::addProperty); - return resNameValues; - } - return null; - } - /** * @param attributes - new JsonObject * @param telemetry - new JsonObject * @param registration - Registration LwM2M Client - * @param path + * @param path - */ private void getParametersFromProfile(JsonObject attributes, JsonObject telemetry, Registration registration, Set path) { LwM2mClientProfile lwM2MClientProfile = lwM2mClientContext.getProfile(registration); @@ -746,7 +706,7 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { LwM2mPath pathIds = new LwM2mPath(path); ResourceValue resourceValue = this.returnResourceValueFromLwM2MClient(lwM2MClient, pathIds); return resourceValue == null ? null : - this.converter.convertValue(resourceValue.getResourceValue(), this.context.getLwM2MTransportConfigServer().getResourceModelType(lwM2MClient.getRegistration(), pathIds), ResourceModel.Type.STRING, pathIds).toString(); + this.converter.convertValue(resourceValue.getResourceValue(), this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getResourceModelType(lwM2MClient.getRegistration(), pathIds), ResourceModel.Type.STRING, pathIds).toString(); } /** @@ -796,25 +756,21 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { * @param deviceProfile - */ private void onDeviceUpdateChangeProfile(Set registrationIds, DeviceProfile deviceProfile) { - LwM2mClientProfile lwM2MClientProfileOld = lwM2mClientContext.getProfiles().get(deviceProfile.getUuidId()); + LwM2mClientProfile lwM2MClientProfileOld = lwM2mClientContext.getProfiles().get(deviceProfile.getUuidId()).clone(); if (lwM2mClientContext.addUpdateProfileParameters(deviceProfile)) { // #1 JsonArray attributeOld = lwM2MClientProfileOld.getPostAttributeProfile(); - Set attributeSetOld = new Gson().fromJson(attributeOld, new TypeToken<>() { - }.getType()); + Set attributeSetOld = this.convertJsonArrayToSet(attributeOld); JsonArray telemetryOld = lwM2MClientProfileOld.getPostTelemetryProfile(); - Set telemetrySetOld = new Gson().fromJson(telemetryOld, new TypeToken<>() { - }.getType()); + Set telemetrySetOld = this.convertJsonArrayToSet(telemetryOld); JsonArray observeOld = lwM2MClientProfileOld.getPostObserveProfile(); JsonObject keyNameOld = lwM2MClientProfileOld.getPostKeyNameProfile(); LwM2mClientProfile lwM2MClientProfileNew = lwM2mClientContext.getProfiles().get(deviceProfile.getUuidId()); JsonArray attributeNew = lwM2MClientProfileNew.getPostAttributeProfile(); - Set attributeSetNew = new Gson().fromJson(attributeNew, new TypeToken<>() { - }.getType()); + Set attributeSetNew = this.convertJsonArrayToSet(attributeNew); JsonArray telemetryNew = lwM2MClientProfileNew.getPostTelemetryProfile(); - Set telemetrySetNew = new Gson().fromJson(telemetryNew, new TypeToken<>() { - }.getType()); + Set telemetrySetNew = this.convertJsonArrayToSet(telemetryNew); JsonArray observeNew = lwM2MClientProfileNew.getPostObserveProfile(); JsonObject keyNameNew = lwM2MClientProfileNew.getPostKeyNameProfile(); @@ -847,11 +803,11 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { if (sentAttrToThingsboard.getPathPostParametersAdd().size() > 0) { // update value in Resources registrationIds.forEach(registrationId -> { - LeshanServer lwServer = leshanServer; +// LeshanServer lwServer = leshanServer; Registration registration = lwM2mClientContext.getRegistration(registrationId); - this.readResourceValueObserve(lwServer, registration, sentAttrToThingsboard.getPathPostParametersAdd(), GET_TYPE_OPER_READ); + this.readResourceValueObserve(registration, sentAttrToThingsboard.getPathPostParametersAdd(), GET_TYPE_OPER_READ); // sent attr/telemetry to tingsboard for new path - this.updateAttrTelemetry(registration, false, sentAttrToThingsboard.getPathPostParametersAdd()); + this.updateAttrTelemetry(registration, sentAttrToThingsboard.getPathPostParametersAdd()); }); } // #4.2 del @@ -862,10 +818,8 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { // #5.1 if (!observeOld.equals(observeNew)) { - Set observeSetOld = new Gson().fromJson(observeOld, new TypeToken<>() { - }.getType()); - Set observeSetNew = new Gson().fromJson(observeNew, new TypeToken<>() { - }.getType()); + Set observeSetOld = new Gson().fromJson(observeOld, new TypeToken<>() {}.getType()); + Set observeSetNew = new Gson().fromJson(observeNew, new TypeToken<>() {}.getType()); //#5.2 add // path Attr/Telemetry includes newObserve attributeSetOld.addAll(telemetrySetOld); @@ -876,17 +830,22 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { ResultsAnalyzerParameters postObserveAnalyzer = this.getAnalyzerParameters(sentObserveToClientOld.getPathPostParametersAdd(), sentObserveToClientNew.getPathPostParametersAdd()); // sent Request observe to Client registrationIds.forEach(registrationId -> { - LeshanServer lwServer = leshanServer; Registration registration = lwM2mClientContext.getRegistration(registrationId); - this.readResourceValueObserve(lwServer, registration, postObserveAnalyzer.getPathPostParametersAdd(), GET_TYPE_OPER_OBSERVE); + this.readResourceValueObserve(registration, postObserveAnalyzer.getPathPostParametersAdd(), GET_TYPE_OPER_OBSERVE); // 5.3 del // sent Request cancel observe to Client - this.cancelObserveIsValue(lwServer, registration, postObserveAnalyzer.getPathPostParametersDel()); + this.cancelObserveIsValue(registration, postObserveAnalyzer.getPathPostParametersDel()); }); } } } + private Set convertJsonArrayToSet (JsonArray jsonArray) { + List attributeListOld = new Gson().fromJson(jsonArray, new TypeToken<>() { + }.getType()); + return Sets.newConcurrentHashSet(attributeListOld); + } + /** * Compare old list with new list after change AttrTelemetryObserve in config Profile * @@ -917,20 +876,19 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { * Update Resource value after change RezAttrTelemetry in config Profile * sent response Read to Client and add path to pathResAttrTelemetry in LwM2MClient.getAttrTelemetryObserveValue() * - * @param lwServer - LeshanServer * @param registration - Registration LwM2M Client * @param targets - path Resources == [ "/2/0/0", "/2/0/1"] */ - private void readResourceValueObserve(LeshanServer lwServer, Registration registration, Set targets, String typeOper) { + private void readResourceValueObserve(Registration registration, Set targets, String typeOper) { targets.forEach(target -> { LwM2mPath pathIds = new LwM2mPath(target); if (pathIds.isResource()) { if (GET_TYPE_OPER_READ.equals(typeOper)) { - lwM2mTransportRequest.sendAllRequest(lwServer, registration, target, typeOper, - ContentFormat.TLV.getName(), null, null, this.context.getLwM2MTransportConfigServer().getTimeout()); + lwM2mTransportRequest.sendAllRequest(registration, target, typeOper, + ContentFormat.TLV.getName(), null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout()); } else if (GET_TYPE_OPER_OBSERVE.equals(typeOper)) { - lwM2mTransportRequest.sendAllRequest(lwServer, registration, target, typeOper, - null, null, null, this.context.getLwM2MTransportConfigServer().getTimeout()); + lwM2mTransportRequest.sendAllRequest(registration, target, typeOper, + null, null, null, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout()); } } }); @@ -946,11 +904,11 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { return analyzerParameters; } - private void cancelObserveIsValue(LeshanServer lwServer, Registration registration, Set paramAnallyzer) { + private void cancelObserveIsValue(Registration registration, Set paramAnallyzer) { LwM2mClient lwM2MClient = lwM2mClientContext.getLwM2mClientWithReg(registration, null); paramAnallyzer.forEach(p -> { if (this.returnResourceValueFromLwM2MClient(lwM2MClient, new LwM2mPath(p)) != null) { - this.setCancelObservationRecourse(lwServer, registration, p); + this.setCancelObservationRecourse(registration, p); } } ); @@ -958,8 +916,8 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { private void putDelayedUpdateResourcesClient(LwM2mClient lwM2MClient, Object valueOld, Object valueNew, String path) { if (valueNew != null && (valueOld == null || !valueNew.toString().equals(valueOld.toString()))) { - lwM2mTransportRequest.sendAllRequest(leshanServer, lwM2MClient.getRegistration(), path, POST_TYPE_OPER_WRITE_REPLACE, - ContentFormat.TLV.getName(), null, valueNew, this.context.getLwM2MTransportConfigServer().getTimeout()); + lwM2mTransportRequest.sendAllRequest(lwM2MClient.getRegistration(), path, POST_TYPE_OPER_WRITE_REPLACE, + ContentFormat.TLV.getName(), null, valueNew, this.lwM2mTransportContextServer.getLwM2MTransportConfigServer().getTimeout()); } else { log.error("05 delayError"); } @@ -1037,18 +995,18 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { /** * @param lwM2MClient - - * @return + * @return SessionInfoProto - */ private SessionInfoProto getNewSessionInfoProto(LwM2mClient lwM2MClient) { if (lwM2MClient != null) { TransportProtos.ValidateDeviceCredentialsResponseMsg msg = lwM2MClient.getCredentialsResponse(); - if (msg == null || msg.getDeviceInfo() == null) { + if (msg == null) { log.error("[{}] [{}]", lwM2MClient.getEndpoint(), CLIENT_NOT_AUTHORIZED); this.closeClientSession(lwM2MClient.getRegistration()); return null; } else { return SessionInfoProto.newBuilder() - .setNodeId(this.context.getNodeId()) + .setNodeId(this.lwM2mTransportContextServer.getNodeId()) .setSessionIdMSB(lwM2MClient.getSessionId().getMostSignificantBits()) .setSessionIdLSB(lwM2MClient.getSessionId().getLeastSignificantBits()) .setDeviceIdMSB(msg.getDeviceInfo().getDeviceIdMSB()) @@ -1114,7 +1072,7 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { if (attrSharedNames.size() > 0) { //#2.1 try { - TransportProtos.GetAttributeRequestMsg getAttributeMsg = context.getAdaptor().convertToGetAttributes(null, attrSharedNames); + TransportProtos.GetAttributeRequestMsg getAttributeMsg = lwM2mTransportContextServer.getAdaptor().convertToGetAttributes(null, attrSharedNames); transportService.process(sessionInfo, getAttributeMsg, getAckCallback(lwM2MClient, getAttributeMsg.getRequestId(), DEVICE_ATTRIBUTES_REQUEST)); } catch (AdaptorException e) { log.warn("Failed to decode get attributes request", e); @@ -1132,14 +1090,13 @@ public class LwM2mTransportServiceImpl implements LwM2mTransportService { */ private List getNamesAttrFromProfileIsWritable(LwM2mClient lwM2MClient) { LwM2mClientProfile profile = lwM2mClientContext.getProfile(lwM2MClient.getProfileId()); - Set attrSet = new Gson().fromJson(profile.getPostAttributeProfile(), Set.class); - ConcurrentMap keyNamesMap = new Gson().fromJson(profile.getPostKeyNameProfile().toString(), new TypeToken>() { - }.getType()); + Set attrSet = new Gson().fromJson(profile.getPostAttributeProfile(), new TypeToken<>() {}.getType()); + ConcurrentMap keyNamesMap = new Gson().fromJson(profile.getPostKeyNameProfile().toString(), new TypeToken>() {}.getType()); ConcurrentMap keyNamesIsWritable = keyNamesMap.entrySet() .stream() - .filter(e -> (attrSet.contains(e.getKey()) && context.getLwM2MTransportConfigServer().getResourceModel(lwM2MClient.getRegistration(), new LwM2mPath(e.getKey())) != null && - context.getLwM2MTransportConfigServer().getResourceModel(lwM2MClient.getRegistration(), new LwM2mPath(e.getKey())).operations.isWritable())) + .filter(e -> (attrSet.contains(e.getKey()) && lwM2mTransportContextServer.getLwM2MTransportConfigServer().getResourceModel(lwM2MClient.getRegistration(), new LwM2mPath(e.getKey())) != null && + lwM2mTransportContextServer.getLwM2MTransportConfigServer().getResourceModel(lwM2MClient.getRegistration(), new LwM2mPath(e.getKey())).operations.isWritable())) .collect(Collectors.toConcurrentMap(Map.Entry::getKey, Map.Entry::getValue)); Set namesIsWritable = ConcurrentHashMap.newKeySet(); diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mVersionedModelProvider.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mVersionedModelProvider.java new file mode 100644 index 0000000000..503af176af --- /dev/null +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/LwM2mVersionedModelProvider.java @@ -0,0 +1,136 @@ +/** + * Copyright © 2016-2021 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.transport.lwm2m.server; + +import lombok.extern.slf4j.Slf4j; +import org.eclipse.leshan.core.model.DefaultDDFFileValidator; +import org.eclipse.leshan.core.model.LwM2mModel; +import org.eclipse.leshan.core.model.ObjectModel; +import org.eclipse.leshan.core.model.ResourceModel; +import org.eclipse.leshan.server.model.LwM2mModelProvider; +import org.eclipse.leshan.server.registration.Registration; +import org.thingsboard.server.common.data.id.TenantId; +import org.thingsboard.server.transport.lwm2m.server.client.LwM2mClientContext; + +import java.util.ArrayList; +import java.util.Base64; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; + +import static org.thingsboard.server.common.data.ResourceType.LWM2M_MODEL; + +@Slf4j +public class LwM2mVersionedModelProvider implements LwM2mModelProvider { + + /** + * int objectId + * String version ("1.01") + * Key = objectId + "##" + version + * Value = TenantId + */ + private final LwM2mClientContext lwM2mClientContext; + private final LwM2mTransportContextServer lwM2mTransportContextServer; + + public LwM2mVersionedModelProvider(LwM2mClientContext lwM2mClientContext, LwM2mTransportContextServer lwM2mTransportContextServer) { + this.lwM2mClientContext = lwM2mClientContext; + this.lwM2mTransportContextServer = lwM2mTransportContextServer; + } + private String getIdVer(ObjectModel objectModel) { + return objectModel.id + "##" + ((objectModel.getVersion() == null || objectModel.getVersion().isEmpty()) ? ObjectModel.DEFAULT_VERSION : objectModel.getVersion()); + } + + private String getIdVer(Integer objectId, String version) { + return objectId != null ? objectId + "##" + ((version == null || version.isEmpty()) ? ObjectModel.DEFAULT_VERSION : version) : null; + } + + /** + * Update repository if need + * + * @param registration + * @return + */ + @Override + public LwM2mModel getObjectModel(Registration registration) { + return new DynamicModel(registration + ); + } + + private class DynamicModel implements LwM2mModel { + + private final Registration registration; + private final TenantId tenantId; + + public DynamicModel(Registration registration) { + this.registration = registration; + this.tenantId = lwM2mClientContext.getProfile(registration).getTenantId(); + } + + @Override + public ResourceModel getResourceModel(int objectId, int resourceId) { + try { + ObjectModel objectModel = getObjectModel(objectId); + if (objectModel != null) + return objectModel.resources.get(resourceId); + else + return null; + } catch (Exception e) { + log.error("", e); + return null; + } + } + + @Override + public ObjectModel getObjectModel(int objectId) { + String version = registration.getSupportedVersion(objectId); + if (version != null) { + return this.getObjectModelDynamic(objectId, version); + } + return null; + } + + @Override + public Collection getObjectModels() { + Map supportedObjects = this.registration.getSupportedObject(); + Collection result = new ArrayList(supportedObjects.size()); + Iterator i$ = supportedObjects.entrySet().iterator(); + + while (i$.hasNext()) { + Map.Entry supportedObject = (Map.Entry) i$.next(); + ObjectModel objectModel = this.getObjectModelDynamic((Integer) supportedObject.getKey(), (String) supportedObject.getValue()); + if (objectModel != null) { + result.add(objectModel); + } + } + return result; + } + + private ObjectModel getObjectModelDynamic(Integer objectId, String version) { + String key = getIdVer(objectId, version); + String xmlB64 = lwM2mTransportContextServer.getTransportResourceCache().get( + this.tenantId, + LWM2M_MODEL, + key). + getValue(); + return xmlB64 != null && !xmlB64.isEmpty() ? + lwM2mTransportContextServer.parseFromXmlToObjectModel( + Base64.getDecoder().decode(xmlB64), + key + ".xml", + new DefaultDDFFileValidator()) : + null; + } + } +} diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java index b965c99611..d30628a43f 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientContextImpl.java @@ -15,7 +15,6 @@ */ package org.thingsboard.server.transport.lwm2m.server.client; -import lombok.extern.slf4j.Slf4j; import org.eclipse.leshan.server.registration.Registration; import org.eclipse.leshan.server.security.EditableSecurityStore; import org.springframework.stereotype.Service; @@ -105,6 +104,7 @@ public class LwM2mClientContextImpl implements LwM2mClientContext { /** * Add new LwM2MClient to session + * * @param identity- * @return SecurityInfo. If error - SecurityInfoError * and log: diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientProfile.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientProfile.java index 6f28d54d67..8285c9bc8b 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientProfile.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/client/LwM2mClientProfile.java @@ -15,18 +15,22 @@ */ package org.thingsboard.server.transport.lwm2m.server.client; +import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import lombok.Data; +import org.thingsboard.server.common.data.id.TenantId; @Data public class LwM2mClientProfile { + + private TenantId tenantId; /** * {"clientLwM2mSettings": { * clientUpdateValueAfterConnect: false; * } - **/ - JsonObject postClientLwM2mSettings; + **/ + private JsonObject postClientLwM2mSettings; /** * {"keyName": { @@ -34,21 +38,44 @@ public class LwM2mClientProfile { * "/3/0/0": "manufacturer", * "/3/0/2": "serialNumber" * } - **/ - JsonObject postKeyNameProfile; + **/ + private JsonObject postKeyNameProfile; /** * [ "/2/0/0", "/2/0/1"] */ - JsonArray postAttributeProfile; + private JsonArray postAttributeProfile; /** * [ "/2/0/0", "/2/0/1"] */ - JsonArray postTelemetryProfile; + private JsonArray postTelemetryProfile; /** * [ "/2/0/0", "/2/0/1"] */ - JsonArray postObserveProfile; + private JsonArray postObserveProfile; + + public LwM2mClientProfile clone() { + LwM2mClientProfile lwM2mClientProfile = new LwM2mClientProfile(); + lwM2mClientProfile.postClientLwM2mSettings = this.deepCopy(this.postClientLwM2mSettings, JsonObject.class); + lwM2mClientProfile.postKeyNameProfile = this.deepCopy(this.postKeyNameProfile, JsonObject.class); + lwM2mClientProfile.postAttributeProfile = this.deepCopy(this.postAttributeProfile, JsonArray.class); + lwM2mClientProfile.postTelemetryProfile = this.deepCopy(this.postTelemetryProfile, JsonArray.class); + lwM2mClientProfile.postObserveProfile = this.deepCopy(this.postObserveProfile, JsonArray.class); + return lwM2mClientProfile; + } + + + private T deepCopy(T elements, Class type) { + try { + Gson gson = new Gson(); + return gson.fromJson(gson.toJson(elements), type); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + } diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/store/TbLwM2mRedisRegistrationStore.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/store/TbLwM2mRedisRegistrationStore.java index 6d24ac5ca0..bac4554b04 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/store/TbLwM2mRedisRegistrationStore.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/server/store/TbLwM2mRedisRegistrationStore.java @@ -21,9 +21,9 @@ import org.eclipse.californium.elements.EndpointContext; import org.eclipse.leshan.core.observation.Observation; import org.eclipse.leshan.core.util.NamedThreadFactory; import org.eclipse.leshan.core.util.Validate; -import org.eclipse.leshan.server.Destroyable; -import org.eclipse.leshan.server.Startable; -import org.eclipse.leshan.server.Stoppable; +import org.eclipse.leshan.core.Destroyable; +import org.eclipse.leshan.core.Startable; +import org.eclipse.leshan.core.Stoppable; import org.eclipse.leshan.server.californium.observation.ObserveUtil; import org.eclipse.leshan.server.californium.registration.CaliforniumRegistrationStore; import org.eclipse.leshan.server.redis.JedisLock; @@ -278,8 +278,8 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto protected class RedisIterator implements Iterator { - private RedisConnectionFactory connectionFactory; - private ScanParams scanParams; + private final RedisConnectionFactory connectionFactory; + private final ScanParams scanParams; private String cursor; private List scanResult; @@ -552,17 +552,16 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto @Override public org.eclipse.californium.core.observe.Observation putIfAbsent(Token token, org.eclipse.californium.core.observe.Observation obs) throws ObservationStoreException { - return add(token, obs, true); + return add(obs, true); } @Override public org.eclipse.californium.core.observe.Observation put(Token token, org.eclipse.californium.core.observe.Observation obs) throws ObservationStoreException { - return add(token, obs, false); + return add(obs, false); } - private org.eclipse.californium.core.observe.Observation add(Token token, - org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent) throws ObservationStoreException { + private org.eclipse.californium.core.observe.Observation add(org.eclipse.californium.core.observe.Observation obs, boolean ifAbsent) throws ObservationStoreException { String endpoint = ObserveUtil.validateCoapObservation(obs); org.eclipse.californium.core.observe.Observation previousObservation = null; @@ -577,7 +576,7 @@ public class TbLwM2mRedisRegistrationStore implements CaliforniumRegistrationSto throw new ObservationStoreException("no registration for this Id"); byte[] key = toKey(OBS_TKN, obs.getRequest().getToken().getBytes()); byte[] serializeObs = serializeObs(obs); - byte[] previousValue = null; + byte[] previousValue; if (ifAbsent) { previousValue = j.get(key); if (previousValue == null || previousValue.length == 0) { diff --git a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2mValueConverterImpl.java b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2mValueConverterImpl.java index 67ce459d9b..85283749dc 100644 --- a/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2mValueConverterImpl.java +++ b/common/transport/lwm2m/src/main/java/org/thingsboard/server/transport/lwm2m/utils/LwM2mValueConverterImpl.java @@ -26,10 +26,13 @@ import org.eclipse.leshan.core.util.StringUtils; import javax.xml.datatype.DatatypeConfigurationException; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; +import java.math.BigInteger; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; +import static org.eclipse.leshan.core.model.ResourceModel.Type.OPAQUE; + @Slf4j public class LwM2mValueConverterImpl implements LwM2mValueConverter { @@ -51,6 +54,9 @@ public class LwM2mValueConverterImpl implements LwM2mValueConverter { /** expected type */ return value; } + if (currentType == null) { + currentType = OPAQUE; + } switch (expectedType) { case INTEGER: @@ -130,7 +136,13 @@ public class LwM2mValueConverterImpl implements LwM2mValueConverter { return String.valueOf(value); case TIME: String DATE_FORMAT = "MMM d, yyyy HH:mm a"; - Long timeValue = ((Date) value).getTime(); + Long timeValue; + try { + timeValue = ((Date) value).getTime(); + } + catch (Exception e){ + timeValue = new BigInteger((byte [])value).longValue(); + } DateFormat formatter = new SimpleDateFormat(DATE_FORMAT); return formatter.format(new Date(timeValue)); default: diff --git a/common/transport/lwm2m/src/main/resources/models/10241.xml b/common/transport/lwm2m/src/main/resources/models/10241.xml deleted file mode 100644 index 2b2af520e2..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10241.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - HostDeviceInfo - - 10241 - urn:oma:lwm2m:x:10241 - - - Multiple - Optional - - Host Device Manufacturer - R - Multiple - Mandatory - String - - - - - Host Device Model Number - R - Multiple - Mandatory - String - - - - - Host Device Unique ID - R - Multiple - Mandatory - String - - - - - Host Device Software Version - R - Multiple - Mandatory - String - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10242.xml b/common/transport/lwm2m/src/main/resources/models/10242.xml deleted file mode 100644 index 09a62806d3..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10242.xml +++ /dev/null @@ -1,659 +0,0 @@ - - - - - - - 3-Phase Power Meter - - - - 10242 - urn:oma:lwm2m:x:10242 - 1.0 - 1.0 - Multiple - Optional - - - Manufacturer - R - Single - Optional - String - - - - - - - - Model Number - R - Single - Optional - String - - - - - - - - Serial Number - R - Single - Optional - String - - - - - - - - Description - R - Single - Optional - String - - - - - - - - Tension R - R - Single - Mandatory - Float - - V - - - - - - Current R - R - Single - Mandatory - Float - - A - - - - - - Active Power R - R - Single - Optional - Float - - kW - - - - - - Reactive Power R - R - Single - Optional - Float - - kvar - - - - - - Inductive Reactive Power R - R - Single - Optional - Float - - kvar - - - - - - Capacitive Reactive Power R - R - Single - Optional - Float - - kvar - - - - - - Apparent Power R - R - Single - Optional - Float - - kVA - - - - - - Power Factor R - R - Single - Optional - Float - -1..1 - - - - - - - THD-V R - R - Single - Optional - Float - - /100 - - - - - - THD-A R - R - Single - Optional - Float - - /100 - - - - - - Tension S - R - Single - Mandatory - Float - - V - - - - - - Current S - R - Single - Mandatory - Float - - A - - - - - - Active Power S - R - Single - Optional - Float - - kW - - - - - - Reactive Power S - R - Single - Optional - Float - - kvar - - - - - - Inductive Reactive Power S - R - Single - Optional - Float - - kvar - - - - - - Capacitive Reactive Power S - R - Single - Optional - Float - - kvar - - - - - - Apparent Power S - R - Single - Optional - Float - - kVA - - - - - - Power Factor S - R - Single - Optional - Float - -1..1 - - - - - - - THD-V S - R - Single - Optional - Float - - /100 - - - - - - THD-A S - R - Single - Optional - Float - - /100 - - - - - - Tension T - R - Single - Mandatory - Float - - V - - - - - - Current T - R - Single - Mandatory - Float - - A - - - - - - Active Power T - R - Single - Optional - Float - - kW - - - - - - Reactive Power T - R - Single - Optional - Float - - kvar - - - - - - Inductive Reactive Power T - R - Single - Optional - Float - - kvar - - - - - - Capacitive Reactive Power T - R - Single - Optional - Float - - kvar - - - - - - Apparent Power T - R - Single - Optional - Float - - kVA - - - - - - Power Factor T - R - Single - Optional - Float - -1..1 - - - - - - - THD-V T - R - Single - Optional - Float - - /100 - - - - - - THD-A T - R - Single - Optional - Float - - /100 - - - - - - 3-Phase Active Power - R - Single - Optional - Float - - kW - - - - - - 3-Phase Reactive Power - R - Single - Optional - Float - - kvar - - - - - - 3-Phase Inductive Reactive Power - R - Single - Optional - Float - - kvar - - - - - - 3-Phase Capacitive Reactive Power - R - Single - Optional - Float - - kvar - - - - - - 3-Phase Apparent Power - R - Single - Optional - Float - - kVA - - - - - - 3-Phase Power Factor - R - Single - Optional - Float - -1..1 - - - - - - - 3-Phase phi cosine - R - Single - Optional - Float - -1..1 - - - - - - - Active Energy - R - Single - Optional - Float - - kWh - - - - - - Reactive Energy - R - Single - Optional - Float - - kvarh - - - - - - Inductive Reactive Energy - R - Single - Optional - Float - - kvarh - - - - - - Capacitive Reactive Energy - R - Single - Optional - Float - - kvarh - - - - - - Apparent Energy - R - Single - Optional - Float - - kVAh - - - - - - Tension R-S - R - Single - Optional - Float - - V - - - - - - Tension S-T - R - Single - Optional - Float - - V - - - - - - Tension T-R - R - Single - Optional - Float - - V - - - - - - Frequency - R - Single - Optional - Float - - Hz - - - - - - Neutral Current - R - Single - Optional - Float - - A - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10243.xml b/common/transport/lwm2m/src/main/resources/models/10243.xml deleted file mode 100644 index b506162174..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10243.xml +++ /dev/null @@ -1,263 +0,0 @@ - - - - - - - Single-Phase Power Meter - - - - 10243 - urn:oma:lwm2m:x:10243 - 1.0 - 1.0 - Multiple - Optional - - - Manufacturer - R - Single - Optional - String - - - - - - - - Model Number - R - Single - Optional - String - - - - - - - - Serial Number - R - Single - Optional - String - - - - - - - - Description - R - Single - Optional - String - - - - - - - - Tension - R - Single - Mandatory - String - - V - - - - - - Current - R - Single - Mandatory - Float - - A - - - - - - Active Power - R - Single - Optional - Float - - kW - - - - - - Reactive Power - R - Single - Optional - Float - - kvar - - - - - - Inductive Reactive Power - R - Single - Optional - Float - - kvar - - - - - - Capacitive Reactive Power - R - Single - Optional - Float - - kvar - - - - - - Apparent Power - R - Single - Optional - Float - - kVA - - - - - - Power Factor - R - Single - Optional - Float - -1..1 - - - - - - - THD-V - R - Single - Optional - Float - - /100 - - - - - - THD-A - R - Single - Optional - Float - - /100 - - - - - - Active Energy - R - Single - Optional - Float - - kWh - - - - - - Reactive Energy - R - Single - Optional - Float - - kvarh - - - - - - Apparent Energy - R - Single - Optional - Float - - kVAh - - - - - - Frequency - R - Single - Optional - Float - - Hz - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10244.xml b/common/transport/lwm2m/src/main/resources/models/10244.xml deleted file mode 100644 index d1ae9d911e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10244.xml +++ /dev/null @@ -1,301 +0,0 @@ - - - VehicleControlUnit - - 10244 - urn:oma:lwm2m:x:10244 - Single - Optional - - Vehicle UI State - R - Single - Mandatory - Integer - 0..15 - - - - Vehicle Speed - R - Single - Mandatory - Integer - - km/h - - - Vehicle Shift Status - R - Single - Mandatory - Integer - 0..3 - - - - Vehicle AP Position - R - Single - Mandatory - Integer - 0..100 - /100 - - - Vehicle Power - R - Single - Optional - Float - - kW - - - Vehicle Drive Energy - R - Single - Optional - Float - - Wh - - - Vehicle Energy Consumption Efficiency - R - Single - Optional - Float - - Wh/km - - - Vehicle Estimated Mileage - R - Single - Optional - Integer - - km - - - Vehicle Charge Cable Status - R - Single - Mandatory - Boolean - - - - - Vehicle Charge Status - R - Single - Mandatory - Integer - 0..15 - - - - Vehicle Charge Voltage - R - Single - Mandatory - Float - - V - - - Vehicle Charge Current - R - Single - Mandatory - Float - - A - - - Vehicle Charge Remaining Time - R - Single - Mandatory - Integer - - min - - - Battery Pack Voltage - R - Single - Mandatory - Float - - V - - - Battery Pack Current - R - Single - Mandatory - Float - - A - - - Battery Pack Remaining Capacity - R - Single - Mandatory - Integer - - Ah - - - Battery Pack SOC - R - Single - Mandatory - Integer - 0..100 - /100 - - - Battery Pack SOH - R - Single - Mandatory - Integer - 0..100 - /100 - - - Battery Cell MinVolt - R - Single - Mandatory - Integer - - mV - - - Battery Cell MaxVolt - R - Single - Mandatory - Integer - - mV - - - Battery Module MinTemp - R - Single - Mandatory - Integer - - Cel - - - Battery Module MaxTemp - R - Single - Mandatory - Integer - - Cel - - - Battery Connection Status - R - Single - Mandatory - Boolean - - - - - - MCU Voltage - R - Single - Mandatory - Integer - - V - - - MCU Temperature - R - Single - Mandatory - Integer - - Cel - - - Motor Speed - R - Single - Mandatory - Integer - - 1/min - - - Motor Temperature - R - Single - Mandatory - Integer - - Cel - - - Motor OT Warning - R - Single - Optional - Boolean - - - - - MCU OT Warning - R - Single - Optional - Boolean - - - - - Battery Pack OT Warning - R - Single - Optional - Boolean - - - - - MCU fault - R - Single - Optional - Boolean - - - - - Motor Error - R - Single - Optional - Boolean - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10245.xml b/common/transport/lwm2m/src/main/resources/models/10245.xml deleted file mode 100644 index ca8c9da9ae..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10245.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - Relay Management - This LWM2M Object provides a range of eNB related measurements and parameters of which several are changeable. Furthermore, it includes Resources to enable/disable the eNB. - 10245 - urn:oma:lwm2m:x:10245 - - - Single - Optional - - - eNB Availability - R - Single - Mandatory - Boolean - AVAILABLE; UNAVAILABLE - - This field indicates to the CCC whether or not the eNB of the CrowdBox is available for activation: AVAILABLE = TRUE; UNAVAILABLE = FALSE This is set by the CrowdBox itself using an algorithm specific to the use case and based on parameters known to the CrowdBox which may not necessarily be signalled to the network. In the absence of a more specific algorithm, this parameter should be set to AVAILABLE, unless a fault is detected which would prevent activation of the eNB, in which case it should be set to UNAVAILABLE. - - - GPS Status - R - Single - Mandatory - Boolean - UNSYNCHRONISED; SYNCHRONISED - - States whether the CrowdBox GPS receiver is synchronised to GPS time or not: UNSYCHRONISED = FALSE; SYNCHRONISED = TRUE If more than one GPS receiver is used by the CrowdBox, then SYNCHRONISED should be reported only if all receivers are synchronised. - - - Orientation - R - Single - Optional - Integer - -180..180 - deg - Orientation of CrowdBox with respect to magnetic north. The reference orientation of the CrowdBox shall be the pointing direction of the eNB antenna(s) or, in the case of an omni-directional CrowdBox antenna, as defined in the accompanying product documentation. - - - eNB EARFCN - RW - Single - Mandatory - Integer - 0..65535 - - EARFCN currently used by the eNB. Highest valid value in 3GPP is currently 46589. If the requested EARFCN is not supported by the eNB, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - eNB Bandwidth - RW - Single - Mandatory - Integer - 5, 10, 15, 20 - - Bandwidth of the currently used eNB carrier. If the requested bandwidth is not supported by the eNB, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Backhaul Primary EARFCN - RW - Single - Mandatory - Integer - 0..65535 - - EARFCN of primary cell used for the backhaul. If the requested EARFCN is not supported by the CrowdBox UE, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Backhaul Secondary EARFCN - RW - Multiple - Mandatory - Integer - 0..65535 - - EARFCN of any secondary cells used for the backhaul, in the event that carrier aggregation is being used. If the requested EARFCN is not supported by the CrowdBox UE, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Cumulative Measurement Window - RW - Single - Mandatory - Integer - 0..65535 - s - The current measurement interval over which cumulative statistics are collected for the following resources: Cumulative Number of Unique Users, Cumulative Downlink Throughput per Connected User, Cumulative Uplink Throughput per Connected User. Note that this measurement period is a sliding window rather than a granularity period. Measurements should never be reset, but rather old measurements should be removed from the cumulative total as they fall outside of the window. A value of 0 shall be interpreted as meaning only the current value should be reported. A value of 65535 shall be interpreted as an infinite window size (i.e. old measurements are never discarded). - - - eNB ECI - R - Single - Mandatory - Integer - 0..2^28-1 - - A 28 bit E-UTRAN Cell Identifier (ECI) - - - eNB Status - RW - Single - Mandatory - Boolean - - - This resource indicates the current status of the eNB and can be used by the CCC to change the state from enabled to disabled. TRUE = eNB enabled FALSE = eNB disabled - - - Enable eNB - E - Single - Mandatory - - - - Enables the eNB. In addition the CrowdBox shall also update its configuration to reflect the current state of other relevant parameters. This might require a reboot. - - - eNB Maximum Power - RW - Single - Mandatory - Integer - 0..63 - dBm - Maximum power for the eNB measured as the sum of input powers to all antenna connectors. The maximum power per antenna port is equal to the maximum eNB power divided by the number of antenna ports. If the requested power is above or below the maximum or minimum power levels of the eNB, then the power level should be set to the maximum or minimum respectively. The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Backhaul Primary q-OffsetFreq - RW - Single - Mandatory - Integer - -24..24 - dB - q-OffsetFreq parameter for the backhaul primary EARFCN in SIB5 of the CrowdBox eNB BCCH. See TS 36.331 for details. Range: dB-24; dB-22 .. dB24 The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Backhaul Secondary q-OffsetFreq - RW - Multiple - Mandatory - Integer - -24..24 - dB - q-OffsetFreq parameter for the backhaul secondary EARFCN in SIB5 of the CrowdBox eNB BCCH. See TS 36.331 for details Range: dB-24; dB-22 .. dB24 The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Neighbour CrowdBox EARFCN - RW - Multiple - Mandatory - Integer - 0..66635 - - EARFCN of a neighbour CrowdBox. Each instance of this resource relates to the same instance of resource ID 15. - - - Neighbour CrowdBox q-OffsetFreq - RW - Multiple - Mandatory - Integer - -24..24 - dB - q-OffsetFreq parameter of the Neighbour CrowdBox EARFCN in SIB5 of the Neighbour CrowdBox eNB BCCH. See TS 36.331 for details Range: dB-24; dB-22 .. dB24 Each instance of this resource relates to the same instance of resource ID 14. The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Serving Macro eNB cellIndividualOffset - RW - Single - Mandatory - Integer - -24..24 - dB - Specifies the value of the cellIndividualOffset parameter applicable to the CrowdBox macro serving cell that is to be signalled to connected UEs in their measurement configuration information . See TS 36.331 for details. The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10246.xml b/common/transport/lwm2m/src/main/resources/models/10246.xml deleted file mode 100644 index b1667af963..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10246.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - CrowdBox Measurements - This LWM2M Object provides CrowdBox-related measurements such as serving cell parameters, backhaul timing advance, and neighbour cell reports. - 10246 - urn:oma:lwm2m:x:10246 - - - Single - Optional - - - Serving Cell ID - R - Single - Mandatory - Integer - 0..2^32-1 - - Serving cell ID as specified by the cellIdentity field broadcast in SIB1 of the serving cell (see TS 36.331). - - - Serving Cell RSRP - R - Single - Mandatory - Integer - 0..97 - - Serving cell RSRP, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 - - - Serving Cell RSRQ - R - Single - Mandatory - Integer - -30..46 - - Serving cell RSRQ, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 - - - Serving Cell SINR - R - Single - Mandatory - Integer - -10..30 - dB - SINR of serving cell as estimated by the CrowdBox. Note that this is a proprietary measurement dependent on the UE chipset manufacturer. The UE chipset used should be stated in the accompanying product documentation. - - - Cumulative Backhaul Timing Advance - R - Single - Optional - Integer - 0..65535 - - The cumulative timing advance signalled by the current serving cell to the CrowdBox. This is the sum of the initial timing advance signalled in the MAC payload of the Random Access Response (11 bits, 0 .. 1282) and subsequent adjustments signalled in the MAC PDU of DL-SCH transmissions (6 bits, -31 .. 32). See TS 36.321 for details. - - - Neighbour Cell Report - R - Multiple - Mandatory - Objlnk - - - A link to the "Neighbour Cell Report" object for each neighbour cell of the CrowdBox. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10247.xml b/common/transport/lwm2m/src/main/resources/models/10247.xml deleted file mode 100644 index 17f2f51be2..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10247.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - Neighbour Cell Report - This LWM2M Object provides the neighbour cell report. The CrowdBox Measurements Object and the Connected UE Report Object have both Objlnk Resources pointing to this Object. - 10247 - urn:oma:lwm2m:x:10247 - - - Multiple - Optional - - - Neighbour PCI - R - Single - Mandatory - Integer - 0..503 - - Physical Cell ID of neighbouring LTE cell, as defined in TS 36.211 - - - Neighbour Cell ID - R - Single - Optional - Integer - 0..2^32-1 - - Neighbour cell ID as specified by the cellIdentity field broadcast in SIB1 of the neighbour cell (see TS 36.331). - - - Neighbour Cell Rank - R - Single - Mandatory - Integer - 0..255 - - Current neighbour cell rank. Neighbour cells should be ordered (ranked) by the CrowdBox according to neighbour cell RSRP, with a higher RSRP corresponding to a lower index. Hence the neighbouring cell with the highest RSRP should be neighbour cell 0, the second neighbour cell 1, and so on. - - - Neighbour Cell RSRP - R - Single - Mandatory - Integer - 0..97 - - Neighbour cell RSRP, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 - - - Neighbour Cell RSRQ - R - Single - Mandatory - Integer - -30..46 - - Neighbour cell RSRQ, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10248.xml b/common/transport/lwm2m/src/main/resources/models/10248.xml deleted file mode 100644 index 92f2a0a284..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10248.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - Connected UE Measurements - This LWM2M Object provides a range of measurements of connected UEs and provides an Object link to the Connected UE report. - 10248 - urn:oma:lwm2m:x:10248 - - - Single - Optional - - - Number of Connected Users - R - Single - Mandatory - Integer - 0..255 - - The number of different UEs currently connected to the eNB (i.e. in RRC_CONNECTED state). - - - Cumulative Number of Unique Users - R - Single - Mandatory - Integer - 0..65535 - - The number of different UEs that have connected to the eNB over the immediately preceding period specified by the "Cumulative Measurement Window" field. - - - Connected UE Report - R - Multiple - Mandatory - Objlnk - - - Provides an Object link to the Connected UE Report which provides a range of information related to the connected UEs. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10249.xml b/common/transport/lwm2m/src/main/resources/models/10249.xml deleted file mode 100644 index ee9e5a9d5a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10249.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - Connected UE Report - This LWM2M Object provides a range of information related to the connected UEs. - 10249 - urn:oma:lwm2m:x:10249 - - - Multiple - Optional - - - Connected User MMEC - R - Single - Mandatory - Integer - 0..255 - - MMEC signalled by the UE to the eNB in the RRCConnectionRequest message (see TS 36.331). - - - Connected User M-TMSI - R - Single - Mandatory - Integer - 0..2^32-1 - - M-TMSI signalled by the UE to the eNB in the RRCConnectionRequest message (see TS 36.331). - - - Serving Cell (CrowdBox) eNB RSRP - R - Single - Mandatory - Integer - 0..97 - - The RSRP of the CrowdBox eNB, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 - - - Serving Cell (CrowdBox) eNB RSRQ - R - Single - Mandatory - Integer - -30..46 - - The RSRQ of the CrowdBox eNB, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 - - - Cumulative Timing Advance per Connected User - R - Single - Optional - Integer - 0..65535 - - The cumulative timing advance signalled by the eNB to each currently connected UE. This is the sum of the initial timing advance signalled in the MAC payload of the Random Access Response (11 bits, 0 .. 1282) and subsequent adjustments signalled in the MAC PDU of DL-SCH transmissions (6 bits, -31 .. 32). See TS 36.321 for details. - - - Last downlink CQI report per Connected User - R - Single - Mandatory - Integer - 0..255 - - The last downlink wideband CQI reported by a connected user the eNB. The CQI format is defined in Table 7.2.3-1 of TS 36.213. - - - Cumulative Downlink Throughput per Connected User - R - Single - Mandatory - Integer - 0..2^32-1 - B - The total number of MAC bytes sent to the connected user over the immediately preceding period specified by the "Cumulative Measurement Window" field. - - - Cumulative Uplink Throughput per Connected User - R - Single - Mandatory - Integer - 0..2^32-1 - B - The total number of MAC bytes received from the connected user over the immediately preceding period specified by the "Cumulative Measurement Window" field. - - - Neighbour Cell Report - R - Multiple - Mandatory - Objlnk - - - A link to the "Neighbour Cell Report" object for each neighbour cell reported to the CrowdBox by the connected UE - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10250.xml b/common/transport/lwm2m/src/main/resources/models/10250.xml deleted file mode 100644 index a29eda5005..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10250.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - App Data Container - - 10250 - urn:oma:lwm2m:x:10250 - 1.0 - 1.0 - Single - Optional - - - UL data - R - Single - Mandatory - Opaque - - - - - - - - DL data - W - Single - Mandatory - Opaque - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10251.xml b/common/transport/lwm2m/src/main/resources/models/10251.xml deleted file mode 100644 index 3fb1c00154..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10251.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - AT Command - - 10251 - urn:oma:lwm2m:x:10251 - 1.0 - 1.0 - Multiple - Optional - - - Command - RW - Single - Mandatory - String - - - - - - Response - R - Multiple - Mandatory - String - - - - - - Status - R - Multiple - Mandatory - String - - - - - - Timeout - RW - Single - Optional - Integer - - - - - - Run - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10252.xml b/common/transport/lwm2m/src/main/resources/models/10252.xml deleted file mode 100644 index ddaf7cb1f2..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10252.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Manifest - - 10252 - urn:oma:lwm2m:x:10252 - 1.0 - 1.0 - Single - Optional - - - Manifest - W - Single - Mandatory - Opaque - - - - - - - - State - R - Single - Mandatory - Integer - 0..8 - - - - - - Manifest Result - R - Single - Mandatory - Integer - 0..19 - - - - - - Payload Result - R - Single - Mandatory - Opaque - - - - - - - - Asset Hash - R - Single - Mandatory - Opaque - - - - - - - - Manifest version - R - Single - Mandatory - Integer - - - - - - - - Asset Installation Progress - R - Single - Mandatory - Integer - - - - - - - - Campaign Id - RW - Single - Mandatory - String - - - - - - - - Manual Trigger - E - Single - Mandatory - - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10253.xml b/common/transport/lwm2m/src/main/resources/models/10253.xml deleted file mode 100644 index 27da37d16a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10253.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - Confidential Data - - 10253 - urn:oma:lwm2m:x:10253 - 1.0 - 1.0 - Single - Optional - - - Public Key - RW - Single - Mandatory - Opaque - - - - - - - - Application Data - R - Single - Mandatory - Opaque - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10254.xml b/common/transport/lwm2m/src/main/resources/models/10254.xml deleted file mode 100644 index 706e1470aa..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10254.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - Current Loop Input - - 10254 - urn:oma:lwm2m:x:10254:1.0 - 1.0 - 1.0 - Multiple - Optional - - - Current Loop Input Current Value - R - Single - Mandatory - Float - 0; 3.8-20.5 - mA - - - - Min Measured Value - R - Single - Optional - Float - - - - - - Max Measured Value - R - Single - Optional - Float - - - - - - Min Range Value - R - Single - Optional - Float - - - - - - Max Range Value - R - Single - Optional - Float - - - - - - Reset Min and Max Measured Values - E - Single - Optional - - - - - - - Sensor Units - R - Single - Optional - String - - - - - - Application Type - RW - Single - Optional - String - - - - - - Current Calibration - RW - Single - Optional - Float - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10255.xml b/common/transport/lwm2m/src/main/resources/models/10255.xml deleted file mode 100644 index fd63016952..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10255.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - Device Metadata - - 10255 - urn:oma:lwm2m:x:10255 - 1.0 - 1.0 - Single - Optional - - - Protocol supported - R - Single - Mandatory - Integer - - - - - - - - Bootloader hash - R - Single - Mandatory - Opaque - - - - - - - - OEM bootloader hash - R - Single - Mandatory - Opaque - - - - - - - - Vendor - R - Single - Mandatory - String - - - - - - - - Class - R - Single - Mandatory - String - - - - - - - - Device - R - Single - Mandatory - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10256.xml b/common/transport/lwm2m/src/main/resources/models/10256.xml deleted file mode 100644 index 77d49f223e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10256.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - ECID-Signal Measurement Information - - 10256 - urn:oma:lwm2m:x:10256 - 1.0 - 1.0 - Multiple - Optional - - - physCellId - R - Single - Mandatory - Integer - - - - - - - - ECGI - R - Single - Optional - Integer - - - - - - - - arfcnEUTRA - R - Single - Mandatory - Integer - - - - - - - - rsrp-Result - R - Single - Mandatory - Integer - - - - - - - - rsrq-Result - R - Single - Optional - Integer - - - - - - - - ue-RxTxTimeDiff - R - Single - Optional - Integer - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10257.xml b/common/transport/lwm2m/src/main/resources/models/10257.xml deleted file mode 100644 index 64c26f5908..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10257.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - Heat / Cooling meter - - 10257 - urn:oma:lwm2m:x:10257 - 1.0 - 1.0 - Multiple - Optional - - - Manufacturer - R - Single - Optional - String - - - - - - Model Number - R - Single - Optional - String - - - - - - Serial Number - R - Single - Optional - String - - - - - - Description - R - Single - Optional - String - - - - - - Error code - R - Multiple - Optional - Integer - - - - - - - Instantaneous active power - R - Single - Optional - Float - - W - - - - Max Measured active power - R - Multiple - Mandatory - Float - - W - - - - Cumulative active power - R - Single - Optional - Float - - Wh - - - - Flow temperature - R - Single - Optional - Float - - Cel - - - - Max Measured flow temperature - R - Single - Optional - Float - - Cel - - - - Return temperature - R - Single - Optional - Float - - Cel - - - - Max Measured return temperature - R - Single - Optional - Float - - Cel - - - - Temperature difference - R - Single - Optional - Float - - K - - - - Flow rate - R - Single - Optional - Float - - m3/s - - - - Max Measured flow - R - Single - Optional - Float - - m3/s - - - - Flow volume - R - Single - Optional - Float - - m3 - - - - Return volume - R - Single - Optional - Float - - m3 - - - - Current Time - RW - Single - Optional - Time - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10258.xml b/common/transport/lwm2m/src/main/resources/models/10258.xml deleted file mode 100644 index 3fbf7c7c54..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10258.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Current Loop Output - - 10258 - urn:oma:lwm2m:x:10258 - 1.0 - 1.0 - Multiple - Optional - - - Current Loop Output Current Value - RW - Single - Mandatory - Float - 3.8-20.5 - mA - - - - Min Range Value - R - Single - Optional - Float - - - - - - Max Range Value - R - Single - Optional - Float - - - - - - Sensor Units - R - Single - Optional - String - - - - - - Application Type - RW - Single - Optional - String - - - - - - Current Calibration - RW - Single - Optional - Float - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10259.xml b/common/transport/lwm2m/src/main/resources/models/10259.xml deleted file mode 100644 index d75869a122..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10259.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - System Log - - 10259 - urn:oma:lwm2m:x:10259 - 1.0 - 1.0 - Multiple - Optional - - - Name - R - Single - Mandatory - String - - - - - - - - Read All - R - Single - Mandatory - String - - - - - - - - Read - R - Single - Optional - String - - - - - - - - Enabled - RW - Single - Optional - Boolean - - - - - - - - Capture Level - RW - Single - Optional - Integer - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10260-2_0.xml b/common/transport/lwm2m/src/main/resources/models/10260-2_0.xml deleted file mode 100644 index 5cd084af73..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10260-2_0.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - RDB - - 10260 - urn:oma:lwm2m:x:10260:2.0 - 1.0 - 2.0 - Multiple - Optional - - - Key - RW - Single - Mandatory - String - - - - - - - - Value - RW - Single - Optional - String - - - - - - - - Exists - RW - Single - Optional - Boolean - - - - - - - - Persistent - RW - Single - Optional - Boolean - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10262.xml b/common/transport/lwm2m/src/main/resources/models/10262.xml deleted file mode 100644 index 7b2e170c9b..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10262.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - Interval Data Delivery - - 10262 - urn:oma:lwm2m:x:10262 - Multiple - Optional - - - Name - RW - Single - Mandatory - String - - - - - - Interval Data Links - RW - Multiple - Mandatory - Objlnk - - - - - - Latest Payload - R - Multiple - Mandatory - Opaque - - - - - - Schedule - RW - Single - Optional - Objlnk - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10263.xml b/common/transport/lwm2m/src/main/resources/models/10263.xml deleted file mode 100644 index 5e18f44244..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10263.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - Event Data Delivery - - 10263 - urn:oma:lwm2m:x:10263 - Multiple - Optional - - - Name - RW - Single - Mandatory - String - - - - - - Event Data Links - RW - Multiple - Mandatory - Objlnk - - - - - - Latest Eventlog - R - Multiple - Mandatory - Opaque - - - - - - Schedule - RW - Single - Mandatory - Objlnk - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10264.xml b/common/transport/lwm2m/src/main/resources/models/10264.xml deleted file mode 100644 index eeaad07447..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10264.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - Delivery Schedule - - 10264 - urn:oma:lwm2m:x:10264 - Multiple - Optional - - - Schedule Start Time - RW - Single - Mandatory - Integer - - - - - - Schedule UTC Offset - RW - Single - Mandatory - String - - - - - - Delivery Frequency - RW - Single - Mandatory - Integer - - - - - - Randomised Delivery Window - RW - Single - Optional - Integer - - - - - - Number of Retries - RW - Single - Optional - Integer - - - - - - Retry Period - RW - Single - Optional - Integer - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10265.xml b/common/transport/lwm2m/src/main/resources/models/10265.xml deleted file mode 100644 index 26657bb754..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10265.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - Leakage Detection Configuration - - 10265 - urn:oma:lwm2m:x:10265 - Single - Optional - - - Sample Times - RW - Multiple - Mandatory - Integer - - - - - - Sample UTC Offset - RW - Single - Optional - String - - - - - - Detection Mode - RW - Single - Mandatory - Integer - 0..3 - - - - - Top Frequency Count - RW - Single - Optional - Integer - - - - - - Frequency Thresholds - RW - Multiple - Optional - Integer - 0..999 - - - - - Frequency Values - R - Multiple - Optional - Integer - - - - - - Firmware Version - R - Single - Mandatory - String - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10266.xml b/common/transport/lwm2m/src/main/resources/models/10266.xml deleted file mode 100644 index 57f7285b84..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10266.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - Water Flow Readings - - 10266 - urn:oma:lwm2m:x:10266 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10267.xml b/common/transport/lwm2m/src/main/resources/models/10267.xml deleted file mode 100644 index 3c6734723f..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10267.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - Daily Maximum Flow Rate Readings - - 10267 - urn:oma:lwm2m:x:10267 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10268.xml b/common/transport/lwm2m/src/main/resources/models/10268.xml deleted file mode 100644 index 9a6d06262e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10268.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - Temperature Readings - - 10268 - urn:oma:lwm2m:x:10268 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10269.xml b/common/transport/lwm2m/src/main/resources/models/10269.xml deleted file mode 100644 index 648227a7d7..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10269.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - Pressure Readings - - 10269 - urn:oma:lwm2m:x:10269 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10270.xml b/common/transport/lwm2m/src/main/resources/models/10270.xml deleted file mode 100644 index 69e3e7e5f3..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10270.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - Battery Level Readings - - 10270 - urn:oma:lwm2m:x:10270 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10271.xml b/common/transport/lwm2m/src/main/resources/models/10271.xml deleted file mode 100644 index f33a3d27e6..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10271.xml +++ /dev/null @@ -1,244 +0,0 @@ - - - - - - - Communications Activity Time Readings - - 10271 - urn:oma:lwm2m:x:10271 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10272.xml b/common/transport/lwm2m/src/main/resources/models/10272.xml deleted file mode 100644 index d70236947b..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10272.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Water Meter Customer Leakage Alarm - - 10272 - urn:oma:lwm2m:x:10272 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10273.xml b/common/transport/lwm2m/src/main/resources/models/10273.xml deleted file mode 100644 index 55404b38d5..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10273.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Water Meter Reverse Flow Alarm - - 10273 - urn:oma:lwm2m:x:10273 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10274.xml b/common/transport/lwm2m/src/main/resources/models/10274.xml deleted file mode 100644 index e0f9de62dc..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10274.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Water Meter Empty Pipe Alarm - - 10274 - urn:oma:lwm2m:x:10274 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10275.xml b/common/transport/lwm2m/src/main/resources/models/10275.xml deleted file mode 100644 index d0bc4dd350..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10275.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Water Meter Tamper Alarm - - 10275 - urn:oma:lwm2m:x:10275 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10276.xml b/common/transport/lwm2m/src/main/resources/models/10276.xml deleted file mode 100644 index 24f0e0056a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10276.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Water Meter High Pressure Alarm - - 10276 - urn:oma:lwm2m:x:10276 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10277.xml b/common/transport/lwm2m/src/main/resources/models/10277.xml deleted file mode 100644 index 07e431b9da..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10277.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Water Meter Low Pressure Alarm - - 10277 - urn:oma:lwm2m:x:10277 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10278.xml b/common/transport/lwm2m/src/main/resources/models/10278.xml deleted file mode 100644 index 9070e1c70e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10278.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - High Temperature Alarm - - 10278 - urn:oma:lwm2m:x:10278 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10279.xml b/common/transport/lwm2m/src/main/resources/models/10279.xml deleted file mode 100644 index 6eef195800..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10279.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Low Temperature Alarm - - 10279 - urn:oma:lwm2m:x:10279 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10280.xml b/common/transport/lwm2m/src/main/resources/models/10280.xml deleted file mode 100644 index 0fe4976077..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10280.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Water Network Leak Alarm - - 10280 - urn:oma:lwm2m:x:10280 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10281.xml b/common/transport/lwm2m/src/main/resources/models/10281.xml deleted file mode 100644 index a02a83e348..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10281.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Low Battery Alarm - - 10281 - urn:oma:lwm2m:x:10281 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10282.xml b/common/transport/lwm2m/src/main/resources/models/10282.xml deleted file mode 100644 index d7c97729b8..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10282.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Daughter Board Failure Alarm - - 10282 - urn:oma:lwm2m:x:10282 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10283.xml b/common/transport/lwm2m/src/main/resources/models/10283.xml deleted file mode 100644 index 6e4df48342..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10283.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Device Reboot Event - - 10283 - urn:oma:lwm2m:x:10283 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10284.xml b/common/transport/lwm2m/src/main/resources/models/10284.xml deleted file mode 100644 index 964df21df9..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10284.xml +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - Time Synchronisation Event - - 10284 - urn:oma:lwm2m:x:10284 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10286.xml b/common/transport/lwm2m/src/main/resources/models/10286.xml deleted file mode 100644 index 39e0809788..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10286.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - App Fota Container - - 10286 - urn:oma:lwm2m:x:10286 - 1.0 - 1.0 - Single - Optional - - - UL data - R - Single - Mandatory - Opaque - - - - - - - - DL data - W - Single - Mandatory - Opaque - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10290.xml b/common/transport/lwm2m/src/main/resources/models/10290.xml deleted file mode 100644 index 7b89cc06c0..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10290.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - Voltage Logging - - 10290 - urn:oma:lwm2m:x:10290 - 1.0 - 1.0 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10291.xml b/common/transport/lwm2m/src/main/resources/models/10291.xml deleted file mode 100644 index a232ed02f9..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10291.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - Voltage Transient - - 10291 - urn:oma:lwm2m:x:10291 - 1.0 - 1.0 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Mandatory - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Mandatory - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - Sample Frequency - RW - Single - Mandatory - Float - 0.0..86400.0 - s - How often the inputs are read/sampled.This value can be changed by doing a write command - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10292.xml b/common/transport/lwm2m/src/main/resources/models/10292.xml deleted file mode 100644 index 00fe33e320..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10292.xml +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - Pressure Transient - - 10292 - urn:oma:lwm2m:x:10292 - 1.0 - 1.0 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Mandatory - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Mandatory - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - Sample Frequency - RW - Single - Mandatory - Float - 0.0..86400.0 - s - How often the inputs are read/sampled.This value can be changed by doing a write command - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10299.xml b/common/transport/lwm2m/src/main/resources/models/10299.xml deleted file mode 100644 index 2c4ea4d2db..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10299.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - HostDevice - This LWM2M Object provides a range of host device related information which can be queried by the LWM2M Server. The host device is any integrated device with an embedded cellular radio module. - 10299 - urn:oma:lwm2m:x:10299 - 1.0 - 1.0 - Single - Optional - - - Manufacturer - R - Single - Mandatory - String - - - Host device manufacturers name (OEM). - - - Model - R - Single - Mandatory - String - - Identifier of the model name or number determined by device manufacturer. - UniqueID - R - Single - Mandatory - String - - - Unique ID assigned by an manufacturer or other body. Used to uniquely identify a host device. Examples include serial # or UUID. - - - FirmwareVersion - R - Single - Mandatory - String - - - Current Firmware version of the host device. (manufacturer specified string). - - SoftwareVersion - R - Single - Optional - String - - - Current software version of the host device. (manufacturer specified string). - - HardwareVersion - R - Single - Optional - String - - - Current hardware version of the host device. (manufacturer specified string). - - - DateStamp - R - Single - Optional - String - - - UTC value of the time and date of the last Firmware or Software update. Format:MM:DD:YYYY HH:MM:SS - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10300.xml b/common/transport/lwm2m/src/main/resources/models/10300.xml deleted file mode 100644 index b290057806..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10300.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - LWM2M Meta Object - - - - 10300 - urn:oma:lwm2m:x:10300 - 1.0 - 1.0 - Multiple - Optional - - - ObjectID - R - Single - Mandatory - Integer - - - - - - - - ObjectURN - R - Single - Mandatory - String - - - - - - - - ObjectInstanceHandle - R - Single - Optional - Objlnk - - - - - - - - URI - R - Multiple - Mandatory - String - - - - - - - - SHAType - R - Single - Optional - Integer - 0..8 - - - - - - - ChecksumValue - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10308-2_0.xml b/common/transport/lwm2m/src/main/resources/models/10308-2_0.xml deleted file mode 100644 index 0ed1a6ea30..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10308-2_0.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - AT&T Connectivity Extension - - 10308 - urn:oma:lwm2m:x:10308:2.0 - 1.0 - 2.0 - Multiple - Optional - - - ICCID - R - Single - Mandatory - String - - - - - - - IMSI - R - Single - Mandatory - String - - - - - - - MSISDN - RW - Single - Mandatory - String - - - - - - - APN Retries - RW - Single - Mandatory - Integer - - - - - - - APN Retry Period - RW - Single - Mandatory - Integer - - - s - - - - APN Retry Back-Off Period - RW - Single - Mandatory - Integer - - - s - - - - SINR - R - Single - Mandatory - Integer - <7 to >12.5 - - - - - SRXLEV - R - Single - Mandatory - Integer - - - - - - - CE_LEVEL - R - Single - Mandatory - Integer - 0,1,2 - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10309.xml b/common/transport/lwm2m/src/main/resources/models/10309.xml deleted file mode 100644 index 333580200e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10309.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Shareparkinglot - - 10309 - urn:oma:lwm2m:x:10309 - 1.0 - 1.0 - Multiple - Optional - - - LockID - R - Single - Mandatory - Integer - - - - - - LockType - R - Single - Optional - String - - - - - - LightSwitchState - R - Multiple - Optional - Boolean - - - - - - RSSI - R - Multiple - Mandatory - Integer - -30..-120 - dBm - - - - BatteryCapacity - R - Multiple - Optional - Float - 0..100 - %EL - - - - DataUpTime - R - Multiple - Mandatory - Time - - - - - - Latitude - R - Multiple - Optional - String - - - - - - Longitude - R - Multiple - Optional - String - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10311.xml b/common/transport/lwm2m/src/main/resources/models/10311.xml deleted file mode 100644 index e622197164..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10311.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - Solar Radiation - - This object is used to report solar irradiance (SI), i.e. power per unit area received from the Sun in the form of electromagnetic radiation, on a planar surface measured by a pyranometer or similar instrument. A pyranometer measures solar irradiance from the hemisphere above within a wavelength range 0.3 μm to 3 μm. For example, the application of solar radiation measurement can be meteorological networks and solar energy applications. - - 10311 - urn:oma:lwm2m:x:10311 - 1.0 - 1.0 - Multiple - Optional - - - Min Measured Value - R - Single - Optional - Float - - - - The minimum value measured by the sensor since it is ON or Reset, expressed in the unit defined by the "Sensor Units" resource if present. - - - - Max Measured Value - R - Single - Optional - Float - - - - The maximum value measured by the sensor since it is ON or Reset, expressed in the unit defined by the "Sensor Units" resource if present. - - - - Min Range Value - R - Single - Optional - Float - - - - The minimum value that can be measured by the sensor, expressed in the unit defined by the "Sensor Units" resource if present. - - - - Max Range Value - R - Single - Optional - Float - - - - The maximum value that can be measured by the sensor, expressed in the unit defined by the "Sensor Units" resource if present. - - - - Reset Min and Max Measured Values - E - Single - Optional - - - - - Reset the Min and Max Measured Values to current value. - - - - Timestamp - R - Single - Optional - Time - - - The timestamp of when the measurement was performed. - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor expressed in the unit defined by the "Sensor Units" resource if present. - - - Sensor Units - R - Single - Optional - String - - - - Measurement Units Definition. - - - - Application Type - RW - Single - Optional - String - - - - The application type of the sensor or actuator as a string, for instance "Air Pressure". - - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10313.xml b/common/transport/lwm2m/src/main/resources/models/10313.xml deleted file mode 100644 index 4875e5d6b0..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10313.xml +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - Gas Readings - - 10313 - urn:oma:lwm2m:x:103131.0 - 1.0Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - Sensor Warm-up Time - RW - Single - Optional - Integer - 0..86400 - s - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10314.xml b/common/transport/lwm2m/src/main/resources/models/10314.xml deleted file mode 100644 index 69f344ea34..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10314.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - Particulates - - 10314 - urn:oma:lwm2m:x:10314 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - - - - Min Measured Value - R - Single - Optional - Float - - - - - - Max Measured Value - R - Single - Optional - Float - - - - - - Max Range Value - R - Single - Optional - Float - - - - - - Sensor Units - R - Single - Optional - String - - - - - - Application Type - RW - Single - Optional - String - - - The Application type of the device, for example “Particulate Sensor”. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - - - - Measured Particle Size - R - Single - Mandatory - Float - - m - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10315.xml b/common/transport/lwm2m/src/main/resources/models/10315.xml deleted file mode 100644 index fcca456342..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10315.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - Robot - - 10315 - urn:oma:lwm2m:x:10315 - 1.0 - 1.0 - Single - Mandatory - - - Robot ID - R - Single - Mandatory - String - 0..255 - - - - - Robot Type - R - Single - Mandatory - String - 0..63 - - - - - Robot Serial Number - R - Single - Mandatory - String - 0..63 - - - - - Battery Level - R - Single - Mandatory - Integer - 0..100 - % - - - - Charging - R - Single - Mandatory - Boolean - - - - - - On time - RW - Single - Mandatory - Integer - - s - - - - Positioning - R - Single - Optional - Boolean - - - - - - Location - R - Single - Optional - Objlnk - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10316.xml b/common/transport/lwm2m/src/main/resources/models/10316.xml deleted file mode 100644 index 011055fde3..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10316.xml +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - RCU - - 10316 - urn:oma:lwm2m:x:10316 - 1.0 - 1.0 - Single - Mandatory - - - RCU ID - R - Single - Mandatory - String - 0..127 - - - - - RCU Serial Number - R - Single - Mandatory - String - 0..63 - - - - - RCU Software Version - R - Single - Mandatory - String - 0..63 - - - - - RCU OS Version - R - Single - Mandatory - String - 0..127 - - - - - RCU CPU Info - R - Single - Mandatory - String - 64 - - - - - RCU RAM Info - R - Single - Mandatory - String - 64 - - - - - RCU ROM Size - R - Single - Mandatory - Integer - - GB - - - - RCU ROM Available Size - R - Single - Mandatory - Integer - - GB - - - - SD Storage - R - Single - Mandatory - Integer - - GB - - - - SD Available Storage - R - Single - Mandatory - Integer - - GB - - - - RCU GPS Location - R - Single - Optional - Objlnk - - - - - - Wi-Fi MAC - R - Single - Optional - String - 12 - - - - - Bluetooth MAC - R - Single - Optional - String - 12 - - - - - Camera Info - R - Single - Optional - String - 64 - - - - - - Battery Level - R - Single - Mandatory - Integer - 0..100 - /100 - - - - - On time - RW - Single - Mandatory - Integer - - s - - - - - Downloaded APP Packages - R - Multiple - Mandatory - String - - - - - - - RCU APPs - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10318.xml b/common/transport/lwm2m/src/main/resources/models/10318.xml deleted file mode 100644 index 989db0de7e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10318.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - RCU PM - - 10318 - urn:oma:lwm2m:x:10318 - 1.0 - 1.0 - Single - Mandatory - - - CPU Usage - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Max CPU Usage - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Memory Usage - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Storage Usage - R - Single - Mandatory - Integer - 0..100 - /100 - - - - - Battery Level - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Network Bandwidth - R - Single - Mandatory - Float - - Mbit/s - - - - Mobile Signal - R - Single - Mandatory - Integer - - - - - - GPS Signal - R - Single - Optional - Integer - - - - - - Wi-Fi Signal - R - Single - Mandatory - Integer - - - - - - UpLink Rate - R - Single - Mandatory - Float - - Mbit/s - - - - DownLink Rate - R - Single - Mandatory - Float - - Mbit/s - - - - Packet Loss Rate - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Network Latency - R - Single - Mandatory - Integer - - ms - - - - - Battery Temperature - R - Single - Mandatory - Float - - Cel - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10319.xml b/common/transport/lwm2m/src/main/resources/models/10319.xml deleted file mode 100644 index b8ebcef6fb..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10319.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - RCU Control - - 10319 - urn:oma:lwm2m:x:10319 - 1.0 - 1.0 - Single - Mandatory - - - RCU Diagnostics Mode - R - Single - Optional - Boolean - - - - - - RCU Log Recording - R - Single - Optional - Boolean - - - - - - - RCU Shutdown - E - Single - Mandatory - - - - - - - RCU Restart - E - Single - Mandatory - - - - - - - RCU Deactivate - E - Single - Mandatory - - - - - - - RCU Reset - E - Single - Mandatory - - - - - - - RCU Diagnostics Mode Control - E - Single - Mandatory - - - - - - - RCU Log Recording Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10320.xml b/common/transport/lwm2m/src/main/resources/models/10320.xml deleted file mode 100644 index 2b46d7c920..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10320.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - CCU - - 10320 - urn:oma:lwm2m:x:10320 - 1.0 - 1.0 - Multiple - Optional - - - CCU ID - R - Single - Mandatory - String - - - - - - CCU FM Version - R - Single - Mandatory - String - - - - - - CCU SW Version - R - Single - Mandatory - String - - - - - - CCU Memory Size - R - Single - Mandatory - Integer - - GB - - - - CCU Storage - R - Single - Mandatory - Integer - - GB - - - - CCU Available Storage - R - Single - Mandatory - Integer - - GB - - - - - On time - RW - Single - Mandatory - Integer - - s - - - - - Downloaded APP Packages - R - Multiple - Optional - String - - - - - - CCU APPs - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10322.xml b/common/transport/lwm2m/src/main/resources/models/10322.xml deleted file mode 100644 index 98822e0efe..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10322.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - CCU PM - - 10322 - urn:oma:lwm2m:x:10322 - 1.0 - 1.0 - Multiple - Optional - - - CPU Usage - R - Single - Optional - Integer - 0..100 - % - - - - Max CPU Usage - R - Single - Optional - Integer - 0..100 - % - - - - Memory Usage - R - Single - Optional - Integer - 0..100 - % - - - - Storage Usage - R - Single - Optional - Integer - 0..100 - % - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10323.xml b/common/transport/lwm2m/src/main/resources/models/10323.xml deleted file mode 100644 index dcbdaeb91d..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10323.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - CCU Control - - 10323 - urn:oma:lwm2m:x:10323 - 1.0 - 1.0 - Multiple - Optional - - - - CCU Restart - E - Single - Mandatory - - - - - - - CCU Reset - E - Single - Mandatory - - - - - - - CCU Self-checking - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10324.xml b/common/transport/lwm2m/src/main/resources/models/10324.xml deleted file mode 100644 index e78bb099de..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10324.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - ECU - - 10324 - urn:oma:lwm2m:x:10324 - 1.0 - 1.0 - Multiple - Optional - - - ECU ID - R - Single - Mandatory - String - - - - - - ECU FM Version - R - Single - Mandatory - String - - - - - - On time - RW - Single - Mandatory - Integer - - s - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10326.xml b/common/transport/lwm2m/src/main/resources/models/10326.xml deleted file mode 100644 index 353e549829..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10326.xml +++ /dev/null @@ -1,722 +0,0 @@ - - - - - - Robot PM - - 10326 - urn:oma:lwm2m:x:10326 - 1.0 - 1.0 - Single - Mandatory - - - Battery Level - R - Single - Mandatory - Integer - 0..100 - /100 - - - - - Battery Temperature - R - Single - Mandatory - Integer - - Cel - - - - Temperature - R - Single - Optional - Float - - Cel - - - - Humidity - R - Single - Optional - Integer - 0..100 - /100 - - - - PM2.5 - R - Single - Optional - Integer - - ug/m3 - - - - Smog - R - Single - Optional - Float - - ug/m3 - - - - CO - R - Single - Optional - Float - - ppm - - - - CO2 - R - Single - Optional - Float - - ppm - - - - PM10 - R - Single - Optional - Integer - - ug/m3 - - - - Speed - R - Single - Optional - Float - - m/h - - - - Water Used - R - Single - Optional - Integer - 0..100 - /100 - - - - Dust Box Used - R - Single - Optional - Integer - 0..100 - /100 - - - - Obstacle Distance - R - Single - Optional - Integer - - cm - - - - - Robot Temperate - R - Single - Optional - Float - - Cel - - - - Confidence Index - R - Single - Optional - Integer - 0..100 - /100 - - - - - Data Traffic Used - R - Single - Mandatory - Float - - Mbit/s - - - - Images Handled - R - Single - Optional - Integer - - - - - - HARI S-Voice Requests - R - Single - Optional - Integer - - - - - - HARI S-Vision Requests - R - Single - Optional - Integer - - - - - - HARI S-Motion Requests - R - Single - Optional - Integer - - - - - - HARI S-Map Requests - R - Single - Optional - Integer - - - - - - Successful HARI S-Voice Requests - R - Single - Optional - Integer - - - - - - Successful HARI S-Vision Requests - R - Single - Optional - Integer - - - - - - Successful HARI S-Motion Requests - R - Single - Optional - Integer - - - - - - Successful HARI S-Map Requests - R - Single - Optional - Integer - - - - - - Questions Answered - R - Single - Optional - Integer - - - - - - Unknown Questions - R - Single - Optional - Integer - - - - - - Mileage - R - Single - Optional - Integer - - m - - - - Cleaned Times - R - Single - Optional - Integer - - - - - - Cleaned Area - R - Single - Optional - Float - - m2 - - - - Cleaned Time - R - Single - Optional - Integer - - s - - - - ASR Recognized - R - Single - Optional - Integer - - B - - - - Incorrect ASR Recognitions - R - Single - Optional - Integer - - B - - - - Tried TTS Texts - R - Single - Optional - Integer - - B - - - - Successful TTS Texts - R - Single - Optional - Integer - - B - - - - ASR Recognized (CH) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (CH) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (CH) - R - Single - Optional - Integer - - B - - - - ASR Recognized (EN) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (EN) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (EN) - R - Single - Optional - Integer - - B - - - - ASR Recognized (ES) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (ES) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (ES) - R - Single - Optional - Integer - - B - - - - ASR Recognized (JA) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (JA) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (JA) - R - Single - Optional - Integer - - B - - - - ASR Recognized (SCCH) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (SCCH) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (SCCH) - R - Single - Optional - Integer - - B - - - - ASR Recognized (GDCH) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (GDCH) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (GDCH) - R - Single - Optional - Integer - - B - - - - ASR Recognized (TCH) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (TCH) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (TCH) - R - Single - Optional - Integer - - B - - - - - Objects Recognition Tries - R - Single - Optional - Integer - - - - - - Successful Object Recognition - R - Single - Optional - Integer - - - - - - Face Recognition Tries - R - Single - Optional - Integer - - - - - - Successful Face Recognitions - R - Single - Optional - Integer - - - - - - Vehicle Plate Recognition Tries - R - Single - Optional - Integer - - - - - - Successful Vehicle Plate Recognitions - R - Single - Optional - Integer - - - - - - Tasks Assigned - R - Single - Mandatory - Integer - - - - - - Successful Tasks Executed - R - Single - Mandatory - Integer - - - - - - Images Uploaded - R - Single - Optional - Integer - - - - - - Videos Uploaded - R - Single - Optional - Integer - - - - - - Images Matted - R - Single - Optional - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10327.xml b/common/transport/lwm2m/src/main/resources/models/10327.xml deleted file mode 100644 index 5f0e232a22..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10327.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Compressor - - 10327 - urn:oma:lwm2m:x:10327 - 1.0 - 1.0 - Multiple - Optional - - - Compressor Name - R - Single - Mandatory - String - - - - - - - Compressor Status - R - Single - Mandatory - Boolean - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10328.xml b/common/transport/lwm2m/src/main/resources/models/10328.xml deleted file mode 100644 index fdf39d5dc1..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10328.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - SCA PM - - 10328 - urn:oma:lwm2m:x:10328 - 1.0 - 1.0 - Multiple - Optional - - - SCA Name - R - Single - Mandatory - String - - - - - - - - - SCA Current - R - Single - Mandatory - Float - - A - - - - SCA Temperate - R - Single - Mandatory - Float - - Cel - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10329.xml b/common/transport/lwm2m/src/main/resources/models/10329.xml deleted file mode 100644 index 7470bec6e1..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10329.xml +++ /dev/null @@ -1,433 +0,0 @@ - - - - - - Robot Control - - 10329 - urn:oma:lwm2m:x:10329 - 1.0 - 1.0 - Single - Mandatory - - - Collision Detection - R - Single - Optional - Boolean - - - - - - Drop Detection - R - Single - Optional - Boolean - - - - - - Automatic Navigation - R - Single - Optional - Boolean - - - - - - Robot Shutdown - E - Single - Mandatory - - - - - - - Robot Reboot - E - Single - Mandatory - - - - - - - Robot Reset - E - Single - Mandatory - - - - - - - Robot Wakeup - E - Single - Mandatory - - - - - - - Robot Sleep - E - Single - Mandatory - - - - - - - Robot Self-checking - E - Single - Mandatory - - - - - - - Emergency Braking - E - Single - Mandatory - - - - - - - Emergency Braking Release - E - Single - Mandatory - - - - - - - Action Execution - E - Single - Optional - - - - - - - Action List Upload - E - Single - Optional - - - - - - - Action List Download - E - Single - Optional - - - - - - - Group Dancing Program Control - E - Single - Optional - - - - - - - Navigation Map Upload - E - Single - Optional - - - - - - - Group Dancing Program Control - E - Single - Optional - - - - - - - Navigation Map Download - E - Single - Optional - - - - - - - Route list Execution - E - Single - Optional - - - - - - - Route list Upload - E - Single - Optional - - - - - - - Route list Download - E - Single - Optional - - - - - - - Automatic Navigation Control - E - Single - Optional - - - - - - - Manual Navigation - E - Single - Optional - - - - - - - Moving to Charging Station - E - Single - Optional - - - - - - - Moving to Specified location - E - Single - Optional - - - - - - - Low Frequency Patrol Broadcasting - E - Single - Optional - - - - - - - Task Start - E - Single - Optional - - - - - - - Task Stop - E - Single - Optional - - - - - - - Task Suspend - E - Single - Optional - - - - - - - Task Resume - E - Single - Optional - - - - - - - Video Upload - E - Single - Optional - - - - - - - Picture Upload - E - Single - Optional - - - - - - - Default Language Switching - E - Single - Optional - - - - - - - Intonation Change - E - Single - Optional - - - - - - - Intonation Change - E - Single - Optional - - - - - - - Speaking with Action - E - Single - Optional - - - - - - - Collision Detection Control - E - Single - Mandatory - - - - - - - Drop Detection Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10330.xml b/common/transport/lwm2m/src/main/resources/models/10330.xml deleted file mode 100644 index 75c5a2ecdd..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10330.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Network Info - - 10330 - urn:oma:lwm2m:x:10330 - 1.0 - 1.0 - Single - Mandatory - - - IMEI - R - Single - Mandatory - String - 15 - - - - - IMSI - R - Single - Mandatory - String - 15 - - - - - Radio Connectivity - R - Single - Mandatory - Objlnk - - - - - - - - GPS Signal Status - R - Single - Optional - Integer - 1..4 - - - - - VBN Connection Status - R - Single - Mandatory - Integer - 0..1 - - - - - HARI Connection Status - R - Single - Mandatory - Integer - 0..1 - - - - - CCU Connection Status - R - Multiple - Optional - Integer - 0..1 - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10331.xml b/common/transport/lwm2m/src/main/resources/models/10331.xml deleted file mode 100644 index ca555cc0d9..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10331.xml +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - Robot Service Info - - 10331 - urn:oma:lwm2m:x:10331 - 1.0 - 1.0 - Single - Mandatory - - - Current status - R - Single - Mandatory - String - 0..127 - - - - - Services Providing - R - Single - Optional - String - 0..127 - - - - - Advertising Contents - R - Single - Mandatory - String - - - - - - Current Language - R - Single - Optional - String - 0..127 - - - - - Volume - R - Single - Optional - String - 0..100 - /100 - - - - Moving Status - R - Single - Optional - Integer - 0..2 - - - - - Moving Speed - R - Single - Optional - Float - - m/h - - - - Location - R - Single - Optional - Objlnk - - - - - - - - Map List - R - Single - Optional - String - - - - - - Planned Route list - R - Single - Optional - String - - - - - - Current Route - R - Single - Optional - String - - - - - - Route to-do List - R - Single - Optional - String - - - - - - Synchronous Whistle - R - Single - Mandatory - Boolean - - - - - - Current Actions - R - Single - Optional - String - - - - - - ASR Type - R - Single - Optional - Integer - 0..2 - - - - - - TTS Vendor - R - Single - Optional - String - - - - - - TTS Speaker - R - Single - Optional - String - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10332.xml b/common/transport/lwm2m/src/main/resources/models/10332.xml deleted file mode 100644 index 6bda413092..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10332.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - Robot Selfcheck Info - - 10332 - urn:oma:lwm2m:x:10332 - 1.0 - 1.0 - Multiple - Optional - - - Entity - R - Single - Mandatory - String - 4..63 - - - - - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10333.xml b/common/transport/lwm2m/src/main/resources/models/10333.xml deleted file mode 100644 index 3a1f1f6dfa..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10333.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - PM Threshold - - 10333 - urn:oma:lwm2m:x:10333 - 1.0 - 1.0 - Single - Optional - - - Entity - RW - Multiple - Mandatory - String - 4..63 - - - - - Performance Type - RW - Multiple - Mandatory - String - - - - - - High Threshold - RW - Multiple - Mandatory - Float - - - - - - Low Threshold - RW - Multiple - Mandatory - Float - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10334.xml b/common/transport/lwm2m/src/main/resources/models/10334.xml deleted file mode 100644 index 547fb7a0d5..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10334.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - Robot Alarm - - 10334 - urn:oma:lwm2m:x:10334 - 1.0 - 1.0 - Multiple - Optional - - - Entity - R - Single - Mandatory - String - 4..63 - - - - - Probable Cause - R - Single - Mandatory - Integer - 0..65535 - - - - - Specific Problem - R - Single - Mandatory - String - - - - - - Alarm Type - R - Single - Mandatory - Integer - 2..6 - - - - - Severity - R - Single - Mandatory - Integer - 1..5 - - - - - Report Time - R - Single - Mandatory - Time - - - - - - Sequence No - R - Single - Mandatory - Integer - 0..2^63-1 - - - - - Additional Info - R - Single - Optional - String - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10335.xml b/common/transport/lwm2m/src/main/resources/models/10335.xml deleted file mode 100644 index 49640154e8..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10335.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - Event - - 10335 - urn:oma:lwm2m:x:10335 - 1.0 - 1.0 - Multiple - Optional - - - Entity - R - Single - Mandatory - String - 4..63 - - - - - Event Type - R - Single - Mandatory - Integer - 0..65535 - - - - - Time - R - Single - Mandatory - Time - - - - - - Sequence No - R - Single - Mandatory - Integer - 0..2^63-1 - - - - - Additional Info - R - Single - Optional - String - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10336.xml b/common/transport/lwm2m/src/main/resources/models/10336.xml deleted file mode 100644 index 74fae1916a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10336.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - MIC - - 10336 - urn:oma:lwm2m:x:10336 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10337.xml b/common/transport/lwm2m/src/main/resources/models/10337.xml deleted file mode 100644 index 3220c8e3e0..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10337.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - SCA - - 10337 - urn:oma:lwm2m:x:10337 - 1.0 - 1.0 - Multiple - Optional - - - SCA Name - R - Single - Mandatory - String - - - - - - - - - - SCA Motion Status - R - Single - Optional - Integer - 0..2 - - - - - - SCA Motion Control - E - Single - Optional - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10338.xml b/common/transport/lwm2m/src/main/resources/models/10338.xml deleted file mode 100644 index 48213fe176..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10338.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - Speaker - - 10338 - urn:oma:lwm2m:x:10338 - 1.0 - 1.0 - Single - Optional - - - Speaker status - R - Single - Mandatory - Boolean - - - - - - Voice Warning - R - Single - Mandatory - Boolean - - - - - - - Voice Control - E - Single - Mandatory - - - - - - - Voice Warning Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10339.xml b/common/transport/lwm2m/src/main/resources/models/10339.xml deleted file mode 100644 index d93e5fd778..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10339.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - Tripod Head - - 10339 - urn:oma:lwm2m:x:10339 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - Tripod Direction Control - E - Single - Optional - - - - - - - Tripod Automatic Control - E - Single - Optional - - - - - - - Tripod Reset - E - Single - Optional - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10340.xml b/common/transport/lwm2m/src/main/resources/models/10340.xml deleted file mode 100644 index 30123ba665..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10340.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - Camera - - 10340 - urn:oma:lwm2m:x:10340 - 1.0 - 1.0 - Multiple - Optional - - - Camera Name - R - Single - Mandatory - String - - - - - - - - Camera Status - R - Single - Mandatory - Boolean - - - - - - Connection Status - R - Single - Mandatory - Boolean - - - - - - Working Status - R - Single - Mandatory - Integer - 0..15 - - - - - Local Recording - R - Single - Mandatory - Boolean - - - - - - Image Matting - R - Single - Mandatory - Boolean - - - - - - Camera Snapshot - R - Single - Mandatory - Boolean - - - - - - Camera Recording - R - Single - Mandatory - Boolean - - - - - - - Camera Control - E - Single - Mandatory - - - - - - - Local Recording Control - E - Single - Mandatory - - - - - - - Image Matting Control - E - Single - Mandatory - - - - - - - Camera Snapshot Control - E - Single - Mandatory - - - - - - - Camera Recording Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10341.xml b/common/transport/lwm2m/src/main/resources/models/10341.xml deleted file mode 100644 index ca00c3ab0c..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10341.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - GPS - - 10341 - urn:oma:lwm2m:x:10341 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10342.xml b/common/transport/lwm2m/src/main/resources/models/10342.xml deleted file mode 100644 index 5a2c0d1982..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10342.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - IMU - - 10342 - urn:oma:lwm2m:x:10342 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10343.xml b/common/transport/lwm2m/src/main/resources/models/10343.xml deleted file mode 100644 index 309c80884d..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10343.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - LiDAR - - 10343 - urn:oma:lwm2m:x:10343 - 1.0 - 1.0 - Multiple - Optional - - - LiDAR Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10344.xml b/common/transport/lwm2m/src/main/resources/models/10344.xml deleted file mode 100644 index 9e3f80a491..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10344.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Arm - - 10344 - urn:oma:lwm2m:x:10344 - 1.0 - 1.0 - Multiple - Optional - - - Arm Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10345.xml b/common/transport/lwm2m/src/main/resources/models/10345.xml deleted file mode 100644 index 488ada316f..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10345.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Leg - - 10345 - urn:oma:lwm2m:x:10345 - 1.0 - 1.0 - Multiple - Optional - - - Leg Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10346.xml b/common/transport/lwm2m/src/main/resources/models/10346.xml deleted file mode 100644 index f5b22f8763..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10346.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Servomotor - - 10346 - urn:oma:lwm2m:x:10346 - 1.0 - 1.0 - Multiple - Optional - - - Servomotor Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10347.xml b/common/transport/lwm2m/src/main/resources/models/10347.xml deleted file mode 100644 index 7c20b00a40..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10347.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Screen - - 10347 - urn:oma:lwm2m:x:10347 - 1.0 - 1.0 - Single - Optional - - - Screen Status - R - Single - Mandatory - Boolean - - - - - - Startup Page - R - Single - Optional - String - - - The Startup Page of the screen. - - - Current Displaying Page or Current Screen Play List - R - Single - Optional - String - - - Current Displaying Page or Current Screen Play List. - - - - Screen Control - E - Single - Mandatory - - - - - - - Startup Page Set - E - Single - Mandatory - - - - - - - Screen Page Set - E - Single - Mandatory - - - - - - - Screen Play List Set - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10348.xml b/common/transport/lwm2m/src/main/resources/models/10348.xml deleted file mode 100644 index 3d8a2d460f..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10348.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Wheel - - 10348 - urn:oma:lwm2m:x:10348 - 1.0 - 1.0 - Multiple - Optional - - - Wheel Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10349.xml b/common/transport/lwm2m/src/main/resources/models/10349.xml deleted file mode 100644 index 8eb7d27ecf..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10349.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - Chassis - - 10349 - urn:oma:lwm2m:x:10349 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10350.xml b/common/transport/lwm2m/src/main/resources/models/10350.xml deleted file mode 100644 index 64295e65bc..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10350.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - Light - - 10350 - urn:oma:lwm2m:x:10350 - 1.0 - 1.0 - Multiple - Optional - - - Light Name - R - Single - Mandatory - String - - - - - - - - Light Status - R - Single - Mandatory - Boolean - - - - - - - Light Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10351.xml b/common/transport/lwm2m/src/main/resources/models/10351.xml deleted file mode 100644 index 473b440b02..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10351.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - Door - - 10351 - urn:oma:lwm2m:x:10351 - 1.0 - 1.0 - Multiple - Optional - - - Door Name - R - Single - Mandatory - String - - - - - - - Door Status - R - Single - Mandatory - Boolean - - - - - - - Door Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10352.xml b/common/transport/lwm2m/src/main/resources/models/10352.xml deleted file mode 100644 index da1dac5834..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10352.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - Thermal Imager - - 10352 - urn:oma:lwm2m:x:10352 - 1.0 - 1.0 - Single - Optional - - - - Highest Temperature - R - Single - Mandatory - Float - -100.0..100.0 - Cel - The Highest Temperature of the thermal imager. - - - Lowest Temperature - R - Single - Mandatory - Float - -100.0..100.0 - Cel - The Lowest Temperature of the thermal imager. - - - Average Temperature - R - Single - Mandatory - Float - -100.0..100.0 - Cel - The Average Temperature of the thermal imager. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10353.xml b/common/transport/lwm2m/src/main/resources/models/10353.xml deleted file mode 100644 index 0b6bb56cc4..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10353.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - Warning Light - - 10353 - urn:oma:lwm2m:x:10353 - 1.0 - 1.0 - Single - Optional - - - Light Status - R - Single - Mandatory - Boolean - - - - - - Light Warning - R - Single - Mandatory - Boolean - - - - - - Light Control - E - Single - Mandatory - - - - - - - Light Warning Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10354.xml b/common/transport/lwm2m/src/main/resources/models/10354.xml deleted file mode 100644 index 3459409720..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10354.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - APP - - 10354 - urn:oma:lwm2m:x:10354 - 1.0 - 1.0 - Multiple - Mandatory - - - APP Name - RW - Single - Mandatory - String - - - The name of the APP, human readable string. - - - APP Version - RW - Single - Mandatory - String - - - The version of the APP, human readable string. - - - APP Build No - RW - Single - Optional - String - - - The Build No of the APP, human readable string. - - - APP Patch No - RW - Single - Optional - String - - - The Patch No of the APP, human readable string. - - - Package URI - W - Single - Optional - String - 0-255 bytes - - - - - Vendor Name - RW - Single - Optional - String - - - The vendor of the package. - - - Installation Target - RW - Single - Mandatory - Objlnk - - - - - - APP Status - R - Single - Mandatory - Integer - 0..5 - - The Status of the APP, 0:Downloading, 1:Downloaded, 2:Installed, 3:Verified, 4:Activated, 5:Stopped. - - - APP Restart - E - Single - Mandatory - - - - - - - APP Start - E - Single - Mandatory - - - - - - - APP Stop - E - Single - Mandatory - - - - - - - APP Download - E - Single - Mandatory - - - - - - - APP Install - E - Single - Mandatory - - - - - - - APP Uninstall - E - Single - Mandatory - - - - - - - APP Activate - E - Single - Mandatory - - - - - - - APP Deactivate - E - Single - Mandatory - - - - - - - APP Verify - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10355.xml b/common/transport/lwm2m/src/main/resources/models/10355.xml deleted file mode 100644 index fb38ee2767..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10355.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - General Info - - 10355 - urn:oma:lwm2m:x:10355 - 1.0 - 1.0 - Single - Optional - - - Robot General Info - R - Single - Mandatory - Objlnk - - - - - - - - RCU General Info - R - Single - Mandatory - Objlnk - - - - - - - - CCU General Info - R - Multiple - Optional - Objlnk - - - - - - - - ECU General Info - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10356.xml b/common/transport/lwm2m/src/main/resources/models/10356.xml deleted file mode 100644 index 2e362ce052..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10356.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - Service Info - - 10356 - urn:oma:lwm2m:x:10356 - 1.0 - 1.0 - Single - Optional - - - Robot Service Info - R - Single - Mandatory - Objlnk - - - - - - - - SCA Info - R - Multiple - Optional - Objlnk - - - - - - - - Speaker Info - R - Single - Optional - Objlnk - - - - - - - - Camera Info - R - Multiple - Optional - Objlnk - - - - - - - - Screen Info - R - Single - Optional - Objlnk - - - - - - - - Light Info - R - Multiple - Optional - Objlnk - - - - - - - - Warning Light Info - R - Single - Optional - Objlnk - - - - - - - - Door Info - R - Multiple - Optional - Objlnk - - - - - - - - Thermal Imager Info - R - Single - Optional - Objlnk - - - - - - - - Compressor Info - R - Multiple - Optional - Objlnk - - - - - - - - Lock Info - R - Multiple - Optional - Objlnk - - - - - - - - Collision Sensor Info - R - Multiple - Optional - Objlnk - - - - - - - - Drop Sensor Info - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10357.xml b/common/transport/lwm2m/src/main/resources/models/10357.xml deleted file mode 100644 index 9487b2813d..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10357.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - PM - - 10357 - urn:oma:lwm2m:x:10357 - 1.0 - 1.0 - Single - Optional - - - Robot PM - R - Single - Mandatory - Objlnk - - - - - - - - RCU PM - R - Single - Mandatory - Objlnk - - - - - - - - CCU PM - R - Multiple - Optional - Objlnk - - - - - - - - SCA PM - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10358.xml b/common/transport/lwm2m/src/main/resources/models/10358.xml deleted file mode 100644 index 27a3684b22..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10358.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - Fan PM - - 10358 - urn:oma:lwm2m:x:10358 - 1.0 - 1.0 - Multiple - Optional - - - Fan Name - R - Single - Mandatory - String - - - - - - - - - Fan Speed - R - Single - Optional - Integer - - 1/min - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10359.xml b/common/transport/lwm2m/src/main/resources/models/10359.xml deleted file mode 100644 index 2fc8af9677..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10359.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - Lock - - 10359 - urn:oma:lwm2m:x:10359 - 1.0 - 1.0 - Multiple - Optional - - - Lock Name - R - Single - Mandatory - String - - - - - - Lock Status - R - Single - Optional - Boolean - - - - - - - Lock Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10360.xml b/common/transport/lwm2m/src/main/resources/models/10360.xml deleted file mode 100644 index 935fea848c..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10360.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - Ultrasonic Sensor - - 10360 - urn:oma:lwm2m:x:10360 - 1.0 - 1.0 - Multiple - Optional - - - Name - R - Single - Mandatory - String - - - - - - - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10361.xml b/common/transport/lwm2m/src/main/resources/models/10361.xml deleted file mode 100644 index 3525647afd..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10361.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - Collision Sensor - - 10361 - urn:oma:lwm2m:x:10361 - 1.0 - 1.0 - Multiple - Optional - - - Name - R - Single - Mandatory - String - - - - - - - - Status - R - Single - Mandatory - Integer - - - - - - - Collision Detection - R - Single - Optional - Boolean - - - - - - - Collision Detection Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10362.xml b/common/transport/lwm2m/src/main/resources/models/10362.xml deleted file mode 100644 index 8a928e4425..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10362.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - Drop Sensor - - 10362 - urn:oma:lwm2m:x:10362 - 1.0 - 1.0 - Multiple - Optional - - - Name - R - Single - Mandatory - String - - - - - - - - Status - R - Single - Mandatory - Integer - - - - - - Drop Detection - R - Single - Optional - Boolean - - - - - - - Drop Detection Control - E - Single - Mandatory - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10363.xml b/common/transport/lwm2m/src/main/resources/models/10363.xml deleted file mode 100644 index ca9d064f2f..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10363.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - Temperature Sensor - - 10363 - urn:oma:lwm2m:x:10363 - 1.0 - 1.0 - Single - Optional - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10364.xml b/common/transport/lwm2m/src/main/resources/models/10364.xml deleted file mode 100644 index 3519665e62..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10364.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - Humidity Sensor - - 10364 - urn:oma:lwm2m:x:10364 - 1.0 - 1.0 - Single - Optional - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10365.xml b/common/transport/lwm2m/src/main/resources/models/10365.xml deleted file mode 100644 index 792844271e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10365.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - Gas-Dust Sensor - - 10365 - urn:oma:lwm2m:x:10365 - 1.0 - 1.0 - Single - Optional - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10366.xml b/common/transport/lwm2m/src/main/resources/models/10366.xml deleted file mode 100644 index 44e94ae51d..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10366.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - Fan - - 10366 - urn:oma:lwm2m:x:10366 - 1.0 - 1.0 - Multiple - Optional - - - Fan Name - R - Single - Mandatory - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10368.xml b/common/transport/lwm2m/src/main/resources/models/10368.xml deleted file mode 100644 index f063e010fe..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10368.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - SpringMotor - - 10368 - urn:oma:lwm2m:x:10368 - 1.0 - 1.0 - Multiple - Optional - - - SpringMotor Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/10369.xml b/common/transport/lwm2m/src/main/resources/models/10369.xml deleted file mode 100644 index 68c345beaf..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/10369.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - MCU - - 10369 - urn:oma:lwm2m:x:10369 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2048.xml b/common/transport/lwm2m/src/main/resources/models/2048.xml deleted file mode 100644 index 0bc99cffd1..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2048.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - CmdhPolicy - - 2048 - urn:oma:lwm2m:ext:20481.0 - 1.0Multiple - Optional - - Name - RW - Single - Mandatory - String - - - - - DefaultRule - RW - Single - Mandatory - Objlnk - - - - - LimiRules - RW - Multiple - Mandatory - Objlnk - - - - - NetworkAccessECRules - RW - Multiple - Mandatory - Objlnk - - - - - BufferRules - RW - Multiple - Mandatory - Objlnk - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2049.xml b/common/transport/lwm2m/src/main/resources/models/2049.xml deleted file mode 100644 index 7509b22160..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2049.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - ActiveCmdhPolicy - - 2049 - urn:oma:lwm2m:ext:20491.0 - 1.0Single - Optional - - ActiveLink - RW - Single - Mandatory - Objlnk - - - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2050.xml b/common/transport/lwm2m/src/main/resources/models/2050.xml deleted file mode 100644 index da27a90de0..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2050.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - CmdhDefaults - - 2050 - urn:oma:lwm2m:ext:20501.0 - 1.0Multiple - Optional - - DefaultEcRules - RW - Multiple - Mandatory - Objlnk - - - - - - DefaultEcParamRules - RW - Multiple - Mandatory - Objlnk - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2051.xml b/common/transport/lwm2m/src/main/resources/models/2051.xml deleted file mode 100644 index f3904e8a2c..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2051.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - CmdhDefEcValues - - 2051 - urn:oma:lwm2m:ext:20511.0 - 1.0Multiple - Optional - - Order - RW - Single - Mandatory - Integer - - - - - DefEcValue - RW - Single - Mandatory - String - - - - - RequestOrigin - RW - Multiple - Mandatory - String - - - - - RequestContext - RW - Single - Optional - String - - - - - RequestContextNotification - RW - Single - Optional - Boolean - - - - - RequestCharacteristics - RW - Single - Optional - String - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2052.xml b/common/transport/lwm2m/src/main/resources/models/2052.xml deleted file mode 100644 index abaae1b54e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2052.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - CmdhEcDefParamValues - - 2052 - urn:oma:lwm2m:ext:20521.0 - 1.0Multiple - Optional - - ApplicableEventCategory - RW - Multiple - Mandatory - Integer - - - - - DefaultRequestExpTime - RW - Single - Mandatory - Integer - - ms - - - - - - - - - DefaultResultExpTime - RW - Single - Mandatory - Integer - - ms - - - - DefaultOpExecTime - RW - Single - Mandatory - Integer - - ms - - - DefaultRespPersistence - RW - Single - Mandatory - Integer - - ms - - - DefaultDelAggregation - RW - Single - Mandatory - Integer - - ms - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2053.xml b/common/transport/lwm2m/src/main/resources/models/2053.xml deleted file mode 100644 index 0b119c70fc..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2053.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - CmdhLimits - - 2053 - urn:oma:lwm2m:ext:20531.0 - 1.0Multiple - Optional - - Order - RW - Single - Mandatory - Integer - - - - - RequestOrigin - RW - Multiple - Mandatory - String - - - - - - - - - - - RequestContext - RW - Single - Optional - String - - - - - - RequestContextNotificatio - RW - Single - Optional - Boolean - - - - - RequestCharacteristics - RW - Single - Optional - String - - - - - LimitsEventCategory - RW - Multiple - Mandatory - Integer - - - - - LimitsRequestExpTime - RW - Multiple - Mandatory - Integer - 2 Instances - ms - - - LimitsResultExpTime - RW - Multiple - Mandatory - Integer - 2 Instances - ms - - - LimitsOptExpTime - RW - Multiple - Mandatory - Integer - 2 Instances - ms - - - LimitsRespPersistence - RW - Multiple - Mandatory - Integer - 2 Instances - ms - - - LimitsDelAggregation - RW - Multiple - Mandatory - String - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2054.xml b/common/transport/lwm2m/src/main/resources/models/2054.xml deleted file mode 100644 index 3935fb7253..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2054.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - CmdhNetworkAccessRules - - 2054 - urn:oma:lwm2m:ext:20541.0 - 1.0Multiple - Optional - - ApplicableEventCategories - RW - Multiple - Mandatory - Integer - - - - - NetworkAccessRule - RW - Multiple - Optional - Objlnk - - - - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2055.xml b/common/transport/lwm2m/src/main/resources/models/2055.xml deleted file mode 100644 index cbd0dc5796..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2055.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - CmdhNwAccessRule - - 2055 - urn:oma:lwm2m:ext:20551.0 - 1.0Multiple - Optional - - TargetNetwork - RW - Multiple - Mandatory - String - - - - - SpreadingWaitTime - RW - Single - Mandatory - Integer - - ms - - - MinReqVolume - RW - Single - Mandatory - Integer - - B - - - BackOffParameters - RW - Single - Mandatory - Objlnk - - - - - OtherConditions - RW - Single - Mandatory - String - - - - - AllowedSchedule - RW - Multiple - Mandatory - String - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2056.xml b/common/transport/lwm2m/src/main/resources/models/2056.xml deleted file mode 100644 index ddd50e269a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2056.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - CmdhBuffer - - 2056 - urn:oma:lwm2m:ext:20561.0 - 1.0Multiple - Optional - - ApplicableEventCategory - RW - Multiple - Mandatory - Integer - - - - - MaxBufferSize - RW - Single - Mandatory - Integer - - B - - - StoragePriority - RW - Single - Mandatory - Integer - 1..10 - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/2057.xml b/common/transport/lwm2m/src/main/resources/models/2057.xml deleted file mode 100644 index 68d4bcd135..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/2057.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - CmdhBackOffParametersSet - - 2057 - urn:oma:lwm2m:ext:2057 - 1.0 - 1.0 - Multiple - Optional - - NetworkAction - RW - Single - Optional - Integer - 1..5 - - - - InitialBackoffTime - RW - Single - Mandatory - Integer - - ms - - - AdditionalBackoffTime - RW - Single - Mandatory - Integer - - ms - - - MaximumBackoffTime - RW - Single - Mandatory - Integer - - ms - - - OptionalRandomBackoffTime - RW - Multiple - Optional - Integer - - ms - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/31024.xml b/common/transport/lwm2m/src/main/resources/models/31024.xml deleted file mode 100644 index 85ba52a79d..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/31024.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - Test - A Wakaama object for testing purpose. - - 31024 - urn:oma:lwm2m:x:31024 - Multiple - Optional - - - test - RW - Single - Mandatory - Integer - 0-255 - - - - exec - E - Single - Mandatory - - - - dec - RW - Single - Mandatory - Float - - - - - - sig - RW - Single - Optional - Integer - - - 16-bit signed integer - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3200.xml b/common/transport/lwm2m/src/main/resources/models/3200.xml deleted file mode 100644 index 5a0dce0378..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3200.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - Digital Input - Generic digital input for non-specific sensors - 3200 - urn:oma:lwm2m:ext:3200 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Mandatory - Boolean - - - The current state of a digital input. - - - Digital Input Counter - R - Single - Optional - Integer - - - The cumulative value of active state detected. - - - Digital Input Polarity - RW - Single - Optional - Boolean - - - The polarity of the digital input as a Boolean (False = Normal, True = Reversed). - - - Digital Input Debounce - RW - Single - Optional - Integer - - ms - The debounce period in ms. - - - Digital Input Edge Selection - RW - Single - Optional - Integer - 1..3 - - The edge selection as an integer (1 = Falling edge, 2 = Rising edge, 3 = Both Rising and Falling edge). - - - Digital Input Counter Reset - E - Single - Optional - - - - Reset the Counter value. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string, for instance, "Air Pressure" - - - Sensor Type - R - Single - Optional - String - - - The type of the sensor (for instance PIR type) - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3201.xml b/common/transport/lwm2m/src/main/resources/models/3201.xml deleted file mode 100644 index 0920d9b030..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3201.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - Digital Output - Generic digital output for non-specific actuators - 3201 - urn:oma:lwm2m:ext:3201 - 1.0 - 1.0 - Multiple - Optional - - - Digital Output State - RW - Single - Mandatory - Boolean - - - The current state of a digital output. - - - Digital Output Polarity - RW - Single - Optional - Boolean - - - The polarity of the digital output as a Boolean (False = Normal, True = Reversed). - - - Application Type - RW - Single - Optional - String - - - The application type of the output as a string, for instance, "LED" - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3202.xml b/common/transport/lwm2m/src/main/resources/models/3202.xml deleted file mode 100644 index 413ba0103b..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3202.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - Analog Input - Generic analog input for non-specific sensors - 3202 - urn:oma:lwm2m:ext:3202 - 1.0 - 1.0 - Multiple - Optional - - - Analog Input Current Value - R - Single - Mandatory - Float - - - The current value of the analog input. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string, for instance, "Air Pressure" - - - Sensor Type - R - Single - Optional - String - - - The type of the sensor, for instance PIR type - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3203.xml b/common/transport/lwm2m/src/main/resources/models/3203.xml deleted file mode 100644 index e807aca00a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3203.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - Analog Output - This IPSO object is a generic object that can be used with any kind of analog output interface. - 3203 - urn:oma:lwm2m:ext:3203 - 1.0 - 1.0 - Multiple - Optional - - - Analog Output Current Value - RW - Single - Mandatory - Float - 0..1 - - The current state of the analogue output. - - - Application Type - RW - Single - Optional - String - - - If present, the application type of the actuator as a string, for instance, "Valve" - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be set for the output - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be set for the output - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3300.xml b/common/transport/lwm2m/src/main/resources/models/3300.xml deleted file mode 100644 index 58cf4f67cb..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3300.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - Generic Sensor - This IPSO object allows the description of a generic sensor. It is based on the description of a value and a unit according to the SenML specification. Thus, any type of value defined within this specification can be reported using this object. This object may be used as a generic object if a dedicated one does not exist. - 3300 - urn:oma:lwm2m:ext:3300 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Application Type - RW - Single - Optional - String - - - If present, the application type of the sensor as a string, for instance, "CO2" - - - Sensor Type - R - Single - Optional - String - - - The type of the sensor (for instance PIR type) - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3301.xml b/common/transport/lwm2m/src/main/resources/models/3301.xml deleted file mode 100644 index 7dfb81d230..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3301.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - Illuminance - Illuminance sensor, example units = lx - 3301 - urn:oma:lwm2m:ext:3301 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - The current value of the luminosity sensor. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3302.xml b/common/transport/lwm2m/src/main/resources/models/3302.xml deleted file mode 100644 index 0223d2f772..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3302.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - Presence - Presence sensor with digital sensing, optional delay parameters - 3302 - urn:oma:lwm2m:ext:3302 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Mandatory - Boolean - - - The current state of the presence sensor - - - Digital Input Counter - R - Single - Optional - Integer - - - The cumulative value of active state detected. - - - Digital Input Counter Reset - E - Single - Optional - - - - Reset the Counter value - - - Sensor Type - R - Single - Optional - String - - - The type of the sensor (for instance PIR type) - - - Busy to Clear delay - RW - Single - Optional - Integer - - ms - Delay from the detection state to the clear state in ms - - - Clear to Busy delay - RW - Single - Optional - Integer - - ms - Delay from the clear state to the busy state in ms - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3303.xml b/common/transport/lwm2m/src/main/resources/models/3303.xml deleted file mode 100644 index b638c932a8..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3303.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - Temperature - This IPSO object should be used with a temperature sensor to report a temperature measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the temperature sensor. An example measurement unit is degrees Celsius. - 3303 - urn:oma:lwm2m:ext:3303 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3304.xml b/common/transport/lwm2m/src/main/resources/models/3304.xml deleted file mode 100644 index 61d65c998b..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3304.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - Humidity - This IPSO object should be used with a humidity sensor to report a humidity measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the humidity sensor. An example measurement unit is relative humidity as a percentage. - 3304 - urn:oma:lwm2m:ext:3304 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3305.xml b/common/transport/lwm2m/src/main/resources/models/3305.xml deleted file mode 100644 index cd50b18907..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3305.xml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - Power Measurement - This IPSO object should be used over a power measurement sensor to report a remote power measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range for both active and reactive power. It also provides resources for cumulative energy, calibration, and the power factor. - 3305 - urn:oma:lwm2m:ext:3305 - 1.0 - 1.0 - Multiple - Optional - - - Instantaneous active power - R - Single - Mandatory - Float - - W - The current active power - - - Min Measured active power - R - Single - Optional - Float - - W - The minimum active power measured by the sensor since it is ON - - - Max Measured active power - R - Single - Optional - Float - - W - The maximum active power measured by the sensor since it is ON - - - Min Range active power - R - Single - Optional - Float - - W - The minimum active power that can be measured by the sensor - - - Max Range active power - R - Single - Optional - Float - - W - The maximum active power that can be measured by the sensor - - - Cumulative active power - R - Single - Optional - Float - - Wh - The cumulative active power since the last cumulative energy reset or device start - - - Active Power Calibration - W - Single - Optional - Float - - W - Request an active power calibration by writing the value of a calibrated load. - - - Instantaneous reactive power - R - Single - Optional - Float - - var - The current reactive power - - - Min Measured reactive power - R - Single - Optional - Float - - var - The minimum reactive power measured by the sensor since it is ON - - - Max Measured reactive power - R - Single - Optional - Float - - var - The maximum reactive power measured by the sensor since it is ON - - - Min Range reactive power - R - Single - Optional - Float - - var - The minimum active power that can be measured by the sensor - - - Max Range reactive power - R - Single - Optional - Float - - var - The maximum reactive power that can be measured by the sensor - - - Cumulative reactive power - R - Single - Optional - Float - - varh - The cumulative reactive power since the last cumulative energy reset or device start - - - Reactive Power Calibration - W - Single - Optional - Float - - var - Request a reactive power calibration by writing the value of a calibrated load. - - - Power factor - R - Single - Optional - Float - - - If applicable, the power factor of the current consumption. - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Reset Cumulative energy - E - Single - Optional - - - - Reset both cumulative active/reactive power - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3306.xml b/common/transport/lwm2m/src/main/resources/models/3306.xml deleted file mode 100644 index 6e76808d96..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3306.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - Actuation - This IPSO object is dedicated to remote actuation such as ON/OFF action or dimming. A multi-state output can also be described as a string. This is useful to send pilot wire orders for instance. It also provides a resource to reflect the time that the device has been switched on. - 3306 - urn:oma:lwm2m:ext:3306 - 1.0 - 1.0 - Multiple - Optional - - - On/Off - RW - Single - Mandatory - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Dimmer - RW - Single - Optional - Integer - 0..100 - /100 - This resource represents a light dimmer setting, which has an Integer value between 0 and 100 as a percentage. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds that the device has been on. Writing a value of 0 resets the counter. - - - Muti-state Output - RW - Single - Optional - String - - - A string describing a state for multiple level output such as Pilot Wire - - - Application Type - RW - Single - Optional - String - - - The Application type of the device, for example "Motion Closure". - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3308.xml b/common/transport/lwm2m/src/main/resources/models/3308.xml deleted file mode 100644 index 865df6235f..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3308.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - Set Point - This IPSO object should be used to set a desired value to a controller, such as a thermostat. A special resource is added to set the colour of an object. - 3308 - urn:oma:lwm2m:ext:3308 - 1.0 - 1.0 - Multiple - Optional - - - Set Point Value - RW - Single - Mandatory - Float - - - The setpoint value. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Colour - RW - Single - Optional - String - - - A string representing a value in some color space - - - Application Type - RW - Single - Optional - String - - - The Application type of the device, for example "Motion Closure". - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3310.xml b/common/transport/lwm2m/src/main/resources/models/3310.xml deleted file mode 100644 index 75e381f488..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3310.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - Load Control - This Object is used for demand-response load control and other load control in automation application (not limited to power). - 3310 - urn:oma:lwm2m:ext:3310 - 1.0 - 1.0 - Multiple - Optional - - - Event Identifier - RW - Single - Mandatory - String - - - The event identifier as a string. - - - Start Time - RW - Single - Mandatory - Time - - - Time when the event started. - - - Duration In Min - RW - Single - Mandatory - Integer - - min - The duration of the event in minutes. - - - Criticality Level - RW - Single - Optional - Integer - 0..3 - - The criticality of the event. The device receiving the event will react in an appropriate fashion for the device. - - - Avg Load AdjPct - RW - Single - Optional - Integer - 0..100 - /100 - Defines the maximum energy usage of the receiving device, as a percentage of the device's normal maximum energy usage. - - - Duty Cycle - RW - Single - Optional - Integer - 0..100 - /100 - Defines the duty cycle for the load control event, i.e, what percentage of time the receiving device is allowed to be on. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3311.xml b/common/transport/lwm2m/src/main/resources/models/3311.xml deleted file mode 100644 index 2e7b3977b6..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3311.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - Light Control - This Object is used to control a light source, such as a LED or other light. It allows a light to be turned on or off and its dimmer setting to be control as a % between 0 and 100. An optional colour setting enables a string to be used to indicate the desired colour. - 3311 - urn:oma:lwm2m:ext:3311 - 1.0 - 1.0 - Multiple - Optional - - - On/Off - RW - Single - Mandatory - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Dimmer - RW - Single - Optional - Integer - 0..100 - /100 - This resource represents a light dimmer setting, which has an Integer value between 0 and 100 as a percentage. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds that the light has been on. Writing a value of 0 resets the counter. - - - Cumulative active power - R - Single - Optional - Float - - Wh - The total power in Wh that the light has used. - - - Power factor - R - Single - Optional - Float - - - The power factor of the light. - - - Colour - RW - Single - Optional - String - - - A string representing a value in some color space - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string, for instance, "Air Pressure" - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3312.xml b/common/transport/lwm2m/src/main/resources/models/3312.xml deleted file mode 100644 index fca6d7926a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3312.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - Power Control - This Object is used to control a power source, such as a Smart Plug. It allows a power relay to be turned on or off and its dimmer setting to be control as a % between 0 and 100. - 3312 - urn:oma:lwm2m:ext:3312 - 1.0 - 1.0 - Multiple - Optional - - - On/Off - RW - Single - Mandatory - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Dimmer - RW - Single - Optional - Integer - 0..100 - /100 - This resource represents a power dimmer setting, which has an Integer value between 0 and 100 as a percentage. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds that the power relay has been on. Writing a value of 0 resets the counter. - - - Cumulative active power - R - Single - Optional - Float - - Wh - The total power in Wh that has been used by the load. - - - Power factor - R - Single - Optional - Float - - - The power factor of the load. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string, for instance, "Air Pressure" - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3313.xml b/common/transport/lwm2m/src/main/resources/models/3313.xml deleted file mode 100644 index df8dd8b573..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3313.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - Accelerometer - This IPSO object can be used to represent a 1-3 axis accelerometer. - 3313 - urn:oma:lwm2m:ext:3313 - 1.0 - 1.0 - Multiple - Optional - - - X Value - R - Single - Mandatory - Float - - - The measured value along the X axis. - - - Y Value - R - Single - Optional - Float - - - The measured value along the Y axis. - - - Z Value - R - Single - Optional - Float - - - The measured value along the Z axis. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3314.xml b/common/transport/lwm2m/src/main/resources/models/3314.xml deleted file mode 100644 index 0dcd28e625..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3314.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - Magnetometer - This IPSO object can be used to represent a 1-3 axis magnetometer with optional compass direction. - 3314 - urn:oma:lwm2m:ext:3314 - 1.0 - 1.0 - Multiple - Optional - - - X Value - R - Single - Mandatory - Float - - - The measured value along the X axis. - - - Y Value - R - Single - Optional - Float - - - The measured value along the Y axis. - - - Z Value - R - Single - Optional - Float - - - The measured value along the Z axis. - - - Compass Direction - R - Single - Optional - Float - 0..360 - deg - The measured compass direction. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3315.xml b/common/transport/lwm2m/src/main/resources/models/3315.xml deleted file mode 100644 index 1e010d3186..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3315.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - Barometer - This IPSO object should be used with an air pressure sensor to report a barometer measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the barometer sensor. An example measurement unit is pascals. - 3315 - urn:oma:lwm2m:ext:3315 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3316.xml b/common/transport/lwm2m/src/main/resources/models/3316.xml deleted file mode 100644 index 63a769bea2..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3316.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Voltage - This IPSO object should be used with voltmeter sensor to report measured voltage between two points. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is volts. - - 3316 - urn:oma:lwm2m:ext:3316 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3317.xml b/common/transport/lwm2m/src/main/resources/models/3317.xml deleted file mode 100644 index f3c0303438..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3317.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Current - This IPSO object should be used with an ammeter to report measured electric current in amperes. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is ampere. - - 3317 - urn:oma:lwm2m:ext:3317 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3318.xml b/common/transport/lwm2m/src/main/resources/models/3318.xml deleted file mode 100644 index e7b69cd460..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3318.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Frequency - This IPSO object should be used to report frequency measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is hertz. - - 3318 - urn:oma:lwm2m:ext:3318 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3319.xml b/common/transport/lwm2m/src/main/resources/models/3319.xml deleted file mode 100644 index 19d074a6eb..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3319.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Depth - This IPSO object should be used to report depth measurements. It can, for example, be used to describe a generic rain gauge that measures the accumulated rainfall in millimetres (mm). - - 3319 - urn:oma:lwm2m:ext:3319 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3320.xml b/common/transport/lwm2m/src/main/resources/models/3320.xml deleted file mode 100644 index d43fe7f315..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3320.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Percentage - This IPSO object should can be used to report measurements relative to a 0-100% scale. For example it could be used to measure the level of a liquid in a vessel or container in units of %. - - 3320 - urn:oma:lwm2m:ext:3320 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3321.xml b/common/transport/lwm2m/src/main/resources/models/3321.xml deleted file mode 100644 index 0e57a8917b..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3321.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Altitude - This IPSO object should be used with an altitude sensor to report altitude above sea level in meters. Note that Altitude can be calculated from the measured pressure given the local sea level pressure. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is meters. - - 3321 - urn:oma:lwm2m:ext:3321 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3322.xml b/common/transport/lwm2m/src/main/resources/models/3322.xml deleted file mode 100644 index c1eb6557c7..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3322.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Load - This IPSO object should be used with a load sensor (as in a scale) to report the applied weight or force. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is kilograms. - - 3322 - urn:oma:lwm2m:ext:3322 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3323.xml b/common/transport/lwm2m/src/main/resources/models/3323.xml deleted file mode 100644 index 16c409931d..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3323.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Pressure - This IPSO object should be used to report pressure measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is pascals. - - 3323 - urn:oma:lwm2m:ext:3323 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3324.xml b/common/transport/lwm2m/src/main/resources/models/3324.xml deleted file mode 100644 index e23c76b5dc..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3324.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Loudness - This IPSO object should be used to report loudness or noise level measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is decibels. - - 3324 - urn:oma:lwm2m:ext:3324 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3325.xml b/common/transport/lwm2m/src/main/resources/models/3325.xml deleted file mode 100644 index 2defd9af1e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3325.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Concentration - This IPSO object should be used to the particle concentration measurement of a medium. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is parts per million. - - 3325 - urn:oma:lwm2m:ext:3325 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3326.xml b/common/transport/lwm2m/src/main/resources/models/3326.xml deleted file mode 100644 index 7d3f940649..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3326.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Acidity - This IPSO object should be used to report an acidity measurement of a liquid. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is pH. - - 3326 - urn:oma:lwm2m:ext:3326 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3327.xml b/common/transport/lwm2m/src/main/resources/models/3327.xml deleted file mode 100644 index 32498aba39..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3327.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Conductivity - This IPSO object should be used to report a measurement of the electric conductivity of a medium or sample. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Siemens. - - 3327 - urn:oma:lwm2m:ext:3327 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3328.xml b/common/transport/lwm2m/src/main/resources/models/3328.xml deleted file mode 100644 index 4c920b05ae..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3328.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Power - This IPSO object should be used to report power measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Watts. This object may be used for either real power or apparent power measurements. - - 3328 - urn:oma:lwm2m:ext:3328 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3329.xml b/common/transport/lwm2m/src/main/resources/models/3329.xml deleted file mode 100644 index ba96e5bf9d..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3329.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Power Factor - This IPSO object should be used to report a measurement or calculation of the power factor of a reactive electrical load. Power Factor is normally the ratio of non-reactive power to total power. This object also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. - - 3329 - urn:oma:lwm2m:ext:3329 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3330.xml b/common/transport/lwm2m/src/main/resources/models/3330.xml deleted file mode 100644 index 5583596aa8..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3330.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Distance - This IPSO object should be used to report a distance measurement. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Meters. - - 3330 - urn:oma:lwm2m:ext:3330 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3331.xml b/common/transport/lwm2m/src/main/resources/models/3331.xml deleted file mode 100644 index 8933e75c69..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3331.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - Energy - This IPSO object should be used to report energy consumption (Cumulative Power) of an electrical load. An example measurement unit is Watt Hours. - - 3331 - urn:oma:lwm2m:ext:3331 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Reset Cumulative energy - E - Single - Optional - - - - Reset both cumulative active/reactive power. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3332.xml b/common/transport/lwm2m/src/main/resources/models/3332.xml deleted file mode 100644 index e39fb6f182..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3332.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - Direction - This IPSO object is used to report the direction indicated by a compass, wind vane, or other directional indicator. The units of measure is plane angle degrees. - - 3332 - urn:oma:lwm2m:ext:3332 - 1.0 - 1.0 - Multiple - Optional - - - Compass Direction - R - Single - Mandatory - Float - 0..360 - deg - The measured compass direction. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset. - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3333.xml b/common/transport/lwm2m/src/main/resources/models/3333.xml deleted file mode 100644 index 7282e2670a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3333.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - Time - This IPSO object is used to report the current time in seconds since January 1, 1970 UTC. There is also a fractional time counter that has a range of less than one second. - - 3333 - urn:oma:lwm2m:ext:3333 - 1.0 - 1.0 - Multiple - Optional - - - Current Time - RW - Single - Mandatory - Time - - - Unix Time. A signed integer representing the number of seconds since Jan 1st, 1970 in the UTC time zone. - - - Fractional Time - RW - Single - Optional - Float - 0..1 - s - Fractional part of the time when sub-second precision is used (e.g., 0.23 for 230 ms). - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3334.xml b/common/transport/lwm2m/src/main/resources/models/3334.xml deleted file mode 100644 index 8fb30e0164..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3334.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - Gyrometer - This IPSO Object is used to report the current reading of a gyrometer sensor in 3 axes. It provides tracking of the minimum and maximum angular rate in all 3 axes. An example unit of measure is radians per second. - - 3334 - urn:oma:lwm2m:ext:3334 - 1.0 - 1.0 - Multiple - Optional - - - X Value - R - Single - Mandatory - Float - - - The measured value along the X axis. - - - Y Value - R - Single - Optional - Float - - - The measured value along the Y axis. - - - Z Value - R - Single - Optional - Float - - - The measured value along the Z axis. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min X Value - R - Single - Optional - Float - - - The minimum measured value along the X axis - - - Max X Value - R - Single - Optional - Float - - - The maximum measured value along the X axis - - - Min Y Value - R - Single - Optional - Float - - - The minimum measured value along the Y axis - - - Max Y Value - R - Single - Optional - Float - - - The maximum measured value along the Y axis - - - Min Z Value - R - Single - Optional - Float - - - The minimum measured value along the Z axis - - - Max Z Value - R - Single - Optional - Float - - - The maximum measured value along the Z axis - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value. - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3335.xml b/common/transport/lwm2m/src/main/resources/models/3335.xml deleted file mode 100644 index 8d48093231..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3335.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - Colour - This IPSO object should be used to report the measured value of a colour sensor in some colour space described by the units resource. - - 3335 - urn:oma:lwm2m:ext:3335 - 1.0 - 1.0 - Multiple - Optional - - - Colour - RW - Single - Mandatory - String - - - A string representing a value in some colour space. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3336.xml b/common/transport/lwm2m/src/main/resources/models/3336.xml deleted file mode 100644 index 30aba24708..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3336.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - Location - This IPSO object represents GPS coordinates. This object is compatible with the LWM2M management object for location, but uses reusable resources. - - 3336 - urn:oma:lwm2m:ext:3336 - 1.0 - 1.0 - Multiple - Optional - - - Latitude - R - Single - Mandatory - String - - - The decimal notation of latitude, e.g. -43.5723 (World Geodetic System 1984). - - - Longitude - R - Single - Mandatory - String - - - The decimal notation of longitude, e.g. 153.21760 (World Geodetic System 1984). - - - Uncertainty - R - Single - Optional - String - - - The accuracy of the position in meters. - - - Compass Direction - R - Single - Optional - Float - 0..360 - deg - The measured compass direction. - - - Velocity - R - Single - Optional - Opaque - - - The velocity of the device as defined in 3GPP 23.032 GAD specification. This set of values may not be available if the device is static. - - - Timestamp - R - Single - Optional - Time - - - The timestamp of when the measurement was performed. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3337.xml b/common/transport/lwm2m/src/main/resources/models/3337.xml deleted file mode 100644 index 54f3d19d54..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3337.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Positioner - This IPSO object should be used with a generic position actuator with range from 0 to 100%. This object optionally allows setting the transition time for an operation that changes the position of the actuator, and for reading the remaining time of the currently active transition. - - 3337 - urn:oma:lwm2m:ext:3337 - 1.0 - 1.0 - Multiple - Optional - - - Current Position - RW - Single - Mandatory - Float - 0..100 - /100 - Current position or desired position of a positioner actuator. - - - Transition Time - RW - Single - Optional - Float - - s - The time expected to move the actuator to the new position. - - - Remaining Time - R - Single - Optional - Float - - s - The time remaining in an operation. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value set on the actuator since power ON or reset. - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value set on the actuator since power ON or reset. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value. - - - Min Limit - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor. - - - Max Limit - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3338.xml b/common/transport/lwm2m/src/main/resources/models/3338.xml deleted file mode 100644 index 1437a62c65..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3338.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - Buzzer - This IPSO object should be used to actuate an audible alarm such as a buzzer, beeper, or vibration alarm. There is a dimmer control for setting the relative loudness of the alarm, and an optional duration control to limit the length of time the alarm sounds when turned on. Each time "true" is written to the On/Off resource, the alarm will sound again for the configured duration. If no duration is programmed or the setting is "false", writing a "true" to the On/Off resource will result in the alarm sounding continuously until a "false" is written to the On/Off resource. - - 3338 - urn:oma:lwm2m:ext:3338 - 1.0 - 1.0 - Multiple - Optional - - - On/Off - RW - Single - Mandatory - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Level - RW - Single - Optional - Float - 0..100 - /100 - Audio volume control, float value between 0 and 100 as a percentage. - - - Delay Duration - RW - Single - Optional - Float - - s - The duration of the time delay. - - - Minimum Off-time - RW - Single - Mandatory - Float - - s - The off time when On/Off control remains on. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3339.xml b/common/transport/lwm2m/src/main/resources/models/3339.xml deleted file mode 100644 index edd11709e8..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3339.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - Audio Clip - This IPSO object should be used for a speaker that plays a pre-recorded audio clip or an audio output that is sent elsewhere. For example, an elevator which announces the floor of the building. A resource is provided to store the clip, a dimmer resource controls the relative sound level of the playback, and a duration resource limits the maximum playback time. After the duration time is reached, any remaining samples in the clip are ignored, and the clip player will be ready to play another clip. - 3339 - urn:oma:lwm2m:ext:3339 - 1.0 - 1.0 - Multiple - Optional - - - Clip - RW - Single - Mandatory - Opaque - - - Audio clip that is playable (e.g., a short audio recording indicating the floor in an elevator). - - - Trigger - E - Single - Optional - - - - Trigger initiating actuation. - - - Level - RW - Single - Optional - Float - 0..100 - /100 - Audio volume control, float value between 0 and 100 as a percentage. - - - Duration - RW - Single - Optional - Float - - s - The duration of the sound once trigger. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3340.xml b/common/transport/lwm2m/src/main/resources/models/3340.xml deleted file mode 100644 index 16585224fa..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3340.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - - - - Timer - This IPSO object is used to time events and actions, using patterns common to industrial timers. A write to the trigger resource or On/Off input state change starts the timing operation, and the timer remaining time shows zero when the operation is complete. The patterns supported are One-Shot (mode 1), On-Time or Interval (mode 2), Time delay on pick-up or TDPU (mode 3), and Time Delay on Drop-Out or TDDO (mode 4). Mode 0 disables the timer, so the output follows the input with no delay. A counter is provided to count occurrences of the timer output changing from 0 to 1. Writing a value of zero resets the counter. The Digital Input State resource reports the state of the timer output. - - 3340 - urn:oma:lwm2m:ext:3340 - 1.0 - 1.0 - Multiple - Optional - - - Delay Duration - RW - Single - Mandatory - Float - - s - The duration of the time delay. - - - Remaining Time - R - Single - Optional - Float - - s - The time remaining in an operation. - - - Minimum Off-time - RW - Single - Optional - Float - - s - The duration of the rearm delay (i.e. the delay from the end of one cycle until the beginning of the next, the inhibit time). - - - Trigger - E - Single - Optional - - - - Trigger initiating actuation. - - - On/Off - RW - Single - Optional - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input. - - - Cumulative Time - RW - Single - Optional - Float - - s - The total time in seconds that the timer input is true. Writing a 0 resets the time. - - - Digital State - R - Single - Optional - Boolean - - - The current state of the timer output. - - - Counter - RW - Single - Optional - Integer - - - Counts the number of times the timer output transitions from 0 to 1. - - - Timer Mode - RW - Single - Optional - Integer - 0..4 - - Type of timer pattern used by the patterns. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3341.xml b/common/transport/lwm2m/src/main/resources/models/3341.xml deleted file mode 100644 index 55865d0f32..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3341.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Addressable Text Display - This IPSO object is used to send text to a text-only or text mode graphics display. Writing a string of text to the text resource causes it to be displayed at the selected X and Y locations on the display. If X or Y are set to a value greater than the size of the display, the position "wraps around" to the modulus of the setting and the display size. Likewise, if the text string overflows the display size, the text "wraps around" and displays on the next line down or, if the last line has been written, wraps around to the top of the display. Brightness and Contrast controls are provided to allow control of various display types including STN and DSTN type LCD character displays. Writing an empty payload to the Clear Display resource causes the display to be erased. - - 3341 - urn:oma:lwm2m:ext:3341 - 1.0 - 1.0 - Multiple - Optional - - - Text - RW - Single - Mandatory - String - - - A string of text. - - - X Coordinate - RW - Single - Optional - Integer - - - X Coordinate. - - - Y Coordinate - RW - Single - Optional - Integer - - - Y Coordinate. - - - Max X Coordinate - R - Single - Optional - Integer - - - The highest X coordinate the display supports before wrapping to the next line. - - - Max Y Coordinate - R - Single - Optional - Integer - - - The highest Y coordinate the display supports before wrapping to the next line. - - - Clear Display - E - Single - Optional - - - - Command to clear the display. - - - Level - RW - Single - Optional - Float - 0..100 - /100 - Brightness control, integer value between 0 and 100 as a percentage. - - - Contrast - RW - Single - Optional - Float - 0..100 - /100 - Proportional control, integer value between 0 and 100 as a percentage. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3342.xml b/common/transport/lwm2m/src/main/resources/models/3342.xml deleted file mode 100644 index b88ebab9d4..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3342.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - On/Off switch - This IPSO object should be used with an On/Off switch to report the state of the switch. - 3342 - urn:oma:lwm2m:ext:3342 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Mandatory - Boolean - - - The current state of a digital input. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input transitions from 0 to 1. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds since the On command was sent. Writing a value of 0 resets the counter. - - - Off Time - RW - Single - Optional - Integer - - s - The time in seconds since the Off command was sent. Writing a value of 0 resets the counter. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3343.xml b/common/transport/lwm2m/src/main/resources/models/3343.xml deleted file mode 100644 index 63b77c3e91..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3343.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - Dimmer - This IPSO object should be used with a dimmer or level control to report the state of the control. - - 3343 - urn:oma:lwm2m:ext:3343 - 1.0 - 1.0 - Multiple - Optional - - - Level - RW - Single - Mandatory - Float - 0..100 - /100 - Proportional control, integer value between 0 and 100 as a percentage. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds that the dimmer has been on (Dimmer value has to be > 0). Writing a value of 0 resets the counter. - - - Off Time - RW - Single - Optional - Integer - - s - The time in seconds that the dimmer has been off (dimmer value less or equal to 0) Writing a value of 0 resets the counter. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3344.xml b/common/transport/lwm2m/src/main/resources/models/3344.xml deleted file mode 100644 index 2dd8648a19..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3344.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - Up/Down Control - This IPSO object is used to report the state of an up/down control element like a pair of push buttons or a rotary encoder. Counters for increase and decrease operations are provided for counting pulses from a quadrature encoder. - - 3344 - urn:oma:lwm2m:ext:3344 - 1.0 - 1.0 - Multiple - Optional - - - Increase Input State - R - Single - Mandatory - Boolean - - - Indicates an increase control action. - - - Decrease Input State - R - Single - Mandatory - Boolean - - - Indicates a decrease control action. - - - Up Counter - RW - Single - Optional - Integer - - - Counts the number of times the increase control has been operated. Writing a 0 resets the counter. - - - Down Counter - RW - Single - Optional - Integer - - - Counts the times the decrease control has been operated. Writing a 0 resets the counter. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3345.xml b/common/transport/lwm2m/src/main/resources/models/3345.xml deleted file mode 100644 index a5355c94ca..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3345.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - Multiple Axis Joystick - This IPSO object can be used to report the position of a shuttle or joystick control. A digital input is provided to report the state of an associated push button. - - 3345 - urn:oma:lwm2m:ext:3345 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Optional - Boolean - - - The current state of a digital input. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input transitions from 0 to 1. - - - X Value - R - Single - Optional - Float - - - The measured value along the X axis. - - - Y Value - R - Single - Optional - Float - - - The measured value along the Y axis. - - - Z Value - R - Single - Optional - Float - - - The measured value along the Z axis. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3346.xml b/common/transport/lwm2m/src/main/resources/models/3346.xml deleted file mode 100644 index 8c68054c39..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3346.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - Rate - This object type should be used to report a rate measurement, for example the speed of a vehicle, or the rotational speed of a drive shaft. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is meters per second (m/s). - - 3346 - urn:oma:lwm2m:ext:3346 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3347.xml b/common/transport/lwm2m/src/main/resources/models/3347.xml deleted file mode 100644 index f86a986f0a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3347.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - Push button - This IPSO object is used to report the state of a momentary action push button control and to count the number of times the control has been operated since the last observation. - - 3347 - urn:oma:lwm2m:ext:3347 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Mandatory - Boolean - - - The current state of a digital input. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input transitions from 0 to 1. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3348.xml b/common/transport/lwm2m/src/main/resources/models/3348.xml deleted file mode 100644 index a2de51f6af..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3348.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - Multi-state Selector - This IPSO object is used to represent the state of a Multi-state selector switch with a number of fixed positions. - - 3348 - urn:oma:lwm2m:ext:3348 - 1.0 - 1.0 - Multiple - Optional - - - Multi-state Input - R - Single - Mandatory - Integer - - - The current state of a Multi-state input or selector. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3349.xml b/common/transport/lwm2m/src/main/resources/models/3349.xml deleted file mode 100644 index 9a77820703..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3349.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - Bitmap - Summarize several digital inputs to one value by mapping each bit to a digital input. - 3349 - urn:oma:lwm2m:ext:3349 - 1.0 - 1.0 - Multiple - Optional - - - Bitmap Input - R - Single - Mandatory - Integer - - - Integer in which each of the bits are associated with specific digital input value. Represented as a binary signed integer in network byte order, and in two's complement representation. Using values in range 0-127 is recommended to avoid ambiguities with byte order and negative values. - - - Bitmap Input Reset - E - Single - Optional - - - - Reset the Bitmap Input value. - - - Element Description - RW - Multiple - Optional - String - - - The description of each bit as a string. First instance describes the least significant bit, second instance the second least significant bit. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3350.xml b/common/transport/lwm2m/src/main/resources/models/3350.xml deleted file mode 100644 index dc1313cd83..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3350.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - Stopwatch - An ascending timer that counts how long time has passed since the timer was started after reset. - 3350 - urn:oma:lwm2m:ext:3350 - 1.0 - 1.0 - Multiple - Optional - - - Cumulative Time - RW - Single - Mandatory - Float - - s - The total time in seconds that the stopwatch has been on. Writing a 0 resets the time. - - - On/Off - RW - Single - Optional - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input transitions from off to on. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3351.xml b/common/transport/lwm2m/src/main/resources/models/3351.xml deleted file mode 100644 index 9219a765df..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3351.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - powerupLog - - 3351 - urn:oma:lwm2m:ext:3351 - 1.0 - 1.0 - Single - Optional - - deviceName - R - Single - Mandatory - String - - - - - toolVersion - R - Single - Mandatory - String - - - - - IMEI - R - Single - Mandatory - String - - - - - IMSI - R - Single - Mandatory - String - - - - - MSISDN - R - Single - Mandatory - String - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3352.xml b/common/transport/lwm2m/src/main/resources/models/3352.xml deleted file mode 100644 index 260daa033a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3352.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - plmnSearchEvent - - 3352 - urn:oma:lwm2m:ext:3352 - 1.0 - 1.0 - Multiple - Optional - - timeScanStart - R - Single - Mandatory - Integer - - - - - plmnID - R - Single - Mandatory - Integer - - - - - BandIndicator - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3353.xml b/common/transport/lwm2m/src/main/resources/models/3353.xml deleted file mode 100644 index 95b87e40b7..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3353.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - scellID - - 3353 - urn:oma:lwm2m:ext:3353 - 1.0 - 1.0 - Single - Optional - - plmnID - R - Single - Mandatory - Integer - - - - - BandIndicator - R - Single - Mandatory - Integer - - - - - TrackingAreaCode - R - Single - Mandatory - Integer - - - - - CellID - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3354.xml b/common/transport/lwm2m/src/main/resources/models/3354.xml deleted file mode 100644 index 065a330d38..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3354.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - cellReselectionEvent - - 3354 - urn:oma:lwm2m:ext:3354 - 1.0 - 1.0 - Single - Optional - - timeReselectionStart - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - CellID - R - Single - Mandatory - Integer - - - - - failureType - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3355.xml b/common/transport/lwm2m/src/main/resources/models/3355.xml deleted file mode 100644 index 627d67b68e..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3355.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - handoverEvent - - 3355 - urn:oma:lwm2m:ext:3355 - 1.0 - 1.0 - Single - Optional - - timeHandoverStart - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - CellID - R - Single - Mandatory - Integer - - - - - handoverResult - R - Single - Mandatory - Integer - - - - - - TargetEarfcn - R - Single - Mandatory - Integer - - - - - TargetPhysicalCellID - R - Single - Mandatory - Integer - - - - - targetCellRsrp - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3356.xml b/common/transport/lwm2m/src/main/resources/models/3356.xml deleted file mode 100644 index 95c7fc7835..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3356.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - radioLinkFailureEvent - - 3356 - urn:oma:lwm2m:ext:3356 - 1.0 - 1.0 - Single - Optional - - timeRLF - R - Single - Mandatory - Integer - - - - - rlfCause - R - Single - Mandatory - Integer - - - - - - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3357.xml b/common/transport/lwm2m/src/main/resources/models/3357.xml deleted file mode 100644 index 935b7c4ba7..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3357.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - rrcStateChangeEvent - - 3357 - urn:oma:lwm2m:ext:3357 - 1.0 - 1.0 - Single - Optional - - rrcState - R - Single - Mandatory - Integer - - - - - rrcStateChangeCause - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3358.xml b/common/transport/lwm2m/src/main/resources/models/3358.xml deleted file mode 100644 index 2784d6a990..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3358.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - rrcTimerExpiryEvent - - 3358 - urn:oma:lwm2m:ext:3358 - 1.0 - 1.0 - Single - Optional - - RrcTimerExpiryEvent - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3359.xml b/common/transport/lwm2m/src/main/resources/models/3359.xml deleted file mode 100644 index 630e52ce8f..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3359.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - cellBlacklistEvent - - 3359 - urn:oma:lwm2m:ext:3359 - 1.0 - 1.0 - Single - Optional - - dlEarfcn - R - Single - Mandatory - Integer - - - - - CellID - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3360.xml b/common/transport/lwm2m/src/main/resources/models/3360.xml deleted file mode 100644 index 12b2302854..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3360.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - esmContextInfo - - 3360 - urn:oma:lwm2m:ext:3360 - 1.0 - 1.0 - Single - Optional - - contextType - R - Single - Mandatory - Integer - - - - - bearerState - R - Single - Mandatory - Integer - - - - - radioBearerId - R - Single - Mandatory - Integer - - - - - qci - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3361.xml b/common/transport/lwm2m/src/main/resources/models/3361.xml deleted file mode 100644 index 3d354bffac..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3361.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - emmStateValue - - 3361 - urn:oma:lwm2m:ext:3361 - 1.0 - 1.0 - Single - Optional - - EmmState - R - Single - Mandatory - Integer - - - - - emmSubstate - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3362.xml b/common/transport/lwm2m/src/main/resources/models/3362.xml deleted file mode 100644 index 3cb73eb79a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3362.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - nasEmmTimerExpiryEvent - - 3362 - urn:oma:lwm2m:ext:3362 - 1.0 - 1.0 - Single - Optional - - NasEmmTimerExpiryEvent - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3363.xml b/common/transport/lwm2m/src/main/resources/models/3363.xml deleted file mode 100644 index 3b44b91f26..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3363.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - nasEsmExpiryEvent - - 3363 - urn:oma:lwm2m:ext:3363 - 1.0 - 1.0 - Single - Optional - - NasEsmExpiryEvent - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3364.xml b/common/transport/lwm2m/src/main/resources/models/3364.xml deleted file mode 100644 index 0a042d12d2..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3364.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - emmFailureCauseEvent - - 3364 - urn:oma:lwm2m:ext:3364 - 1.0 - 1.0 - Single - Optional - - EMMCause - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3365.xml b/common/transport/lwm2m/src/main/resources/models/3365.xml deleted file mode 100644 index 99f1b3885c..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3365.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - rachLatency_delay - - 3365 - urn:oma:lwm2m:ext:3365 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - rachLatencyVal - R - Single - Mandatory - Integer - - - - - delay - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3366.xml b/common/transport/lwm2m/src/main/resources/models/3366.xml deleted file mode 100644 index 5498af2a3d..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3366.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - macRachAttemptEvent - - 3366 - urn:oma:lwm2m:ext:3366 - 1.0 - 1.0 - Single - Optional - - rachAttemptCounter - R - Single - Mandatory - Integer - - - - - MacRachAttemptEventType - R - Single - Mandatory - Integer - - - - - contentionBased - R - Single - Mandatory - Boolean - - - - - rachMessage - R - Single - Mandatory - Integer - - - - - preambleIndex - R - Single - Mandatory - Integer - - - - - preamblePowerOffset - R - Single - Mandatory - Integer - - - - - backoffTime - R - Single - Mandatory - Integer - - - - - msg2Result - R - Single - Mandatory - Boolean - - - - - timingAdjustmentValue - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3367.xml b/common/transport/lwm2m/src/main/resources/models/3367.xml deleted file mode 100644 index 1f35cf4cc5..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3367.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - macRachAttemptReasonEvent - - 3367 - urn:oma:lwm2m:ext:3367 - 1.0 - 1.0 - Single - Optional - - MacRachAttemptReasonType - R - Single - Mandatory - Integer - - - - - ueID - R - Single - Mandatory - Integer - - - - - contentionBased - R - Single - Mandatory - Boolean - - - - - preamble - R - Single - Mandatory - Integer - - - - - preambleGroupChosen - R - Single - Mandatory - Boolean - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3368.xml b/common/transport/lwm2m/src/main/resources/models/3368.xml deleted file mode 100644 index 40c17bfd37..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3368.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - macTimerStatusEvent - - 3368 - urn:oma:lwm2m:ext:3368 - 1.0 - 1.0 - Single - Optional - - macTimerName - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3369.xml b/common/transport/lwm2m/src/main/resources/models/3369.xml deleted file mode 100644 index b93bb86644..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3369.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - macTimingAdvanceEvent - - 3369 - urn:oma:lwm2m:ext:3369 - 1.0 - 1.0 - Single - Optional - - timerValue - R - Single - Mandatory - Integer - - - - - timingAdvance - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3370.xml b/common/transport/lwm2m/src/main/resources/models/3370.xml deleted file mode 100644 index c79ff32a75..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3370.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - ServingCellMeasurement - - 3370 - urn:oma:lwm2m:ext:3370 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - pci - R - Single - Mandatory - Integer - - - - - rsrp - R - Single - Mandatory - Integer - - - - - rsrq - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3371.xml b/common/transport/lwm2m/src/main/resources/models/3371.xml deleted file mode 100644 index 8267b8ed81..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3371.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - NeighborCellMeasurements - - 3371 - urn:oma:lwm2m:ext:3371 - 1.0 - 1.0 - Multiple - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - pci - R - Single - Mandatory - Integer - - - - - rsrp - R - Single - Mandatory - Integer - - - - - rsrq - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3372.xml b/common/transport/lwm2m/src/main/resources/models/3372.xml deleted file mode 100644 index d08c1dad3a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3372.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - TimingAdvance - - 3372 - urn:oma:lwm2m:ext:3372 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - timingAdvance - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3373.xml b/common/transport/lwm2m/src/main/resources/models/3373.xml deleted file mode 100644 index 9a4191787f..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3373.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - txPowerHeadroomEvent - - 3373 - urn:oma:lwm2m:ext:3373 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - headroom-value - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3374.xml b/common/transport/lwm2m/src/main/resources/models/3374.xml deleted file mode 100644 index abc9cc926f..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3374.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - radioLinkMonitoring - - 3374 - urn:oma:lwm2m:ext:3374 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - outOfSyncCount - R - Single - Mandatory - Integer - - - - - inSyncCount - R - Single - Mandatory - Integer - - - - - t310Timer - R - Single - Mandatory - Boolean - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3375.xml b/common/transport/lwm2m/src/main/resources/models/3375.xml deleted file mode 100644 index e1df9f4851..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3375.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - PagingDRX - - 3375 - urn:oma:lwm2m:ext:3375 - 1.0 - 1.0 - Single - Optional - - dlEarfcn - R - Single - Mandatory - Integer - - - - - pci - R - Single - Mandatory - Integer - - - - - pagingCycle - R - Single - Mandatory - Integer - - - - - DrxNb - R - Single - Mandatory - Integer - - - - - ueID - R - Single - Mandatory - Integer - - - - - drxSysFrameNumOffset - R - Single - Mandatory - Integer - - - - - drxSubFrameNumOffset - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3376.xml b/common/transport/lwm2m/src/main/resources/models/3376.xml deleted file mode 100644 index 542f816da0..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3376.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - txPowerBackOffEvent - - 3376 - urn:oma:lwm2m:ext:3376 - 1.0 - 1.0 - Single - Optional - - TxPowerBackoff - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3377.xml b/common/transport/lwm2m/src/main/resources/models/3377.xml deleted file mode 100644 index 515eb36439..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3377.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - Message3Report - - 3377 - urn:oma:lwm2m:ext:3377 - 1.0 - 1.0 - Single - Optional - - tpc - R - Single - Mandatory - Integer - - - - - resourceIndicatorValue - R - Single - Mandatory - Integer - - - - - cqi - R - Single - Mandatory - Integer - - - - - uplinkDelay - R - Single - Mandatory - Boolean - - - - - hoppingEnabled - R - Single - Mandatory - Boolean - - - - - numRb - R - Single - Mandatory - Integer - - - - - transportBlockSizeIndex - R - Single - Mandatory - Integer - - - - - ModulationType - R - Single - Mandatory - Integer - - - - - redundancyVersionIndex - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3378.xml b/common/transport/lwm2m/src/main/resources/models/3378.xml deleted file mode 100644 index 0855f5798a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3378.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - PbchDecodingResults - - 3378 - urn:oma:lwm2m:ext:3378 - 1.0 - 1.0 - Single - Optional - - servingCellID - R - Single - Mandatory - Integer - - - - - crcResult - R - Single - Mandatory - Boolean - - - - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3379.xml b/common/transport/lwm2m/src/main/resources/models/3379.xml deleted file mode 100644 index 0ac1648961..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3379.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - pucchPowerControl - - 3379 - urn:oma:lwm2m:ext:3379 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - pucchTxPowerValue - - Single - Mandatory - Integer - - - - - dlPathLoss - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3380-2_0.xml b/common/transport/lwm2m/src/main/resources/models/3380-2_0.xml deleted file mode 100644 index 27545a6345..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3380-2_0.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - PrachReport - - 3380 - urn:oma:lwm2m:ext:3380:2.0 - 1.0 - 2.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - rachTxPower - R - Single - Mandatory - Integer - - - - - zadOffSeqNum - R - Single - Mandatory - Integer - - - - - prachConfig - R - Single - Mandatory - Integer - - - - - preambleFormat - R - Single - Mandatory - Integer - - - - - maxTransmissionMsg3 - R - Single - Mandatory - Integer - - - - - raResponseWindowSize - R - Single - Mandatory - Integer - - - - - RachRequestResult - R - Single - Mandatory - Boolean - - - - - ce_mode - R - Single - Mandatory - Integer - - - - - ce_level - R - Single - Mandatory - Integer - - - - - num_prach_repetition - R - Single - Mandatory - Integer - - - - - prach_repetition_seq - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3381.xml b/common/transport/lwm2m/src/main/resources/models/3381.xml deleted file mode 100644 index db2e4d52e8..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3381.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - VolteCallEvent - - 3381 - urn:oma:lwm2m:ext:3381 - 1.0 - 1.0 - Single - Optional - - callStatus - R - Single - Mandatory - Integer - - - - - callType - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3382.xml b/common/transport/lwm2m/src/main/resources/models/3382.xml deleted file mode 100644 index 8f066837c8..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3382.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - SipRegistrationEvent - - 3382 - urn:oma:lwm2m:ext:3382 - 1.0 - 1.0 - Single - Optional - - registrationType - R - Single - Mandatory - Integer - - - - - registrationResult - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3383.xml b/common/transport/lwm2m/src/main/resources/models/3383.xml deleted file mode 100644 index 663ac45faa..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3383.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - sipPublishEvent - - 3383 - urn:oma:lwm2m:ext:3383 - 1.0 - 1.0 - Single - Optional - - publishResult - R - Single - Mandatory - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3384.xml b/common/transport/lwm2m/src/main/resources/models/3384.xml deleted file mode 100644 index a18c6b910b..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3384.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - sipSubscriptionEvent - - 3384 - urn:oma:lwm2m:ext:3384 - 1.0 - 1.0 - Single - Optional - - eventType - R - Single - Mandatory - Integer - - - - - subscriptionResult - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3385.xml b/common/transport/lwm2m/src/main/resources/models/3385.xml deleted file mode 100644 index cc0a99182a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3385.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - volteCallStateChangeEvent - - 3385 - urn:oma:lwm2m:ext:3385 - 1.0 - 1.0 - Single - Optional - - callStatus - R - Single - Mandatory - Integer - - - - - VolteCallStateChangeCause - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/3386.xml b/common/transport/lwm2m/src/main/resources/models/3386.xml deleted file mode 100644 index 43937efadb..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/3386.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - VoLTErtpPacketLoss - 1]]> - 3386 - urn:oma:lwm2m:ext:3386 - 1.0 - 1.0 - Single - Optional - - ssrc - R - Single - Mandatory - Integer - - - - - packetsLost - R - Single - Mandatory - Integer - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_APN_Connection_Profile-v1_0_1.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_APN_Connection_Profile-v1_0_1.xml deleted file mode 100644 index 924e822fc6..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_APN_Connection_Profile-v1_0_1.xml +++ /dev/null @@ -1,324 +0,0 @@ - - - - - LWM2M APN Connection Profile - - 11 - - urn:oma:lwm2m:oma:11 - 1.0 - 1.0 - Multiple - Optional - - Profile name - RW - Single - Mandatory - String - - - - - APN - RW - Single - Optional - String - - - - - Auto select APN by device - RW - Single - Optional - Boolean - - - - - Enable status - RW - Single - Optional - Boolean - - - - - Authentication Type - RW - Single - Mandatory - Integer - - - - - User Name - RW - Single - Optional - String - - - - - Secret - RW - Single - Optional - String - - - - - Reconnect Schedule - RW - Single - Optional - String - - - - - Validity (MCC, MNC) - RW - Multiple - Optional - String - - - - - Connection establishment time (1) - R - Multiple - Optional - Time - - - - - Connection establishment result (1) - R - Multiple - Optional - Integer - - - - - - Connection establishment reject cause (1) - R - Multiple - Optional - Integer - 0..111 - - - - Connection end time (1) - R - Multiple - Optional - Time - - - - - TotalBytesSent - R - Single - Optional - Integer - - - - - TotalBytesReceived - R - Single - Optional - Integer - - - - - IP address (2) - RW - Multiple - Optional - String - - - - - Prefix length(2) - RW - Multiple - Optional - String - - - - - Subnet mask (2) - RW - Multiple - Optional - String - - - - - Gateway (2) - RW - Multiple - Optional - String - - - - - Primary DNS address (2) - RW - Multiple - Optional - String - - - - - Secondary DNS address (2) - RW - Multiple - Optional - String - - - - - QCI (3) - R - Single - Optional - Integer - 1..9 - - - - Vendor specific extensions - R - Single - Optional - Objlnk - - - - - TotalPacketsSent - R - Single - Optional - Integer - - - - - PDN Type - RW - Single - Optional - Integer - - - - - - APN Rate Control - R - Single - Optional - Integer - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_Bearer_Selection-v1_0_1.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_Bearer_Selection-v1_0_1.xml deleted file mode 100644 index 307df73553..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_Bearer_Selection-v1_0_1.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - - - LWM2M Bearer Selection - - 13 - urn:oma:lwm2m:oma:13 - 1.0 - 1.0 - Single - Optional - - Preferred Communications Bearer - RW - Multiple - Optional - Integer - 8 bit - - - - Acceptable RSSI (GSM) - RW - Single - Optional - Integer - - - - - Acceptable RSCP (UMTS) - RW - Single - Optional - Integer - - - - - Acceptable RSRP (LTE) - RW - Single - Optional - Integer - - - - - Acceptable RSSI (1xEV-DO) - RW - Single - Optional - Integer - - - - - Cell lock list - RW - Single - Optional - String - - - - - Operator list - RW - Single - Optional - String - - - - - Operator list mode - RW - Single - Optional - Boolean - - - - - List of available PLMNs - R - Single - Optional - String - - - - - Vendor specific extensions - R - Single - Optional - Objlnk - - - - - Acceptable RSRP (NB-IoT) - RW - Single - Optional - Integer - - - - - Higher Priority PLMN Search Timer - RW - Single - Optional - Integer - - - - - Attach without PDN connection - RW - Single - Optional - Boolean - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_Cellular_Connectivity-v1_0_1.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_Cellular_Connectivity-v1_0_1.xml deleted file mode 100644 index 45499202ba..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_Cellular_Connectivity-v1_0_1.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - LWM2M Cellular Connectivity - - 10 - urn:oma:lwm2m:oma:10 - 1.0 - 1.0 - Single - Optional - - SMSC address - RW - Single - Optional - String - - - - - Disable radio period - RW - Single - Optional - Integer - 0..65535 - - 0 the device SHALL disconnect. When the period has elapsed the device MAY reconnect.]]> - - Module activation code - RW - Single - Optional - String - - - - - Vendor specific extensions - R - Single - Optional - Objlnk - - - - - PSM Timer (1) - RW - Single - Optional - Integer - - s - - - Active Timer (1) - RW - Single - Optional - Integer - - s - - - Serving PLMN Rate control - R - Single - Optional - Integer - - - - - eDRX parameters for Iu mode (1) - RW - Single - Optional - Opaque - 8 bit - - - - eDRX parameters for WB-S1 mode (1) - RW - Single - Optional - Opaque - 8 bit - - - - eDRX parameters for NB-S1 mode (1) - RW - Single - Optional - Opaque - 8 bit - - - - eDRX parameters for A/Gb mode (1) - RW - Single - Optional - Opaque - 8 bit - - - - Activated Profile Names - R - Multiple - Mandatory - Objlnk - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_DevCapMgmt-v1_0.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_DevCapMgmt-v1_0.xml deleted file mode 100644 index 6569894e18..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_DevCapMgmt-v1_0.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - DevCapMgmt - - 15 - urn:oma:lwm2m:oma:15 - Multiple - Optional - - Property - R - Single - Mandatory - String - - - - - Group - R - Single - Mandatory - Integer - 0-15 - - - - Description - R - Single - Optional - String - - - - - Attached - R - Single - Optional - Boolean - - - - - Enabled - R - Single - Mandatory - Boolean - - - - - opEnable - E - Single - Mandatory - - - - - - opDisable - E - Multiple - Mandatory - - - - - - NotifyEn - RW - Single - Optional - Boolean - - - - - - - \ No newline at end of file diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_LOCKWIPE-v1_0_1.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_LOCKWIPE-v1_0_1.xml deleted file mode 100644 index 912add1a0a..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_LOCKWIPE-v1_0_1.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - Lock and Wipe - - 8 - urn:oma:lwm2m:oma:8 - Single - Optional - - State - RW - Single - Mandatory - Integer - 0-2 - - - - Lock target - W - Multiple - Mandatory - String - - - - - Wipe item - R - Multiple - Optional - String - - - - - Wipe - E - Single - Mandatory - - - - - - - Wipe target - W - Multiple - Mandatory - String - - - - Lock or Wipe Operation Result - R - Single - Mandatory - Integer - 0-8 - - - - - - \ No newline at end of file diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_Portfolio-v1_0.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_Portfolio-v1_0.xml deleted file mode 100644 index 8147fc64a2..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_Portfolio-v1_0.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - Portfolio - - 16 - urn:oma:lwm2m:oma:161.0 - 1.0Multiple - Optional - - Identity - RW - Multiple - Mandatory - String - - - - - GetAuthData - E - Single - Optional - - - - - - AuthData - R - Multiple - Optional - Opaque - - - - - AuthStatus - R - Single - Optional - Integer - [0-2] - - - - - - \ No newline at end of file diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_Software_Component-v1_0.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_Software_Component-v1_0.xml deleted file mode 100644 index 2cbdc8b76b..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_Software_Component-v1_0.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - LWM2M Software Component - - 14 - urn:oma:lwm2m:oma:14 - Multiple - Optional - - - Component Identity - R - Single - Optional - String - 0-255 bytes - - - - - Component Pack - R - Single - Optional - Opaque - - - - - - Component Version - R - Single - Optional - String - 0-255 bytes - - - - - Activate - E - Single - Optional - - - - - - - Deactivate - E - Single - Optional - - - - - - Activation State - R - Single - Optional - Boolean - - - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_Software_Management-v1_0.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_Software_Management-v1_0.xml deleted file mode 100644 index 33d9a62f4c..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_Software_Management-v1_0.xml +++ /dev/null @@ -1,279 +0,0 @@ - - - - - - - LWM2M Software Management - - 9 - urn:oma:lwm2m:oma:9 - Multiple - Optional - - - PkgName - R - Single - Mandatory - String - 0-255 bytes - - - - - PkgVersion - R - Single - Mandatory - String - 0-255 bytes - - - - - Package - W - Single - Optional - Opaque - - - - - - Package URI - W - Single - Optional - String - 0-255 bytes - - - - - Install - E - Single - Mandatory - - - - - - Checkpoint - R - Single - Optional - Objlnk - - - - - Uninstall - E - Single - Mandatory - - - - - - Update State - R - Single - Mandatory - Integer - 0-4 - - - - Update Supported Objects - RW - Single - Optional - Boolean - - - - - Update Result - R - Single - Mandatory - Integer - 0-200 - - - - Activate - E - Single - Mandatory - - - - - - Deactivate - E - Single - Mandatory - - - - - - Activation State - R - Single - Mandatory - Boolean - - - - - Package Settings - RW - Single - Optional - Objlnk - - - - - User Name - W - Single - Optional - String - 0-255 bytes - - - - Password - W - Single - Optional - String - 0-255 bytes - - - - - - diff --git a/common/transport/lwm2m/src/main/resources/models/LWM2M_WLAN_connectivity4-v1_0.xml b/common/transport/lwm2m/src/main/resources/models/LWM2M_WLAN_connectivity4-v1_0.xml deleted file mode 100644 index 71252b2b5c..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LWM2M_WLAN_connectivity4-v1_0.xml +++ /dev/null @@ -1,572 +0,0 @@ - - - - - - - WLAN connectivity - - 12 - urn:oma:lwm2m:oma:12 - - - Multiple - Optional - - Interface name - RW - Single - Mandatory - String - - - - - Enable - RW - Single - Mandatory - Boolean - - - - - Radio Enabled - RW - Single - Optional - Integer - - - - - Status - R - Single - Mandatory - Integer - - - - - BSSID - R - Single - Mandatory - String - 12 bytes - - - - SSID - RW - Single - Mandatory - String - 1-32 Bytes - - - - Broadcast SSID - RW - Single - Optional - Boolean - - - - - Beacon Enabled - RW - Single - Optional - Boolean - - - - - Mode - RW - Single - Mandatory - Integer - - - - - Channel - RW - Single - Mandatory - Integer - 0-255 - - - - Auto Channel - RW - Single - Optional - Boolean - - - - - Supported Channels - RW - Multiple - Optional - Integer - - - - - Channels In Use - RW - Multiple - Optional - Integer - - - - - Regulatory Domain - RW - Single - Optional - String - 3 Bytes - - - - Standard - RW - Single - Mandatory - Integer - - - - - Authentication Mode - RW - Single - Mandatory - Integer - - - - - Encryption Mode - RW - Single - Optional - Integer - - - - - WPA Pre Shared Key - W - Single - Optional - String - 64 Bytes - - - - WPA Key Phrase - W - Single - Optional - String - 1-64 Bytes - - - - WEP Encryption Type - RW - Single - Optional - Integer - - - - - WEP Key Index - RW - Single - Optional - Integer - [1:4] - - - - WEP Key Phrase - W - Single - Optional - String - 1-64 Bytes - - - - WEP Key 1 - W - Single - Optional - String - 0 or 26 Bytes - - - - WEP Key 2 - W - Single - Optional - String - 0 or 26 Bytes - - - - WEP Key 3 - W - Single - Optional - String - 10 or 26 Bytes - - - - WEP Key 4 - W - Single - Optional - String - 10 or 26 Bytes - - - - RADIUS Server - RW - Single - Optional - String - 1-256 Bytes - - - - RADIUS Server Port - RW - Single - Optional - Integer - - - - - RADIUS Secret - W - Single - Optional - String - 1-256 Bytes - - - - WMM Supported - R - Single - Optional - Boolean - - - - - WMM Enabled - RW - Single - Optional - Boolean - - - - - MAC Control Enabled - RW - Single - Optional - Boolean - - - - - MAC Address List - RW - Multiple - Optional - String - 12 Bytes - - - - Total Bytes Sent - R - Single - Optional - Integer - - - - - Total Bytes Received - R - Single - Optional - Integer - - - - - Total Packets Sent - R - Single - Optional - Integer - - - - - Total Packets Received - R - Single - Optional - Integer - - - - - Transmit Errors - R - Single - Optional - Integer - - - - - Receive Errors - R - Single - Optional - Integer - - - - - Unicast Packets Sent - R - Single - Optional - Integer - - - - - Unicast Packets Received - R - Single - Optional - Integer - - - - - Multicast Packets Received - R - Single - Optional - Integer - - - - - Multicast Packets Received - R - Single - Optional - Integer - - - - - Broadcast Packets Sent - R - Single - Optional - Integer - - - - - 44 Broadcast Packets Received - R - Single - Optional - Integer - - - - - Discard Packets Sent - R - Single - Optional - Integer - - - - - Discard Packets Received - R - Single - Optional - Integer - - - - - Unknown Packets Received - R - Single - Optional - Integer - - - - - Vendor specific extensions - R - Single - Optional - Objlnk - - - - - - - \ No newline at end of file diff --git a/common/transport/lwm2m/src/main/resources/models/LwM2M_EventLog-V1_0.xml b/common/transport/lwm2m/src/main/resources/models/LwM2M_EventLog-V1_0.xml deleted file mode 100644 index 7cc3f918b2..0000000000 --- a/common/transport/lwm2m/src/main/resources/models/LwM2M_EventLog-V1_0.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - Event Log - - 20 - urn:oma:lwm2m:oma:20 - 1.0 - 1.0 - Single - Optional - - LogClass - RW - Single - Optional - Integer - 255 - - - - LogStart - E - Single - Optional - - - - - - LogStop - E - Single - Optional - - - - - - LogStatus - R - Single - Optional - Integer - 8-Bits - - - - LogData - R - Single - Mandatory - Opaque - - - - - LogDataFormat - RW - Single - Optional - Integer - 255 - - - - - - \ No newline at end of file diff --git a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportResourceCache.java b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportResourceCache.java new file mode 100644 index 0000000000..34e95189fa --- /dev/null +++ b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportResourceCache.java @@ -0,0 +1,29 @@ +/** + * Copyright © 2016-2021 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.common.transport; + +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; +import org.thingsboard.server.common.data.id.TenantId; + +public interface TransportResourceCache { + + Resource get(TenantId tenantId, ResourceType resourceType, String resourceId); + + void update(TenantId tenantId, ResourceType resourceType, String resourceI); + + void evict(TenantId tenantId, ResourceType resourceType, String resourceId); +} diff --git a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportService.java b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportService.java index e642e7f7b2..04b08272b1 100644 --- a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportService.java +++ b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/TransportService.java @@ -25,6 +25,8 @@ import org.thingsboard.server.gen.transport.TransportProtos.GetAttributeRequestM import org.thingsboard.server.gen.transport.TransportProtos.GetEntityProfileRequestMsg; import org.thingsboard.server.gen.transport.TransportProtos.GetEntityProfileResponseMsg; import org.thingsboard.server.gen.transport.TransportProtos.GetOrCreateDeviceFromGatewayRequestMsg; +import org.thingsboard.server.gen.transport.TransportProtos.GetResourceRequestMsg; +import org.thingsboard.server.gen.transport.TransportProtos.GetResourceResponseMsg; import org.thingsboard.server.gen.transport.TransportProtos.LwM2MRequestMsg; import org.thingsboard.server.gen.transport.TransportProtos.LwM2MResponseMsg; import org.thingsboard.server.gen.transport.TransportProtos.PostAttributeMsg; @@ -51,6 +53,8 @@ public interface TransportService { GetEntityProfileResponseMsg getEntityProfile(GetEntityProfileRequestMsg msg); + GetResourceResponseMsg getResource(GetResourceRequestMsg msg); + void process(DeviceTransportType transportType, ValidateDeviceTokenRequestMsg msg, TransportServiceCallback callback); diff --git a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/lwm2m/LwM2MTransportConfigServer.java b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/lwm2m/LwM2MTransportConfigServer.java index 810848a5ca..1208ace313 100644 --- a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/lwm2m/LwM2MTransportConfigServer.java +++ b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/lwm2m/LwM2MTransportConfigServer.java @@ -18,10 +18,10 @@ package org.thingsboard.server.common.transport.lwm2m; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; -import org.eclipse.leshan.core.model.ObjectLoader; import org.eclipse.leshan.core.model.ObjectModel; import org.eclipse.leshan.core.model.ResourceModel; import org.eclipse.leshan.core.node.LwM2mPath; +import org.eclipse.leshan.server.model.LwM2mModelProvider; import org.eclipse.leshan.server.registration.Registration; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; @@ -38,16 +38,13 @@ import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; -import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; @Slf4j @Component @ConditionalOnExpression("('${service.type:null}'=='tb-transport' && '${transport.lwm2m.enabled:false}'=='true') || '${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core'") public class LwM2MTransportConfigServer { - @Getter private String MODEL_PATH_DEFAULT = "models"; @@ -84,7 +81,11 @@ public class LwM2MTransportConfigServer { @Getter @Setter - private List modelsValue; + private List modelsValueCommon; + + @Getter + @Setter + private LwM2mModelProvider modelProvider; @Getter @Value("${transport.lwm2m.timeout:}") @@ -188,29 +189,9 @@ public class LwM2MTransportConfigServer { @PostConstruct public void init() { - modelsValue = ObjectLoader.loadDefault(); - File path = getPathModels(); - if (path.isDirectory()) { - try { - modelsValue.addAll(ObjectLoader.loadObjectsFromDir(path)); - log.info(" [{}] Models directory is a directory", path.getAbsoluteFile()); - } catch (Exception e) { - log.error(" [{}] Could not parse the resource definition file", e.toString()); - } - } else { - log.error(" [{}] Read Models", path.getAbsoluteFile()); - } this.getInKeyStore(); } - private File getPathModels() { - Path pathModels = (modelPathFile != null && !modelPathFile.isEmpty()) ? Paths.get(modelPathFile) : - (new File(Paths.get(getBaseDirPath(), PATH_DATA, MODEL_PATH_DEFAULT).toUri()).isDirectory()) ? - Paths.get(getBaseDirPath(), PATH_DATA, MODEL_PATH_DEFAULT) : - Paths.get(getBaseDirPath(), APP_DIR, TRANSPORT_DIR, LWM2M_DIR, SRC_DIR, MAIN_DIR, RESOURCES_DIR, MODEL_PATH_DEFAULT); - return (pathModels != null) ? new File(pathModels.toUri()) : null; - } - private KeyStore getInKeyStore() { try { if (keyStoreValue != null && keyStoreValue.size() > 0) @@ -253,12 +234,7 @@ public class LwM2MTransportConfigServer { } public ResourceModel getResourceModel(Registration registration, LwM2mPath pathIds) { - String pathLink = "/" + pathIds.getObjectId() + "/" + pathIds.getObjectInstanceId(); - return (Arrays.stream(registration.getObjectLinks()).filter(p-> p.getUrl().equals(pathLink)).findFirst().isPresent() && - this.modelsValue.stream().filter(v -> v.id == pathIds.getObjectId()).collect(Collectors.toList()).size() > 0) && - this.modelsValue.stream().filter(v -> v.id == pathIds.getObjectId()).collect(Collectors.toList()).get(0).resources.containsKey(pathIds.getResourceId()) ? - this.modelsValue.stream().filter(v -> v.id == pathIds.getObjectId()).collect(Collectors.toList()).get(0).resources.get(pathIds.getResourceId()) : - null; + return this.modelProvider.getObjectModel(registration).getResourceModel(pathIds.getObjectId(), pathIds.getResourceId()); } public ResourceModel.Type getResourceModelType(Registration registration, LwM2mPath pathIds) { @@ -270,4 +246,5 @@ public class LwM2MTransportConfigServer { ResourceModel resource = this.getResourceModel(registration, pathIds); return (resource == null) ? ResourceModel.Operations.NONE : resource.operations; } + } diff --git a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/DefaultTransportResourceCache.java b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/DefaultTransportResourceCache.java new file mode 100644 index 0000000000..5160479d1e --- /dev/null +++ b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/DefaultTransportResourceCache.java @@ -0,0 +1,130 @@ +/** + * Copyright © 2016-2021 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.common.transport.service; + +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.springframework.context.annotation.Lazy; +import org.springframework.stereotype.Component; +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; +import org.thingsboard.server.common.data.id.TenantId; +import org.thingsboard.server.common.transport.TransportResourceCache; +import org.thingsboard.server.common.transport.TransportService; +import org.thingsboard.server.common.transport.util.DataDecodingEncodingService; +import org.thingsboard.server.gen.transport.TransportProtos; +import org.thingsboard.server.queue.util.TbTransportComponent; + +import java.util.Optional; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +@Slf4j +@Component +@TbTransportComponent +public class DefaultTransportResourceCache implements TransportResourceCache { + + private final Lock resourceFetchLock = new ReentrantLock(); + private final ConcurrentMap resources = new ConcurrentHashMap<>(); + private final Set keys = ConcurrentHashMap.newKeySet(); + private final DataDecodingEncodingService dataDecodingEncodingService; + private final TransportService transportService; + + public DefaultTransportResourceCache(DataDecodingEncodingService dataDecodingEncodingService, @Lazy TransportService transportService) { + this.dataDecodingEncodingService = dataDecodingEncodingService; + this.transportService = transportService; + } + + @Override + public Resource get(TenantId tenantId, ResourceType resourceType, String resourceId) { + ResourceKey resourceKey = new ResourceKey(tenantId, resourceType, resourceId); + Resource resource; + + if (keys.contains(resourceKey)) { + resource = resources.get(resourceKey); + if (resource == null) { + resource = resources.get(resourceKey.getSystemKey()); + } + } else { + resourceFetchLock.lock(); + try { + if (keys.contains(resourceKey)) { + resource = resources.get(resourceKey); + if (resource == null) { + resource = resources.get(resourceKey.getSystemKey()); + } + } else { + resource = fetchResource(resourceKey); + keys.add(resourceKey); + } + } finally { + resourceFetchLock.unlock(); + } + } + + return resource; + } + + private Resource fetchResource(ResourceKey resourceKey) { + UUID tenantId = resourceKey.getTenantId().getId(); + TransportProtos.GetResourceRequestMsg.Builder builder = TransportProtos.GetResourceRequestMsg.newBuilder(); + builder + .setTenantIdLSB(tenantId.getLeastSignificantBits()) + .setTenantIdMSB(tenantId.getMostSignificantBits()) + .setResourceType(resourceKey.resourceType.name()) + .setResourceId(resourceKey.resourceId); + TransportProtos.GetResourceResponseMsg responseMsg = transportService.getResource(builder.build()); + + Optional optionalResource = dataDecodingEncodingService.decode(responseMsg.getResource().toByteArray()); + if (optionalResource.isPresent()) { + Resource resource = optionalResource.get(); + resources.put(new ResourceKey(resource.getTenantId(), resource.getResourceType(), resource.getResourceId()), resource); + return resource; + } + + return null; + } + + @Override + public void update(TenantId tenantId, ResourceType resourceType, String resourceId) { + ResourceKey resourceKey = new ResourceKey(tenantId, resourceType, resourceId); + if (keys.contains(resourceKey) || resources.containsKey(resourceKey)) { + fetchResource(resourceKey); + } + } + + @Override + public void evict(TenantId tenantId, ResourceType resourceType, String resourceId) { + ResourceKey resourceKey = new ResourceKey(tenantId, resourceType, resourceId); + keys.remove(resourceKey); + resources.remove(resourceKey); + } + + @Data + private static class ResourceKey { + private final TenantId tenantId; + private final ResourceType resourceType; + private final String resourceId; + + public ResourceKey getSystemKey() { + return new ResourceKey(TenantId.SYS_TENANT_ID, resourceType, resourceId); + } + } +} diff --git a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/DefaultTransportService.java b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/DefaultTransportService.java index 473eeea42c..6a8526f543 100644 --- a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/DefaultTransportService.java +++ b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/service/DefaultTransportService.java @@ -31,6 +31,7 @@ import org.thingsboard.server.common.data.Device; import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.DeviceTransportType; import org.thingsboard.server.common.data.EntityType; +import org.thingsboard.server.common.data.ResourceType; import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.id.DeviceId; import org.thingsboard.server.common.data.id.DeviceProfileId; @@ -49,6 +50,7 @@ import org.thingsboard.server.common.stats.StatsFactory; import org.thingsboard.server.common.stats.StatsType; import org.thingsboard.server.common.transport.SessionMsgListener; import org.thingsboard.server.common.transport.TransportDeviceProfileCache; +import org.thingsboard.server.common.transport.TransportResourceCache; import org.thingsboard.server.common.transport.TransportService; import org.thingsboard.server.common.transport.TransportServiceCallback; import org.thingsboard.server.common.transport.TransportTenantProfileCache; @@ -61,7 +63,6 @@ import org.thingsboard.server.common.transport.util.JsonUtils; import org.thingsboard.server.gen.transport.TransportProtos; import org.thingsboard.server.gen.transport.TransportProtos.ProvisionDeviceRequestMsg; import org.thingsboard.server.gen.transport.TransportProtos.ProvisionDeviceResponseMsg; -import org.thingsboard.server.gen.transport.TransportProtos.SessionInfoProto; import org.thingsboard.server.gen.transport.TransportProtos.ToCoreMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToRuleEngineMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToTransportMsg; @@ -131,6 +132,7 @@ public class DefaultTransportService implements TransportService { private final TransportRateLimitService rateLimitService; private final DataDecodingEncodingService dataDecodingEncodingService; private final SchedulerComponent scheduler; + private final TransportResourceCache transportResourceCache; protected TbQueueRequestTemplate, TbProtoQueueMsg> transportApiRequestTemplate; protected TbQueueProducer> ruleEngineMsgProducer; @@ -157,7 +159,7 @@ public class DefaultTransportService implements TransportService { TransportDeviceProfileCache deviceProfileCache, TransportTenantProfileCache tenantProfileCache, TbApiUsageClient apiUsageClient, TransportRateLimitService rateLimitService, - DataDecodingEncodingService dataDecodingEncodingService, SchedulerComponent scheduler) { + DataDecodingEncodingService dataDecodingEncodingService, SchedulerComponent scheduler, TransportResourceCache transportResourceCache) { this.serviceInfoProvider = serviceInfoProvider; this.queueProvider = queueProvider; this.producerProvider = producerProvider; @@ -169,6 +171,7 @@ public class DefaultTransportService implements TransportService { this.rateLimitService = rateLimitService; this.dataDecodingEncodingService = dataDecodingEncodingService; this.scheduler = scheduler; + this.transportResourceCache = transportResourceCache; } @PostConstruct @@ -254,6 +257,18 @@ public class DefaultTransportService implements TransportService { } } + @Override + public TransportProtos.GetResourceResponseMsg getResource(TransportProtos.GetResourceRequestMsg msg) { + TbProtoQueueMsg protoMsg = + new TbProtoQueueMsg<>(UUID.randomUUID(), TransportProtos.TransportApiRequestMsg.newBuilder().setResourceRequestMsg(msg).build()); + try { + TbProtoQueueMsg response = transportApiRequestTemplate.send(protoMsg).get(); + return response.getValue().getResourceResponseMsg(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + } + @Override public void process(DeviceTransportType transportType, TransportProtos.ValidateDeviceTokenRequestMsg msg, TransportServiceCallback callback) { @@ -280,6 +295,7 @@ public class DefaultTransportService implements TransportService { response -> callback.onSuccess(response.getValue().getValidateCredResponseMsg()), callback::onError, transportCallbackExecutor); } + @Override public void process(DeviceTransportType transportType, TransportProtos.ValidateDeviceX509CertRequestMsg msg, TransportServiceCallback callback) { log.trace("Processing msg: {}", msg); TbProtoQueueMsg protoMsg = new TbProtoQueueMsg<>(UUID.randomUUID(), TransportApiRequestMsg.newBuilder().setValidateX509CertRequestMsg(msg).build()); @@ -688,6 +704,18 @@ public class DefaultTransportService implements TransportService { } else if (EntityType.DEVICE.equals(entityType)) { rateLimitService.remove(new DeviceId(entityUuid)); } + } else if (toSessionMsg.hasResourceUpdateMsg()) { + TransportProtos.ResourceUpdateMsg msg = toSessionMsg.getResourceUpdateMsg(); + TenantId tenantId = new TenantId(new UUID(msg.getTenantIdMSB(), msg.getTenantIdLSB())); + ResourceType resourceType = ResourceType.valueOf(msg.getResourceType()); + String resourceId = msg.getResourceId(); + transportResourceCache.update(tenantId, resourceType, resourceId); + } else if (toSessionMsg.hasResourceDeleteMsg()) { + TransportProtos.ResourceDeleteMsg msg = toSessionMsg.getResourceDeleteMsg(); + TenantId tenantId = new TenantId(new UUID(msg.getTenantIdMSB(), msg.getTenantIdLSB())); + ResourceType resourceType = ResourceType.valueOf(msg.getResourceType()); + String resourceId = msg.getResourceId(); + transportResourceCache.evict(tenantId, resourceType, resourceId); } else { //TODO: should we notify the device actor about missed session? log.debug("[{}] Missing session.", sessionId); @@ -695,6 +723,7 @@ public class DefaultTransportService implements TransportService { } } + public void onProfileUpdate(DeviceProfile deviceProfile) { long deviceProfileIdMSB = deviceProfile.getId().getId().getMostSignificantBits(); long deviceProfileIdLSB = deviceProfile.getId().getId().getLeastSignificantBits(); diff --git a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/util/ProtoWithFSTService.java b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/util/ProtoWithFSTService.java index a3b65c2248..4d0b8bb86a 100644 --- a/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/util/ProtoWithFSTService.java +++ b/common/transport/transport-api/src/main/java/org/thingsboard/server/common/transport/util/ProtoWithFSTService.java @@ -18,8 +18,6 @@ package org.thingsboard.server.common.transport.util; import lombok.extern.slf4j.Slf4j; import org.nustaq.serialization.FSTConfiguration; import org.springframework.stereotype.Service; -import org.thingsboard.server.common.msg.TbActorMsg; -import org.thingsboard.server.common.transport.util.DataDecodingEncodingService; import java.util.Optional; @@ -33,8 +31,8 @@ public class ProtoWithFSTService implements DataDecodingEncodingService { public Optional decode(byte[] byteArray) { try { @SuppressWarnings("unchecked") - T msg = (T) config.asObject(byteArray); - return Optional.of(msg); + T msg = byteArray != null && byteArray.length > 0 ? (T) config.asObject(byteArray) : null; + return Optional.ofNullable(msg); } catch (IllegalArgumentException e) { log.error("Error during deserialization message, [{}]", e.getMessage()); return Optional.empty(); diff --git a/common/util/src/main/java/org/thingsboard/common/util/JacksonUtil.java b/common/util/src/main/java/org/thingsboard/common/util/JacksonUtil.java index b48030f714..8d498fa853 100644 --- a/common/util/src/main/java/org/thingsboard/common/util/JacksonUtil.java +++ b/common/util/src/main/java/org/thingsboard/common/util/JacksonUtil.java @@ -57,6 +57,15 @@ public class JacksonUtil { } } + public static T fromString(String string, TypeReference valueTypeRef) { + try { + return string != null ? OBJECT_MAPPER.readValue(string, valueTypeRef) : null; + } catch (IOException e) { + throw new IllegalArgumentException("The given string value: " + + string + " cannot be transformed to Json object", e); + } + } + public static String toString(Object value) { try { return value != null ? OBJECT_MAPPER.writeValueAsString(value) : null; diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributeCacheKey.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributeCacheKey.java new file mode 100644 index 0000000000..10771656e9 --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributeCacheKey.java @@ -0,0 +1,39 @@ +/** + * Copyright © 2016-2021 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.dao.attributes; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import org.thingsboard.server.common.data.id.EntityId; + +import java.io.Serializable; + +@EqualsAndHashCode +@Getter +@AllArgsConstructor +public class AttributeCacheKey implements Serializable { + private static final long serialVersionUID = 2013369077925351881L; + + private final String scope; + private final EntityId entityId; + private final String key; + + @Override + public String toString() { + return entityId + "_" + scope + "_" + key; + } +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributeUtils.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributeUtils.java new file mode 100644 index 0000000000..b1fc82fe88 --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributeUtils.java @@ -0,0 +1,39 @@ +/** + * Copyright © 2016-2021 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.dao.attributes; + +import org.thingsboard.server.common.data.id.EntityId; +import org.thingsboard.server.common.data.kv.AttributeKvEntry; +import org.thingsboard.server.dao.exception.IncorrectParameterException; +import org.thingsboard.server.dao.service.Validator; + +public class AttributeUtils { + public static void validate(EntityId id, String scope) { + Validator.validateId(id.getId(), "Incorrect id " + id); + Validator.validateString(scope, "Incorrect scope " + scope); + } + + public static void validate(AttributeKvEntry kvEntry) { + if (kvEntry == null) { + throw new IncorrectParameterException("Key value entry can't be null"); + } else if (kvEntry.getDataType() == null) { + throw new IncorrectParameterException("Incorrect kvEntry. Data type can't be null"); + } else { + Validator.validateString(kvEntry.getKey(), "Incorrect kvEntry. Key can't be empty"); + Validator.validatePositiveNumber(kvEntry.getLastUpdateTs(), "Incorrect last update ts. Ts should be positive"); + } + } +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesCacheWrapper.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesCacheWrapper.java new file mode 100644 index 0000000000..196204cda1 --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesCacheWrapper.java @@ -0,0 +1,63 @@ +/** + * Copyright © 2016-2021 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.dao.attributes; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Service; +import org.thingsboard.server.common.data.kv.AttributeKvEntry; + +import static org.thingsboard.server.common.data.CacheConstants.ATTRIBUTES_CACHE; + +@Service +@ConditionalOnProperty(prefix = "cache.attributes", value = "enabled", havingValue = "true") +@Primary +@Slf4j +public class AttributesCacheWrapper { + private final Cache attributesCache; + + public AttributesCacheWrapper(CacheManager cacheManager) { + this.attributesCache = cacheManager.getCache(ATTRIBUTES_CACHE); + } + + public Cache.ValueWrapper get(AttributeCacheKey attributeCacheKey) { + try { + return attributesCache.get(attributeCacheKey); + } catch (Exception e) { + log.debug("Failed to retrieve element from cache for key {}. Reason - {}.", attributeCacheKey, e.getMessage()); + return null; + } + } + + public void put(AttributeCacheKey attributeCacheKey, AttributeKvEntry attributeKvEntry) { + try { + attributesCache.put(attributeCacheKey, attributeKvEntry); + } catch (Exception e) { + log.debug("Failed to put element from cache for key {}. Reason - {}.", attributeCacheKey, e.getMessage()); + } + } + + public void evict(AttributeCacheKey attributeCacheKey) { + try { + attributesCache.evict(attributeCacheKey); + } catch (Exception e) { + log.debug("Failed to evict element from cache for key {}. Reason - {}.", attributeCacheKey, e.getMessage()); + } + } +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/BaseAttributesService.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/BaseAttributesService.java index e70604353a..3eee300627 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/attributes/BaseAttributesService.java +++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/BaseAttributesService.java @@ -15,31 +15,39 @@ */ package org.thingsboard.server.dao.attributes; -import com.google.common.collect.Lists; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; -import org.springframework.beans.factory.annotation.Autowired; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Service; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.id.DeviceProfileId; import org.thingsboard.server.common.data.id.EntityId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.kv.AttributeKvEntry; -import org.thingsboard.server.dao.exception.IncorrectParameterException; import org.thingsboard.server.dao.service.Validator; import java.util.Collection; import java.util.List; import java.util.Optional; +import java.util.stream.Collectors; + +import static org.thingsboard.server.dao.attributes.AttributeUtils.validate; /** * @author Andrew Shvayka */ @Service +@ConditionalOnProperty(prefix = "cache.attributes", value = "enabled", havingValue = "false", matchIfMissing = true) +@Primary +@Slf4j public class BaseAttributesService implements AttributesService { + private final AttributesDao attributesDao; - @Autowired - private AttributesDao attributesDao; + public BaseAttributesService(AttributesDao attributesDao) { + this.attributesDao = attributesDao; + } @Override public ListenableFuture> find(TenantId tenantId, EntityId entityId, String scope, String attributeKey) { @@ -75,33 +83,14 @@ public class BaseAttributesService implements AttributesService { public ListenableFuture> save(TenantId tenantId, EntityId entityId, String scope, List attributes) { validate(entityId, scope); attributes.forEach(attribute -> validate(attribute)); - List> futures = Lists.newArrayListWithExpectedSize(attributes.size()); - for (AttributeKvEntry attribute : attributes) { - futures.add(attributesDao.save(tenantId, entityId, scope, attribute)); - } - return Futures.allAsList(futures); + + List> saveFutures = attributes.stream().map(attribute -> attributesDao.save(tenantId, entityId, scope, attribute)).collect(Collectors.toList()); + return Futures.allAsList(saveFutures); } @Override - public ListenableFuture> removeAll(TenantId tenantId, EntityId entityId, String scope, List keys) { + public ListenableFuture> removeAll(TenantId tenantId, EntityId entityId, String scope, List attributeKeys) { validate(entityId, scope); - return attributesDao.removeAll(tenantId, entityId, scope, keys); - } - - private static void validate(EntityId id, String scope) { - Validator.validateId(id.getId(), "Incorrect id " + id); - Validator.validateString(scope, "Incorrect scope " + scope); - } - - private static void validate(AttributeKvEntry kvEntry) { - if (kvEntry == null) { - throw new IncorrectParameterException("Key value entry can't be null"); - } else if (kvEntry.getDataType() == null) { - throw new IncorrectParameterException("Incorrect kvEntry. Data type can't be null"); - } else { - Validator.validateString(kvEntry.getKey(), "Incorrect kvEntry. Key can't be empty"); - Validator.validatePositiveNumber(kvEntry.getLastUpdateTs(), "Incorrect last update ts. Ts should be positive"); - } + return attributesDao.removeAll(tenantId, entityId, scope, attributeKeys); } - } diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/CachedAttributesService.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/CachedAttributesService.java new file mode 100644 index 0000000000..87ddfeee9a --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/CachedAttributesService.java @@ -0,0 +1,193 @@ +/** + * Copyright © 2016-2021 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.dao.attributes; + +import com.google.common.util.concurrent.Futures; +import com.google.common.util.concurrent.ListenableFuture; +import com.google.common.util.concurrent.MoreExecutors; +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.cache.Cache; +import org.springframework.cache.CacheManager; +import org.springframework.context.annotation.Primary; +import org.springframework.stereotype.Service; +import org.thingsboard.server.common.data.EntityType; +import org.thingsboard.server.common.data.id.DeviceProfileId; +import org.thingsboard.server.common.data.id.EntityId; +import org.thingsboard.server.common.data.id.TenantId; +import org.thingsboard.server.common.data.kv.AttributeKvEntry; +import org.thingsboard.server.common.data.kv.KvEntry; +import org.thingsboard.server.common.stats.DefaultCounter; +import org.thingsboard.server.common.stats.StatsFactory; +import org.thingsboard.server.dao.service.Validator; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +import static org.thingsboard.server.common.data.CacheConstants.ATTRIBUTES_CACHE; +import static org.thingsboard.server.dao.attributes.AttributeUtils.validate; + +@Service +@ConditionalOnProperty(prefix = "cache.attributes", value = "enabled", havingValue = "true") +@Primary +@Slf4j +public class CachedAttributesService implements AttributesService { + private static final String STATS_NAME = "attributes.cache"; + + private final AttributesDao attributesDao; + private final AttributesCacheWrapper cacheWrapper; + private final DefaultCounter hitCounter; + private final DefaultCounter missCounter; + + public CachedAttributesService(AttributesDao attributesDao, + AttributesCacheWrapper cacheWrapper, + StatsFactory statsFactory) { + this.attributesDao = attributesDao; + this.cacheWrapper = cacheWrapper; + + this.hitCounter = statsFactory.createDefaultCounter(STATS_NAME, "result", "hit"); + this.missCounter = statsFactory.createDefaultCounter(STATS_NAME, "result", "miss"); + } + + @Override + public ListenableFuture> find(TenantId tenantId, EntityId entityId, String scope, String attributeKey) { + validate(entityId, scope); + Validator.validateString(attributeKey, "Incorrect attribute key " + attributeKey); + + AttributeCacheKey attributeCacheKey = new AttributeCacheKey(scope, entityId, attributeKey); + Cache.ValueWrapper cachedAttributeValue = cacheWrapper.get(attributeCacheKey); + if (cachedAttributeValue != null) { + hitCounter.increment(); + AttributeKvEntry cachedAttributeKvEntry = (AttributeKvEntry) cachedAttributeValue.get(); + return Futures.immediateFuture(Optional.ofNullable(cachedAttributeKvEntry)); + } else { + missCounter.increment(); + ListenableFuture> result = attributesDao.find(tenantId, entityId, scope, attributeKey); + return Futures.transform(result, foundAttrKvEntry -> { + // TODO: think if it's a good idea to store 'empty' attributes + cacheWrapper.put(attributeCacheKey, foundAttrKvEntry.orElse(null)); + return foundAttrKvEntry; + }, MoreExecutors.directExecutor()); + } + } + + @Override + public ListenableFuture> find(TenantId tenantId, EntityId entityId, String scope, Collection attributeKeys) { + validate(entityId, scope); + attributeKeys.forEach(attributeKey -> Validator.validateString(attributeKey, "Incorrect attribute key " + attributeKey)); + + Map wrappedCachedAttributes = findCachedAttributes(entityId, scope, attributeKeys); + + List cachedAttributes = wrappedCachedAttributes.values().stream() + .map(wrappedCachedAttribute -> (AttributeKvEntry) wrappedCachedAttribute.get()) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + if (wrappedCachedAttributes.size() == attributeKeys.size()) { + return Futures.immediateFuture(cachedAttributes); + } + + Set notFoundAttributeKeys = new HashSet<>(attributeKeys); + notFoundAttributeKeys.removeAll(wrappedCachedAttributes.keySet()); + + ListenableFuture> result = attributesDao.find(tenantId, entityId, scope, notFoundAttributeKeys); + return Futures.transform(result, foundInDbAttributes -> mergeDbAndCacheAttributes(entityId, scope, cachedAttributes, notFoundAttributeKeys, foundInDbAttributes), MoreExecutors.directExecutor()); + + } + + private Map findCachedAttributes(EntityId entityId, String scope, Collection attributeKeys) { + Map cachedAttributes = new HashMap<>(); + for (String attributeKey : attributeKeys) { + Cache.ValueWrapper cachedAttributeValue = cacheWrapper.get(new AttributeCacheKey(scope, entityId, attributeKey)); + if (cachedAttributeValue != null) { + hitCounter.increment(); + cachedAttributes.put(attributeKey, cachedAttributeValue); + } else { + missCounter.increment(); + } + } + return cachedAttributes; + } + + private List mergeDbAndCacheAttributes(EntityId entityId, String scope, List cachedAttributes, Set notFoundAttributeKeys, List foundInDbAttributes) { + for (AttributeKvEntry foundInDbAttribute : foundInDbAttributes) { + AttributeCacheKey attributeCacheKey = new AttributeCacheKey(scope, entityId, foundInDbAttribute.getKey()); + cacheWrapper.put(attributeCacheKey, foundInDbAttribute); + notFoundAttributeKeys.remove(foundInDbAttribute.getKey()); + } + for (String key : notFoundAttributeKeys){ + cacheWrapper.put(new AttributeCacheKey(scope, entityId, key), null); + } + List mergedAttributes = new ArrayList<>(cachedAttributes); + mergedAttributes.addAll(foundInDbAttributes); + return mergedAttributes; + } + + @Override + public ListenableFuture> findAll(TenantId tenantId, EntityId entityId, String scope) { + validate(entityId, scope); + return attributesDao.findAll(tenantId, entityId, scope); + } + + @Override + public List findAllKeysByDeviceProfileId(TenantId tenantId, DeviceProfileId deviceProfileId) { + return attributesDao.findAllKeysByDeviceProfileId(tenantId, deviceProfileId); + } + + @Override + public List findAllKeysByEntityIds(TenantId tenantId, EntityType entityType, List entityIds) { + return attributesDao.findAllKeysByEntityIds(tenantId, entityType, entityIds); + } + + @Override + public ListenableFuture> save(TenantId tenantId, EntityId entityId, String scope, List attributes) { + validate(entityId, scope); + attributes.forEach(AttributeUtils::validate); + + List> saveFutures = attributes.stream().map(attribute -> attributesDao.save(tenantId, entityId, scope, attribute)).collect(Collectors.toList()); + ListenableFuture> future = Futures.allAsList(saveFutures); + + // TODO: can do if (attributesCache.get() != null) attributesCache.put() instead, but will be more twice more requests to cache + List attributeKeys = attributes.stream().map(KvEntry::getKey).collect(Collectors.toList()); + future.addListener(() -> evictAttributesFromCache(tenantId, entityId, scope, attributeKeys), MoreExecutors.directExecutor()); + return future; + } + + @Override + public ListenableFuture> removeAll(TenantId tenantId, EntityId entityId, String scope, List attributeKeys) { + validate(entityId, scope); + ListenableFuture> future = attributesDao.removeAll(tenantId, entityId, scope, attributeKeys); + future.addListener(() -> evictAttributesFromCache(tenantId, entityId, scope, attributeKeys), MoreExecutors.directExecutor()); + return future; + } + + private void evictAttributesFromCache(TenantId tenantId, EntityId entityId, String scope, List attributeKeys) { + try { + for (String attributeKey : attributeKeys) { + cacheWrapper.evict(new AttributeCacheKey(scope, entityId, attributeKey)); + } + } catch (Exception e) { + log.error("[{}][{}] Failed to remove values from cache.", tenantId, entityId, e); + } + } +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java b/dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java index b80e680279..02911e7f0e 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java +++ b/dao/src/main/java/org/thingsboard/server/dao/model/ModelConstants.java @@ -455,6 +455,15 @@ public class ModelConstants { public static final String API_USAGE_STATE_EMAIL_EXEC_COLUMN = "email_exec"; public static final String API_USAGE_STATE_SMS_EXEC_COLUMN = "sms_exec"; + /** + * Resource constants. + */ + public static final String RESOURCE_TABLE_NAME = "resource"; + public static final String RESOURCE_TENANT_ID_COLUMN = TENANT_ID_COLUMN; + public static final String RESOURCE_TYPE_COLUMN = "resource_type"; + public static final String RESOURCE_ID_COLUMN = "resource_id"; + public static final String RESOURCE_VALUE_COLUMN = "resource_value"; + /** * Edge constants. */ diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/ResourceCompositeKey.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/ResourceCompositeKey.java new file mode 100644 index 0000000000..6592cf757d --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/ResourceCompositeKey.java @@ -0,0 +1,44 @@ +/** + * Copyright © 2016-2021 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.dao.model.sql; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.thingsboard.server.common.data.Resource; + +import javax.persistence.Transient; +import java.io.Serializable; +import java.util.UUID; + +@NoArgsConstructor +@AllArgsConstructor +@Data +public class ResourceCompositeKey implements Serializable { + + @Transient + private static final long serialVersionUID = -3789469030818742769L; + + private UUID tenantId; + private String resourceType; + private String resourceId; + + public ResourceCompositeKey(Resource resource) { + this.tenantId = resource.getTenantId().getId(); + this.resourceType = resource.getResourceType().name(); + this.resourceId = resource.getResourceId(); + } +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/ResourceEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/ResourceEntity.java new file mode 100644 index 0000000000..fdb24e6159 --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/ResourceEntity.java @@ -0,0 +1,77 @@ +/** + * Copyright © 2016-2021 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.dao.model.sql; + +import lombok.Data; +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; +import org.thingsboard.server.common.data.id.TenantId; +import org.thingsboard.server.dao.model.ToData; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.IdClass; +import javax.persistence.Table; +import java.util.UUID; + +import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_ID_COLUMN; +import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_TABLE_NAME; +import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_TENANT_ID_COLUMN; +import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_TYPE_COLUMN; +import static org.thingsboard.server.dao.model.ModelConstants.RESOURCE_VALUE_COLUMN; + +@Data +@Entity +@Table(name = RESOURCE_TABLE_NAME) +@IdClass(ResourceCompositeKey.class) +public class ResourceEntity implements ToData { + + @Id + @Column(name = RESOURCE_TENANT_ID_COLUMN, columnDefinition = "uuid") + private UUID tenantId; + + @Id + @Column(name = RESOURCE_TYPE_COLUMN) + private String resourceType; + + @Id + @Column(name = RESOURCE_ID_COLUMN) + private String resourceId; + + @Column(name = RESOURCE_VALUE_COLUMN) + private String value; + + public ResourceEntity() { + } + + public ResourceEntity(Resource resource) { + this.tenantId = resource.getTenantId().getId(); + this.resourceType = resource.getResourceType().name(); + this.resourceId = resource.getResourceId(); + this.value = resource.getValue(); + } + + @Override + public Resource toData() { + Resource resource = new Resource(); + resource.setTenantId(new TenantId(tenantId)); + resource.setResourceType(ResourceType.valueOf(resourceType)); + resource.setResourceId(resourceId); + resource.setValue(value); + return resource; + } +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java b/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java index 1fa9f057b2..44b328fd9f 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java +++ b/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationService.java @@ -35,7 +35,7 @@ import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntityRelationInfo; import org.thingsboard.server.common.data.relation.EntityRelationsQuery; import org.thingsboard.server.common.data.relation.EntitySearchDirection; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationTypeGroup; import org.thingsboard.server.common.data.relation.RelationsSearchParameters; import org.thingsboard.server.dao.entity.EntityService; @@ -457,7 +457,7 @@ public class BaseRelationService implements RelationService { //boolean fetchLastLevelOnly = true; log.trace("Executing findByQuery [{}]", query); RelationsSearchParameters params = query.getParameters(); - final List filters = query.getFilters(); + final List filters = query.getFilters(); if (filters == null || filters.isEmpty()) { log.debug("Filters are not set [{}]", query); } @@ -575,8 +575,8 @@ public class BaseRelationService implements RelationService { }; } - private boolean matchFilters(List filters, EntityRelation relation, EntitySearchDirection direction) { - for (EntityTypeFilter filter : filters) { + private boolean matchFilters(List filters, EntityRelation relation, EntitySearchDirection direction) { + for (RelationEntityTypeFilter filter : filters) { if (match(filter, relation, direction)) { return true; } @@ -584,7 +584,7 @@ public class BaseRelationService implements RelationService { return false; } - private boolean match(EntityTypeFilter filter, EntityRelation relation, EntitySearchDirection direction) { + private boolean match(RelationEntityTypeFilter filter, EntityRelation relation, EntitySearchDirection direction) { if (StringUtils.isEmpty(filter.getRelationType()) || filter.getRelationType().equals(relation.getType())) { if (filter.getEntityTypes() == null || filter.getEntityTypes().isEmpty()) { return true; diff --git a/dao/src/main/java/org/thingsboard/server/dao/resource/BaseResourceService.java b/dao/src/main/java/org/thingsboard/server/dao/resource/BaseResourceService.java new file mode 100644 index 0000000000..a451a4e627 --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/resource/BaseResourceService.java @@ -0,0 +1,106 @@ +/** + * Copyright © 2016-2021 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.dao.resource; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; +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.exception.DataValidationException; + +import java.util.List; + +import static org.thingsboard.server.dao.device.DeviceServiceImpl.INCORRECT_TENANT_ID; +import static org.thingsboard.server.dao.service.Validator.validateId; + +@Service +@Slf4j +public class BaseResourceService implements ResourceService { + + private final ResourceDao resourceDao; + + public BaseResourceService(ResourceDao resourceDao) { + this.resourceDao = resourceDao; + } + + @Override + public Resource saveResource(Resource resource) { + log.trace("Executing saveResource [{}]", resource); + validate(resource); + return resourceDao.saveResource(resource); + } + + @Override + public Resource getResource(TenantId tenantId, ResourceType resourceType, String resourceId) { + log.trace("Executing getResource [{}] [{}] [{}]", tenantId, resourceType, resourceId); + validate(tenantId, resourceType, resourceId); + return resourceDao.getResource(tenantId, resourceType, resourceId); + } + + @Override + public void deleteResource(TenantId tenantId, ResourceType resourceType, String resourceId) { + log.trace("Executing deleteResource [{}] [{}] [{}]", tenantId, resourceType, resourceId); + validate(tenantId, resourceType, resourceId); + resourceDao.deleteResource(tenantId, resourceType, resourceId); + } + + @Override + public PageData findResourcesByTenantId(TenantId tenantId, PageLink pageLink) { + log.trace("Executing findByTenantId [{}]", tenantId); + validateId(tenantId, INCORRECT_TENANT_ID + tenantId); + return resourceDao.findAllByTenantId(tenantId, pageLink); + } + + + @Override + public List findResourcesByTenantIdResourceType(TenantId tenantId, ResourceType resourceType) { + log.trace("Executing findByTenantId [{}]", tenantId); + validateId(tenantId, INCORRECT_TENANT_ID + tenantId); + return resourceDao.findAllByTenantIdResourceType(tenantId, resourceType); + } + + @Override + public void deleteResourcesByTenantId(TenantId tenantId) { + log.trace("Executing deleteDevicesByTenantId, tenantId [{}]", tenantId); + validateId(tenantId, INCORRECT_TENANT_ID + tenantId); + resourceDao.removeAllByTenantId(tenantId); + } + + protected void validate(Resource resource) { + if (resource == null) { + throw new DataValidationException("Resource should be specified!"); + } + + if (resource.getValue() == null) { + throw new DataValidationException("Resource value should be specified!"); + } + validate(resource.getTenantId(), resource.getResourceType(), resource.getResourceId()); + } + + protected void validate(TenantId tenantId, ResourceType resourceType, String resourceId) { + if (resourceType == null) { + throw new DataValidationException("Resource type should be specified!"); + } + if (resourceId == null) { + throw new DataValidationException("Resource id should be specified!"); + } + validateId(tenantId, "Incorrect tenantId "); + } + +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/resource/ResourceDao.java b/dao/src/main/java/org/thingsboard/server/dao/resource/ResourceDao.java new file mode 100644 index 0000000000..68ad4db4fb --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/resource/ResourceDao.java @@ -0,0 +1,40 @@ +/** + * Copyright © 2016-2021 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.dao.resource; + +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; +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 java.util.List; + +public interface ResourceDao { + + Resource saveResource(Resource resource); + + Resource getResource(TenantId tenantId, ResourceType resourceType, String resourceId); + + void deleteResource(TenantId tenantId, ResourceType resourceType, String resourceId); + + PageData findAllByTenantId(TenantId tenantId, PageLink pageLink); + + + List findAllByTenantIdResourceType(TenantId tenantId, ResourceType resourceType); + + void removeAllByTenantId(TenantId tenantId); +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultEntityQueryRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultEntityQueryRepository.java index c42f1a0994..ac4d2b9553 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultEntityQueryRepository.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultEntityQueryRepository.java @@ -42,12 +42,13 @@ import org.thingsboard.server.common.data.query.EntityKeyType; import org.thingsboard.server.common.data.query.EntityListFilter; import org.thingsboard.server.common.data.query.EntityNameFilter; import org.thingsboard.server.common.data.query.EntitySearchQueryFilter; +import org.thingsboard.server.common.data.query.EntityTypeFilter; import org.thingsboard.server.common.data.query.EntityViewSearchQueryFilter; import org.thingsboard.server.common.data.query.EntityViewTypeFilter; import org.thingsboard.server.common.data.query.RelationsQueryFilter; import org.thingsboard.server.common.data.query.SingleEntityFilter; import org.thingsboard.server.common.data.relation.EntitySearchDirection; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import java.util.Arrays; import java.util.Collections; @@ -266,18 +267,70 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository { public long countEntitiesByQuery(TenantId tenantId, CustomerId customerId, EntityCountQuery query) { EntityType entityType = resolveEntityType(query.getEntityFilter()); QueryContext ctx = new QueryContext(new QuerySecurityContext(tenantId, customerId, entityType)); - ctx.append("select count(e.id) from "); - ctx.append(addEntityTableQuery(ctx, query.getEntityFilter())); - ctx.append(" e where "); - ctx.append(buildEntityWhere(ctx, query.getEntityFilter(), Collections.emptyList())); - return transactionTemplate.execute(status -> { - long startTs = System.currentTimeMillis(); - try { - return jdbcTemplate.queryForObject(ctx.getQuery(), ctx, Long.class); - } finally { - queryLog.logQuery(ctx, ctx.getQuery(), System.currentTimeMillis() - startTs); + if (query.getKeyFilters() == null || query.getKeyFilters().isEmpty()) { + ctx.append("select count(e.id) from "); + ctx.append(addEntityTableQuery(ctx, query.getEntityFilter())); + ctx.append(" e where "); + ctx.append(buildEntityWhere(ctx, query.getEntityFilter(), Collections.emptyList())); + return transactionTemplate.execute(status -> { + long startTs = System.currentTimeMillis(); + try { + return jdbcTemplate.queryForObject(ctx.getQuery(), ctx, Long.class); + } finally { + queryLog.logQuery(ctx, ctx.getQuery(), System.currentTimeMillis() - startTs); + } + }); + } else { + List mappings = EntityKeyMapping.prepareEntityCountKeyMapping(query); + + List selectionMapping = mappings.stream().filter(EntityKeyMapping::isSelection) + .collect(Collectors.toList()); + List entityFieldsSelectionMapping = selectionMapping.stream().filter(mapping -> !mapping.isLatest()) + .collect(Collectors.toList()); + + List filterMapping = mappings.stream().filter(EntityKeyMapping::hasFilter) + .collect(Collectors.toList()); + List entityFieldsFiltersMapping = filterMapping.stream().filter(mapping -> !mapping.isLatest()) + .collect(Collectors.toList()); + + List allLatestMappings = mappings.stream().filter(EntityKeyMapping::isLatest) + .collect(Collectors.toList()); + + + String entityWhereClause = DefaultEntityQueryRepository.this.buildEntityWhere(ctx, query.getEntityFilter(), entityFieldsFiltersMapping); + String latestJoinsCnt = EntityKeyMapping.buildLatestJoins(ctx, query.getEntityFilter(), entityType, allLatestMappings, true); + String entityFieldsSelection = EntityKeyMapping.buildSelections(entityFieldsSelectionMapping, query.getEntityFilter().getType(), entityType); + String entityTypeStr; + if (query.getEntityFilter().getType().equals(EntityFilterType.RELATIONS_QUERY)) { + entityTypeStr = "e.entity_type"; + } else { + entityTypeStr = "'" + entityType.name() + "'"; } - }); + if (!StringUtils.isEmpty(entityFieldsSelection)) { + entityFieldsSelection = String.format("e.id id, %s entity_type, %s", entityTypeStr, entityFieldsSelection); + } else { + entityFieldsSelection = String.format("e.id id, %s entity_type", entityTypeStr); + } + + String fromClauseCount = String.format("from (select %s from (select %s from %s e where %s) entities %s ) result %s", + "entities.*", + entityFieldsSelection, + addEntityTableQuery(ctx, query.getEntityFilter()), + entityWhereClause, + latestJoinsCnt, + ""); + + String countQuery = String.format("select count(id) %s", fromClauseCount); + + return transactionTemplate.execute(status -> { + long startTs = System.currentTimeMillis(); + try { + return jdbcTemplate.queryForObject(countQuery, ctx, Long.class); + } finally { + queryLog.logQuery(ctx, ctx.getQuery(), System.currentTimeMillis() - startTs); + } + }); + } } @Override @@ -456,6 +509,7 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository { case ENTITY_VIEW_SEARCH_QUERY: case EDGE_SEARCH_QUERY: case API_USAGE_STATE: + case ENTITY_TYPE: return ""; default: throw new RuntimeException("Not implemented!"); @@ -544,7 +598,7 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository { boolean single = entityFilter.getFilters() != null && entityFilter.getFilters().size() == 1; if (entityFilter.getFilters() != null && !entityFilter.getFilters().isEmpty()) { int entityTypeFilterIdx = 0; - for (EntityTypeFilter etf : entityFilter.getFilters()) { + for (RelationEntityTypeFilter etf : entityFilter.getFilters()) { String etfCondition = buildEtfCondition(ctx, etf, entityFilter.getDirection(), entityTypeFilterIdx++); if (!etfCondition.isEmpty()) { if (noConditions) { @@ -593,7 +647,7 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository { return "( " + selectFields + from + ")"; } - private String buildEtfCondition(QueryContext ctx, EntityTypeFilter etf, EntitySearchDirection direction, int entityTypeFilterIdx) { + private String buildEtfCondition(QueryContext ctx, RelationEntityTypeFilter etf, EntitySearchDirection direction, int entityTypeFilterIdx) { StringBuilder whereFilter = new StringBuilder(); String relationType = etf.getRelationType(); List entityTypes = etf.getEntityTypes(); @@ -703,6 +757,8 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository { return ((EntityListFilter) entityFilter).getEntityType(); case ENTITY_NAME: return ((EntityNameFilter) entityFilter).getEntityType(); + case ENTITY_TYPE: + return ((EntityTypeFilter) entityFilter).getEntityType(); case ASSET_TYPE: case ASSET_SEARCH_QUERY: return EntityType.ASSET; diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/query/EntityKeyMapping.java b/dao/src/main/java/org/thingsboard/server/dao/sql/query/EntityKeyMapping.java index 0bacdf6349..9ed515f518 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sql/query/EntityKeyMapping.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/query/EntityKeyMapping.java @@ -21,6 +21,7 @@ import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.query.BooleanFilterPredicate; import org.thingsboard.server.common.data.query.ComplexFilterPredicate; +import org.thingsboard.server.common.data.query.EntityCountQuery; import org.thingsboard.server.common.data.query.EntityDataQuery; import org.thingsboard.server.common.data.query.EntityDataSortOrder; import org.thingsboard.server.common.data.query.EntityFilter; @@ -380,6 +381,30 @@ public class EntityKeyMapping { return mappings; } + public static List prepareEntityCountKeyMapping(EntityCountQuery query) { + Map> filters = + query.getKeyFilters() != null ? + query.getKeyFilters().stream().collect(Collectors.groupingBy(KeyFilter::getKey)) : Collections.emptyMap(); + int index = 2; + List mappings = new ArrayList<>(); + if (!filters.isEmpty()) { + for (EntityKey filterField : filters.keySet()) { + EntityKeyMapping mapping = new EntityKeyMapping(); + mapping.setIndex(index); + mapping.setAlias(String.format("alias%s", index)); + mapping.setKeyFilters(filters.get(filterField)); + mapping.setLatest(!filterField.getType().equals(EntityKeyType.ENTITY_FIELD)); + mapping.setSelection(false); + mapping.setEntityKey(filterField); + mappings.add(mapping); + index += 1; + } + } + + return mappings; + } + + private String buildAttributeSelection() { return buildTimeSeriesOrAttrSelection(true); } @@ -494,6 +519,9 @@ public class EntityKeyMapping { String operationField = field; String paramName = getNextParameterName(field); String value = stringFilterPredicate.getValue().getValue(); + if (value.isEmpty()) { + return null; + } String stringOperationQuery = ""; if (stringFilterPredicate.isIgnoreCase()) { value = value.toLowerCase(); @@ -501,30 +529,26 @@ public class EntityKeyMapping { } switch (stringFilterPredicate.getOperation()) { case EQUAL: - stringOperationQuery = String.format("%s = :%s) or (%s is null and :%s = '')", operationField, paramName, operationField, paramName); + stringOperationQuery = String.format("%s = :%s)", operationField, paramName); break; case NOT_EQUAL: - stringOperationQuery = String.format("%s != :%s) or (%s is null and :%s != '')", operationField, paramName, operationField, paramName); + stringOperationQuery = String.format("%s != :%s or %s is null)", operationField, paramName, operationField); break; case STARTS_WITH: value += "%"; - stringOperationQuery = String.format("%s like :%s) or (%s is null and :%s = '%%')", operationField, paramName, operationField, paramName); + stringOperationQuery = String.format("%s like :%s)", operationField, paramName); break; case ENDS_WITH: value = "%" + value; - stringOperationQuery = String.format("%s like :%s) or (%s is null and :%s = '%%')", operationField, paramName, operationField, paramName); + stringOperationQuery = String.format("%s like :%s)", operationField, paramName); break; case CONTAINS: - if (value.length() > 0) { - value = "%" + value + "%"; - } - stringOperationQuery = String.format("%s like :%s) or (%s is null and :%s = '')", operationField, paramName, operationField, paramName); + value = "%" + value + "%"; + stringOperationQuery = String.format("%s like :%s)", operationField, paramName); break; case NOT_CONTAINS: - if (value.length() > 0) { - value = "%" + value + "%"; - } - stringOperationQuery = String.format("%s not like :%s) or (%s is null and :%s != '')", operationField, paramName, operationField, paramName); + value = "%" + value + "%"; + stringOperationQuery = String.format("%s not like :%s or %s is null)", operationField, paramName, operationField); break; } ctx.addStringParameter(paramName, value); diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/resource/ResourceDaoImpl.java b/dao/src/main/java/org/thingsboard/server/dao/sql/resource/ResourceDaoImpl.java new file mode 100644 index 0000000000..e0cddcc555 --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/resource/ResourceDaoImpl.java @@ -0,0 +1,84 @@ +/** + * Copyright © 2016-2021 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.dao.sql.resource; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; +import org.thingsboard.server.common.data.Resource; +import org.thingsboard.server.common.data.ResourceType; +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.DaoUtil; +import org.thingsboard.server.dao.model.sql.ResourceCompositeKey; +import org.thingsboard.server.dao.model.sql.ResourceEntity; +import org.thingsboard.server.dao.resource.ResourceDao; + +import java.util.List; + +@Slf4j +@Component +public class ResourceDaoImpl implements ResourceDao { + + private final ResourceRepository resourceRepository; + + public ResourceDaoImpl(ResourceRepository resourceRepository) { + this.resourceRepository = resourceRepository; + } + + @Override + @Transactional + public Resource saveResource(Resource resource) { + return DaoUtil.getData(resourceRepository.save(new ResourceEntity(resource))); + } + + @Override + public Resource getResource(TenantId tenantId, ResourceType resourceType, String resourceId) { + ResourceCompositeKey key = new ResourceCompositeKey(); + key.setTenantId(tenantId.getId()); + key.setResourceType(resourceType.name()); + key.setResourceId(resourceId); + + return DaoUtil.getData(resourceRepository.findById(key)); + } + + @Override + @Transactional + public void deleteResource(TenantId tenantId, ResourceType resourceType, String resourceId) { + ResourceCompositeKey key = new ResourceCompositeKey(); + key.setTenantId(tenantId.getId()); + key.setResourceType(resourceType.name()); + key.setResourceId(resourceId); + + resourceRepository.deleteById(key); + } + + @Override + public PageData findAllByTenantId(TenantId tenantId, PageLink pageLink) { + return DaoUtil.toPageData(resourceRepository.findAllByTenantId(tenantId.getId(), DaoUtil.toPageable(pageLink))); + } + + @Override + public List findAllByTenantIdResourceType(TenantId tenantId, ResourceType resourceType) { + return DaoUtil.convertDataList(resourceRepository.findAllByTenantIdAndResourceType(tenantId.getId(), resourceType.name())); + } + + @Override + public void removeAllByTenantId(TenantId tenantId) { + resourceRepository.removeAllByTenantId(tenantId.getId()); + } +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/resource/ResourceRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/resource/ResourceRepository.java new file mode 100644 index 0000000000..c33c9786bd --- /dev/null +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/resource/ResourceRepository.java @@ -0,0 +1,35 @@ +/** + * Copyright © 2016-2021 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.dao.sql.resource; + +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.repository.CrudRepository; +import org.thingsboard.server.dao.model.sql.ResourceCompositeKey; +import org.thingsboard.server.dao.model.sql.ResourceEntity; + +import java.util.List; +import java.util.UUID; + +public interface ResourceRepository extends CrudRepository { + + Page findAllByTenantId(UUID tenantId, Pageable pageable); + + + List findAllByTenantIdAndResourceType(UUID tenantId, String resourceType); + + void removeAllByTenantId(UUID tenantId); +} diff --git a/dao/src/main/java/org/thingsboard/server/dao/sqlts/psql/JpaPsqlTimeseriesDao.java b/dao/src/main/java/org/thingsboard/server/dao/sqlts/psql/JpaPsqlTimeseriesDao.java index 93a7cf5ec7..64c074fd40 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sqlts/psql/JpaPsqlTimeseriesDao.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sqlts/psql/JpaPsqlTimeseriesDao.java @@ -19,8 +19,10 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.MoreExecutors; import lombok.extern.slf4j.Slf4j; +import org.hibernate.exception.ConstraintViolationException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.dao.DataIntegrityViolationException; import org.springframework.stereotype.Component; import org.thingsboard.server.common.data.id.EntityId; import org.thingsboard.server.common.data.id.TenantId; @@ -114,6 +116,14 @@ public class JpaPsqlTimeseriesDao extends AbstractChunkedAggregationTimeseriesDa partitioningRepository.save(psqlPartition); log.trace("Adding partition to Set: {}", psqlPartition); partitions.put(psqlPartition.getStart(), psqlPartition); + } catch (DataIntegrityViolationException ex) { + log.trace("Error occurred during partition save:", ex); + if (ex.getCause() instanceof ConstraintViolationException) { + log.warn("Saving partition [{}] rejected. Timeseries data will save to the ts_kv_indefinite (DEFAULT) partition.", psqlPartition.getPartitionDate()); + partitions.put(psqlPartition.getStart(), psqlPartition); + } else { + throw new RuntimeException(ex); + } } finally { partitionCreationLock.unlock(); } diff --git a/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantServiceImpl.java index 61b6ef30fd..b514b43cf3 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantServiceImpl.java +++ b/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantServiceImpl.java @@ -35,6 +35,7 @@ import org.thingsboard.server.dao.device.DeviceService; import org.thingsboard.server.dao.entity.AbstractEntityService; import org.thingsboard.server.dao.entityview.EntityViewService; import org.thingsboard.server.dao.exception.DataValidationException; +import org.thingsboard.server.dao.resource.ResourceService; import org.thingsboard.server.dao.rule.RuleChainService; import org.thingsboard.server.dao.service.DataValidator; import org.thingsboard.server.dao.service.PaginatedRemover; @@ -88,6 +89,9 @@ public class TenantServiceImpl extends AbstractEntityService implements TenantSe @Autowired private RuleChainService ruleChainService; + @Autowired + private ResourceService resourceService; + @Override public Tenant findTenantById(TenantId tenantId) { log.trace("Executing findTenantById [{}]", tenantId); @@ -141,6 +145,7 @@ public class TenantServiceImpl extends AbstractEntityService implements TenantSe userService.deleteTenantAdmins(tenantId); ruleChainService.deleteRuleChainsByTenantId(tenantId); apiUsageStateService.deleteApiUsageStateByTenantId(tenantId); + resourceService.deleteResourcesByTenantId(tenantId); tenantDao.removeById(tenantId, tenantId.getId()); deleteEntityRelations(tenantId, tenantId); } diff --git a/dao/src/main/java/org/thingsboard/server/dao/user/UserServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/user/UserServiceImpl.java index 5cb4c693fc..ada6208b6b 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/user/UserServiceImpl.java +++ b/dao/src/main/java/org/thingsboard/server/dao/user/UserServiceImpl.java @@ -22,8 +22,8 @@ import com.google.common.util.concurrent.ListenableFuture; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import org.thingsboard.server.common.data.Customer; @@ -38,6 +38,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.security.UserCredentials; +import org.thingsboard.server.common.data.security.event.UserAuthDataChangedEvent; import org.thingsboard.server.common.data.tenant.profile.DefaultTenantProfileConfiguration; import org.thingsboard.server.dao.customer.CustomerDao; import org.thingsboard.server.dao.entity.AbstractEntityService; @@ -75,21 +76,26 @@ public class UserServiceImpl extends AbstractEntityService implements UserServic @Value("${security.user_login_case_sensitive:true}") private boolean userLoginCaseSensitive; - @Autowired - private UserDao userDao; - - @Autowired - private UserCredentialsDao userCredentialsDao; - - @Autowired - private TenantDao tenantDao; - - @Autowired - private CustomerDao customerDao; - - @Autowired - @Lazy - private TbTenantProfileCache tenantProfileCache; + private final UserDao userDao; + private final UserCredentialsDao userCredentialsDao; + private final TenantDao tenantDao; + private final CustomerDao customerDao; + private final TbTenantProfileCache tenantProfileCache; + private final ApplicationEventPublisher eventPublisher; + + public UserServiceImpl(UserDao userDao, + UserCredentialsDao userCredentialsDao, + TenantDao tenantDao, + CustomerDao customerDao, + @Lazy TbTenantProfileCache tenantProfileCache, + ApplicationEventPublisher eventPublisher) { + this.userDao = userDao; + this.userCredentialsDao = userCredentialsDao; + this.tenantDao = tenantDao; + this.customerDao = customerDao; + this.tenantProfileCache = tenantProfileCache; + this.eventPublisher = eventPublisher; + } @Override public User findUserByEmail(TenantId tenantId, String email) { @@ -225,6 +231,7 @@ public class UserServiceImpl extends AbstractEntityService implements UserServic userCredentialsDao.removeById(tenantId, userCredentials.getUuidId()); deleteEntityRelations(tenantId, userId); userDao.removeById(tenantId, userId.getId()); + eventPublisher.publishEvent(new UserAuthDataChangedEvent(userId)); } @Override diff --git a/dao/src/main/resources/sql/schema-entities-hsql.sql b/dao/src/main/resources/sql/schema-entities-hsql.sql index 40867e872f..6dd6b3ad7d 100644 --- a/dao/src/main/resources/sql/schema-entities-hsql.sql +++ b/dao/src/main/resources/sql/schema-entities-hsql.sql @@ -421,6 +421,14 @@ CREATE TABLE IF NOT EXISTS api_usage_state ( CONSTRAINT api_usage_state_unq_key UNIQUE (tenant_id, entity_id) ); +CREATE TABLE IF NOT EXISTS resource ( + tenant_id uuid NOT NULL, + resource_type varchar(32) NOT NULL, + resource_id varchar(255) NOT NULL, + resource_value varchar, + CONSTRAINT resource_unq_key UNIQUE (tenant_id, resource_type, resource_id) +); + CREATE TABLE IF NOT EXISTS edge ( id uuid NOT NULL CONSTRAINT edge_pkey PRIMARY KEY, created_time bigint NOT NULL, diff --git a/dao/src/main/resources/sql/schema-entities.sql b/dao/src/main/resources/sql/schema-entities.sql index 8458b4b9c0..41c7c3d9db 100644 --- a/dao/src/main/resources/sql/schema-entities.sql +++ b/dao/src/main/resources/sql/schema-entities.sql @@ -448,6 +448,14 @@ CREATE TABLE IF NOT EXISTS api_usage_state ( CONSTRAINT api_usage_state_unq_key UNIQUE (tenant_id, entity_id) ); +CREATE TABLE IF NOT EXISTS resource ( + tenant_id uuid NOT NULL, + resource_type varchar(32) NOT NULL, + resource_id varchar(255) NOT NULL, + resource_value varchar, + CONSTRAINT resource_unq_key UNIQUE (tenant_id, resource_type, resource_id) +); + CREATE TABLE IF NOT EXISTS edge ( id uuid NOT NULL CONSTRAINT edge_pkey PRIMARY KEY, created_time bigint NOT NULL, diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java index 22e5ecc4b0..e16fc3dac7 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseEntityServiceTest.java @@ -15,12 +15,10 @@ */ package org.thingsboard.server.dao.service; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.lang3.RandomUtils; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -33,27 +31,57 @@ import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.Tenant; import org.thingsboard.server.common.data.asset.Asset; import org.thingsboard.server.common.data.edge.Edge; -import org.thingsboard.server.common.data.id.*; -import org.thingsboard.server.common.data.kv.*; +import org.thingsboard.server.common.data.id.CustomerId; +import org.thingsboard.server.common.data.id.DeviceId; +import org.thingsboard.server.common.data.id.EdgeId; +import org.thingsboard.server.common.data.id.EntityId; +import org.thingsboard.server.common.data.id.TenantId; +import org.thingsboard.server.common.data.kv.AttributeKvEntry; +import org.thingsboard.server.common.data.kv.BaseAttributeKvEntry; +import org.thingsboard.server.common.data.kv.BasicTsKvEntry; +import org.thingsboard.server.common.data.kv.DoubleDataEntry; +import org.thingsboard.server.common.data.kv.KvEntry; +import org.thingsboard.server.common.data.kv.LongDataEntry; +import org.thingsboard.server.common.data.kv.StringDataEntry; import org.thingsboard.server.common.data.page.PageData; -import org.thingsboard.server.common.data.query.*; +import org.thingsboard.server.common.data.query.AssetSearchQueryFilter; +import org.thingsboard.server.common.data.query.DeviceSearchQueryFilter; +import org.thingsboard.server.common.data.query.DeviceTypeFilter; +import org.thingsboard.server.common.data.query.EdgeSearchQueryFilter; +import org.thingsboard.server.common.data.query.EdgeTypeFilter; +import org.thingsboard.server.common.data.query.EntityCountQuery; +import org.thingsboard.server.common.data.query.EntityData; +import org.thingsboard.server.common.data.query.EntityDataPageLink; +import org.thingsboard.server.common.data.query.EntityDataQuery; +import org.thingsboard.server.common.data.query.EntityDataSortOrder; +import org.thingsboard.server.common.data.query.EntityKey; +import org.thingsboard.server.common.data.query.EntityKeyType; +import org.thingsboard.server.common.data.query.EntityListFilter; +import org.thingsboard.server.common.data.query.FilterPredicateValue; +import org.thingsboard.server.common.data.query.KeyFilter; +import org.thingsboard.server.common.data.query.NumericFilterPredicate; +import org.thingsboard.server.common.data.query.RelationsQueryFilter; +import org.thingsboard.server.common.data.query.StringFilterPredicate; +import org.thingsboard.server.common.data.query.StringFilterPredicate.StringOperation; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntitySearchDirection; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationTypeGroup; -import org.thingsboard.server.common.data.rule.RuleChain; -import org.thingsboard.server.common.data.rule.RuleChainMetaData; -import org.thingsboard.server.common.data.rule.RuleNode; import org.thingsboard.server.dao.attributes.AttributesService; import org.thingsboard.server.dao.model.sqlts.ts.TsKvEntity; -import org.thingsboard.server.dao.rule.RuleChainService; import org.thingsboard.server.dao.timeseries.TimeseriesService; -import org.thingsboard.server.dao.util.DaoTestUtil; -import org.thingsboard.server.dao.util.SqlDbType; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Random; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.junit.Assert.assertEquals; public abstract class BaseEntityServiceTest extends AbstractServiceTest { @@ -142,13 +170,13 @@ public abstract class BaseEntityServiceTest extends AbstractServiceTest { long count = entityService.countEntitiesByQuery(tenantId, new CustomerId(CustomerId.NULL_UUID), countQuery); Assert.assertEquals(30, count); - filter.setFilters(Collections.singletonList(new EntityTypeFilter("Contains", Collections.singletonList(EntityType.DEVICE)))); + filter.setFilters(Collections.singletonList(new RelationEntityTypeFilter("Contains", Collections.singletonList(EntityType.DEVICE)))); count = entityService.countEntitiesByQuery(tenantId, new CustomerId(CustomerId.NULL_UUID), countQuery); Assert.assertEquals(25, count); filter.setRootEntity(devices.get(0).getId()); filter.setDirection(EntitySearchDirection.TO); - filter.setFilters(Collections.singletonList(new EntityTypeFilter("Manages", Collections.singletonList(EntityType.TENANT)))); + filter.setFilters(Collections.singletonList(new RelationEntityTypeFilter("Manages", Collections.singletonList(EntityType.TENANT)))); count = entityService.countEntitiesByQuery(tenantId, new CustomerId(CustomerId.NULL_UUID), countQuery); Assert.assertEquals(1, count); @@ -292,7 +320,7 @@ public abstract class BaseEntityServiceTest extends AbstractServiceTest { RelationsQueryFilter filter = new RelationsQueryFilter(); filter.setRootEntity(tenantId); filter.setDirection(EntitySearchDirection.FROM); - filter.setFilters(Collections.singletonList(new EntityTypeFilter("Contains", Collections.singletonList(EntityType.DEVICE)))); + filter.setFilters(Collections.singletonList(new RelationEntityTypeFilter("Contains", Collections.singletonList(EntityType.DEVICE)))); EntityDataSortOrder sortOrder = new EntityDataSortOrder( new EntityKey(EntityKeyType.ENTITY_FIELD, "createdTime"), EntityDataSortOrder.Direction.ASC @@ -605,6 +633,155 @@ public abstract class BaseEntityServiceTest extends AbstractServiceTest { deviceService.deleteDevicesByTenantId(tenantId); } + @Test + public void testFindEntityDataByQuery_operationEqual_emptySearchQuery() { + List devices = createMockDevices(10); + devices.get(0).setLabel(""); + devices.get(1).setLabel(null); + devices.forEach(deviceService::saveDevice); + + String searchQuery = ""; + EntityDataQuery query = createDeviceSearchQuery("label", StringOperation.EQUAL, searchQuery); + + PageData result = searchEntities(query); + assertEquals(devices.size(), result.getTotalElements()); + } + + @Test + public void testFindEntityDataByQuery_operationNotEqual() { + List devices = createMockDevices(10); + devices.get(0).setLabel(""); + devices.get(1).setLabel(null); + devices.forEach(deviceService::saveDevice); + + String searchQuery = devices.get(2).getLabel(); + EntityDataQuery query = createDeviceSearchQuery("label", StringOperation.NOT_EQUAL, searchQuery); + + PageData result = searchEntities(query); + assertEquals(devices.size() - 1, result.getTotalElements()); + } + + @Test + public void testFindEntityDataByQuery_operationNotEqual_emptySearchQuery() { + List devices = createMockDevices(10); + devices.get(0).setLabel(""); + devices.get(1).setLabel(null); + devices.forEach(deviceService::saveDevice); + + String searchQuery = ""; + EntityDataQuery query = createDeviceSearchQuery("label", StringOperation.NOT_EQUAL, searchQuery); + + PageData result = searchEntities(query); + assertEquals(devices.size(), result.getTotalElements()); + } + + @Test + public void testFindEntityDataByQuery_operationStartsWith_emptySearchQuery() { + List devices = createMockDevices(10); + devices.get(0).setLabel(""); + devices.get(1).setLabel(null); + devices.forEach(deviceService::saveDevice); + + String searchQuery = ""; + EntityDataQuery query = createDeviceSearchQuery("label", StringOperation.STARTS_WITH, searchQuery); + + PageData result = searchEntities(query); + assertEquals(devices.size(), result.getTotalElements()); + } + + @Test + public void testFindEntityDataByQuery_operationEndsWith_emptySearchQuery() { + List devices = createMockDevices(10); + devices.get(0).setLabel(""); + devices.get(1).setLabel(null); + devices.forEach(deviceService::saveDevice); + + String searchQuery = ""; + EntityDataQuery query = createDeviceSearchQuery("label", StringOperation.ENDS_WITH, searchQuery); + + PageData result = searchEntities(query); + assertEquals(devices.size(), result.getTotalElements()); + } + + @Test + public void testFindEntityDataByQuery_operationContains_emptySearchQuery() { + List devices = createMockDevices(10); + devices.get(0).setLabel(""); + devices.get(1).setLabel(null); + devices.forEach(deviceService::saveDevice); + + String searchQuery = ""; + EntityDataQuery query = createDeviceSearchQuery("label", StringOperation.CONTAINS, searchQuery); + + PageData result = searchEntities(query); + assertEquals(devices.size(), result.getTotalElements()); + } + + @Test + public void testFindEntityDataByQuery_operationNotContains() { + List devices = createMockDevices(10); + devices.get(0).setLabel(""); + devices.get(1).setLabel(null); + devices.forEach(deviceService::saveDevice); + + String searchQuery = "label-"; + EntityDataQuery query = createDeviceSearchQuery("label", StringOperation.NOT_CONTAINS, searchQuery); + + PageData result = searchEntities(query); + assertEquals(2, result.getTotalElements()); + } + + @Test + public void testFindEntityDataByQuery_operationNotContains_emptySearchQuery() { + List devices = createMockDevices(10); + devices.get(0).setLabel(""); + devices.get(1).setLabel(null); + devices.forEach(deviceService::saveDevice); + + String searchQuery = ""; + EntityDataQuery query = createDeviceSearchQuery("label", StringOperation.NOT_CONTAINS, searchQuery); + + PageData result = searchEntities(query); + assertEquals(devices.size(), result.getTotalElements()); + } + + private PageData searchEntities(EntityDataQuery query) { + return entityService.findEntityDataByQuery(tenantId, new CustomerId(CustomerId.NULL_UUID), query); + } + + private EntityDataQuery createDeviceSearchQuery(String deviceField, StringOperation operation, String searchQuery) { + DeviceTypeFilter deviceTypeFilter = new DeviceTypeFilter(); + deviceTypeFilter.setDeviceType("default"); + deviceTypeFilter.setDeviceNameFilter(""); + + EntityDataSortOrder sortOrder = new EntityDataSortOrder( + new EntityKey(EntityKeyType.ENTITY_FIELD, "createdTime"), EntityDataSortOrder.Direction.ASC + ); + EntityDataPageLink pageLink = new EntityDataPageLink(1000, 0, null, sortOrder); + List entityFields = Arrays.asList( + new EntityKey(EntityKeyType.ENTITY_FIELD, "name"), + new EntityKey(EntityKeyType.ENTITY_FIELD, "label") + ); + + List keyFilters = createStringKeyFilters(deviceField, EntityKeyType.ENTITY_FIELD, operation, searchQuery); + + return new EntityDataQuery(deviceTypeFilter, pageLink, entityFields, null, keyFilters); + } + + private List createMockDevices(int count) { + return Stream.iterate(1, i -> i + 1) + .map(i -> { + Device device = new Device(); + device.setTenantId(tenantId); + device.setName("Device " + i); + device.setType("default"); + device.setLabel("label-" + RandomUtils.nextInt(100, 10000)); + return device; + }) + .limit(count) + .collect(Collectors.toList()); + } + @Test public void testFindEntityDataByQueryWithAttributes() throws ExecutionException, InterruptedException { diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java index 84c0a2975c..6f5ea9acb9 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationServiceTest.java @@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.id.DeviceId; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntityRelationsQuery; import org.thingsboard.server.common.data.relation.EntitySearchDirection; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import org.thingsboard.server.common.data.relation.RelationTypeGroup; import org.thingsboard.server.common.data.relation.RelationsSearchParameters; import org.thingsboard.server.dao.exception.DataValidationException; @@ -221,7 +221,7 @@ public abstract class BaseRelationServiceTest extends AbstractServiceTest { EntityRelationsQuery query = new EntityRelationsQuery(); query.setParameters(new RelationsSearchParameters(assetA, EntitySearchDirection.FROM, -1, false)); - query.setFilters(Collections.singletonList(new EntityTypeFilter(EntityRelation.CONTAINS_TYPE, Collections.singletonList(EntityType.ASSET)))); + query.setFilters(Collections.singletonList(new RelationEntityTypeFilter(EntityRelation.CONTAINS_TYPE, Collections.singletonList(EntityType.ASSET)))); List relations = relationService.findByQuery(SYSTEM_TENANT_ID, query).get(); Assert.assertEquals(3, relations.size()); Assert.assertTrue(relations.contains(relationA)); @@ -255,7 +255,7 @@ public abstract class BaseRelationServiceTest extends AbstractServiceTest { EntityRelationsQuery query = new EntityRelationsQuery(); query.setParameters(new RelationsSearchParameters(assetA, EntitySearchDirection.FROM, -1, false)); - query.setFilters(Collections.singletonList(new EntityTypeFilter(EntityRelation.CONTAINS_TYPE, Collections.singletonList(EntityType.ASSET)))); + query.setFilters(Collections.singletonList(new RelationEntityTypeFilter(EntityRelation.CONTAINS_TYPE, Collections.singletonList(EntityType.ASSET)))); List relations = relationService.findByQuery(SYSTEM_TENANT_ID, query).get(); Assert.assertEquals(2, relations.size()); Assert.assertTrue(relations.contains(relationAB)); diff --git a/dao/src/test/resources/sql/hsql/drop-all-tables.sql b/dao/src/test/resources/sql/hsql/drop-all-tables.sql index 90a9ba3657..fd8ce8c86c 100644 --- a/dao/src/test/resources/sql/hsql/drop-all-tables.sql +++ b/dao/src/test/resources/sql/hsql/drop-all-tables.sql @@ -28,6 +28,7 @@ DROP TABLE IF EXISTS oauth2_client_registration; DROP TABLE IF EXISTS oauth2_client_registration_info; DROP TABLE IF EXISTS oauth2_client_registration_template; DROP TABLE IF EXISTS api_usage_state; +DROP TABLE IF EXISTS resource; DROP TABLE IF EXISTS edge; DROP TABLE IF EXISTS edge_event; DROP FUNCTION IF EXISTS to_uuid; diff --git a/dao/src/test/resources/sql/psql/drop-all-tables.sql b/dao/src/test/resources/sql/psql/drop-all-tables.sql index 1d1298ef56..1c4e22632f 100644 --- a/dao/src/test/resources/sql/psql/drop-all-tables.sql +++ b/dao/src/test/resources/sql/psql/drop-all-tables.sql @@ -24,10 +24,11 @@ DROP TABLE IF EXISTS tenant_profile; DROP TABLE IF EXISTS rule_node_state; DROP TABLE IF EXISTS rule_node; DROP TABLE IF EXISTS rule_chain; -DROP TABLE IF EXISTS edge; -DROP TABLE IF EXISTS edge_event; DROP TABLE IF EXISTS tb_schema_settings; DROP TABLE IF EXISTS oauth2_client_registration; DROP TABLE IF EXISTS oauth2_client_registration_info; DROP TABLE IF EXISTS oauth2_client_registration_template; DROP TABLE IF EXISTS api_usage_state; +DROP TABLE IF EXISTS resource; +DROP TABLE IF EXISTS edge; +DROP TABLE IF EXISTS edge_event; \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5852b8135d..7bbf0783ad 100755 --- a/pom.xml +++ b/pom.xml @@ -65,10 +65,10 @@ 2.12.1 2.12.1 2.2.6 - 2.6.0 - 1.3.0 - 1.3.0 - 1.3.0 + 2.6.1 + 1.3.1 + 1.3.1 + 1.3.1 2.6.2 2.3.30 1.6.2 diff --git a/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java b/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java index 627184c181..de7ba29141 100644 --- a/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java +++ b/rest-client/src/main/java/org/thingsboard/rest/client/RestClient.java @@ -2222,7 +2222,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { Map params = new HashMap<>(); addPageLinkToParam(params, pageLink); return restTemplate.exchange( - baseURL + "/api/tenantProfiles" + getUrlParams(pageLink), + baseURL + "/api/tenantProfiles?" + getUrlParams(pageLink), HttpMethod.GET, HttpEntity.EMPTY, new ParameterizedTypeReference>() { @@ -2233,7 +2233,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { Map params = new HashMap<>(); addPageLinkToParam(params, pageLink); return restTemplate.exchange( - baseURL + "/api/tenantProfileInfos" + getUrlParams(pageLink), + baseURL + "/api/tenantProfileInfos?" + getUrlParams(pageLink), HttpMethod.GET, HttpEntity.EMPTY, new ParameterizedTypeReference>() { @@ -2290,7 +2290,7 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { Map params = new HashMap<>(); addPageLinkToParam(params, pageLink); return restTemplate.exchange( - baseURL + "/api/users" + getUrlParams(pageLink), + baseURL + "/api/users?" + getUrlParams(pageLink), HttpMethod.GET, HttpEntity.EMPTY, new ParameterizedTypeReference>() { diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/credentials/CertPemCredentials.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/credentials/CertPemCredentials.java index 0a97be3bd0..54be64b7fa 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/credentials/CertPemCredentials.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/credentials/CertPemCredentials.java @@ -56,7 +56,7 @@ import java.security.spec.PKCS8EncodedKeySpec; public class CertPemCredentials implements ClientCredentials { private static final String TLS_VERSION = "TLSv1.2"; - private String caCert; + protected String caCert; private String cert; private String privateKey; private String password; diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/data/RelationsQuery.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/data/RelationsQuery.java index 295690d445..46e3c97e87 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/data/RelationsQuery.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/data/RelationsQuery.java @@ -17,7 +17,7 @@ package org.thingsboard.rule.engine.data; import lombok.Data; import org.thingsboard.server.common.data.relation.EntitySearchDirection; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import java.util.List; @@ -26,6 +26,6 @@ public class RelationsQuery { private EntitySearchDirection direction; private int maxLevel = 1; - private List filters; + private List filters; private boolean fetchLastLevelOnly = false; } diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityDetailsNode.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityDetailsNode.java index 8e69c2b2c6..93d974163a 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityDetailsNode.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbAbstractGetEntityDetailsNode.java @@ -83,11 +83,8 @@ public abstract class TbAbstractGetEntityDetailsNode getTbMsgListenableFuture(TbContext ctx, TbMsg msg, MessageData messageData, String prefix) { if (!this.config.getDetailsList().isEmpty()) { - ListenableFuture resultObject = null; ListenableFuture contactBasedListenableFuture = getContactBasedListenableFuture(ctx, msg); - for (EntityDetails entityDetails : this.config.getDetailsList()) { - resultObject = addContactProperties(messageData.getData(), contactBasedListenableFuture, entityDetails, prefix); - } + ListenableFuture resultObject = addContactProperties(messageData.getData(), contactBasedListenableFuture, prefix); return transformMsg(ctx, msg, resultObject, messageData); } else { return Futures.immediateFuture(msg); @@ -109,10 +106,14 @@ public abstract class TbAbstractGetEntityDetailsNode addContactProperties(JsonElement data, ListenableFuture entityFuture, EntityDetails entityDetails, String prefix) { + private ListenableFuture addContactProperties(JsonElement data, ListenableFuture entityFuture, String prefix) { return Futures.transformAsync(entityFuture, contactBased -> { if (contactBased != null) { - return Futures.immediateFuture(setProperties(contactBased, data, entityDetails, prefix)); + JsonElement jsonElement = null; + for (EntityDetails entityDetails : this.config.getDetailsList()) { + jsonElement = setProperties(contactBased, data, entityDetails, prefix); + } + return Futures.immediateFuture(jsonElement); } else { return Futures.immediateFuture(null); } diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetCustomerDetailsNode.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetCustomerDetailsNode.java index 777813ebff..c4c8295823 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetCustomerDetailsNode.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetCustomerDetailsNode.java @@ -30,6 +30,7 @@ import org.thingsboard.server.common.data.id.AssetId; import org.thingsboard.server.common.data.id.DeviceId; import org.thingsboard.server.common.data.id.EdgeId; import org.thingsboard.server.common.data.id.EntityViewId; +import org.thingsboard.server.common.data.id.UserId; import org.thingsboard.server.common.data.plugin.ComponentType; import org.thingsboard.server.common.msg.TbMsg; @@ -106,6 +107,18 @@ public class TbGetCustomerDetailsNode extends TbAbstractGetEntityDetailsNode { + if (user != null) { + if (!user.getCustomerId().isNullUid()) { + return ctx.getCustomerService().findCustomerByIdAsync(ctx.getTenantId(), user.getCustomerId()); + } else { + throw new RuntimeException("User with name '" + user.getName() + "' is not assigned to Customer."); + } + } else { + return Futures.immediateFuture(null); + } + }, MoreExecutors.directExecutor()); case EDGE: return Futures.transformAsync(ctx.getEdgeService().findEdgeByIdAsync(ctx.getTenantId(), new EdgeId(msg.getOriginator().getId())), edge -> { if (edge != null) { diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetRelatedAttrNodeConfiguration.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetRelatedAttrNodeConfiguration.java index 2ae5fd7add..b9a8df3acd 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetRelatedAttrNodeConfiguration.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/metadata/TbGetRelatedAttrNodeConfiguration.java @@ -19,7 +19,7 @@ import lombok.Data; import org.thingsboard.rule.engine.data.RelationsQuery; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntitySearchDirection; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import java.util.Collections; import java.util.HashMap; @@ -41,8 +41,8 @@ public class TbGetRelatedAttrNodeConfiguration extends TbGetEntityAttrNodeConfig RelationsQuery relationsQuery = new RelationsQuery(); relationsQuery.setDirection(EntitySearchDirection.FROM); relationsQuery.setMaxLevel(1); - EntityTypeFilter entityTypeFilter = new EntityTypeFilter(EntityRelation.CONTAINS_TYPE, Collections.emptyList()); - relationsQuery.setFilters(Collections.singletonList(entityTypeFilter)); + RelationEntityTypeFilter relationEntityTypeFilter = new RelationEntityTypeFilter(EntityRelation.CONTAINS_TYPE, Collections.emptyList()); + relationsQuery.setFilters(Collections.singletonList(relationEntityTypeFilter)); configuration.setRelationsQuery(relationsQuery); return configuration; diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/azure/AzureIotHubSasCredentials.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/azure/AzureIotHubSasCredentials.java index 5155acf831..836f94c558 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/azure/AzureIotHubSasCredentials.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/mqtt/azure/AzureIotHubSasCredentials.java @@ -40,8 +40,7 @@ import java.security.cert.X509Certificate; @JsonIgnoreProperties(ignoreUnknown = true) public class AzureIotHubSasCredentials extends CertPemCredentials { private String sasKey; - private String caCert; - + @Override public SslContext initSslContext() { try { diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/AlarmRuleState.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/AlarmRuleState.java index 499e9189cc..ab0d9df7c2 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/AlarmRuleState.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/AlarmRuleState.java @@ -16,9 +16,13 @@ package org.thingsboard.rule.engine.profile; import lombok.Data; +import lombok.extern.slf4j.Slf4j; import org.thingsboard.rule.engine.profile.state.PersistedAlarmRuleState; import org.thingsboard.server.common.data.alarm.AlarmSeverity; import org.thingsboard.server.common.data.device.profile.AlarmCondition; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilter; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; +import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; import org.thingsboard.server.common.data.device.profile.AlarmConditionSpec; import org.thingsboard.server.common.data.device.profile.AlarmRule; import org.thingsboard.server.common.data.device.profile.CustomTimeSchedule; @@ -45,6 +49,7 @@ import java.util.Set; import java.util.function.Function; @Data +@Slf4j class AlarmRuleState { private final AlarmSeverity severity; @@ -52,12 +57,12 @@ class AlarmRuleState { private final AlarmConditionSpec spec; private final long requiredDurationInMs; private final long requiredRepeats; - private final Set entityKeys; + private final Set entityKeys; private PersistedAlarmRuleState state; private boolean updateFlag; private final DynamicPredicateValueCtx dynamicPredicateValueCtx; - AlarmRuleState(AlarmSeverity severity, AlarmRule alarmRule, Set entityKeys, PersistedAlarmRuleState state, DynamicPredicateValueCtx dynamicPredicateValueCtx) { + AlarmRuleState(AlarmSeverity severity, AlarmRule alarmRule, Set entityKeys, PersistedAlarmRuleState state, DynamicPredicateValueCtx dynamicPredicateValueCtx) { this.severity = severity; this.alarmRule = alarmRule; this.entityKeys = entityKeys; @@ -84,8 +89,8 @@ class AlarmRuleState { this.dynamicPredicateValueCtx = dynamicPredicateValueCtx; } - public boolean validateTsUpdate(Set changedKeys) { - for (EntityKey key : changedKeys) { + public boolean validateTsUpdate(Set changedKeys) { + for (AlarmConditionFilterKey key : changedKeys) { if (entityKeys.contains(key)) { return true; } @@ -93,18 +98,14 @@ class AlarmRuleState { return false; } - public boolean validateAttrUpdate(Set changedKeys) { + public boolean validateAttrUpdate(Set changedKeys) { //If the attribute was updated, but no new telemetry arrived - we ignore this until new telemetry is there. - for (EntityKey key : entityKeys) { - if (key.getType().equals(EntityKeyType.TIME_SERIES)) { + for (AlarmConditionFilterKey key : entityKeys) { + if (key.getType().equals(AlarmConditionKeyType.TIME_SERIES)) { return false; } } - for (EntityKey key : changedKeys) { - EntityKeyType keyType = key.getType(); - if (EntityKeyType.CLIENT_ATTRIBUTE.equals(keyType) || EntityKeyType.SERVER_ATTRIBUTE.equals(keyType) || EntityKeyType.SHARED_ATTRIBUTE.equals(keyType)) { - key = new EntityKey(EntityKeyType.ATTRIBUTE, key.getKey()); - } + for (AlarmConditionFilterKey key : changedKeys) { if (entityKeys.contains(key)) { return true; } @@ -259,16 +260,46 @@ class AlarmRuleState { private boolean eval(AlarmCondition condition, DataSnapshot data) { boolean eval = true; - for (KeyFilter keyFilter : condition.getCondition()) { - EntityKeyValue value = data.getValue(keyFilter.getKey()); + for (var filter : condition.getCondition()) { + EntityKeyValue value; + if (filter.getKey().getType().equals(AlarmConditionKeyType.CONSTANT)) { + try { + value = getConstantValue(filter); + } catch (RuntimeException e) { + log.warn("Failed to parse constant value from filter: {}", filter, e); + value = null; + } + } else { + value = data.getValue(filter.getKey()); + } if (value == null) { return false; } - eval = eval && eval(data, value, keyFilter.getPredicate()); + eval = eval && eval(data, value, filter.getPredicate()); } return eval; } + private EntityKeyValue getConstantValue(AlarmConditionFilter filter) { + EntityKeyValue value = new EntityKeyValue(); + String valueStr = filter.getValue().toString(); + switch (filter.getValueType()) { + case STRING: + value.setStrValue(valueStr); + break; + case DATE_TIME: + value.setLngValue(Long.valueOf(valueStr)); + break; + case NUMERIC: + value.setDblValue(Double.valueOf(valueStr)); + break; + case BOOLEAN: + value.setBoolValue(Boolean.valueOf(valueStr)); + break; + } + return value; + } + private boolean eval(DataSnapshot data, EntityKeyValue value, KeyFilterPredicate predicate) { switch (predicate.getType()) { case STRING: @@ -389,23 +420,14 @@ class AlarmRuleState { if (value.getDynamicValue() != null) { switch (value.getDynamicValue().getSourceType()) { case CURRENT_DEVICE: - ekv = data.getValue(new EntityKey(EntityKeyType.ATTRIBUTE, value.getDynamicValue().getSourceAttribute())); - if (ekv == null) { - ekv = data.getValue(new EntityKey(EntityKeyType.SERVER_ATTRIBUTE, value.getDynamicValue().getSourceAttribute())); - if (ekv == null) { - ekv = data.getValue(new EntityKey(EntityKeyType.SHARED_ATTRIBUTE, value.getDynamicValue().getSourceAttribute())); - if (ekv == null) { - ekv = data.getValue(new EntityKey(EntityKeyType.CLIENT_ATTRIBUTE, value.getDynamicValue().getSourceAttribute())); - } - } - } - if(ekv != null || !value.getDynamicValue().isInherit()) { + ekv = data.getValue(new AlarmConditionFilterKey(AlarmConditionKeyType.ATTRIBUTE, value.getDynamicValue().getSourceAttribute())); + if (ekv != null || !value.getDynamicValue().isInherit()) { break; } case CURRENT_CUSTOMER: ekv = dynamicPredicateValueCtx.getCustomerValue(value.getDynamicValue().getSourceAttribute()); - if(ekv != null || !value.getDynamicValue().isInherit()) { - break; + if (ekv != null || !value.getDynamicValue().isInherit()) { + break; } case CURRENT_TENANT: ekv = dynamicPredicateValueCtx.getTenantValue(value.getDynamicValue().getSourceAttribute()); diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/AlarmState.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/AlarmState.java index b1c21f08f0..d59ffee3ea 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/AlarmState.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/AlarmState.java @@ -20,6 +20,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.thingsboard.common.util.JacksonUtil; import org.thingsboard.rule.engine.action.TbAlarmResult; import org.thingsboard.rule.engine.api.TbContext; import org.thingsboard.rule.engine.profile.state.PersistedAlarmRuleState; @@ -28,6 +29,8 @@ import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.alarm.Alarm; import org.thingsboard.server.common.data.alarm.AlarmSeverity; import org.thingsboard.server.common.data.alarm.AlarmStatus; +import org.thingsboard.server.common.data.device.profile.AlarmConditionSpecType; +import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; import org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm; import org.thingsboard.server.common.data.id.EntityId; import org.thingsboard.server.common.data.query.EntityKeyType; @@ -35,7 +38,6 @@ import org.thingsboard.server.common.data.query.KeyFilter; import org.thingsboard.server.common.msg.TbMsg; import org.thingsboard.server.common.msg.TbMsgMetaData; import org.thingsboard.server.common.msg.queue.ServiceQueue; -import org.thingsboard.common.util.JacksonUtil; import java.util.ArrayList; import java.util.Comparator; @@ -100,7 +102,7 @@ class AlarmState { if (resultState != null) { TbAlarmResult result = calculateAlarmResult(ctx, resultState); if (result != null) { - pushMsg(ctx, result); + pushMsg(ctx, result, resultState); } stateUpdate = clearAlarmState(stateUpdate, clearState); } else if (currentAlarm != null && clearState != null) { @@ -115,7 +117,7 @@ class AlarmState { stateUpdate = clearAlarmState(stateUpdate, state); } ctx.getAlarmService().clearAlarm(ctx.getTenantId(), currentAlarm.getId(), createDetails(clearState), System.currentTimeMillis()); - pushMsg(ctx, new TbAlarmResult(false, false, true, currentAlarm)); + pushMsg(ctx, new TbAlarmResult(false, false, true, currentAlarm), clearState); currentAlarm = null; } else if (AlarmEvalResult.FALSE.equals(evalResult)) { stateUpdate = clearAlarmState(stateUpdate, clearState); @@ -135,9 +137,9 @@ class AlarmState { public boolean validateUpdate(SnapshotUpdate update, AlarmRuleState state) { if (update != null) { //Check that the update type and that keys match. - if (update.getType().equals(EntityKeyType.TIME_SERIES)) { + if (update.getType().equals(AlarmConditionKeyType.TIME_SERIES)) { return state.validateTsUpdate(update.getKeys()); - } else if (update.getType().equals(EntityKeyType.ATTRIBUTE)) { + } else if (update.getType().equals(AlarmConditionKeyType.ATTRIBUTE)) { return state.validateAttrUpdate(update.getKeys()); } } @@ -154,7 +156,7 @@ class AlarmState { } } - public void pushMsg(TbContext ctx, TbAlarmResult alarmResult) { + public void pushMsg(TbContext ctx, TbAlarmResult alarmResult, AlarmRuleState ruleState) { JsonNode jsonNodes = JacksonUtil.valueToTree(alarmResult.getAlarm()); String data = jsonNodes.toString(); TbMsgMetaData metaData = lastMsgMetaData != null ? lastMsgMetaData.copy() : new TbMsgMetaData(); @@ -173,10 +175,20 @@ class AlarmState { relationType = "Alarm Cleared"; metaData.putValue(DataConstants.IS_CLEARED_ALARM, Boolean.TRUE.toString()); } + setAlarmConditionMetadata(ruleState, metaData); TbMsg newMsg = ctx.newMsg(lastMsgQueueName != null ? lastMsgQueueName : ServiceQueue.MAIN, "ALARM", originator, metaData, data); ctx.tellNext(newMsg, relationType); } + protected void setAlarmConditionMetadata(AlarmRuleState ruleState, TbMsgMetaData metaData) { + if (ruleState.getSpec().getType() == AlarmConditionSpecType.REPEATING) { + metaData.putValue(DataConstants.ALARM_CONDITION_REPEATS, String.valueOf(ruleState.getState().getEventCount())); + } + if (ruleState.getSpec().getType() == AlarmConditionSpecType.DURATION) { + metaData.putValue(DataConstants.ALARM_CONDITION_DURATION, String.valueOf(ruleState.getState().getDuration())); + } + } + public void updateState(DeviceProfileAlarm alarm, PersistedAlarmState alarmState) { this.alarmDefinition = alarm; this.createRulesSortedBySeverityDesc = new ArrayList<>(); @@ -249,7 +261,7 @@ class AlarmState { String alarmDetailsStr = ruleState.getAlarmRule().getAlarmDetails(); if (StringUtils.isNotEmpty(alarmDetailsStr)) { - for (KeyFilter keyFilter : ruleState.getAlarmRule().getCondition().getCondition()) { + for (var keyFilter : ruleState.getAlarmRule().getCondition().getCondition()) { EntityKeyValue entityKeyValue = dataSnapshot.getValue(keyFilter.getKey()); alarmDetailsStr = alarmDetailsStr.replaceAll(String.format("\\$\\{%s}", keyFilter.getKey().getKey()), getValueAsString(entityKeyValue)); } diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/DataSnapshot.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/DataSnapshot.java index ed939bc3c1..c7db043dc9 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/DataSnapshot.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/DataSnapshot.java @@ -17,6 +17,8 @@ package org.thingsboard.rule.engine.profile; import lombok.Getter; import lombok.Setter; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; +import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; import org.thingsboard.server.common.data.query.EntityKey; import org.thingsboard.server.common.data.query.EntityKeyType; @@ -30,55 +32,42 @@ class DataSnapshot { @Getter @Setter private long ts; - private final Set keys; - private final Map values = new ConcurrentHashMap<>(); + private final Set keys; + private final Map values = new ConcurrentHashMap<>(); - DataSnapshot(Set entityKeysToFetch) { + DataSnapshot(Set entityKeysToFetch) { this.keys = entityKeysToFetch; } - void removeValue(EntityKey key) { - switch (key.getType()) { - case ATTRIBUTE: - values.remove(key); - values.remove(getAttrKey(key, EntityKeyType.CLIENT_ATTRIBUTE)); - values.remove(getAttrKey(key, EntityKeyType.SHARED_ATTRIBUTE)); - values.remove(getAttrKey(key, EntityKeyType.SERVER_ATTRIBUTE)); - break; - case CLIENT_ATTRIBUTE: - case SHARED_ATTRIBUTE: - case SERVER_ATTRIBUTE: - values.remove(key); - values.remove(getAttrKey(key, EntityKeyType.ATTRIBUTE)); - break; - default: - values.remove(key); - } + static AlarmConditionFilterKey toConditionKey(EntityKey key) { + return new AlarmConditionFilterKey(toConditionKeyType(key.getType()), key.getKey()); } - boolean putValue(EntityKey key, long newTs, EntityKeyValue value) { - boolean updateOfTs = ts != newTs; - boolean result = false; - switch (key.getType()) { + static AlarmConditionKeyType toConditionKeyType(EntityKeyType keyType) { + switch (keyType) { case ATTRIBUTE: - result |= putIfKeyExists(key, value, updateOfTs); - result |= putIfKeyExists(getAttrKey(key, EntityKeyType.CLIENT_ATTRIBUTE), value, updateOfTs); - result |= putIfKeyExists(getAttrKey(key, EntityKeyType.SHARED_ATTRIBUTE), value, updateOfTs); - result |= putIfKeyExists(getAttrKey(key, EntityKeyType.SERVER_ATTRIBUTE), value, updateOfTs); - break; - case CLIENT_ATTRIBUTE: - case SHARED_ATTRIBUTE: case SERVER_ATTRIBUTE: - result |= putIfKeyExists(key, value, updateOfTs); - result |= putIfKeyExists(getAttrKey(key, EntityKeyType.ATTRIBUTE), value, updateOfTs); - break; + case SHARED_ATTRIBUTE: + case CLIENT_ATTRIBUTE: + return AlarmConditionKeyType.ATTRIBUTE; + case TIME_SERIES: + return AlarmConditionKeyType.TIME_SERIES; + case ENTITY_FIELD: + return AlarmConditionKeyType.ENTITY_FIELD; default: - result |= putIfKeyExists(key, value, updateOfTs); + throw new RuntimeException("Not supported entity key: " + keyType.name()); } - return result; } - private boolean putIfKeyExists(EntityKey key, EntityKeyValue value, boolean updateOfTs) { + void removeValue(EntityKey key) { + values.remove(toConditionKey(key)); + } + + boolean putValue(AlarmConditionFilterKey key, long newTs, EntityKeyValue value) { + return putIfKeyExists(key, value, ts != newTs); + } + + private boolean putIfKeyExists(AlarmConditionFilterKey key, EntityKeyValue value, boolean updateOfTs) { if (keys.contains(key)) { EntityKeyValue oldValue = values.put(key, value); if (updateOfTs) { @@ -91,25 +80,7 @@ class DataSnapshot { } } - EntityKeyValue getValue(EntityKey key) { - if (EntityKeyType.ATTRIBUTE.equals(key.getType())) { - EntityKeyValue value = values.get(key); - if (value == null) { - value = values.get(getAttrKey(key, EntityKeyType.CLIENT_ATTRIBUTE)); - if (value == null) { - value = values.get(getAttrKey(key, EntityKeyType.SHARED_ATTRIBUTE)); - if (value == null) { - value = values.get(getAttrKey(key, EntityKeyType.SERVER_ATTRIBUTE)); - } - } - } - return value; - } else { - return values.get(key); - } - } - - private EntityKey getAttrKey(EntityKey key, EntityKeyType clientAttribute) { - return new EntityKey(clientAttribute, key.getKey()); + EntityKeyValue getValue(AlarmConditionFilterKey key) { + return values.get(key); } } diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/DeviceState.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/DeviceState.java index 3e1443a274..e84beae702 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/DeviceState.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/DeviceState.java @@ -26,6 +26,8 @@ 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.alarm.Alarm; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; +import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; import org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm; import org.thingsboard.server.common.data.id.DeviceId; import org.thingsboard.server.common.data.id.DeviceProfileId; @@ -97,10 +99,10 @@ class DeviceState { } public void updateProfile(TbContext ctx, DeviceProfile deviceProfile) throws ExecutionException, InterruptedException { - Set oldKeys = this.deviceProfile.getEntityKeys(); + Set oldKeys = this.deviceProfile.getEntityKeys(); this.deviceProfile.updateDeviceProfile(deviceProfile); if (latestValues != null) { - Set keysToFetch = new HashSet<>(this.deviceProfile.getEntityKeys()); + Set keysToFetch = new HashSet<>(this.deviceProfile.getEntityKeys()); keysToFetch.removeAll(oldKeys); if (!keysToFetch.isEmpty()) { addEntityKeysToSnapshot(ctx, deviceId, keysToFetch, latestValues); @@ -260,29 +262,29 @@ class DeviceState { } private SnapshotUpdate merge(DataSnapshot latestValues, Long newTs, List data) { - Set keys = new HashSet<>(); + Set keys = new HashSet<>(); for (KvEntry entry : data) { - EntityKey entityKey = new EntityKey(EntityKeyType.TIME_SERIES, entry.getKey()); + AlarmConditionFilterKey entityKey = new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, entry.getKey()); if (latestValues.putValue(entityKey, newTs, toEntityValue(entry))) { keys.add(entityKey); } } latestValues.setTs(newTs); - return new SnapshotUpdate(EntityKeyType.TIME_SERIES, keys); + return new SnapshotUpdate(AlarmConditionKeyType.TIME_SERIES, keys); } private SnapshotUpdate merge(DataSnapshot latestValues, Set attributes, String scope) { long newTs = 0; - Set keys = new HashSet<>(); + Set keys = new HashSet<>(); for (AttributeKvEntry entry : attributes) { newTs = Math.max(newTs, entry.getLastUpdateTs()); - EntityKey entityKey = new EntityKey(getKeyTypeFromScope(scope), entry.getKey()); + AlarmConditionFilterKey entityKey = new AlarmConditionFilterKey(AlarmConditionKeyType.ATTRIBUTE, entry.getKey()); if (latestValues.putValue(entityKey, newTs, toEntityValue(entry))) { keys.add(entityKey); } } latestValues.setTs(newTs); - return new SnapshotUpdate(EntityKeyType.ATTRIBUTE, keys); + return new SnapshotUpdate(AlarmConditionKeyType.ATTRIBUTE, keys); } private static EntityKeyType getKeyTypeFromScope(String scope) { @@ -298,37 +300,22 @@ class DeviceState { } private DataSnapshot fetchLatestValues(TbContext ctx, EntityId originator) throws ExecutionException, InterruptedException { - Set entityKeysToFetch = deviceProfile.getEntityKeys(); + Set entityKeysToFetch = deviceProfile.getEntityKeys(); DataSnapshot result = new DataSnapshot(entityKeysToFetch); addEntityKeysToSnapshot(ctx, originator, entityKeysToFetch, result); return result; } - private void addEntityKeysToSnapshot(TbContext ctx, EntityId originator, Set entityKeysToFetch, DataSnapshot result) throws InterruptedException, ExecutionException { - Set serverAttributeKeys = new HashSet<>(); - Set clientAttributeKeys = new HashSet<>(); - Set sharedAttributeKeys = new HashSet<>(); - Set commonAttributeKeys = new HashSet<>(); + private void addEntityKeysToSnapshot(TbContext ctx, EntityId originator, Set entityKeysToFetch, DataSnapshot result) throws InterruptedException, ExecutionException { + Set attributeKeys = new HashSet<>(); Set latestTsKeys = new HashSet<>(); Device device = null; - for (EntityKey entityKey : entityKeysToFetch) { + for (AlarmConditionFilterKey entityKey : entityKeysToFetch) { String key = entityKey.getKey(); switch (entityKey.getType()) { - case SERVER_ATTRIBUTE: - serverAttributeKeys.add(key); - break; - case CLIENT_ATTRIBUTE: - clientAttributeKeys.add(key); - break; - case SHARED_ATTRIBUTE: - sharedAttributeKeys.add(key); - break; case ATTRIBUTE: - serverAttributeKeys.add(key); - clientAttributeKeys.add(key); - sharedAttributeKeys.add(key); - commonAttributeKeys.add(key); + attributeKeys.add(key); break; case TIME_SERIES: latestTsKeys.add(key); @@ -361,32 +348,22 @@ class DeviceState { List data = ctx.getTimeseriesService().findLatest(ctx.getTenantId(), originator, latestTsKeys).get(); for (TsKvEntry entry : data) { if (entry.getValue() != null) { - result.putValue(new EntityKey(EntityKeyType.TIME_SERIES, entry.getKey()), entry.getTs(), toEntityValue(entry)); + result.putValue(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, entry.getKey()), entry.getTs(), toEntityValue(entry)); } } } - if (!clientAttributeKeys.isEmpty()) { - addToSnapshot(result, commonAttributeKeys, - ctx.getAttributesService().find(ctx.getTenantId(), originator, DataConstants.CLIENT_SCOPE, clientAttributeKeys).get()); - } - if (!sharedAttributeKeys.isEmpty()) { - addToSnapshot(result, commonAttributeKeys, - ctx.getAttributesService().find(ctx.getTenantId(), originator, DataConstants.SHARED_SCOPE, sharedAttributeKeys).get()); - } - if (!serverAttributeKeys.isEmpty()) { - addToSnapshot(result, commonAttributeKeys, - ctx.getAttributesService().find(ctx.getTenantId(), originator, DataConstants.SERVER_SCOPE, serverAttributeKeys).get()); + if (!attributeKeys.isEmpty()) { + addToSnapshot(result, ctx.getAttributesService().find(ctx.getTenantId(), originator, DataConstants.CLIENT_SCOPE, attributeKeys).get()); + addToSnapshot(result, ctx.getAttributesService().find(ctx.getTenantId(), originator, DataConstants.SHARED_SCOPE, attributeKeys).get()); + addToSnapshot(result, ctx.getAttributesService().find(ctx.getTenantId(), originator, DataConstants.SERVER_SCOPE, attributeKeys).get()); } } - private void addToSnapshot(DataSnapshot snapshot, Set commonAttributeKeys, List data) { + private void addToSnapshot(DataSnapshot snapshot, List data) { for (AttributeKvEntry entry : data) { if (entry.getValue() != null) { EntityKeyValue value = toEntityValue(entry); - snapshot.putValue(new EntityKey(EntityKeyType.CLIENT_ATTRIBUTE, entry.getKey()), entry.getLastUpdateTs(), value); - if (commonAttributeKeys.contains(entry.getKey())) { - snapshot.putValue(new EntityKey(EntityKeyType.ATTRIBUTE, entry.getKey()), entry.getLastUpdateTs(), value); - } + snapshot.putValue(new AlarmConditionFilterKey(AlarmConditionKeyType.ATTRIBUTE, entry.getKey()), entry.getLastUpdateTs(), value); } } } diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/ProfileState.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/ProfileState.java index 08a230d716..8fbacc120d 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/ProfileState.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/ProfileState.java @@ -19,6 +19,9 @@ import lombok.AccessLevel; import lombok.Getter; import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.alarm.AlarmSeverity; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilter; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; +import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; import org.thingsboard.server.common.data.device.profile.AlarmRule; import org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm; import org.thingsboard.server.common.data.id.DeviceProfileId; @@ -50,10 +53,10 @@ class ProfileState { @Getter(AccessLevel.PACKAGE) private final List alarmSettings = new CopyOnWriteArrayList<>(); @Getter(AccessLevel.PACKAGE) - private final Set entityKeys = ConcurrentHashMap.newKeySet(); + private final Set entityKeys = ConcurrentHashMap.newKeySet(); - private final Map>> alarmCreateKeys = new HashMap<>(); - private final Map> alarmClearKeys = new HashMap<>(); + private final Map>> alarmCreateKeys = new HashMap<>(); + private final Map> alarmClearKeys = new HashMap<>(); ProfileState(DeviceProfile deviceProfile) { updateDeviceProfile(deviceProfile); @@ -68,18 +71,18 @@ class ProfileState { if (deviceProfile.getProfileData().getAlarms() != null) { alarmSettings.addAll(deviceProfile.getProfileData().getAlarms()); for (DeviceProfileAlarm alarm : deviceProfile.getProfileData().getAlarms()) { - Map> createAlarmKeys = alarmCreateKeys.computeIfAbsent(alarm.getId(), id -> new HashMap<>()); + Map> createAlarmKeys = alarmCreateKeys.computeIfAbsent(alarm.getId(), id -> new HashMap<>()); alarm.getCreateRules().forEach(((severity, alarmRule) -> { - Set ruleKeys = createAlarmKeys.computeIfAbsent(severity, id -> new HashSet<>()); - for (KeyFilter keyFilter : alarmRule.getCondition().getCondition()) { + var ruleKeys = createAlarmKeys.computeIfAbsent(severity, id -> new HashSet<>()); + for (var keyFilter : alarmRule.getCondition().getCondition()) { entityKeys.add(keyFilter.getKey()); ruleKeys.add(keyFilter.getKey()); addDynamicValuesRecursively(keyFilter.getPredicate(), entityKeys, ruleKeys); } })); if (alarm.getClearRule() != null) { - Set clearAlarmKeys = alarmClearKeys.computeIfAbsent(alarm.getId(), id -> new HashSet<>()); - for (KeyFilter keyFilter : alarm.getClearRule().getCondition().getCondition()) { + var clearAlarmKeys = alarmClearKeys.computeIfAbsent(alarm.getId(), id -> new HashSet<>()); + for (var keyFilter : alarm.getClearRule().getCondition().getCondition()) { entityKeys.add(keyFilter.getKey()); clearAlarmKeys.add(keyFilter.getKey()); addDynamicValuesRecursively(keyFilter.getPredicate(), entityKeys, clearAlarmKeys); @@ -89,7 +92,7 @@ class ProfileState { } } - private void addDynamicValuesRecursively(KeyFilterPredicate predicate, Set entityKeys, Set ruleKeys) { + private void addDynamicValuesRecursively(KeyFilterPredicate predicate, Set entityKeys, Set ruleKeys) { switch (predicate.getType()) { case STRING: case NUMERIC: @@ -98,7 +101,7 @@ class ProfileState { if (value != null && (value.getSourceType() == DynamicValueSourceType.CURRENT_TENANT || value.getSourceType() == DynamicValueSourceType.CURRENT_CUSTOMER || value.getSourceType() == DynamicValueSourceType.CURRENT_DEVICE)) { - EntityKey entityKey = new EntityKey(EntityKeyType.ATTRIBUTE, value.getSourceAttribute()); + AlarmConditionFilterKey entityKey = new AlarmConditionFilterKey(AlarmConditionKeyType.ATTRIBUTE, value.getSourceAttribute()); entityKeys.add(entityKey); ruleKeys.add(entityKey); } @@ -115,12 +118,12 @@ class ProfileState { return deviceProfile.getId(); } - Set getCreateAlarmKeys(String id, AlarmSeverity severity) { - Map> sKeys = alarmCreateKeys.get(id); + Set getCreateAlarmKeys(String id, AlarmSeverity severity) { + Map> sKeys = alarmCreateKeys.get(id); if (sKeys == null) { return Collections.emptySet(); } else { - Set keys = sKeys.get(severity); + Set keys = sKeys.get(severity); if (keys == null) { return Collections.emptySet(); } else { @@ -129,8 +132,8 @@ class ProfileState { } } - Set getClearAlarmKeys(String id) { - Set keys = alarmClearKeys.get(id); + Set getClearAlarmKeys(String id) { + Set keys = alarmClearKeys.get(id); if (keys == null) { return Collections.emptySet(); } else { diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/SnapshotUpdate.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/SnapshotUpdate.java index 1ad1860d5a..7a3ce5debc 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/SnapshotUpdate.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/profile/SnapshotUpdate.java @@ -16,6 +16,8 @@ package org.thingsboard.rule.engine.profile; import lombok.Getter; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; +import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; import org.thingsboard.server.common.data.query.EntityKey; import org.thingsboard.server.common.data.query.EntityKeyType; @@ -24,11 +26,11 @@ import java.util.Set; class SnapshotUpdate { @Getter - private final EntityKeyType type; + private final AlarmConditionKeyType type; @Getter - private final Set keys; + private final Set keys; - SnapshotUpdate(EntityKeyType type, Set keys) { + SnapshotUpdate(AlarmConditionKeyType type, Set keys) { this.type = type; this.keys = keys; } diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/transform/TbChangeOriginatorNodeConfiguration.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/transform/TbChangeOriginatorNodeConfiguration.java index 79ed4f5191..6dcc5280ea 100644 --- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/transform/TbChangeOriginatorNodeConfiguration.java +++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/transform/TbChangeOriginatorNodeConfiguration.java @@ -20,7 +20,7 @@ import org.thingsboard.rule.engine.api.NodeConfiguration; import org.thingsboard.rule.engine.data.RelationsQuery; import org.thingsboard.server.common.data.relation.EntityRelation; import org.thingsboard.server.common.data.relation.EntitySearchDirection; -import org.thingsboard.server.common.data.relation.EntityTypeFilter; +import org.thingsboard.server.common.data.relation.RelationEntityTypeFilter; import java.util.Collections; @@ -39,8 +39,8 @@ public class TbChangeOriginatorNodeConfiguration extends TbTransformNodeConfigur RelationsQuery relationsQuery = new RelationsQuery(); relationsQuery.setDirection(EntitySearchDirection.FROM); relationsQuery.setMaxLevel(1); - EntityTypeFilter entityTypeFilter = new EntityTypeFilter(EntityRelation.CONTAINS_TYPE, Collections.emptyList()); - relationsQuery.setFilters(Collections.singletonList(entityTypeFilter)); + RelationEntityTypeFilter relationEntityTypeFilter = new RelationEntityTypeFilter(EntityRelation.CONTAINS_TYPE, Collections.emptyList()); + relationsQuery.setFilters(Collections.singletonList(relationEntityTypeFilter)); configuration.setRelationsQuery(relationsQuery); return configuration; diff --git a/rule-engine/rule-engine-components/src/main/resources/public/static/rulenode/rulenode-core-config.js b/rule-engine/rule-engine-components/src/main/resources/public/static/rulenode/rulenode-core-config.js index cc60f46df2..4eea9d1764 100644 --- a/rule-engine/rule-engine-components/src/main/resources/public/static/rulenode/rulenode-core-config.js +++ b/rule-engine/rule-engine-components/src/main/resources/public/static/rulenode/rulenode-core-config.js @@ -12,5 +12,5 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */var y=function(e,t){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function h(e,t,r,n){var a,o=arguments.length,i=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(i=(o<3?a(i):o>3?a(t,r,i):a(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function C(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create;function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create;var F,x=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.emptyConfigForm},r.prototype.onConfigurationSet=function(e){this.emptyConfigForm=this.fb.group({})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-node-empty-config",template:"

"}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),T=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.attributeScopes=Object.keys(a.AttributeScope),n.telemetryTypeTranslationsMap=a.telemetryTypeTranslations,n}return b(r,e),r.prototype.configForm=function(){return this.attributesConfigForm},r.prototype.onConfigurationSet=function(e){this.attributesConfigForm=this.fb.group({scope:[e?e.scope:null,[i.Validators.required]],notifyDevice:[!e||e.scope,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-attributes-config",template:'
\n \n attribute.attributes-scope\n \n \n {{ telemetryTypeTranslationsMap.get(scope) | translate }}\n \n \n \n
\n \n {{ \'tb.rulenode.notify-device\' | translate }}\n \n
tb.rulenode.notify-device-hint
\n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),q=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.timeseriesConfigForm},r.prototype.onConfigurationSet=function(e){this.timeseriesConfigForm=this.fb.group({defaultTTL:[e?e.defaultTTL:null,[i.Validators.required,i.Validators.min(0)]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-timeseries-config",template:'
\n \n tb.rulenode.default-ttl\n \n \n {{ \'tb.rulenode.default-ttl-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-default-ttl-message\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),S=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.rpcRequestConfigForm},r.prototype.onConfigurationSet=function(e){this.rpcRequestConfigForm=this.fb.group({timeoutInSeconds:[e?e.timeoutInSeconds:null,[i.Validators.required,i.Validators.min(0)]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-rpc-request-config",template:'
\n \n tb.rulenode.timeout-sec\n \n \n {{ \'tb.rulenode.timeout-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-timeout-message\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),I=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.logConfigForm},r.prototype.onConfigurationSet=function(e){this.logConfigForm=this.fb.group({jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.logConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"string",this.translate.instant("tb.rulenode.to-string"),"ToString",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.logConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-action-node-log-config",template:'
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),k=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.assignCustomerConfigForm},r.prototype.onConfigurationSet=function(e){this.assignCustomerConfigForm=this.fb.group({customerNamePattern:[e?e.customerNamePattern:null,[i.Validators.required]],createCustomerIfNotExists:[!!e&&e.createCustomerIfNotExists,[]],customerCacheExpiration:[e?e.customerCacheExpiration:null,[i.Validators.required,i.Validators.min(0)]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-assign-to-customer-config",template:'
\n \n tb.rulenode.customer-name-pattern\n \n \n {{ \'tb.rulenode.customer-name-pattern-required\' | translate }}\n \n \n \n \n {{ \'tb.rulenode.create-customer-if-not-exists\' | translate }}\n \n \n tb.rulenode.customer-cache-expiration\n \n \n {{ \'tb.rulenode.customer-cache-expiration-required\' | translate }}\n \n \n {{ \'tb.rulenode.customer-cache-expiration-range\' | translate }}\n \n tb.rulenode.customer-cache-expiration-hint\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),N=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.clearAlarmConfigForm},r.prototype.onConfigurationSet=function(e){this.clearAlarmConfigForm=this.fb.group({alarmDetailsBuildJs:[e?e.alarmDetailsBuildJs:null,[i.Validators.required]],alarmType:[e?e.alarmType:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.clearAlarmConfigForm.get("alarmDetailsBuildJs").value;this.nodeScriptTestService.testNodeScript(t,"json",this.translate.instant("tb.rulenode.details"),"Details",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.clearAlarmConfigForm.get("alarmDetailsBuildJs").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-action-node-clear-alarm-config",template:'
\n \n \n \n
\n \n
\n \n tb.rulenode.alarm-type\n \n \n {{ \'tb.rulenode.alarm-type-required\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),V=function(e){function r(t,r,n,o){var i=e.call(this,t)||this;return i.store=t,i.fb=r,i.nodeScriptTestService=n,i.translate=o,i.alarmSeverities=Object.keys(a.AlarmSeverity),i.alarmSeverityTranslationMap=a.alarmSeverityTranslations,i.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],i}return b(r,e),r.prototype.configForm=function(){return this.createAlarmConfigForm},r.prototype.onConfigurationSet=function(e){this.createAlarmConfigForm=this.fb.group({alarmDetailsBuildJs:[e?e.alarmDetailsBuildJs:null,[i.Validators.required]],useMessageAlarmData:[!!e&&e.useMessageAlarmData,[]],alarmType:[e?e.alarmType:null,[]],severity:[e?e.severity:null,[]],propagate:[!!e&&e.propagate,[]],relationTypes:[e?e.relationTypes:null,[]]})},r.prototype.validatorTriggers=function(){return["useMessageAlarmData"]},r.prototype.updateValidators=function(e){this.createAlarmConfigForm.get("useMessageAlarmData").value?(this.createAlarmConfigForm.get("alarmType").setValidators([]),this.createAlarmConfigForm.get("severity").setValidators([])):(this.createAlarmConfigForm.get("alarmType").setValidators([i.Validators.required]),this.createAlarmConfigForm.get("severity").setValidators([i.Validators.required])),this.createAlarmConfigForm.get("alarmType").updateValueAndValidity({emitEvent:e}),this.createAlarmConfigForm.get("severity").updateValueAndValidity({emitEvent:e})},r.prototype.testScript=function(){var e=this,t=this.createAlarmConfigForm.get("alarmDetailsBuildJs").value;this.nodeScriptTestService.testNodeScript(t,"json",this.translate.instant("tb.rulenode.details"),"Details",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.createAlarmConfigForm.get("alarmDetailsBuildJs").setValue(t)}))},r.prototype.removeKey=function(e,t){var r=this.createAlarmConfigForm.get(t).value,n=r.indexOf(e);n>=0&&(r.splice(n,1),this.createAlarmConfigForm.get(t).setValue(r,{emitEvent:!0}))},r.prototype.addKey=function(e,t){var r=e.input,n=e.value;if((n||"").trim()){n=n.trim();var a=this.createAlarmConfigForm.get(t).value;a&&-1!==a.indexOf(n)||(a||(a=[]),a.push(n),this.createAlarmConfigForm.get(t).setValue(a,{emitEvent:!0}))}r&&(r.value="")},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-action-node-create-alarm-config",template:'
\n \n \n \n
\n \n
\n \n {{ \'tb.rulenode.use-message-alarm-data\' | translate }}\n \n
\n
\n \n tb.rulenode.alarm-type\n \n \n {{ \'tb.rulenode.alarm-type-required\' | translate }}\n \n \n \n \n tb.rulenode.alarm-severity\n \n \n {{ alarmSeverityTranslationMap.get(severity) | translate }}\n \n \n \n {{ \'tb.rulenode.alarm-severity-required\' | translate }}\n \n \n
\n \n {{ \'tb.rulenode.propagate\' | translate }}\n \n
\n \n tb.rulenode.relation-types-list\n \n \n {{key}}\n close\n \n \n \n tb.rulenode.relation-types-list-hint\n \n
\n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),E=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.directionTypes=Object.keys(a.EntitySearchDirection),n.directionTypeTranslations=a.entitySearchDirectionTranslations,n.entityType=a.EntityType,n}return b(r,e),r.prototype.configForm=function(){return this.createRelationConfigForm},r.prototype.onConfigurationSet=function(e){this.createRelationConfigForm=this.fb.group({direction:[e?e.direction:null,[i.Validators.required]],entityType:[e?e.entityType:null,[i.Validators.required]],entityNamePattern:[e?e.entityNamePattern:null,[]],entityTypePattern:[e?e.entityTypePattern:null,[]],relationType:[e?e.relationType:null,[i.Validators.required]],createEntityIfNotExists:[!!e&&e.createEntityIfNotExists,[]],removeCurrentRelations:[!!e&&e.removeCurrentRelations,[]],changeOriginatorToRelatedEntity:[!!e&&e.changeOriginatorToRelatedEntity,[]],entityCacheExpiration:[e?e.entityCacheExpiration:null,[i.Validators.required,i.Validators.min(0)]]})},r.prototype.validatorTriggers=function(){return["entityType"]},r.prototype.updateValidators=function(e){var t=this.createRelationConfigForm.get("entityType").value;t?this.createRelationConfigForm.get("entityNamePattern").setValidators([i.Validators.required]):this.createRelationConfigForm.get("entityNamePattern").setValidators([]),!t||t!==a.EntityType.DEVICE&&t!==a.EntityType.ASSET?this.createRelationConfigForm.get("entityTypePattern").setValidators([]):this.createRelationConfigForm.get("entityTypePattern").setValidators([i.Validators.required]),this.createRelationConfigForm.get("entityNamePattern").updateValueAndValidity({emitEvent:e}),this.createRelationConfigForm.get("entityTypePattern").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-create-relation-config",template:'
\n \n relation.direction\n \n \n {{ directionTypeTranslations.get(type) | translate }}\n \n \n \n
\n \n \n \n tb.rulenode.entity-name-pattern\n \n \n {{ \'tb.rulenode.entity-name-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.entity-type-pattern\n \n \n {{ \'tb.rulenode.entity-type-pattern-required\' | translate }}\n \n \n \n
\n \n tb.rulenode.relation-type-pattern\n \n \n {{ \'tb.rulenode.relation-type-pattern-required\' | translate }}\n \n \n \n
\n \n {{ \'tb.rulenode.create-entity-if-not-exists\' | translate }}\n \n
tb.rulenode.create-entity-if-not-exists-hint
\n
\n \n {{ \'tb.rulenode.remove-current-relations\' | translate }}\n \n
tb.rulenode.remove-current-relations-hint
\n \n {{ \'tb.rulenode.change-originator-to-related-entity\' | translate }}\n \n
tb.rulenode.change-originator-to-related-entity-hint
\n \n tb.rulenode.entity-cache-expiration\n \n \n {{ \'tb.rulenode.entity-cache-expiration-required\' | translate }}\n \n \n {{ \'tb.rulenode.entity-cache-expiration-range\' | translate }}\n \n tb.rulenode.entity-cache-expiration-hint\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),A=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.msgDelayConfigForm},r.prototype.onConfigurationSet=function(e){this.msgDelayConfigForm=this.fb.group({useMetadataPeriodInSecondsPatterns:[!!e&&e.useMetadataPeriodInSecondsPatterns,[]],periodInSeconds:[e?e.periodInSeconds:null,[]],periodInSecondsPattern:[e?e.periodInSecondsPattern:null,[]],maxPendingMsgs:[e?e.maxPendingMsgs:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(1e5)]]})},r.prototype.validatorTriggers=function(){return["useMetadataPeriodInSecondsPatterns"]},r.prototype.updateValidators=function(e){this.msgDelayConfigForm.get("useMetadataPeriodInSecondsPatterns").value?(this.msgDelayConfigForm.get("periodInSecondsPattern").setValidators([i.Validators.required]),this.msgDelayConfigForm.get("periodInSeconds").setValidators([])):(this.msgDelayConfigForm.get("periodInSecondsPattern").setValidators([]),this.msgDelayConfigForm.get("periodInSeconds").setValidators([i.Validators.required,i.Validators.min(0)])),this.msgDelayConfigForm.get("periodInSecondsPattern").updateValueAndValidity({emitEvent:e}),this.msgDelayConfigForm.get("periodInSeconds").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-msg-delay-config",template:'
\n \n {{ \'tb.rulenode.use-metadata-period-in-seconds-patterns\' | translate }}\n \n
tb.rulenode.use-metadata-period-in-seconds-patterns-hint
\n \n tb.rulenode.period-seconds\n \n \n {{ \'tb.rulenode.period-seconds-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-period-0-seconds-message\' | translate }}\n \n \n \n \n tb.rulenode.period-in-seconds-pattern\n \n \n {{ \'tb.rulenode.period-in-seconds-pattern-required\' | translate }}\n \n \n \n \n \n tb.rulenode.max-pending-messages\n \n \n {{ \'tb.rulenode.max-pending-messages-required\' | translate }}\n \n \n {{ \'tb.rulenode.max-pending-messages-range\' | translate }}\n \n \n {{ \'tb.rulenode.max-pending-messages-range\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),L=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.directionTypes=Object.keys(a.EntitySearchDirection),n.directionTypeTranslations=a.entitySearchDirectionTranslations,n.entityType=a.EntityType,n}return b(r,e),r.prototype.configForm=function(){return this.deleteRelationConfigForm},r.prototype.onConfigurationSet=function(e){this.deleteRelationConfigForm=this.fb.group({deleteForSingleEntity:[!!e&&e.deleteForSingleEntity,[]],direction:[e?e.direction:null,[i.Validators.required]],entityType:[e?e.entityType:null,[]],entityNamePattern:[e?e.entityNamePattern:null,[]],relationType:[e?e.relationType:null,[i.Validators.required]],entityCacheExpiration:[e?e.entityCacheExpiration:null,[i.Validators.required,i.Validators.min(0)]]})},r.prototype.validatorTriggers=function(){return["deleteForSingleEntity","entityType"]},r.prototype.updateValidators=function(e){var t=this.deleteRelationConfigForm.get("deleteForSingleEntity").value,r=this.deleteRelationConfigForm.get("entityType").value;t?this.deleteRelationConfigForm.get("entityType").setValidators([i.Validators.required]):this.deleteRelationConfigForm.get("entityType").setValidators([]),t&&r?this.deleteRelationConfigForm.get("entityNamePattern").setValidators([i.Validators.required]):this.deleteRelationConfigForm.get("entityNamePattern").setValidators([]),this.deleteRelationConfigForm.get("entityType").updateValueAndValidity({emitEvent:!1}),this.deleteRelationConfigForm.get("entityNamePattern").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-delete-relation-config",template:'
\n \n {{ \'tb.rulenode.delete-relation-to-specific-entity\' | translate }}\n \n
tb.rulenode.delete-relation-hint
\n \n relation.direction\n \n \n {{ directionTypeTranslations.get(type) | translate }}\n \n \n \n
\n \n \n \n tb.rulenode.entity-name-pattern\n \n \n {{ \'tb.rulenode.entity-name-pattern-required\' | translate }}\n \n \n \n
\n \n tb.rulenode.relation-type-pattern\n \n \n {{ \'tb.rulenode.relation-type-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.entity-cache-expiration\n \n \n {{ \'tb.rulenode.entity-cache-expiration-required\' | translate }}\n \n \n {{ \'tb.rulenode.entity-cache-expiration-range\' | translate }}\n \n tb.rulenode.entity-cache-expiration-hint\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),P=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.generatorConfigForm},r.prototype.onConfigurationSet=function(e){this.generatorConfigForm=this.fb.group({msgCount:[e?e.msgCount:null,[i.Validators.required,i.Validators.min(0)]],periodInSeconds:[e?e.periodInSeconds:null,[i.Validators.required,i.Validators.min(1)]],originator:[e?e.originator:null,[]],jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.prepareInputConfig=function(e){return e&&(e.originatorId&&e.originatorType?e.originator={id:e.originatorId,entityType:e.originatorType}:e.originator=null,delete e.originatorId,delete e.originatorType),e},r.prototype.prepareOutputConfig=function(e){return e.originator?(e.originatorId=e.originator.id,e.originatorType=e.originator.entityType):(e.originatorId=null,e.originatorType=null),delete e.originator,e},r.prototype.testScript=function(){var e=this,t=this.generatorConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"generate",this.translate.instant("tb.rulenode.generator"),"Generate",["prevMsg","prevMetadata","prevMsgType"],this.ruleNodeId).subscribe((function(t){t&&e.generatorConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-action-node-generator-config",template:'
\n \n tb.rulenode.message-count\n \n \n {{ \'tb.rulenode.message-count-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-message-count-message\' | translate }}\n \n \n \n tb.rulenode.period-seconds\n \n \n {{ \'tb.rulenode.period-seconds-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-period-seconds-message\' | translate }}\n \n \n
\n \n \n \n
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent);!function(e){e.CUSTOMER="CUSTOMER",e.TENANT="TENANT",e.RELATED="RELATED",e.ALARM_ORIGINATOR="ALARM_ORIGINATOR"}(F||(F={}));var M,w=new Map([[F.CUSTOMER,"tb.rulenode.originator-customer"],[F.TENANT,"tb.rulenode.originator-tenant"],[F.RELATED,"tb.rulenode.originator-related"],[F.ALARM_ORIGINATOR,"tb.rulenode.originator-alarm-originator"]]);!function(e){e.CIRCLE="CIRCLE",e.POLYGON="POLYGON"}(M||(M={}));var R,D=new Map([[M.CIRCLE,"tb.rulenode.perimeter-circle"],[M.POLYGON,"tb.rulenode.perimeter-polygon"]]);!function(e){e.MILLISECONDS="MILLISECONDS",e.SECONDS="SECONDS",e.MINUTES="MINUTES",e.HOURS="HOURS",e.DAYS="DAYS"}(R||(R={}));var O,K=new Map([[R.MILLISECONDS,"tb.rulenode.time-unit-milliseconds"],[R.SECONDS,"tb.rulenode.time-unit-seconds"],[R.MINUTES,"tb.rulenode.time-unit-minutes"],[R.HOURS,"tb.rulenode.time-unit-hours"],[R.DAYS,"tb.rulenode.time-unit-days"]]);!function(e){e.METER="METER",e.KILOMETER="KILOMETER",e.FOOT="FOOT",e.MILE="MILE",e.NAUTICAL_MILE="NAUTICAL_MILE"}(O||(O={}));var B,G=new Map([[O.METER,"tb.rulenode.range-unit-meter"],[O.KILOMETER,"tb.rulenode.range-unit-kilometer"],[O.FOOT,"tb.rulenode.range-unit-foot"],[O.MILE,"tb.rulenode.range-unit-mile"],[O.NAUTICAL_MILE,"tb.rulenode.range-unit-nautical-mile"]]);!function(e){e.TITLE="TITLE",e.COUNTRY="COUNTRY",e.STATE="STATE",e.ZIP="ZIP",e.ADDRESS="ADDRESS",e.ADDRESS2="ADDRESS2",e.PHONE="PHONE",e.EMAIL="EMAIL",e.ADDITIONAL_INFO="ADDITIONAL_INFO"}(B||(B={}));var H,U,j,z=new Map([[B.TITLE,"tb.rulenode.entity-details-title"],[B.COUNTRY,"tb.rulenode.entity-details-country"],[B.STATE,"tb.rulenode.entity-details-state"],[B.ZIP,"tb.rulenode.entity-details-zip"],[B.ADDRESS,"tb.rulenode.entity-details-address"],[B.ADDRESS2,"tb.rulenode.entity-details-address2"],[B.PHONE,"tb.rulenode.entity-details-phone"],[B.EMAIL,"tb.rulenode.entity-details-email"],[B.ADDITIONAL_INFO,"tb.rulenode.entity-details-additional_info"]]);!function(e){e.FIRST="FIRST",e.LAST="LAST",e.ALL="ALL"}(H||(H={})),function(e){e.ASC="ASC",e.DESC="DESC"}(U||(U={})),function(e){e.STANDARD="STANDARD",e.FIFO="FIFO"}(j||(j={}));var Q,_=new Map([[j.STANDARD,"tb.rulenode.sqs-queue-standard"],[j.FIFO,"tb.rulenode.sqs-queue-fifo"]]),$=["anonymous","basic","cert.PEM"],W=new Map([["anonymous","tb.rulenode.credentials-anonymous"],["basic","tb.rulenode.credentials-basic"],["cert.PEM","tb.rulenode.credentials-pem"]]),J=["sas","cert.PEM"],Y=new Map([["sas","tb.rulenode.credentials-sas"],["cert.PEM","tb.rulenode.credentials-pem"]]);!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"}(Q||(Q={}));var Z=["US-ASCII","ISO-8859-1","UTF-8","UTF-16BE","UTF-16LE","UTF-16"],X=new Map([["US-ASCII","tb.rulenode.charset-us-ascii"],["ISO-8859-1","tb.rulenode.charset-iso-8859-1"],["UTF-8","tb.rulenode.charset-utf-8"],["UTF-16BE","tb.rulenode.charset-utf-16be"],["UTF-16LE","tb.rulenode.charset-utf-16le"],["UTF-16","tb.rulenode.charset-utf-16"]]),ee=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.perimeterType=M,n.perimeterTypes=Object.keys(M),n.perimeterTypeTranslationMap=D,n.rangeUnits=Object.keys(O),n.rangeUnitTranslationMap=G,n.timeUnits=Object.keys(R),n.timeUnitsTranslationMap=K,n}return b(r,e),r.prototype.configForm=function(){return this.geoActionConfigForm},r.prototype.onConfigurationSet=function(e){this.geoActionConfigForm=this.fb.group({latitudeKeyName:[e?e.latitudeKeyName:null,[i.Validators.required]],longitudeKeyName:[e?e.longitudeKeyName:null,[i.Validators.required]],fetchPerimeterInfoFromMessageMetadata:[!!e&&e.fetchPerimeterInfoFromMessageMetadata,[]],perimeterType:[e?e.perimeterType:null,[]],centerLatitude:[e?e.centerLatitude:null,[]],centerLongitude:[e?e.centerLatitude:null,[]],range:[e?e.range:null,[]],rangeUnit:[e?e.rangeUnit:null,[]],polygonsDefinition:[e?e.polygonsDefinition:null,[]],minInsideDuration:[e?e.minInsideDuration:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(2147483647)]],minInsideDurationTimeUnit:[e?e.minInsideDurationTimeUnit:null,[i.Validators.required]],minOutsideDuration:[e?e.minOutsideDuration:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(2147483647)]],minOutsideDurationTimeUnit:[e?e.minOutsideDurationTimeUnit:null,[i.Validators.required]]})},r.prototype.validatorTriggers=function(){return["fetchPerimeterInfoFromMessageMetadata","perimeterType"]},r.prototype.updateValidators=function(e){var t=this.geoActionConfigForm.get("fetchPerimeterInfoFromMessageMetadata").value,r=this.geoActionConfigForm.get("perimeterType").value;t?this.geoActionConfigForm.get("perimeterType").setValidators([]):this.geoActionConfigForm.get("perimeterType").setValidators([i.Validators.required]),t||r!==M.CIRCLE?(this.geoActionConfigForm.get("centerLatitude").setValidators([]),this.geoActionConfigForm.get("centerLongitude").setValidators([]),this.geoActionConfigForm.get("range").setValidators([]),this.geoActionConfigForm.get("rangeUnit").setValidators([])):(this.geoActionConfigForm.get("centerLatitude").setValidators([i.Validators.required,i.Validators.min(-90),i.Validators.max(90)]),this.geoActionConfigForm.get("centerLongitude").setValidators([i.Validators.required,i.Validators.min(-180),i.Validators.max(180)]),this.geoActionConfigForm.get("range").setValidators([i.Validators.required,i.Validators.min(0)]),this.geoActionConfigForm.get("rangeUnit").setValidators([i.Validators.required])),t||r!==M.POLYGON?this.geoActionConfigForm.get("polygonsDefinition").setValidators([]):this.geoActionConfigForm.get("polygonsDefinition").setValidators([i.Validators.required]),this.geoActionConfigForm.get("perimeterType").updateValueAndValidity({emitEvent:!1}),this.geoActionConfigForm.get("centerLatitude").updateValueAndValidity({emitEvent:e}),this.geoActionConfigForm.get("centerLongitude").updateValueAndValidity({emitEvent:e}),this.geoActionConfigForm.get("range").updateValueAndValidity({emitEvent:e}),this.geoActionConfigForm.get("rangeUnit").updateValueAndValidity({emitEvent:e}),this.geoActionConfigForm.get("polygonsDefinition").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-gps-geofencing-config",template:'
\n \n tb.rulenode.latitude-key-name\n \n \n {{ \'tb.rulenode.latitude-key-name-required\' | translate }}\n \n \n \n tb.rulenode.longitude-key-name\n \n \n {{ \'tb.rulenode.longitude-key-name-required\' | translate }}\n \n \n \n {{ \'tb.rulenode.fetch-perimeter-info-from-message-metadata\' | translate }}\n \n
\n \n tb.rulenode.perimeter-type\n \n \n {{ perimeterTypeTranslationMap.get(type) | translate }}\n \n \n \n
\n
\n
\n \n tb.rulenode.circle-center-latitude\n \n \n {{ \'tb.rulenode.circle-center-latitude-required\' | translate }}\n \n \n \n tb.rulenode.circle-center-longitude\n \n \n {{ \'tb.rulenode.circle-center-longitude-required\' | translate }}\n \n \n
\n
\n \n tb.rulenode.range\n \n \n {{ \'tb.rulenode.range-required\' | translate }}\n \n \n \n tb.rulenode.range-units\n \n \n {{ rangeUnitTranslationMap.get(type) | translate }}\n \n \n \n
\n
\n
\n \n tb.rulenode.polygon-definition\n \n \n {{ \'tb.rulenode.polygon-definition-required\' | translate }}\n \n \n
\n
\n \n tb.rulenode.min-inside-duration\n \n \n {{ \'tb.rulenode.min-inside-duration-value-required\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n \n tb.rulenode.min-inside-duration-time-unit\n \n \n {{ timeUnitsTranslationMap.get(timeUnit) | translate }}\n \n \n \n
\n
\n \n tb.rulenode.min-outside-duration\n \n \n {{ \'tb.rulenode.min-outside-duration-value-required\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n \n tb.rulenode.min-outside-duration-time-unit\n \n \n {{ timeUnitsTranslationMap.get(timeUnit) | translate }}\n \n \n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),te=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.msgCountConfigForm},r.prototype.onConfigurationSet=function(e){this.msgCountConfigForm=this.fb.group({interval:[e?e.interval:null,[i.Validators.required,i.Validators.min(1)]],telemetryPrefix:[e?e.telemetryPrefix:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-msg-count-config",template:'
\n \n tb.rulenode.interval-seconds\n \n \n {{ \'tb.rulenode.interval-seconds-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-interval-seconds-message\' | translate }}\n \n \n \n tb.rulenode.output-timeseries-key-prefix\n \n \n {{ \'tb.rulenode.output-timeseries-key-prefix-required\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),re=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.rpcReplyConfigForm},r.prototype.onConfigurationSet=function(e){this.rpcReplyConfigForm=this.fb.group({requestIdMetaDataAttribute:[e?e.requestIdMetaDataAttribute:null,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-rpc-reply-config",template:'
\n \n tb.rulenode.request-id-metadata-attribute\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ne=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.saveToCustomTableConfigForm},r.prototype.onConfigurationSet=function(e){this.saveToCustomTableConfigForm=this.fb.group({tableName:[e?e.tableName:null,[i.Validators.required]],fieldsMapping:[e?e.fieldsMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-custom-table-config",template:'
\n \n tb.rulenode.custom-table-name\n \n \n {{ \'tb.rulenode.custom-table-name-required\' | translate }}\n \n tb.rulenode.custom-table-hint\n \n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ae=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.translate=r,o.injector=n,o.fb=a,o.propagateChange=null,o.valueChangeSubscription=null,o}var a;return b(r,e),a=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.ngOnInit=function(){this.ngControl=this.injector.get(i.NgControl),null!=this.ngControl&&(this.ngControl.valueAccessor=this),this.kvListFormGroup=this.fb.group({}),this.kvListFormGroup.addControl("keyVals",this.fb.array([]))},r.prototype.keyValsFormArray=function(){return this.kvListFormGroup.get("keyVals")},r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.setDisabledState=function(e){this.disabled=e,this.disabled?this.kvListFormGroup.disable({emitEvent:!1}):this.kvListFormGroup.enable({emitEvent:!1})},r.prototype.writeValue=function(e){var t,r,n=this;this.valueChangeSubscription&&this.valueChangeSubscription.unsubscribe();var a=[];if(e)try{for(var o=v(Object.keys(e)),l=o.next();!l.done;l=o.next()){var s=l.value;Object.prototype.hasOwnProperty.call(e,s)&&a.push(this.fb.group({key:[s,[i.Validators.required]],value:[e[s],[i.Validators.required]]}))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}this.kvListFormGroup.setControl("keyVals",this.fb.array(a)),this.valueChangeSubscription=this.kvListFormGroup.valueChanges.subscribe((function(){n.updateModel()}))},r.prototype.removeKeyVal=function(e){this.kvListFormGroup.get("keyVals").removeAt(e)},r.prototype.addKeyVal=function(){this.kvListFormGroup.get("keyVals").push(this.fb.group({key:["",[i.Validators.required]],value:["",[i.Validators.required]]}))},r.prototype.validate=function(e){return!this.kvListFormGroup.get("keyVals").value.length&&this.required?{kvMapRequired:!0}:this.kvListFormGroup.valid?null:{kvFieldsRequired:!0}},r.prototype.updateModel=function(){var e=this.kvListFormGroup.get("keyVals").value;if(this.required&&!e.length||!this.kvListFormGroup.valid)this.propagateChange(null);else{var t={};e.forEach((function(e){t[e.key]=e.value})),this.propagateChange(t)}},r.ctorParameters=function(){return[{type:o.Store},{type:n.TranslateService},{type:t.Injector},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean)],r.prototype,"disabled",void 0),h([t.Input(),C("design:type",String)],r.prototype,"requiredText",void 0),h([t.Input(),C("design:type",String)],r.prototype,"keyText",void 0),h([t.Input(),C("design:type",String)],r.prototype,"keyRequiredText",void 0),h([t.Input(),C("design:type",String)],r.prototype,"valText",void 0),h([t.Input(),C("design:type",String)],r.prototype,"valRequiredText",void 0),h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),r=a=h([t.Component({selector:"tb-kv-map-config",template:'
\n
\n {{ keyText | translate }}\n {{ valText | translate }}\n \n
\n
\n
\n \n \n \n \n {{ keyRequiredText | translate }}\n \n \n \n \n \n \n {{ valRequiredText | translate }}\n \n \n \n
\n
\n \n
\n \n
\n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return a})),multi:!0},{provide:i.NG_VALIDATORS,useExisting:t.forwardRef((function(){return a})),multi:!0}],styles:[":host .tb-kv-map-config{margin-bottom:16px}:host .tb-kv-map-config .header{padding-left:5px;padding-right:5px;padding-bottom:5px}:host .tb-kv-map-config .header .cell{padding-left:5px;padding-right:5px;color:rgba(0,0,0,.54);font-size:12px;font-weight:700;white-space:nowrap}:host .tb-kv-map-config .body{padding-left:5px;padding-right:5px;padding-bottom:20px;max-height:300px;overflow:auto}:host .tb-kv-map-config .body .row{padding-top:5px;max-height:40px}:host .tb-kv-map-config .body .cell{padding-left:5px;padding-right:5px}:host ::ng-deep .tb-kv-map-config .body mat-form-field.cell{margin:0;max-height:40px}:host ::ng-deep .tb-kv-map-config .body mat-form-field.cell .mat-form-field-infix{border-top:0}:host ::ng-deep .tb-kv-map-config .body button.mat-button{margin:0}"]}),C("design:paramtypes",[o.Store,n.TranslateService,t.Injector,i.FormBuilder])],r)}(a.PageComponent),oe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.directionTypes=Object.keys(a.EntitySearchDirection),n.directionTypeTranslations=a.entitySearchDirectionTranslations,n.entityType=a.EntityType,n.propagateChange=null,n}var n;return b(r,e),n=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.ngOnInit=function(){var e=this;this.deviceRelationsQueryFormGroup=this.fb.group({fetchLastLevelOnly:[!1,[]],direction:[null,[i.Validators.required]],maxLevel:[null,[]],relationType:[null],deviceTypes:[null,[i.Validators.required]]}),this.deviceRelationsQueryFormGroup.valueChanges.subscribe((function(t){e.deviceRelationsQueryFormGroup.valid?e.propagateChange(t):e.propagateChange(null)}))},r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.setDisabledState=function(e){this.disabled=e,this.disabled?this.deviceRelationsQueryFormGroup.disable({emitEvent:!1}):this.deviceRelationsQueryFormGroup.enable({emitEvent:!1})},r.prototype.writeValue=function(e){this.deviceRelationsQueryFormGroup.reset(e,{emitEvent:!1})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean)],r.prototype,"disabled",void 0),h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),r=n=h([t.Component({selector:"tb-device-relations-query-config",template:'
\n \n {{ \'alias.last-level-relation\' | translate }}\n \n
\n \n relation.direction\n \n \n {{ directionTypeTranslations.get(type) | translate }}\n \n \n \n \n tb.rulenode.max-relation-level\n \n \n
\n
relation.relation-type
\n \n \n
device.device-types
\n \n \n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return n})),multi:!0}]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.PageComponent),ie=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.directionTypes=Object.keys(a.EntitySearchDirection),n.directionTypeTranslations=a.entitySearchDirectionTranslations,n.propagateChange=null,n}var n;return b(r,e),n=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.ngOnInit=function(){var e=this;this.relationsQueryFormGroup=this.fb.group({fetchLastLevelOnly:[!1,[]],direction:[null,[i.Validators.required]],maxLevel:[null,[]],filters:[null]}),this.relationsQueryFormGroup.valueChanges.subscribe((function(t){e.relationsQueryFormGroup.valid?e.propagateChange(t):e.propagateChange(null)}))},r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.setDisabledState=function(e){this.disabled=e,this.disabled?this.relationsQueryFormGroup.disable({emitEvent:!1}):this.relationsQueryFormGroup.enable({emitEvent:!1})},r.prototype.writeValue=function(e){this.relationsQueryFormGroup.reset(e||{},{emitEvent:!1})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean)],r.prototype,"disabled",void 0),h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),r=n=h([t.Component({selector:"tb-relations-query-config",template:'
\n \n {{ \'alias.last-level-relation\' | translate }}\n \n
\n \n relation.direction\n \n \n {{ directionTypeTranslations.get(type) | translate }}\n \n \n \n \n tb.rulenode.max-relation-level\n \n \n
\n
relation.relation-filters
\n \n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return n})),multi:!0}]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.PageComponent),le=function(e){function r(t,r,n,o){var i,l,s=e.call(this,t)||this;s.store=t,s.translate=r,s.truncate=n,s.fb=o,s.placeholder="tb.rulenode.message-type",s.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],s.messageTypes=[],s.messageTypesList=[],s.searchText="",s.propagateChange=function(e){},s.messageTypeConfigForm=s.fb.group({messageType:[null]});try{for(var u=v(Object.keys(a.MessageType)),d=u.next();!d.done;d=u.next()){var p=d.value;s.messageTypesList.push({name:a.messageTypeNames.get(a.MessageType[p]),value:p})}}catch(e){i={error:e}}finally{try{d&&!d.done&&(l=u.return)&&l.call(u)}finally{if(i)throw i.error}}return s}var l;return b(r,e),l=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.ngOnInit=function(){var e=this;this.filteredMessageTypes=this.messageTypeConfigForm.get("messageType").valueChanges.pipe(f.startWith(""),f.map((function(e){return e||""})),f.mergeMap((function(t){return e.fetchMessageTypes(t)})),f.share())},r.prototype.ngAfterViewInit=function(){},r.prototype.setDisabledState=function(e){this.disabled=e,this.disabled?this.messageTypeConfigForm.disable({emitEvent:!1}):this.messageTypeConfigForm.enable({emitEvent:!1})},r.prototype.writeValue=function(e){var t=this;this.searchText="",this.messageTypes.length=0,e&&e.forEach((function(e){var r=t.messageTypesList.find((function(t){return t.value===e}));r?t.messageTypes.push({name:r.name,value:r.value}):t.messageTypes.push({name:e,value:e})}))},r.prototype.displayMessageTypeFn=function(e){return e?e.name:void 0},r.prototype.textIsNotEmpty=function(e){return!!(e&&null!=e&&e.length>0)},r.prototype.createMessageType=function(e,t){e.preventDefault(),this.transformMessageType(t)},r.prototype.add=function(e){this.transformMessageType(e.value)},r.prototype.fetchMessageTypes=function(e){if(this.searchText=e,this.searchText&&this.searchText.length){var t=this.searchText.toUpperCase();return c.of(this.messageTypesList.filter((function(e){return e.name.toUpperCase().includes(t)})))}return c.of(this.messageTypesList)},r.prototype.transformMessageType=function(e){if((e||"").trim()){var t=null,r=e.trim(),n=this.messageTypesList.find((function(e){return e.name===r}));(t=n?{name:n.name,value:n.value}:{name:r,value:r})&&this.addMessageType(t)}this.clear("")},r.prototype.remove=function(e){var t=this.messageTypes.indexOf(e);t>=0&&(this.messageTypes.splice(t,1),this.updateModel())},r.prototype.selected=function(e){this.addMessageType(e.option.value),this.clear("")},r.prototype.addMessageType=function(e){-1===this.messageTypes.findIndex((function(t){return t.value===e.value}))&&(this.messageTypes.push(e),this.updateModel())},r.prototype.onFocus=function(){this.messageTypeConfigForm.get("messageType").updateValueAndValidity({onlySelf:!0,emitEvent:!0})},r.prototype.clear=function(e){var t=this;void 0===e&&(e=""),this.messageTypeInput.nativeElement.value=e,this.messageTypeConfigForm.get("messageType").patchValue(null,{emitEvent:!0}),setTimeout((function(){t.messageTypeInput.nativeElement.blur(),t.messageTypeInput.nativeElement.focus()}),0)},r.prototype.updateModel=function(){var e=this.messageTypes.map((function(e){return e.value}));this.required?(this.chipList.errorState=!e.length,this.propagateChange(e.length>0?e:null)):(this.chipList.errorState=!1,this.propagateChange(e))},r.ctorParameters=function(){return[{type:o.Store},{type:n.TranslateService},{type:a.TruncatePipe},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),h([t.Input(),C("design:type",String)],r.prototype,"label",void 0),h([t.Input(),C("design:type",Object)],r.prototype,"placeholder",void 0),h([t.Input(),C("design:type",Boolean)],r.prototype,"disabled",void 0),h([t.ViewChild("chipList",{static:!1}),C("design:type",d.MatChipList)],r.prototype,"chipList",void 0),h([t.ViewChild("messageTypeAutocomplete",{static:!1}),C("design:type",p.MatAutocomplete)],r.prototype,"matAutocomplete",void 0),h([t.ViewChild("messageTypeInput",{static:!1}),C("design:type",t.ElementRef)],r.prototype,"messageTypeInput",void 0),r=l=h([t.Component({selector:"tb-message-types-config",template:'\n {{ label }}\n \n \n {{messageType.name}}\n close\n \n \n \n \n \n \n \n \n
\n
\n tb.rulenode.no-message-types-found\n
\n \n \n {{ translate.get(\'tb.rulenode.no-message-type-matching\',\n {messageType: truncate.transform(searchText, true, 6, '...')}) | async }}\n \n \n \n tb.rulenode.create-new-message-type\n \n
\n
\n
\n \n {{ \'tb.rulenode.message-types-required\' | translate }}\n \n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return l})),multi:!0}]}),C("design:paramtypes",[o.Store,n.TranslateService,a.TruncatePipe,i.FormBuilder])],r)}(a.PageComponent),se=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.subscriptions=[],n.disableCertPemCredentials=!1,n.allCredentialsTypes=$,n.credentialsTypeTranslationsMap=W,n.propagateChange=null,n}var n;return b(r,e),n=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.ngOnInit=function(){var e=this;this.credentialsConfigFormGroup=this.fb.group({type:[null,[i.Validators.required]],username:[null,[]],password:[null,[]],caCert:[null,[]],caCertFileName:[null,[]],privateKey:[null,[]],privateKeyFileName:[null,[]],cert:[null,[]],certFileName:[null,[]]}),this.subscriptions.push(this.credentialsConfigFormGroup.valueChanges.pipe(f.distinctUntilChanged()).subscribe((function(){e.updateView()}))),this.subscriptions.push(this.credentialsConfigFormGroup.get("type").valueChanges.subscribe((function(){e.credentialsTypeChanged()})))},r.prototype.ngOnChanges=function(e){var t,r,n=this;try{for(var a=v(Object.keys(e)),o=a.next();!o.done;o=a.next()){var i=o.value,l=e[i];if(!l.firstChange&&l.currentValue!==l.previousValue)if(l.currentValue&&"disableCertPemCredentials"===i)"cert.PEM"===this.credentialsConfigFormGroup.get("type").value&&setTimeout((function(){n.credentialsConfigFormGroup.get("type").patchValue("anonymous",{emitEvent:!0})}))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}},r.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(e){return e.unsubscribe()}))},r.prototype.writeValue=function(e){s.isDefinedAndNotNull(e)&&(this.credentialsConfigFormGroup.reset(e,{emitEvent:!1}),this.updateValidators(!1))},r.prototype.setDisabledState=function(e){e?this.credentialsConfigFormGroup.disable():(this.credentialsConfigFormGroup.enable(),this.updateValidators())},r.prototype.updateView=function(){var e=this.credentialsConfigFormGroup.value,t=e.type;switch(t){case"anonymous":e={type:t};break;case"basic":e={type:t,username:e.username,password:e.password};break;case"cert.PEM":delete e.username}this.propagateChange(e)},r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.validate=function(e){return this.credentialsConfigFormGroup.valid?null:{credentialsConfig:{valid:!1}}},r.prototype.credentialsTypeChanged=function(){this.credentialsConfigFormGroup.patchValue({username:null,password:null,caCert:null,caCertFileName:null,privateKey:null,privateKeyFileName:null,cert:null,certFileName:null}),this.updateValidators()},r.prototype.updateValidators=function(e){void 0===e&&(e=!1);var t=this.credentialsConfigFormGroup.get("type").value;switch(e&&this.credentialsConfigFormGroup.reset({type:t},{emitEvent:!1}),this.credentialsConfigFormGroup.setValidators([]),this.credentialsConfigFormGroup.get("username").setValidators([]),this.credentialsConfigFormGroup.get("password").setValidators([]),t){case"anonymous":break;case"basic":this.credentialsConfigFormGroup.get("username").setValidators([i.Validators.required]),this.credentialsConfigFormGroup.get("password").setValidators([i.Validators.required]);break;case"cert.PEM":this.credentialsConfigFormGroup.setValidators([this.requiredFilesSelected(i.Validators.required,[["caCert","caCertFileName"],["privateKey","privateKeyFileName","cert","certFileName"]])])}this.credentialsConfigFormGroup.get("username").updateValueAndValidity({emitEvent:e}),this.credentialsConfigFormGroup.get("password").updateValueAndValidity({emitEvent:e}),this.credentialsConfigFormGroup.updateValueAndValidity({emitEvent:e})},r.prototype.requiredFilesSelected=function(e,t){return void 0===t&&(t=null),function(r){return t||(t=[Object.keys(r.controls)]),(null==r?void 0:r.controls)&&t.some((function(t){return t.every((function(t){return!e(r.controls[t])}))}))?null:{notAllRequiredFilesSelected:!0}}},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),h([t.Input(),C("design:type",Object)],r.prototype,"disableCertPemCredentials",void 0),r=n=h([t.Component({selector:"tb-credentials-config",template:'
\n \n \n tb.rulenode.credentials\n \n {{ credentialsTypeTranslationsMap.get(credentialsConfigFormGroup.get(\'type\').value) | translate }}\n \n \n \n \n tb.rulenode.credentials-type\n \n \n {{ credentialsTypeTranslationsMap.get(credentialsType) | translate }}\n \n \n \n {{ \'tb.rulenode.credentials-type-required\' | translate }}\n \n \n
\n \n \n \n \n tb.rulenode.username\n \n \n {{ \'tb.rulenode.username-required\' | translate }}\n \n \n \n tb.rulenode.password\n \n \n {{ \'tb.rulenode.password-required\' | translate }}\n \n \n \n \n
{{ \'tb.rulenode.credentials-pem-hint\' | translate }}
\n \n \n \n \n \n \n \n tb.rulenode.private-key-password\n \n \n
\n
\n
\n
\n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return n})),multi:!0},{provide:i.NG_VALIDATORS,useExisting:t.forwardRef((function(){return n})),multi:!0}]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.PageComponent),me=function(){function e(e){this.sanitizer=e}return e.prototype.transform=function(e){return this.sanitizer.bypassSecurityTrustHtml(e)},e.ctorParameters=function(){return[{type:g.DomSanitizer}]},e=h([t.Pipe({name:"safeHtml"}),C("design:paramtypes",[g.DomSanitizer])],e)}(),ue=function(){function e(){}return e=h([t.NgModule({declarations:[ae,oe,ie,le,se,me],imports:[r.CommonModule,a.SharedModule,l.HomeComponentsModule],exports:[ae,oe,ie,le,se,me]})],e)}(),de=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.unassignCustomerConfigForm},r.prototype.onConfigurationSet=function(e){this.unassignCustomerConfigForm=this.fb.group({customerNamePattern:[e?e.customerNamePattern:null,[i.Validators.required]],customerCacheExpiration:[e?e.customerCacheExpiration:null,[i.Validators.required,i.Validators.min(0)]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-un-assign-to-customer-config",template:'
\n \n tb.rulenode.customer-name-pattern\n \n \n {{ \'tb.rulenode.customer-name-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.customer-cache-expiration\n \n \n {{ \'tb.rulenode.customer-cache-expiration-required\' | translate }}\n \n \n {{ \'tb.rulenode.customer-cache-expiration-range\' | translate }}\n \n tb.rulenode.customer-cache-expiration-hint\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),pe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.snsConfigForm},r.prototype.onConfigurationSet=function(e){this.snsConfigForm=this.fb.group({topicArnPattern:[e?e.topicArnPattern:null,[i.Validators.required]],accessKeyId:[e?e.accessKeyId:null,[i.Validators.required]],secretAccessKey:[e?e.secretAccessKey:null,[i.Validators.required]],region:[e?e.region:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-sns-config",template:'
\n \n tb.rulenode.topic-arn-pattern\n \n \n {{ \'tb.rulenode.topic-arn-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.aws-access-key-id\n \n \n {{ \'tb.rulenode.aws-access-key-id-required\' | translate }}\n \n \n \n tb.rulenode.aws-secret-access-key\n \n \n {{ \'tb.rulenode.aws-secret-access-key-required\' | translate }}\n \n \n \n tb.rulenode.aws-region\n \n \n {{ \'tb.rulenode.aws-region-required\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ce=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.sqsQueueType=j,n.sqsQueueTypes=Object.keys(j),n.sqsQueueTypeTranslationsMap=_,n}return b(r,e),r.prototype.configForm=function(){return this.sqsConfigForm},r.prototype.onConfigurationSet=function(e){this.sqsConfigForm=this.fb.group({queueType:[e?e.queueType:null,[i.Validators.required]],queueUrlPattern:[e?e.queueUrlPattern:null,[i.Validators.required]],delaySeconds:[e?e.delaySeconds:null,[i.Validators.min(0),i.Validators.max(900)]],messageAttributes:[e?e.messageAttributes:null,[]],accessKeyId:[e?e.accessKeyId:null,[i.Validators.required]],secretAccessKey:[e?e.secretAccessKey:null,[i.Validators.required]],region:[e?e.region:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-sqs-config",template:'
\n \n tb.rulenode.queue-type\n \n \n {{ sqsQueueTypeTranslationsMap.get(type) | translate }}\n \n \n \n \n tb.rulenode.queue-url-pattern\n \n \n {{ \'tb.rulenode.queue-url-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.delay-seconds\n \n \n {{ \'tb.rulenode.min-delay-seconds-message\' | translate }}\n \n \n {{ \'tb.rulenode.max-delay-seconds-message\' | translate }}\n \n \n \n
\n \n \n \n tb.rulenode.aws-access-key-id\n \n \n {{ \'tb.rulenode.aws-access-key-id-required\' | translate }}\n \n \n \n tb.rulenode.aws-secret-access-key\n \n \n {{ \'tb.rulenode.aws-secret-access-key-required\' | translate }}\n \n \n \n tb.rulenode.aws-region\n \n \n {{ \'tb.rulenode.aws-region-required\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),fe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.pubSubConfigForm},r.prototype.onConfigurationSet=function(e){this.pubSubConfigForm=this.fb.group({projectId:[e?e.projectId:null,[i.Validators.required]],topicName:[e?e.topicName:null,[i.Validators.required]],serviceAccountKey:[e?e.serviceAccountKey:null,[i.Validators.required]],serviceAccountKeyFileName:[e?e.serviceAccountKeyFileName:null,[i.Validators.required]],messageAttributes:[e?e.messageAttributes:null,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-pub-sub-config",template:'
\n \n tb.rulenode.gcp-project-id\n \n \n {{ \'tb.rulenode.gcp-project-id-required\' | translate }}\n \n \n \n tb.rulenode.pubsub-topic-name\n \n \n {{ \'tb.rulenode.pubsub-topic-name-required\' | translate }}\n \n \n \n \n \n
\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ge=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.ackValues=["all","-1","0","1"],n.ToByteStandartCharsetTypesValues=Z,n.ToByteStandartCharsetTypeTranslationMap=X,n}return b(r,e),r.prototype.configForm=function(){return this.kafkaConfigForm},r.prototype.onConfigurationSet=function(e){this.kafkaConfigForm=this.fb.group({topicPattern:[e?e.topicPattern:null,[i.Validators.required]],bootstrapServers:[e?e.bootstrapServers:null,[i.Validators.required]],retries:[e?e.retries:null,[i.Validators.min(0)]],batchSize:[e?e.batchSize:null,[i.Validators.min(0)]],linger:[e?e.linger:null,[i.Validators.min(0)]],bufferMemory:[e?e.bufferMemory:null,[i.Validators.min(0)]],acks:[e?e.acks:null,[i.Validators.required]],keySerializer:[e?e.keySerializer:null,[i.Validators.required]],valueSerializer:[e?e.valueSerializer:null,[i.Validators.required]],otherProperties:[e?e.otherProperties:null,[]],addMetadataKeyValuesAsKafkaHeaders:[!!e&&e.addMetadataKeyValuesAsKafkaHeaders,[]],kafkaHeadersCharset:[e?e.kafkaHeadersCharset:null,[]]})},r.prototype.validatorTriggers=function(){return["addMetadataKeyValuesAsKafkaHeaders"]},r.prototype.updateValidators=function(e){this.kafkaConfigForm.get("addMetadataKeyValuesAsKafkaHeaders").value?this.kafkaConfigForm.get("kafkaHeadersCharset").setValidators([i.Validators.required]):this.kafkaConfigForm.get("kafkaHeadersCharset").setValidators([]),this.kafkaConfigForm.get("kafkaHeadersCharset").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-kafka-config",template:'
\n \n tb.rulenode.topic-pattern\n \n \n {{ \'tb.rulenode.topic-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.bootstrap-servers\n \n \n {{ \'tb.rulenode.bootstrap-servers-required\' | translate }}\n \n \n \n tb.rulenode.retries\n \n \n {{ \'tb.rulenode.min-retries-message\' | translate }}\n \n \n \n tb.rulenode.batch-size-bytes\n \n \n {{ \'tb.rulenode.min-batch-size-bytes-message\' | translate }}\n \n \n \n tb.rulenode.linger-ms\n \n \n {{ \'tb.rulenode.min-linger-ms-message\' | translate }}\n \n \n \n tb.rulenode.buffer-memory-bytes\n \n \n {{ \'tb.rulenode.min-buffer-memory-bytes-message\' | translate }}\n \n \n \n tb.rulenode.acks\n \n \n {{ ackValue }}\n \n \n \n \n tb.rulenode.key-serializer\n \n \n {{ \'tb.rulenode.key-serializer-required\' | translate }}\n \n \n \n tb.rulenode.value-serializer\n \n \n {{ \'tb.rulenode.value-serializer-required\' | translate }}\n \n \n \n \n \n \n {{ \'tb.rulenode.add-metadata-key-values-as-kafka-headers\' | translate }}\n \n
tb.rulenode.add-metadata-key-values-as-kafka-headers-hint
\n \n tb.rulenode.charset-encoding\n \n \n {{ ToByteStandartCharsetTypeTranslationMap.get(charset) | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ye=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.mqttConfigForm},r.prototype.onConfigurationSet=function(e){this.mqttConfigForm=this.fb.group({topicPattern:[e?e.topicPattern:null,[i.Validators.required]],host:[e?e.host:null,[i.Validators.required]],port:[e?e.port:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]],connectTimeoutSec:[e?e.connectTimeoutSec:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(200)]],clientId:[e?e.clientId:null,[]],cleanSession:[!!e&&e.cleanSession,[]],ssl:[!!e&&e.ssl,[]],credentials:[e?e.credentials:null,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-mqtt-config",template:'
\n \n tb.rulenode.topic-pattern\n \n \n {{ \'tb.rulenode.topic-pattern-required\' | translate }}\n \n \n \n
\n \n tb.rulenode.host\n \n \n {{ \'tb.rulenode.host-required\' | translate }}\n \n \n \n tb.rulenode.port\n \n \n {{ \'tb.rulenode.port-required\' | translate }}\n \n \n {{ \'tb.rulenode.port-range\' | translate }}\n \n \n {{ \'tb.rulenode.port-range\' | translate }}\n \n \n \n tb.rulenode.connect-timeout\n \n \n {{ \'tb.rulenode.connect-timeout-required\' | translate }}\n \n \n {{ \'tb.rulenode.connect-timeout-range\' | translate }}\n \n \n {{ \'tb.rulenode.connect-timeout-range\' | translate }}\n \n \n
\n \n tb.rulenode.client-id\n \n \n \n {{ \'tb.rulenode.clean-session\' | translate }}\n \n \n {{ \'tb.rulenode.enable-ssl\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),be=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.messageProperties=[null,"BASIC","TEXT_PLAIN","MINIMAL_BASIC","MINIMAL_PERSISTENT_BASIC","PERSISTENT_BASIC","PERSISTENT_TEXT_PLAIN"],n}return b(r,e),r.prototype.configForm=function(){return this.rabbitMqConfigForm},r.prototype.onConfigurationSet=function(e){this.rabbitMqConfigForm=this.fb.group({exchangeNamePattern:[e?e.exchangeNamePattern:null,[]],routingKeyPattern:[e?e.routingKeyPattern:null,[]],messageProperties:[e?e.messageProperties:null,[]],host:[e?e.host:null,[i.Validators.required]],port:[e?e.port:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]],virtualHost:[e?e.virtualHost:null,[]],username:[e?e.username:null,[]],password:[e?e.password:null,[]],automaticRecoveryEnabled:[!!e&&e.automaticRecoveryEnabled,[]],connectionTimeout:[e?e.connectionTimeout:null,[i.Validators.min(0)]],handshakeTimeout:[e?e.handshakeTimeout:null,[i.Validators.min(0)]],clientProperties:[e?e.clientProperties:null,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-rabbit-mq-config",template:'
\n \n tb.rulenode.exchange-name-pattern\n \n \n \n tb.rulenode.routing-key-pattern\n \n \n \n tb.rulenode.message-properties\n \n \n {{ property }}\n \n \n \n
\n \n tb.rulenode.host\n \n \n {{ \'tb.rulenode.host-required\' | translate }}\n \n \n \n tb.rulenode.port\n \n \n {{ \'tb.rulenode.port-required\' | translate }}\n \n \n {{ \'tb.rulenode.port-range\' | translate }}\n \n \n {{ \'tb.rulenode.port-range\' | translate }}\n \n \n
\n \n tb.rulenode.virtual-host\n \n \n \n tb.rulenode.username\n \n \n \n tb.rulenode.password\n \n \n \n {{ \'tb.rulenode.automatic-recovery\' | translate }}\n \n \n tb.rulenode.connection-timeout-ms\n \n \n {{ \'tb.rulenode.min-connection-timeout-ms-message\' | translate }}\n \n \n \n tb.rulenode.handshake-timeout-ms\n \n \n {{ \'tb.rulenode.min-handshake-timeout-ms-message\' | translate }}\n \n \n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),he=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.proxySchemes=["http","https"],n.httpRequestTypes=Object.keys(Q),n}return b(r,e),r.prototype.configForm=function(){return this.restApiCallConfigForm},r.prototype.onConfigurationSet=function(e){this.restApiCallConfigForm=this.fb.group({restEndpointUrlPattern:[e?e.restEndpointUrlPattern:null,[i.Validators.required]],requestMethod:[e?e.requestMethod:null,[i.Validators.required]],useSimpleClientHttpFactory:[!!e&&e.useSimpleClientHttpFactory,[]],enableProxy:[!!e&&e.enableProxy,[]],useSystemProxyProperties:[!!e&&e.enableProxy,[]],proxyScheme:[e?e.proxyHost:null,[]],proxyHost:[e?e.proxyHost:null,[]],proxyPort:[e?e.proxyPort:null,[]],proxyUser:[e?e.proxyUser:null,[]],proxyPassword:[e?e.proxyPassword:null,[]],readTimeoutMs:[e?e.readTimeoutMs:null,[]],maxParallelRequestsCount:[e?e.maxParallelRequestsCount:null,[i.Validators.min(0)]],headers:[e?e.headers:null,[]],useRedisQueueForMsgPersistence:[!!e&&e.useRedisQueueForMsgPersistence,[]],trimQueue:[!!e&&e.trimQueue,[]],maxQueueSize:[e?e.maxQueueSize:null,[]],credentials:[e?e.credentials:null,[]]})},r.prototype.validatorTriggers=function(){return["useSimpleClientHttpFactory","useRedisQueueForMsgPersistence","enableProxy","useSystemProxyProperties"]},r.prototype.updateValidators=function(e){var t=this.restApiCallConfigForm.get("useSimpleClientHttpFactory").value,r=this.restApiCallConfigForm.get("useRedisQueueForMsgPersistence").value,n=this.restApiCallConfigForm.get("enableProxy").value,a=this.restApiCallConfigForm.get("useSystemProxyProperties").value;n&&!a?(this.restApiCallConfigForm.get("proxyHost").setValidators(n?[i.Validators.required]:[]),this.restApiCallConfigForm.get("proxyPort").setValidators(n?[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]:[])):(this.restApiCallConfigForm.get("proxyHost").setValidators([]),this.restApiCallConfigForm.get("proxyPort").setValidators([]),t?this.restApiCallConfigForm.get("readTimeoutMs").setValidators([]):this.restApiCallConfigForm.get("readTimeoutMs").setValidators([i.Validators.min(0)])),r?this.restApiCallConfigForm.get("maxQueueSize").setValidators([i.Validators.min(0)]):this.restApiCallConfigForm.get("maxQueueSize").setValidators([]),this.restApiCallConfigForm.get("readTimeoutMs").updateValueAndValidity({emitEvent:e}),this.restApiCallConfigForm.get("maxQueueSize").updateValueAndValidity({emitEvent:e}),this.restApiCallConfigForm.get("proxyHost").updateValueAndValidity({emitEvent:e}),this.restApiCallConfigForm.get("proxyPort").updateValueAndValidity({emitEvent:e}),this.restApiCallConfigForm.get("credentials").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-rest-api-call-config",template:'
\n \n tb.rulenode.endpoint-url-pattern\n \n \n {{ \'tb.rulenode.endpoint-url-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.request-method\n \n \n {{ requestType }}\n \n \n \n \n {{ \'tb.rulenode.enable-proxy\' | translate }}\n \n \n {{ \'tb.rulenode.use-simple-client-http-factory\' | translate }}\n \n
\n \n {{ \'tb.rulenode.use-system-proxy-properties\' | translate }}\n \n
\n
\n \n tb.rulenode.proxy-scheme\n \n \n {{ proxyScheme }}\n \n \n \n \n tb.rulenode.proxy-host\n \n \n {{ \'tb.rulenode.proxy-host-required\' | translate }}\n \n \n \n tb.rulenode.proxy-port\n \n \n {{ \'tb.rulenode.proxy-port-required\' | translate }}\n \n \n {{ \'tb.rulenode.proxy-port-range\' | translate }}\n \n \n
\n \n tb.rulenode.proxy-user\n \n \n \n tb.rulenode.proxy-password\n \n \n
\n
\n \n tb.rulenode.read-timeout\n \n tb.rulenode.read-timeout-hint\n \n \n tb.rulenode.max-parallel-requests-count\n \n tb.rulenode.max-parallel-requests-count-hint\n \n \n
\n \n \n \n {{ \'tb.rulenode.use-redis-queue\' | translate }}\n \n
\n \n {{ \'tb.rulenode.trim-redis-queue\' | translate }}\n \n \n tb.rulenode.redis-queue-max-size\n \n \n
\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ce=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.smtpProtocols=["smtp","smtps"],n.tlsVersions=["TLSv1","TLSv1.1","TLSv1.2","TLSv1.3"],n}return b(r,e),r.prototype.configForm=function(){return this.sendEmailConfigForm},r.prototype.onConfigurationSet=function(e){this.sendEmailConfigForm=this.fb.group({useSystemSmtpSettings:[!!e&&e.useSystemSmtpSettings,[]],smtpProtocol:[e?e.smtpProtocol:null,[]],smtpHost:[e?e.smtpHost:null,[]],smtpPort:[e?e.smtpPort:null,[]],timeout:[e?e.timeout:null,[]],enableTls:[!!e&&e.enableTls,[]],tlsVersion:[e?e.tlsVersion:null,[]],enableProxy:[!!e&&e.enableProxy,[]],proxyHost:[e?e.proxyHost:null,[]],proxyPort:[e?e.proxyPort:null,[]],proxyUser:[e?e.proxyUser:null,[]],proxyPassword:[e?e.proxyPassword:null,[]],username:[e?e.username:null,[]],password:[e?e.password:null,[]]})},r.prototype.validatorTriggers=function(){return["useSystemSmtpSettings","enableProxy"]},r.prototype.updateValidators=function(e){var t=this.sendEmailConfigForm.get("useSystemSmtpSettings").value,r=this.sendEmailConfigForm.get("enableProxy").value;t?(this.sendEmailConfigForm.get("smtpProtocol").setValidators([]),this.sendEmailConfigForm.get("smtpHost").setValidators([]),this.sendEmailConfigForm.get("smtpPort").setValidators([]),this.sendEmailConfigForm.get("timeout").setValidators([]),this.sendEmailConfigForm.get("proxyHost").setValidators([]),this.sendEmailConfigForm.get("proxyPort").setValidators([])):(this.sendEmailConfigForm.get("smtpProtocol").setValidators([i.Validators.required]),this.sendEmailConfigForm.get("smtpHost").setValidators([i.Validators.required]),this.sendEmailConfigForm.get("smtpPort").setValidators([i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]),this.sendEmailConfigForm.get("timeout").setValidators([i.Validators.required,i.Validators.min(0)]),this.sendEmailConfigForm.get("proxyHost").setValidators(r?[i.Validators.required]:[]),this.sendEmailConfigForm.get("proxyPort").setValidators(r?[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]:[])),this.sendEmailConfigForm.get("smtpProtocol").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("smtpHost").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("smtpPort").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("timeout").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("proxyHost").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("proxyPort").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-send-email-config",template:'
\n \n {{ \'tb.rulenode.use-system-smtp-settings\' | translate }}\n \n
\n \n tb.rulenode.smtp-protocol\n \n \n {{ smtpProtocol.toUpperCase() }}\n \n \n \n
\n \n tb.rulenode.smtp-host\n \n \n {{ \'tb.rulenode.smtp-host-required\' | translate }}\n \n \n \n tb.rulenode.smtp-port\n \n \n {{ \'tb.rulenode.smtp-port-required\' | translate }}\n \n \n {{ \'tb.rulenode.smtp-port-range\' | translate }}\n \n \n {{ \'tb.rulenode.smtp-port-range\' | translate }}\n \n \n
\n \n tb.rulenode.timeout-msec\n \n \n {{ \'tb.rulenode.timeout-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-timeout-msec-message\' | translate }}\n \n \n \n {{ \'tb.rulenode.enable-tls\' | translate }}\n \n \n tb.rulenode.tls-version\n \n \n {{ tlsVersion }}\n \n \n \n \n {{ \'tb.rulenode.enable-proxy\' | translate }}\n \n
\n
\n \n tb.rulenode.proxy-host\n \n \n {{ \'tb.rulenode.proxy-host-required\' | translate }}\n \n \n \n tb.rulenode.proxy-port\n \n \n {{ \'tb.rulenode.proxy-port-required\' | translate }}\n \n \n {{ \'tb.rulenode.proxy-port-range\' | translate }}\n \n \n
\n \n tb.rulenode.proxy-user\n \n \n \n tb.rulenode.proxy-password\n \n \n
\n \n tb.rulenode.username\n \n \n \n tb.rulenode.password\n \n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ve=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.serviceType=a.ServiceType.TB_RULE_ENGINE,n}return b(r,e),r.prototype.configForm=function(){return this.checkPointConfigForm},r.prototype.onConfigurationSet=function(e){this.checkPointConfigForm=this.fb.group({queueName:[e?e.queueName:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-check-point-config",template:'
\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Fe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.allAzureIotHubCredentialsTypes=J,n.azureIotHubCredentialsTypeTranslationsMap=Y,n}return b(r,e),r.prototype.configForm=function(){return this.azureIotHubConfigForm},r.prototype.onConfigurationSet=function(e){this.azureIotHubConfigForm=this.fb.group({topicPattern:[e?e.topicPattern:null,[i.Validators.required]],host:[e?e.host:null,[i.Validators.required]],port:[e?e.port:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]],connectTimeoutSec:[e?e.connectTimeoutSec:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(200)]],clientId:[e?e.clientId:null,[i.Validators.required]],cleanSession:[!!e&&e.cleanSession,[]],ssl:[!!e&&e.ssl,[]],credentials:this.fb.group({type:[e&&e.credentials?e.credentials.type:null,[i.Validators.required]],sasKey:[e&&e.credentials?e.credentials.sasKey:null,[]],caCert:[e&&e.credentials?e.credentials.caCert:null,[]],caCertFileName:[e&&e.credentials?e.credentials.caCertFileName:null,[]],privateKey:[e&&e.credentials?e.credentials.privateKey:null,[]],privateKeyFileName:[e&&e.credentials?e.credentials.privateKeyFileName:null,[]],cert:[e&&e.credentials?e.credentials.cert:null,[]],certFileName:[e&&e.credentials?e.credentials.certFileName:null,[]],password:[e&&e.credentials?e.credentials.password:null,[]]})})},r.prototype.prepareOutputConfig=function(e){var t=e.credentials.type;return"sas"===t&&(e.credentials={type:t,sasKey:e.credentials.sasKey,caCert:e.credentials.caCert,caCertFileName:e.credentials.caCertFileName}),e},r.prototype.validatorTriggers=function(){return["credentials.type"]},r.prototype.updateValidators=function(e){var t=this.azureIotHubConfigForm.get("credentials"),r=t.get("type").value;switch(e&&t.reset({type:r},{emitEvent:!1}),t.get("sasKey").setValidators([]),t.get("privateKey").setValidators([]),t.get("privateKeyFileName").setValidators([]),t.get("cert").setValidators([]),t.get("certFileName").setValidators([]),r){case"sas":t.get("sasKey").setValidators([i.Validators.required]);break;case"cert.PEM":t.get("privateKey").setValidators([i.Validators.required]),t.get("privateKeyFileName").setValidators([i.Validators.required]),t.get("cert").setValidators([i.Validators.required]),t.get("certFileName").setValidators([i.Validators.required])}t.get("sasKey").updateValueAndValidity({emitEvent:e}),t.get("privateKey").updateValueAndValidity({emitEvent:e}),t.get("privateKeyFileName").updateValueAndValidity({emitEvent:e}),t.get("cert").updateValueAndValidity({emitEvent:e}),t.get("certFileName").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-azure-iot-hub-config",template:'
\n \n tb.rulenode.topic\n \n \n {{ \'tb.rulenode.topic-required\' | translate }}\n \n \n \n tb.rulenode.hostname\n \n \n {{ \'tb.rulenode.hostname-required\' | translate }}\n \n \n \n tb.rulenode.device-id\n \n \n {{ \'tb.rulenode.device-id-required\' | translate }}\n \n \n \n \n \n tb.rulenode.credentials\n \n {{ azureIotHubCredentialsTypeTranslationsMap.get(azureIotHubConfigForm.get(\'credentials.type\').value) | translate }}\n \n \n
\n \n tb.rulenode.credentials-type\n \n \n {{ azureIotHubCredentialsTypeTranslationsMap.get(credentialsType) | translate }}\n \n \n \n {{ \'tb.rulenode.credentials-type-required\' | translate }}\n \n \n
\n \n \n \n \n tb.rulenode.sas-key\n \n \n {{ \'tb.rulenode.sas-key-required\' | translate }}\n \n \n \n \n \n \n \n \n \n \n \n \n \n tb.rulenode.private-key-password\n \n \n \n
\n
\n
\n
\n
\n',styles:[":host .tb-mqtt-credentials-panel-group{margin:0 6px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),xe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.deviceProfile},r.prototype.onConfigurationSet=function(e){this.deviceProfile=this.fb.group({persistAlarmRulesState:[!!e&&e.persistAlarmRulesState,i.Validators.required],fetchAlarmRulesStateOnStart:[!!e&&e.fetchAlarmRulesStateOnStart,i.Validators.required]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-device-profile-config",template:'
\n \n {{ \'tb.rulenode.persist-alarm-rules\' | translate }}\n \n \n {{ \'tb.rulenode.fetch-alarm-rules\' | translate }}\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Te=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.sendSmsConfigForm},r.prototype.onConfigurationSet=function(e){this.sendSmsConfigForm=this.fb.group({numbersToTemplate:[e?e.numbersToTemplate:null,[i.Validators.required]],smsMessageTemplate:[e?e.smsMessageTemplate:null,[i.Validators.required]],useSystemSmsSettings:[!!e&&e.useSystemSmsSettings,[]],smsProviderConfiguration:[e?e.smsProviderConfiguration:null,[]]})},r.prototype.validatorTriggers=function(){return["useSystemSmsSettings"]},r.prototype.updateValidators=function(e){this.sendSmsConfigForm.get("useSystemSmsSettings").value?this.sendSmsConfigForm.get("smsProviderConfiguration").setValidators([]):this.sendSmsConfigForm.get("smsProviderConfiguration").setValidators([i.Validators.required]),this.sendSmsConfigForm.get("smsProviderConfiguration").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-send-sms-config",template:'
\n \n tb.rulenode.numbers-to-template\n \n \n {{ \'tb.rulenode.numbers-to-template-required\' | translate }}\n \n \n \n \n tb.rulenode.sms-message-template\n \n \n {{ \'tb.rulenode.sms-message-template-required\' | translate }}\n \n \n \n \n {{ \'tb.rulenode.use-system-sms-settings\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),qe=function(){function e(){}return e=h([t.NgModule({declarations:[T,q,S,I,k,N,V,E,A,L,P,ee,te,re,ne,de,pe,ce,fe,ge,ye,be,he,Ce,ve,Fe,xe,Te],imports:[r.CommonModule,a.SharedModule,l.HomeComponentsModule,ue],exports:[T,q,S,I,k,N,V,E,A,L,P,ee,te,re,ne,de,pe,ce,fe,ge,ye,be,he,Ce,ve,Fe,xe,Te]})],e)}(),Se=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n}return b(r,e),r.prototype.configForm=function(){return this.checkMessageConfigForm},r.prototype.onConfigurationSet=function(e){this.checkMessageConfigForm=this.fb.group({messageNames:[e?e.messageNames:null,[]],metadataNames:[e?e.metadataNames:null,[]],checkAllKeys:[!!e&&e.checkAllKeys,[]]})},r.prototype.validateConfig=function(){var e=this.checkMessageConfigForm.get("messageNames").value,t=this.checkMessageConfigForm.get("metadataNames").value;return e.length>0||t.length>0},r.prototype.removeMessageName=function(e){var t=this.checkMessageConfigForm.get("messageNames").value,r=t.indexOf(e);r>=0&&(t.splice(r,1),this.checkMessageConfigForm.get("messageNames").setValue(t,{emitEvent:!0}))},r.prototype.removeMetadataName=function(e){var t=this.checkMessageConfigForm.get("metadataNames").value,r=t.indexOf(e);r>=0&&(t.splice(r,1),this.checkMessageConfigForm.get("metadataNames").setValue(t,{emitEvent:!0}))},r.prototype.addMessageName=function(e){var t=e.input,r=e.value;if((r||"").trim()){r=r.trim();var n=this.checkMessageConfigForm.get("messageNames").value;n&&-1!==n.indexOf(r)||(n||(n=[]),n.push(r),this.checkMessageConfigForm.get("messageNames").setValue(n,{emitEvent:!0}))}t&&(t.value="")},r.prototype.addMetadataName=function(e){var t=e.input,r=e.value;if((r||"").trim()){r=r.trim();var n=this.checkMessageConfigForm.get("metadataNames").value;n&&-1!==n.indexOf(r)||(n||(n=[]),n.push(r),this.checkMessageConfigForm.get("metadataNames").setValue(n,{emitEvent:!0}))}t&&(t.value="")},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-check-message-config",template:'
\n \n \n \n \n \n {{messageName}}\n close\n \n \n \n \n
tb.rulenode.separator-hint
\n \n \n \n \n \n {{metadataName}}\n close\n \n \n \n \n
tb.rulenode.separator-hint
\n \n {{ \'tb.rulenode.check-all-keys\' | translate }}\n \n
tb.rulenode.check-all-keys-hint
\n
\n',styles:[":host label.tb-title{margin-bottom:-10px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ie=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.entitySearchDirection=Object.keys(a.EntitySearchDirection),n.entitySearchDirectionTranslationsMap=a.entitySearchDirectionTranslations,n}return b(r,e),r.prototype.configForm=function(){return this.checkRelationConfigForm},r.prototype.onConfigurationSet=function(e){this.checkRelationConfigForm=this.fb.group({checkForSingleEntity:[!!e&&e.checkForSingleEntity,[]],direction:[e?e.direction:null,[]],entityType:[e?e.entityType:null,e&&e.checkForSingleEntity?[i.Validators.required]:[]],entityId:[e?e.entityId:null,e&&e.checkForSingleEntity?[i.Validators.required]:[]],relationType:[e?e.relationType:null,[i.Validators.required]]})},r.prototype.validatorTriggers=function(){return["checkForSingleEntity"]},r.prototype.updateValidators=function(e){var t=this.checkRelationConfigForm.get("checkForSingleEntity").value;this.checkRelationConfigForm.get("entityType").setValidators(t?[i.Validators.required]:[]),this.checkRelationConfigForm.get("entityType").updateValueAndValidity({emitEvent:e}),this.checkRelationConfigForm.get("entityId").setValidators(t?[i.Validators.required]:[]),this.checkRelationConfigForm.get("entityId").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-check-relation-config",template:'
\n \n {{ \'tb.rulenode.check-relation-to-specific-entity\' | translate }}\n \n
tb.rulenode.check-relation-hint
\n \n relation.direction\n \n \n {{ entitySearchDirectionTranslationsMap.get(direction) | translate }}\n \n \n \n
\n \n \n \n \n
\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ke=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.perimeterType=M,n.perimeterTypes=Object.keys(M),n.perimeterTypeTranslationMap=D,n.rangeUnits=Object.keys(O),n.rangeUnitTranslationMap=G,n}return b(r,e),r.prototype.configForm=function(){return this.geoFilterConfigForm},r.prototype.onConfigurationSet=function(e){this.geoFilterConfigForm=this.fb.group({latitudeKeyName:[e?e.latitudeKeyName:null,[i.Validators.required]],longitudeKeyName:[e?e.longitudeKeyName:null,[i.Validators.required]],fetchPerimeterInfoFromMessageMetadata:[!!e&&e.fetchPerimeterInfoFromMessageMetadata,[]],perimeterType:[e?e.perimeterType:null,[]],centerLatitude:[e?e.centerLatitude:null,[]],centerLongitude:[e?e.centerLatitude:null,[]],range:[e?e.range:null,[]],rangeUnit:[e?e.rangeUnit:null,[]],polygonsDefinition:[e?e.polygonsDefinition:null,[]]})},r.prototype.validatorTriggers=function(){return["fetchPerimeterInfoFromMessageMetadata","perimeterType"]},r.prototype.updateValidators=function(e){var t=this.geoFilterConfigForm.get("fetchPerimeterInfoFromMessageMetadata").value,r=this.geoFilterConfigForm.get("perimeterType").value;t?this.geoFilterConfigForm.get("perimeterType").setValidators([]):this.geoFilterConfigForm.get("perimeterType").setValidators([i.Validators.required]),t||r!==M.CIRCLE?(this.geoFilterConfigForm.get("centerLatitude").setValidators([]),this.geoFilterConfigForm.get("centerLongitude").setValidators([]),this.geoFilterConfigForm.get("range").setValidators([]),this.geoFilterConfigForm.get("rangeUnit").setValidators([])):(this.geoFilterConfigForm.get("centerLatitude").setValidators([i.Validators.required,i.Validators.min(-90),i.Validators.max(90)]),this.geoFilterConfigForm.get("centerLongitude").setValidators([i.Validators.required,i.Validators.min(-180),i.Validators.max(180)]),this.geoFilterConfigForm.get("range").setValidators([i.Validators.required,i.Validators.min(0)]),this.geoFilterConfigForm.get("rangeUnit").setValidators([i.Validators.required])),t||r!==M.POLYGON?this.geoFilterConfigForm.get("polygonsDefinition").setValidators([]):this.geoFilterConfigForm.get("polygonsDefinition").setValidators([i.Validators.required]),this.geoFilterConfigForm.get("perimeterType").updateValueAndValidity({emitEvent:!1}),this.geoFilterConfigForm.get("centerLatitude").updateValueAndValidity({emitEvent:e}),this.geoFilterConfigForm.get("centerLongitude").updateValueAndValidity({emitEvent:e}),this.geoFilterConfigForm.get("range").updateValueAndValidity({emitEvent:e}),this.geoFilterConfigForm.get("rangeUnit").updateValueAndValidity({emitEvent:e}),this.geoFilterConfigForm.get("polygonsDefinition").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-gps-geofencing-config",template:'
\n \n tb.rulenode.latitude-key-name\n \n \n {{ \'tb.rulenode.latitude-key-name-required\' | translate }}\n \n \n \n tb.rulenode.longitude-key-name\n \n \n {{ \'tb.rulenode.longitude-key-name-required\' | translate }}\n \n \n \n {{ \'tb.rulenode.fetch-perimeter-info-from-message-metadata\' | translate }}\n \n
\n \n tb.rulenode.perimeter-type\n \n \n {{ perimeterTypeTranslationMap.get(type) | translate }}\n \n \n \n
\n
\n
\n \n tb.rulenode.circle-center-latitude\n \n \n {{ \'tb.rulenode.circle-center-latitude-required\' | translate }}\n \n \n \n tb.rulenode.circle-center-longitude\n \n \n {{ \'tb.rulenode.circle-center-longitude-required\' | translate }}\n \n \n
\n
\n \n tb.rulenode.range\n \n \n {{ \'tb.rulenode.range-required\' | translate }}\n \n \n \n tb.rulenode.range-units\n \n \n {{ rangeUnitTranslationMap.get(type) | translate }}\n \n \n \n
\n
\n
\n
\n \n tb.rulenode.polygon-definition\n \n \n {{ \'tb.rulenode.polygon-definition-required\' | translate }}\n \n \n
\n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ne=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.messageTypeConfigForm},r.prototype.onConfigurationSet=function(e){this.messageTypeConfigForm=this.fb.group({messageTypes:[e?e.messageTypes:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-message-type-config",template:'
\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ve=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.allowedEntityTypes=[a.EntityType.DEVICE,a.EntityType.ASSET,a.EntityType.ENTITY_VIEW,a.EntityType.TENANT,a.EntityType.CUSTOMER,a.EntityType.USER,a.EntityType.DASHBOARD,a.EntityType.RULE_CHAIN,a.EntityType.RULE_NODE],n}return b(r,e),r.prototype.configForm=function(){return this.originatorTypeConfigForm},r.prototype.onConfigurationSet=function(e){this.originatorTypeConfigForm=this.fb.group({originatorTypes:[e?e.originatorTypes:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-originator-type-config",template:'
\n \n \n \n
\n',styles:[":host ::ng-deep tb-entity-type-list .mat-form-field-flex{padding-top:0}:host ::ng-deep tb-entity-type-list .mat-form-field-infix{border-top:0}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ee=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.scriptConfigForm},r.prototype.onConfigurationSet=function(e){this.scriptConfigForm=this.fb.group({jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.scriptConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"filter",this.translate.instant("tb.rulenode.filter"),"Filter",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.scriptConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-filter-node-script-config",template:'
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),Ae=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.switchConfigForm},r.prototype.onConfigurationSet=function(e){this.switchConfigForm=this.fb.group({jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.switchConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"switch",this.translate.instant("tb.rulenode.switch"),"Switch",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.switchConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-filter-node-switch-config",template:'
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),Le=function(e){function r(t,r,n){var o,l,s=e.call(this,t)||this;s.store=t,s.translate=r,s.fb=n,s.alarmStatusTranslationsMap=a.alarmStatusTranslations,s.alarmStatusList=[],s.searchText="",s.displayStatusFn=s.displayStatus.bind(s);try{for(var m=v(Object.keys(a.AlarmStatus)),u=m.next();!u.done;u=m.next()){var d=u.value;s.alarmStatusList.push(a.AlarmStatus[d])}}catch(e){o={error:e}}finally{try{u&&!u.done&&(l=m.return)&&l.call(m)}finally{if(o)throw o.error}}return s.statusFormControl=new i.FormControl(""),s.filteredAlarmStatus=s.statusFormControl.valueChanges.pipe(f.startWith(""),f.map((function(e){return e||""})),f.mergeMap((function(e){return s.fetchAlarmStatus(e)})),f.share()),s}return b(r,e),r.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this)},r.prototype.configForm=function(){return this.alarmStatusConfigForm},r.prototype.prepareInputConfig=function(e){return this.searchText="",this.statusFormControl.patchValue("",{emitEvent:!0}),e},r.prototype.onConfigurationSet=function(e){this.alarmStatusConfigForm=this.fb.group({alarmStatusList:[e?e.alarmStatusList:null,[i.Validators.required]]})},r.prototype.displayStatus=function(e){return e?this.translate.instant(a.alarmStatusTranslations.get(e)):void 0},r.prototype.fetchAlarmStatus=function(e){var t=this,r=this.getAlarmStatusList();if(this.searchText=e,this.searchText&&this.searchText.length){var n=this.searchText.toUpperCase();return c.of(r.filter((function(e){return t.translate.instant(a.alarmStatusTranslations.get(a.AlarmStatus[e])).toUpperCase().includes(n)})))}return c.of(r)},r.prototype.alarmStatusSelected=function(e){this.addAlarmStatus(e.option.value),this.clear("")},r.prototype.removeAlarmStatus=function(e){var t=this.alarmStatusConfigForm.get("alarmStatusList").value;if(t){var r=t.indexOf(e);r>=0&&(t.splice(r,1),this.alarmStatusConfigForm.get("alarmStatusList").setValue(t))}},r.prototype.addAlarmStatus=function(e){var t=this.alarmStatusConfigForm.get("alarmStatusList").value;t||(t=[]),-1===t.indexOf(e)&&(t.push(e),this.alarmStatusConfigForm.get("alarmStatusList").setValue(t))},r.prototype.getAlarmStatusList=function(){var e=this;return this.alarmStatusList.filter((function(t){return-1===e.alarmStatusConfigForm.get("alarmStatusList").value.indexOf(t)}))},r.prototype.onAlarmStatusInputFocus=function(){this.statusFormControl.updateValueAndValidity({onlySelf:!0,emitEvent:!0})},r.prototype.clear=function(e){var t=this;void 0===e&&(e=""),this.alarmStatusInput.nativeElement.value=e,this.statusFormControl.patchValue(null,{emitEvent:!0}),setTimeout((function(){t.alarmStatusInput.nativeElement.blur(),t.alarmStatusInput.nativeElement.focus()}),0)},r.ctorParameters=function(){return[{type:o.Store},{type:n.TranslateService},{type:i.FormBuilder}]},h([t.ViewChild("alarmStatusInput",{static:!1}),C("design:type",t.ElementRef)],r.prototype,"alarmStatusInput",void 0),r=h([t.Component({selector:"tb-filter-node-check-alarm-status-config",template:'
\n \n tb.rulenode.alarm-status-filter\n \n \n \n {{alarmStatusTranslationsMap.get(alarmStatus) | translate}}\n \n close\n \n \n \n \n \n \n \n \n
\n
\n tb.rulenode.no-alarm-status-matching\n
\n
\n
\n
\n
\n \n
\n\n\n\n'}),C("design:paramtypes",[o.Store,n.TranslateService,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Pe=function(){function e(){}return e=h([t.NgModule({declarations:[Se,Ie,ke,Ne,Ve,Ee,Ae,Le],imports:[r.CommonModule,a.SharedModule,ue],exports:[Se,Ie,ke,Ne,Ve,Ee,Ae,Le]})],e)}(),Me=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.customerAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.customerAttributesConfigForm=this.fb.group({telemetry:[!!e&&e.telemetry,[]],attrMapping:[e?e.attrMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-customer-attributes-config",template:'
\n \n \n {{ \'tb.rulenode.latest-telemetry\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),we=function(e){function r(t,r,n){var a,o,l=e.call(this,t)||this;l.store=t,l.translate=r,l.fb=n,l.entityDetailsTranslationsMap=z,l.entityDetailsList=[],l.searchText="",l.displayDetailsFn=l.displayDetails.bind(l);try{for(var s=v(Object.keys(B)),m=s.next();!m.done;m=s.next()){var u=m.value;l.entityDetailsList.push(B[u])}}catch(e){a={error:e}}finally{try{m&&!m.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}return l.detailsFormControl=new i.FormControl(""),l.filteredEntityDetails=l.detailsFormControl.valueChanges.pipe(f.startWith(""),f.map((function(e){return e||""})),f.mergeMap((function(e){return l.fetchEntityDetails(e)})),f.share()),l}return b(r,e),r.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this)},r.prototype.configForm=function(){return this.entityDetailsConfigForm},r.prototype.prepareInputConfig=function(e){return this.searchText="",this.detailsFormControl.patchValue("",{emitEvent:!0}),e},r.prototype.onConfigurationSet=function(e){this.entityDetailsConfigForm=this.fb.group({detailsList:[e?e.detailsList:null,[i.Validators.required]],addToMetadata:[!!e&&e.addToMetadata,[]]})},r.prototype.displayDetails=function(e){return e?this.translate.instant(z.get(e)):void 0},r.prototype.fetchEntityDetails=function(e){var t=this;if(this.searchText=e,this.searchText&&this.searchText.length){var r=this.searchText.toUpperCase();return c.of(this.entityDetailsList.filter((function(e){return t.translate.instant(z.get(B[e])).toUpperCase().includes(r)})))}return c.of(this.entityDetailsList)},r.prototype.detailsFieldSelected=function(e){this.addDetailsField(e.option.value),this.clear("")},r.prototype.removeDetailsField=function(e){var t=this.entityDetailsConfigForm.get("detailsList").value;if(t){var r=t.indexOf(e);r>=0&&(t.splice(r,1),this.entityDetailsConfigForm.get("detailsList").setValue(t))}},r.prototype.addDetailsField=function(e){var t=this.entityDetailsConfigForm.get("detailsList").value;t||(t=[]),-1===t.indexOf(e)&&(t.push(e),this.entityDetailsConfigForm.get("detailsList").setValue(t))},r.prototype.onEntityDetailsInputFocus=function(){this.detailsFormControl.updateValueAndValidity({onlySelf:!0,emitEvent:!0})},r.prototype.clear=function(e){var t=this;void 0===e&&(e=""),this.detailsInput.nativeElement.value=e,this.detailsFormControl.patchValue(null,{emitEvent:!0}),setTimeout((function(){t.detailsInput.nativeElement.blur(),t.detailsInput.nativeElement.focus()}),0)},r.ctorParameters=function(){return[{type:o.Store},{type:n.TranslateService},{type:i.FormBuilder}]},h([t.ViewChild("detailsInput",{static:!1}),C("design:type",t.ElementRef)],r.prototype,"detailsInput",void 0),r=h([t.Component({selector:"tb-enrichment-node-entity-details-config",template:'
\n \n tb.rulenode.entity-details\n \n \n \n {{entityDetailsTranslationsMap.get(details) | translate}}\n \n close\n \n \n \n \n \n \n \n \n
\n
\n tb.rulenode.no-entity-details-matching\n
\n
\n
\n
\n
\n \n \n {{ \'tb.rulenode.add-to-metadata\' | translate }}\n \n
tb.rulenode.add-to-metadata-hint
\n
\n',styles:[":host ::ng-deep mat-form-field.entity-fields-list .mat-form-field-wrapper{margin-bottom:-1.25em}"]}),C("design:paramtypes",[o.Store,n.TranslateService,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Re=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n}return b(r,e),r.prototype.configForm=function(){return this.deviceAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.deviceAttributesConfigForm=this.fb.group({deviceRelationsQuery:[e?e.deviceRelationsQuery:null,[i.Validators.required]],tellFailureIfAbsent:[!!e&&e.tellFailureIfAbsent,[]],clientAttributeNames:[e?e.clientAttributeNames:null,[]],sharedAttributeNames:[e?e.sharedAttributeNames:null,[]],serverAttributeNames:[e?e.serverAttributeNames:null,[]],latestTsKeyNames:[e?e.latestTsKeyNames:null,[]],getLatestValueWithTs:[!!e&&e.getLatestValueWithTs,[]]})},r.prototype.removeKey=function(e,t){var r=this.deviceAttributesConfigForm.get(t).value,n=r.indexOf(e);n>=0&&(r.splice(n,1),this.deviceAttributesConfigForm.get(t).setValue(r,{emitEvent:!0}))},r.prototype.addKey=function(e,t){var r=e.input,n=e.value;if((n||"").trim()){n=n.trim();var a=this.deviceAttributesConfigForm.get(t).value;a&&-1!==a.indexOf(n)||(a||(a=[]),a.push(n),this.deviceAttributesConfigForm.get(t).setValue(a,{emitEvent:!0}))}r&&(r.value="")},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-device-attributes-config",template:'
\n \n \n \n \n {{ \'tb.rulenode.tell-failure-if-absent\' | translate }}\n \n
tb.rulenode.tell-failure-if-absent-hint
\n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n {{ \'tb.rulenode.get-latest-value-with-ts\' | translate }}\n \n
tb.rulenode.get-latest-value-with-ts-hint
\n
\n',styles:[":host label.tb-title{margin-bottom:-10px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),De=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n}return b(r,e),r.prototype.configForm=function(){return this.originatorAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.originatorAttributesConfigForm=this.fb.group({tellFailureIfAbsent:[!!e&&e.tellFailureIfAbsent,[]],clientAttributeNames:[e?e.clientAttributeNames:null,[]],sharedAttributeNames:[e?e.sharedAttributeNames:null,[]],serverAttributeNames:[e?e.serverAttributeNames:null,[]],latestTsKeyNames:[e?e.latestTsKeyNames:null,[]],getLatestValueWithTs:[!!e&&e.getLatestValueWithTs,[]]})},r.prototype.removeKey=function(e,t){var r=this.originatorAttributesConfigForm.get(t).value,n=r.indexOf(e);n>=0&&(r.splice(n,1),this.originatorAttributesConfigForm.get(t).setValue(r,{emitEvent:!0}))},r.prototype.addKey=function(e,t){var r=e.input,n=e.value;if((n||"").trim()){n=n.trim();var a=this.originatorAttributesConfigForm.get(t).value;a&&-1!==a.indexOf(n)||(a||(a=[]),a.push(n),this.originatorAttributesConfigForm.get(t).setValue(a,{emitEvent:!0}))}r&&(r.value="")},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-originator-attributes-config",template:'
\n \n {{ \'tb.rulenode.tell-failure-if-absent\' | translate }}\n \n
tb.rulenode.tell-failure-if-absent-hint
\n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n {{ \'tb.rulenode.get-latest-value-with-ts\' | translate }}\n \n
tb.rulenode.get-latest-value-with-ts-hint
\n
\n',styles:[":host label.tb-title{margin-bottom:-10px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Oe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.originatorFieldsConfigForm},r.prototype.onConfigurationSet=function(e){this.originatorFieldsConfigForm=this.fb.group({fieldsMapping:[e?e.fieldsMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-originator-fields-config",template:'
\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ke=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n.fetchMode=H,n.fetchModes=Object.keys(H),n.samplingOrders=Object.keys(U),n.timeUnits=Object.keys(R),n.timeUnitsTranslationMap=K,n}return b(r,e),r.prototype.configForm=function(){return this.getTelemetryFromDatabaseConfigForm},r.prototype.onConfigurationSet=function(e){this.getTelemetryFromDatabaseConfigForm=this.fb.group({latestTsKeyNames:[e?e.latestTsKeyNames:null,[]],fetchMode:[e?e.fetchMode:null,[i.Validators.required]],orderBy:[e?e.orderBy:null,[]],limit:[e?e.limit:null,[]],useMetadataIntervalPatterns:[!!e&&e.useMetadataIntervalPatterns,[]],startInterval:[e?e.startInterval:null,[]],startIntervalTimeUnit:[e?e.startIntervalTimeUnit:null,[]],endInterval:[e?e.endInterval:null,[]],endIntervalTimeUnit:[e?e.endIntervalTimeUnit:null,[]],startIntervalPattern:[e?e.startIntervalPattern:null,[]],endIntervalPattern:[e?e.endIntervalPattern:null,[]]})},r.prototype.validatorTriggers=function(){return["fetchMode","useMetadataIntervalPatterns"]},r.prototype.updateValidators=function(e){var t=this.getTelemetryFromDatabaseConfigForm.get("fetchMode").value,r=this.getTelemetryFromDatabaseConfigForm.get("useMetadataIntervalPatterns").value;t&&t===H.ALL?(this.getTelemetryFromDatabaseConfigForm.get("orderBy").setValidators([i.Validators.required]),this.getTelemetryFromDatabaseConfigForm.get("limit").setValidators([i.Validators.required,i.Validators.min(2),i.Validators.max(1e3)])):(this.getTelemetryFromDatabaseConfigForm.get("orderBy").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("limit").setValidators([])),r?(this.getTelemetryFromDatabaseConfigForm.get("startInterval").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("startIntervalTimeUnit").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("endInterval").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("endIntervalTimeUnit").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("startIntervalPattern").setValidators([i.Validators.required]),this.getTelemetryFromDatabaseConfigForm.get("endIntervalPattern").setValidators([i.Validators.required])):(this.getTelemetryFromDatabaseConfigForm.get("startInterval").setValidators([i.Validators.required,i.Validators.min(1),i.Validators.max(2147483647)]),this.getTelemetryFromDatabaseConfigForm.get("startIntervalTimeUnit").setValidators([i.Validators.required]),this.getTelemetryFromDatabaseConfigForm.get("endInterval").setValidators([i.Validators.required,i.Validators.min(1),i.Validators.max(2147483647)]),this.getTelemetryFromDatabaseConfigForm.get("endIntervalTimeUnit").setValidators([i.Validators.required]),this.getTelemetryFromDatabaseConfigForm.get("startIntervalPattern").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("endIntervalPattern").setValidators([])),this.getTelemetryFromDatabaseConfigForm.get("orderBy").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("limit").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("startInterval").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("startIntervalTimeUnit").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("endInterval").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("endIntervalTimeUnit").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("startIntervalPattern").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("endIntervalPattern").updateValueAndValidity({emitEvent:e})},r.prototype.removeKey=function(e,t){var r=this.getTelemetryFromDatabaseConfigForm.get(t).value,n=r.indexOf(e);n>=0&&(r.splice(n,1),this.getTelemetryFromDatabaseConfigForm.get(t).setValue(r,{emitEvent:!0}))},r.prototype.addKey=function(e,t){var r=e.input,n=e.value;if((n||"").trim()){n=n.trim();var a=this.getTelemetryFromDatabaseConfigForm.get(t).value;a&&-1!==a.indexOf(n)||(a||(a=[]),a.push(n),this.getTelemetryFromDatabaseConfigForm.get(t).setValue(a,{emitEvent:!0}))}r&&(r.value="")},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-get-telemetry-from-database",template:'
\n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n tb.rulenode.fetch-mode\n \n \n {{ mode }}\n \n \n tb.rulenode.fetch-mode-hint\n \n
\n \n tb.rulenode.order-by\n \n \n {{ order }}\n \n \n tb.rulenode.order-by-hint\n \n \n tb.rulenode.limit\n \n tb.rulenode.limit-hint\n \n
\n \n {{ \'tb.rulenode.use-metadata-interval-patterns\' | translate }}\n \n
tb.rulenode.use-metadata-interval-patterns-hint
\n
\n
\n \n tb.rulenode.start-interval\n \n \n {{ \'tb.rulenode.start-interval-value-required\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n \n tb.rulenode.start-interval-time-unit\n \n \n {{ timeUnitsTranslationMap.get(timeUnit) | translate }}\n \n \n \n
\n
\n \n tb.rulenode.end-interval\n \n \n {{ \'tb.rulenode.end-interval-value-required\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n \n tb.rulenode.end-interval-time-unit\n \n \n {{ timeUnitsTranslationMap.get(timeUnit) | translate }}\n \n \n \n
\n
\n \n \n tb.rulenode.start-interval-pattern\n \n \n {{ \'tb.rulenode.start-interval-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.end-interval-pattern\n \n \n {{ \'tb.rulenode.end-interval-pattern-required\' | translate }}\n \n \n \n \n
\n',styles:[":host label.tb-title{margin-bottom:-10px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Be=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.relatedAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.relatedAttributesConfigForm=this.fb.group({relationsQuery:[e?e.relationsQuery:null,[i.Validators.required]],telemetry:[!!e&&e.telemetry,[]],attrMapping:[e?e.attrMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-related-attributes-config",template:'
\n \n \n \n \n \n {{ \'tb.rulenode.latest-telemetry\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ge=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.tenantAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.tenantAttributesConfigForm=this.fb.group({telemetry:[!!e&&e.telemetry,[]],attrMapping:[e?e.attrMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-tenant-attributes-config",template:'
\n \n \n {{ \'tb.rulenode.latest-telemetry\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),He=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n}return b(r,e),r.prototype.configForm=function(){return this.calculateDeltaConfigForm},r.prototype.onConfigurationSet=function(e){this.calculateDeltaConfigForm=this.fb.group({inputValueKey:[e?e.inputValueKey:null,[i.Validators.required]],outputValueKey:[e?e.outputValueKey:null,[i.Validators.required]],useCache:[e?e.useCache:null,[]],addPeriodBetweenMsgs:[!!e&&e.addPeriodBetweenMsgs,[]],periodValueKey:[e?e.periodValueKey:null,[]],round:[e?e.round:null,[i.Validators.min(0),i.Validators.max(15)]],tellFailureIfInputValueKeyIsAbsent:[e?e.tellFailureIfInputValueKeyIsAbsent:null,[]],tellFailureIfDeltaIsNegative:[e?e.tellFailureIfDeltaIsNegative:null,[]]})},r.prototype.updateValidators=function(e){this.calculateDeltaConfigForm.get("addPeriodBetweenMsgs").value?this.calculateDeltaConfigForm.get("periodValueKey").setValidators([i.Validators.required]):this.calculateDeltaConfigForm.get("periodValueKey").setValidators([]),this.calculateDeltaConfigForm.get("periodValueKey").updateValueAndValidity({emitEvent:e})},r.prototype.validatorTriggers=function(){return["addPeriodBetweenMsgs"]},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-calculate-delta-config",template:'
\n
\n \n tb.rulenode.input-value-key\n \n \n {{ \'tb.rulenode.input-value-key-required\' | translate }}\n \n \n \n tb.rulenode.output-value-key\n \n \n {{ \'tb.rulenode.output-value-key-required\' | translate }}\n \n \n \n tb.rulenode.round\n \n \n {{ \'tb.rulenode.round-range\' | translate }}\n \n \n {{ \'tb.rulenode.round-range\' | translate }}\n \n \n
\n \n {{ \'tb.rulenode.use-cache\' | translate }}\n \n \n {{ \'tb.rulenode.tell-failure-if-input-value-key-is-absent\' | translate }}\n \n \n {{ \'tb.rulenode.tell-failure-if-delta-is-negative\' | translate }}\n \n \n {{ \'tb.rulenode.add-period-between-msgs\' | translate }}\n \n \n tb.rulenode.period-value-key\n \n \n {{ \'tb.rulenode.period-value-key-required\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ue=function(){function e(){}return e=h([t.NgModule({declarations:[Me,we,Re,De,Oe,Ke,Be,Ge,He],imports:[r.CommonModule,a.SharedModule,ue],exports:[Me,we,Re,De,Oe,Ke,Be,Ge,He]})],e)}(),je=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.originatorSource=F,n.originatorSources=Object.keys(F),n.originatorSourceTranslationMap=w,n}return b(r,e),r.prototype.configForm=function(){return this.changeOriginatorConfigForm},r.prototype.onConfigurationSet=function(e){this.changeOriginatorConfigForm=this.fb.group({originatorSource:[e?e.originatorSource:null,[i.Validators.required]],relationsQuery:[e?e.relationsQuery:null,[]]})},r.prototype.validatorTriggers=function(){return["originatorSource"]},r.prototype.updateValidators=function(e){var t=this.changeOriginatorConfigForm.get("originatorSource").value;t&&t===F.RELATED?this.changeOriginatorConfigForm.get("relationsQuery").setValidators([i.Validators.required]):this.changeOriginatorConfigForm.get("relationsQuery").setValidators([]),this.changeOriginatorConfigForm.get("relationsQuery").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-transformation-node-change-originator-config",template:'
\n \n tb.rulenode.originator-source\n \n \n {{ originatorSourceTranslationMap.get(source) | translate }}\n \n \n \n
\n \n \n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ze=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.scriptConfigForm},r.prototype.onConfigurationSet=function(e){this.scriptConfigForm=this.fb.group({jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.scriptConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"update",this.translate.instant("tb.rulenode.transformer"),"Transform",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.scriptConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-transformation-node-script-config",template:'
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),Qe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.toEmailConfigForm},r.prototype.onConfigurationSet=function(e){this.toEmailConfigForm=this.fb.group({fromTemplate:[e?e.fromTemplate:null,[i.Validators.required]],toTemplate:[e?e.toTemplate:null,[i.Validators.required]],ccTemplate:[e?e.ccTemplate:null,[]],bccTemplate:[e?e.bccTemplate:null,[]],subjectTemplate:[e?e.subjectTemplate:null,[i.Validators.required]],bodyTemplate:[e?e.bodyTemplate:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-transformation-node-to-email-config",template:'
\n \n tb.rulenode.from-template\n \n \n {{ \'tb.rulenode.from-template-required\' | translate }}\n \n \n \n \n tb.rulenode.to-template\n \n \n {{ \'tb.rulenode.to-template-required\' | translate }}\n \n \n \n \n tb.rulenode.cc-template\n \n \n \n \n tb.rulenode.bcc-template\n \n \n \n \n tb.rulenode.subject-template\n \n \n {{ \'tb.rulenode.subject-template-required\' | translate }}\n \n \n \n \n tb.rulenode.body-template\n \n \n {{ \'tb.rulenode.body-template-required\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),_e=function(){function e(){}return e=h([t.NgModule({declarations:[je,ze,Qe],imports:[r.CommonModule,a.SharedModule,ue],exports:[je,ze,Qe]})],e)}(),$e=function(){function e(e){!function(e){e.setTranslation("en_US",{tb:{rulenode:{"create-entity-if-not-exists":"Create new entity if not exists","create-entity-if-not-exists-hint":"Create a new entity set above if it does not exist.","entity-name-pattern":"Name pattern","entity-name-pattern-required":"Name pattern is required","entity-type-pattern":"Type pattern","entity-type-pattern-required":"Type pattern is required","entity-cache-expiration":"Entities cache expiration time (sec)","entity-cache-expiration-hint":"Specifies maximum time interval allowed to store found entity records. 0 value means that records will never expire.","entity-cache-expiration-required":"Entities cache expiration time is required.","entity-cache-expiration-range":"Entities cache expiration time should be greater than or equal to 0.","customer-name-pattern":"Customer name pattern","customer-name-pattern-required":"Customer name pattern is required","create-customer-if-not-exists":"Create new customer if not exists","customer-cache-expiration":"Customers cache expiration time (sec)","customer-cache-expiration-hint":"Specifies maximum time interval allowed to store found customer records. 0 value means that records will never expire.","customer-cache-expiration-required":"Customers cache expiration time is required.","customer-cache-expiration-range":"Customers cache expiration time should be greater than or equal to 0.","start-interval":"Start Interval","end-interval":"End Interval","start-interval-time-unit":"Start Interval Time Unit","end-interval-time-unit":"End Interval Time Unit","fetch-mode":"Fetch mode","fetch-mode-hint":"If selected fetch mode 'ALL' you able to choose telemetry sampling order.","order-by":"Order by","order-by-hint":"Select to choose telemetry sampling order.",limit:"Limit","limit-hint":"Min limit value is 2, max - 1000. In case you want to fetch a single entry, select fetch mode 'FIRST' or 'LAST'.","time-unit-milliseconds":"Milliseconds","time-unit-seconds":"Seconds","time-unit-minutes":"Minutes","time-unit-hours":"Hours","time-unit-days":"Days","time-value-range":"Time value should be in a range from 1 to 2147483647.","start-interval-value-required":"Start interval value is required.","end-interval-value-required":"End interval value is required.",filter:"Filter",switch:"Switch","message-type":"Message type","message-type-required":"Message type is required.","message-types-filter":"Message types filter","no-message-types-found":"No message types found","no-message-type-matching":"'{{messageType}}' not found.","create-new-message-type":"Create a new one!","message-types-required":"Message types are required.","client-attributes":"Client attributes","shared-attributes":"Shared attributes","server-attributes":"Server attributes","notify-device":"Notify Device","notify-device-hint":"If the message arrives from the device, we will push it back to the device by default.","latest-timeseries":"Latest timeseries","data-keys":"Message data","metadata-keys":"Message metadata","relations-query":"Relations query","device-relations-query":"Device relations query","max-relation-level":"Max relation level","relation-type-pattern":"Relation type pattern","relation-type-pattern-required":"Relation type pattern is required","relation-types-list":"Relation types to propagate","relation-types-list-hint":"If Propagate relation types are not selected, alarms will be propagated without filtering by relation type.","unlimited-level":"Unlimited level","latest-telemetry":"Latest telemetry","attr-mapping":"Attributes mapping","source-attribute":"Source attribute","source-attribute-required":"Source attribute is required.","source-telemetry":"Source telemetry","source-telemetry-required":"Source telemetry is required.","target-attribute":"Target attribute","target-attribute-required":"Target attribute is required.","attr-mapping-required":"At least one attribute mapping should be specified.","fields-mapping":"Fields mapping","fields-mapping-required":"At least one field mapping should be specified.","source-field":"Source field","source-field-required":"Source field is required.","originator-source":"Originator source","originator-customer":"Customer","originator-tenant":"Tenant","originator-related":"Related","originator-alarm-originator":"Alarm Originator","clone-message":"Clone message",transform:"Transform","default-ttl":"Default TTL in seconds","default-ttl-required":"Default TTL is required.","min-default-ttl-message":"Only 0 minimum TTL is allowed.","message-count":"Message count (0 - unlimited)","message-count-required":"Message count is required.","min-message-count-message":"Only 0 minimum message count is allowed.","period-seconds":"Period in seconds","period-seconds-required":"Period is required.","use-metadata-period-in-seconds-patterns":"Use period in seconds pattern","use-metadata-period-in-seconds-patterns-hint":"If selected, rule node use period in seconds interval pattern from message metadata or data assuming that intervals are in the seconds.","period-in-seconds-pattern":"Period in seconds pattern","period-in-seconds-pattern-required":"Period in seconds pattern is required","min-period-seconds-message":"Only 1 second minimum period is allowed.",originator:"Originator","message-body":"Message body","message-metadata":"Message metadata",generate:"Generate","test-generator-function":"Test generator function",generator:"Generator","test-filter-function":"Test filter function","test-switch-function":"Test switch function","test-transformer-function":"Test transformer function",transformer:"Transformer","alarm-create-condition":"Alarm create condition","test-condition-function":"Test condition function","alarm-clear-condition":"Alarm clear condition","alarm-details-builder":"Alarm details builder","test-details-function":"Test details function","alarm-type":"Alarm type","alarm-type-required":"Alarm type is required.","alarm-severity":"Alarm severity","alarm-severity-required":"Alarm severity is required","alarm-status-filter":"Alarm status filter","alarm-status-list-empty":"Alarm status list is empty","no-alarm-status-matching":"No alarm status matching were found.",propagate:"Propagate",condition:"Condition",details:"Details","to-string":"To string","test-to-string-function":"Test to string function","from-template":"From Template","from-template-required":"From Template is required","to-template":"To Template","to-template-required":"To Template is required","mail-address-list-template-hint":'Comma separated address list, use ${metadataKey} for value from metadata, $[messageKey] for value from message body',"cc-template":"Cc Template","bcc-template":"Bcc Template","subject-template":"Subject Template","subject-template-required":"Subject Template is required","body-template":"Body Template","body-template-required":"Body Template is required","request-id-metadata-attribute":"Request Id Metadata attribute name","timeout-sec":"Timeout in seconds","timeout-required":"Timeout is required","min-timeout-message":"Only 0 minimum timeout value is allowed.","endpoint-url-pattern":"Endpoint URL pattern","endpoint-url-pattern-required":"Endpoint URL pattern is required","request-method":"Request method","use-simple-client-http-factory":"Use simple client HTTP factory","read-timeout":"Read timeout in millis","read-timeout-hint":"The value of 0 means an infinite timeout","max-parallel-requests-count":"Max number of parallel requests","max-parallel-requests-count-hint":"The value of 0 specifies no limit in parallel processing",headers:"Headers","headers-hint":'Use ${metadataKey} for value from metadata, $[messageKey] for value from message body in header/value fields',header:"Header","header-required":"Header is required",value:"Value","value-required":"Value is required","topic-pattern":"Topic pattern","topic-pattern-required":"Topic pattern is required",topic:"Topic","topic-required":"Topic is required","bootstrap-servers":"Bootstrap servers","bootstrap-servers-required":"Bootstrap servers value is required","other-properties":"Other properties",key:"Key","key-required":"Key is required",retries:"Automatically retry times if fails","min-retries-message":"Only 0 minimum retries is allowed.","batch-size-bytes":"Produces batch size in bytes","min-batch-size-bytes-message":"Only 0 minimum batch size is allowed.","linger-ms":"Time to buffer locally (ms)","min-linger-ms-message":"Only 0 ms minimum value is allowed.","buffer-memory-bytes":"Client buffer max size in bytes","min-buffer-memory-message":"Only 0 minimum buffer size is allowed.",acks:"Number of acknowledgments","key-serializer":"Key serializer","key-serializer-required":"Key serializer is required","value-serializer":"Value serializer","value-serializer-required":"Value serializer is required","topic-arn-pattern":"Topic ARN pattern","topic-arn-pattern-required":"Topic ARN pattern is required","aws-access-key-id":"AWS Access Key ID","aws-access-key-id-required":"AWS Access Key ID is required","aws-secret-access-key":"AWS Secret Access Key","aws-secret-access-key-required":"AWS Secret Access Key is required","aws-region":"AWS Region","aws-region-required":"AWS Region is required","exchange-name-pattern":"Exchange name pattern","routing-key-pattern":"Routing key pattern","message-properties":"Message properties",host:"Host","host-required":"Host is required",port:"Port","port-required":"Port is required","port-range":"Port should be in a range from 1 to 65535.","virtual-host":"Virtual host",username:"Username",password:"Password","automatic-recovery":"Automatic recovery","connection-timeout-ms":"Connection timeout (ms)","min-connection-timeout-ms-message":"Only 0 ms minimum value is allowed.","handshake-timeout-ms":"Handshake timeout (ms)","min-handshake-timeout-ms-message":"Only 0 ms minimum value is allowed.","client-properties":"Client properties","queue-url-pattern":"Queue URL pattern","queue-url-pattern-required":"Queue URL pattern is required","delay-seconds":"Delay (seconds)","min-delay-seconds-message":"Only 0 seconds minimum value is allowed.","max-delay-seconds-message":"Only 900 seconds maximum value is allowed.",name:"Name","name-required":"Name is required","queue-type":"Queue type","sqs-queue-standard":"Standard","sqs-queue-fifo":"FIFO","gcp-project-id":"GCP project ID","gcp-project-id-required":"GCP project ID is required","gcp-service-account-key":"GCP service account key file","gcp-service-account-key-required":"GCP service account key file is required","pubsub-topic-name":"Topic name","pubsub-topic-name-required":"Topic name is required","message-attributes":"Message attributes","message-attributes-hint":'Use ${metadataKey} for value from metadata, $[messageKey] for value from message body in name/value fields',"connect-timeout":"Connection timeout (sec)","connect-timeout-required":"Connection timeout is required.","connect-timeout-range":"Connection timeout should be in a range from 1 to 200.","client-id":"Client ID","device-id":"Device ID","device-id-required":"Device ID is required.","clean-session":"Clean session","enable-ssl":"Enable SSL",credentials:"Credentials","credentials-type":"Credentials type","credentials-type-required":"Credentials type is required.","credentials-anonymous":"Anonymous","credentials-basic":"Basic","credentials-pem":"PEM","credentials-pem-hint":"At least Server CA certificate file or a pair of Client certificate and Client private key files are required","credentials-sas":"Shared Access Signature","sas-key":"SAS Key","sas-key-required":"SAS Key is required.",hostname:"Hostname","hostname-required":"Hostname is required.","azure-ca-cert":"CA certificate file","username-required":"Username is required.","password-required":"Password is required.","ca-cert":"Server CA certificate file *","private-key":"Client private key file *",cert:"Client certificate file *","no-file":"No file selected.","drop-file":"Drop a file or click to select a file to upload.","private-key-password":"Private key password","use-system-smtp-settings":"Use system SMTP settings","use-metadata-interval-patterns":"Use interval patterns","use-metadata-interval-patterns-hint":"If selected, rule node use start and end interval patterns from message metadata or data assuming that intervals are in the milliseconds.","use-message-alarm-data":"Use message alarm data","check-all-keys":"Check that all selected keys are present","check-all-keys-hint":"If selected, checks that all specified keys are present in the message data and metadata.","check-relation-to-specific-entity":"Check relation to specific entity","check-relation-hint":"Checks existence of relation to specific entity or to any entity based on direction and relation type.","delete-relation-to-specific-entity":"Delete relation to specific entity","delete-relation-hint":"Deletes relation from the originator of the incoming message to the specified entity or list of entities based on direction and type.","remove-current-relations":"Remove current relations","remove-current-relations-hint":"Removes current relations from the originator of the incoming message based on direction and type.","change-originator-to-related-entity":"Change originator to related entity","change-originator-to-related-entity-hint":"Used to process submitted message as a message from another entity.","start-interval-pattern":"Start interval pattern","end-interval-pattern":"End interval pattern","start-interval-pattern-required":"Start interval pattern is required","end-interval-pattern-required":"End interval pattern is required","smtp-protocol":"Protocol","smtp-host":"SMTP host","smtp-host-required":"SMTP host is required.","smtp-port":"SMTP port","smtp-port-required":"You must supply a smtp port.","smtp-port-range":"SMTP port should be in a range from 1 to 65535.","timeout-msec":"Timeout ms","min-timeout-msec-message":"Only 0 ms minimum value is allowed.","enter-username":"Enter username","enter-password":"Enter password","enable-tls":"Enable TLS","tls-version":"TLS version","enable-proxy":"Enable proxy","use-system-proxy-properties":"Use system proxy properties","proxy-host":"Proxy host","proxy-host-required":"Proxy host is required.","proxy-port":"Proxy port","proxy-port-required":"Proxy port is required.","proxy-port-range":"Proxy port should be in a range from 1 to 65535.","proxy-user":"Proxy user","proxy-password":"Proxy password","proxy-scheme":"Proxy scheme","numbers-to-template":"Phone Numbers To Template","numbers-to-template-required":"Phone Numbers To Template is required","numbers-to-template-hint":'Comma separated Phone Numbers, use ${metadataKey} for value from metadata, $[messageKey] for value from message body',"sms-message-template":"SMS message Template","sms-message-template-required":"SMS message Template is required","use-system-sms-settings":"Use system SMS provider settings","min-period-0-seconds-message":"Only 0 second minimum period is allowed.","max-pending-messages":"Maximum pending messages","max-pending-messages-required":"Maximum pending messages is required.","max-pending-messages-range":"Maximum pending messages should be in a range from 1 to 100000.","originator-types-filter":"Originator types filter","interval-seconds":"Interval in seconds","interval-seconds-required":"Interval is required.","min-interval-seconds-message":"Only 1 second minimum interval is allowed.","output-timeseries-key-prefix":"Output timeseries key prefix","output-timeseries-key-prefix-required":"Output timeseries key prefix required.","separator-hint":'You should press "enter" to complete field input.',"entity-details":"Select entity details:","entity-details-title":"Title","entity-details-country":"Country","entity-details-state":"State","entity-details-zip":"Zip","entity-details-address":"Address","entity-details-address2":"Address2","entity-details-additional_info":"Additional Info","entity-details-phone":"Phone","entity-details-email":"Email","add-to-metadata":"Add selected details to message metadata","add-to-metadata-hint":"If selected, adds the selected details keys to the message metadata instead of message data.","entity-details-list-empty":"No entity details selected.","no-entity-details-matching":"No entity details matching were found.","custom-table-name":"Custom table name","custom-table-name-required":"Table Name is required","custom-table-hint":"You should enter the table name without prefix 'cs_tb_'.","message-field":"Message field","message-field-required":"Message field is required.","table-col":"Table column","table-col-required":"Table column is required.","latitude-key-name":"Latitude key name","longitude-key-name":"Longitude key name","latitude-key-name-required":"Latitude key name is required.","longitude-key-name-required":"Longitude key name is required.","fetch-perimeter-info-from-message-metadata":"Fetch perimeter information from message metadata","perimeter-circle":"Circle","perimeter-polygon":"Polygon","perimeter-type":"Perimeter type","circle-center-latitude":"Center latitude","circle-center-latitude-required":"Center latitude is required.","circle-center-longitude":"Center longitude","circle-center-longitude-required":"Center longitude is required.","range-unit-meter":"Meter","range-unit-kilometer":"Kilometer","range-unit-foot":"Foot","range-unit-mile":"Mile","range-unit-nautical-mile":"Nautical mile","range-units":"Range units",range:"Range","range-required":"Range is required.","polygon-definition":"Polygon definition","polygon-definition-required":"Polygon definition is required.","polygon-definition-hint":"Please, use the following format for manual definition of polygon: [[lat1,lon1],[lat2,lon2], ... ,[latN,lonN]].","min-inside-duration":"Minimal inside duration","min-inside-duration-value-required":"Minimal inside duration is required","min-inside-duration-time-unit":"Minimal inside duration time unit","min-outside-duration":"Minimal outside duration","min-outside-duration-value-required":"Minimal outside duration is required","min-outside-duration-time-unit":"Minimal outside duration time unit","tell-failure-if-absent":"Tell Failure","tell-failure-if-absent-hint":'If at least one selected key doesn\'t exist the outbound message will report "Failure".',"get-latest-value-with-ts":"Fetch Latest telemetry with Timestamp","get-latest-value-with-ts-hint":'If selected, latest telemetry values will be added to the outbound message metadata with timestamp, e.g: "temp": "{\\"ts\\":1574329385897,\\"value\\":42}"',"use-redis-queue":"Use redis queue for message persistence","trim-redis-queue":"Trim redis queue","redis-queue-max-size":"Redis queue max size","add-metadata-key-values-as-kafka-headers":"Add Message metadata key-value pairs to Kafka record headers","add-metadata-key-values-as-kafka-headers-hint":"If selected, key-value pairs from message metadata will be added to the outgoing records headers as byte arrays with predefined charset encoding.","charset-encoding":"Charset encoding","charset-encoding-required":"Charset encoding is required.","charset-us-ascii":"US-ASCII","charset-iso-8859-1":"ISO-8859-1","charset-utf-8":"UTF-8","charset-utf-16be":"UTF-16BE","charset-utf-16le":"UTF-16LE","charset-utf-16":"UTF-16","select-queue-hint":"The queue name can be selected from a drop-down list or add a custom name.","persist-alarm-rules":"Persist state of alarm rules","fetch-alarm-rules":"Fetch state of alarm rules","input-value-key":"Input value key","input-value-key-required":"Input value key is required.","output-value-key":"Output value key","output-value-key-required":"Output value key is required.",round:"Decimals","round-range":"Decimals should be in a range from 0 to 15.","use-cache":"Use cache for latest value","tell-failure-if-input-value-key-is-absent":"Tell Failure if input value key is absent","tell-failure-if-delta-is-negative":"Tell Failure if delta is negative","add-period-between-msgs":"Add period between messages","period-value-key":"Period value key","period-key-required":"Period value key is required.","general-pattern-hint":'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body'},"key-val":{key:"Key",value:"Value","remove-entry":"Remove entry","add-entry":"Add entry"}}},!0)}(e)}return e.ctorParameters=function(){return[{type:n.TranslateService}]},e=h([t.NgModule({declarations:[x],imports:[r.CommonModule,a.SharedModule],exports:[qe,Pe,Ue,_e,x]}),C("design:paramtypes",[n.TranslateService])],e)}();e.RuleNodeCoreConfigModule=$e,e.ɵa=x,e.ɵb=qe,e.ɵba=ve,e.ɵbb=Fe,e.ɵbc=xe,e.ɵbd=Te,e.ɵbe=ue,e.ɵbf=ae,e.ɵbg=oe,e.ɵbh=ie,e.ɵbi=le,e.ɵbj=se,e.ɵbk=me,e.ɵbl=Pe,e.ɵbm=Se,e.ɵbn=Ie,e.ɵbo=ke,e.ɵbp=Ne,e.ɵbq=Ve,e.ɵbr=Ee,e.ɵbs=Ae,e.ɵbt=Le,e.ɵbu=Ue,e.ɵbv=Me,e.ɵbw=we,e.ɵbx=Re,e.ɵby=De,e.ɵbz=Oe,e.ɵc=T,e.ɵca=Ke,e.ɵcb=Be,e.ɵcc=Ge,e.ɵcd=He,e.ɵce=_e,e.ɵcf=je,e.ɵcg=ze,e.ɵch=Qe,e.ɵd=q,e.ɵe=S,e.ɵf=I,e.ɵg=k,e.ɵh=N,e.ɵi=V,e.ɵj=E,e.ɵk=A,e.ɵl=L,e.ɵm=P,e.ɵn=ee,e.ɵo=te,e.ɵp=re,e.ɵq=ne,e.ɵr=de,e.ɵs=pe,e.ɵt=ce,e.ɵu=fe,e.ɵv=ge,e.ɵw=ye,e.ɵx=be,e.ɵy=he,e.ɵz=Ce,Object.defineProperty(e,"__esModule",{value:!0})})); + ***************************************************************************** */var y=function(e,t){return(y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}y(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function h(e,t,r,n){var a,o=arguments.length,i=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(i=(o<3?a(i):o>3?a(t,r,i):a(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}function C(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create;function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create;var F,x=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.emptyConfigForm},r.prototype.onConfigurationSet=function(e){this.emptyConfigForm=this.fb.group({})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-node-empty-config",template:"
"}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),T=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.attributeScopes=Object.keys(a.AttributeScope),n.telemetryTypeTranslationsMap=a.telemetryTypeTranslations,n}return b(r,e),r.prototype.configForm=function(){return this.attributesConfigForm},r.prototype.onConfigurationSet=function(e){this.attributesConfigForm=this.fb.group({scope:[e?e.scope:null,[i.Validators.required]],notifyDevice:[!e||e.scope,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-attributes-config",template:'
\n \n attribute.attributes-scope\n \n \n {{ telemetryTypeTranslationsMap.get(scope) | translate }}\n \n \n \n
\n \n {{ \'tb.rulenode.notify-device\' | translate }}\n \n
tb.rulenode.notify-device-hint
\n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),q=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.timeseriesConfigForm},r.prototype.onConfigurationSet=function(e){this.timeseriesConfigForm=this.fb.group({defaultTTL:[e?e.defaultTTL:null,[i.Validators.required,i.Validators.min(0)]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-timeseries-config",template:'
\n \n tb.rulenode.default-ttl\n \n \n {{ \'tb.rulenode.default-ttl-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-default-ttl-message\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),S=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.rpcRequestConfigForm},r.prototype.onConfigurationSet=function(e){this.rpcRequestConfigForm=this.fb.group({timeoutInSeconds:[e?e.timeoutInSeconds:null,[i.Validators.required,i.Validators.min(0)]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-rpc-request-config",template:'
\n \n tb.rulenode.timeout-sec\n \n \n {{ \'tb.rulenode.timeout-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-timeout-message\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),I=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.logConfigForm},r.prototype.onConfigurationSet=function(e){this.logConfigForm=this.fb.group({jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.logConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"string",this.translate.instant("tb.rulenode.to-string"),"ToString",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.logConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-action-node-log-config",template:'
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),k=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.assignCustomerConfigForm},r.prototype.onConfigurationSet=function(e){this.assignCustomerConfigForm=this.fb.group({customerNamePattern:[e?e.customerNamePattern:null,[i.Validators.required,i.Validators.pattern(/.*\S.*/)]],createCustomerIfNotExists:[!!e&&e.createCustomerIfNotExists,[]],customerCacheExpiration:[e?e.customerCacheExpiration:null,[i.Validators.required,i.Validators.min(0)]]})},r.prototype.prepareOutputConfig=function(e){return e.customerNamePattern=e.customerNamePattern.trim(),e},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-assign-to-customer-config",template:'
\n \n tb.rulenode.customer-name-pattern\n \n \n {{ \'tb.rulenode.customer-name-pattern-required\' | translate }}\n \n \n \n \n {{ \'tb.rulenode.create-customer-if-not-exists\' | translate }}\n \n \n tb.rulenode.customer-cache-expiration\n \n \n {{ \'tb.rulenode.customer-cache-expiration-required\' | translate }}\n \n \n {{ \'tb.rulenode.customer-cache-expiration-range\' | translate }}\n \n tb.rulenode.customer-cache-expiration-hint\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),N=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.clearAlarmConfigForm},r.prototype.onConfigurationSet=function(e){this.clearAlarmConfigForm=this.fb.group({alarmDetailsBuildJs:[e?e.alarmDetailsBuildJs:null,[i.Validators.required]],alarmType:[e?e.alarmType:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.clearAlarmConfigForm.get("alarmDetailsBuildJs").value;this.nodeScriptTestService.testNodeScript(t,"json",this.translate.instant("tb.rulenode.details"),"Details",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.clearAlarmConfigForm.get("alarmDetailsBuildJs").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-action-node-clear-alarm-config",template:'
\n \n \n \n
\n \n
\n \n tb.rulenode.alarm-type\n \n \n {{ \'tb.rulenode.alarm-type-required\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),V=function(e){function r(t,r,n,o){var i=e.call(this,t)||this;return i.store=t,i.fb=r,i.nodeScriptTestService=n,i.translate=o,i.alarmSeverities=Object.keys(a.AlarmSeverity),i.alarmSeverityTranslationMap=a.alarmSeverityTranslations,i.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],i}return b(r,e),r.prototype.configForm=function(){return this.createAlarmConfigForm},r.prototype.onConfigurationSet=function(e){this.createAlarmConfigForm=this.fb.group({alarmDetailsBuildJs:[e?e.alarmDetailsBuildJs:null,[i.Validators.required]],useMessageAlarmData:[!!e&&e.useMessageAlarmData,[]],alarmType:[e?e.alarmType:null,[]],severity:[e?e.severity:null,[]],propagate:[!!e&&e.propagate,[]],relationTypes:[e?e.relationTypes:null,[]]})},r.prototype.validatorTriggers=function(){return["useMessageAlarmData"]},r.prototype.updateValidators=function(e){this.createAlarmConfigForm.get("useMessageAlarmData").value?(this.createAlarmConfigForm.get("alarmType").setValidators([]),this.createAlarmConfigForm.get("severity").setValidators([])):(this.createAlarmConfigForm.get("alarmType").setValidators([i.Validators.required]),this.createAlarmConfigForm.get("severity").setValidators([i.Validators.required])),this.createAlarmConfigForm.get("alarmType").updateValueAndValidity({emitEvent:e}),this.createAlarmConfigForm.get("severity").updateValueAndValidity({emitEvent:e})},r.prototype.testScript=function(){var e=this,t=this.createAlarmConfigForm.get("alarmDetailsBuildJs").value;this.nodeScriptTestService.testNodeScript(t,"json",this.translate.instant("tb.rulenode.details"),"Details",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.createAlarmConfigForm.get("alarmDetailsBuildJs").setValue(t)}))},r.prototype.removeKey=function(e,t){var r=this.createAlarmConfigForm.get(t).value,n=r.indexOf(e);n>=0&&(r.splice(n,1),this.createAlarmConfigForm.get(t).setValue(r,{emitEvent:!0}))},r.prototype.addKey=function(e,t){var r=e.input,n=e.value;if((n||"").trim()){n=n.trim();var a=this.createAlarmConfigForm.get(t).value;a&&-1!==a.indexOf(n)||(a||(a=[]),a.push(n),this.createAlarmConfigForm.get(t).setValue(a,{emitEvent:!0}))}r&&(r.value="")},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-action-node-create-alarm-config",template:'
\n \n \n \n
\n \n
\n \n {{ \'tb.rulenode.use-message-alarm-data\' | translate }}\n \n
\n
\n \n tb.rulenode.alarm-type\n \n \n {{ \'tb.rulenode.alarm-type-required\' | translate }}\n \n \n \n \n tb.rulenode.alarm-severity\n \n \n {{ alarmSeverityTranslationMap.get(severity) | translate }}\n \n \n \n {{ \'tb.rulenode.alarm-severity-required\' | translate }}\n \n \n
\n \n {{ \'tb.rulenode.propagate\' | translate }}\n \n
\n \n tb.rulenode.relation-types-list\n \n \n {{key}}\n close\n \n \n \n tb.rulenode.relation-types-list-hint\n \n
\n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),E=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.directionTypes=Object.keys(a.EntitySearchDirection),n.directionTypeTranslations=a.entitySearchDirectionTranslations,n.entityType=a.EntityType,n}return b(r,e),r.prototype.configForm=function(){return this.createRelationConfigForm},r.prototype.onConfigurationSet=function(e){this.createRelationConfigForm=this.fb.group({direction:[e?e.direction:null,[i.Validators.required]],entityType:[e?e.entityType:null,[i.Validators.required]],entityNamePattern:[e?e.entityNamePattern:null,[]],entityTypePattern:[e?e.entityTypePattern:null,[]],relationType:[e?e.relationType:null,[i.Validators.required]],createEntityIfNotExists:[!!e&&e.createEntityIfNotExists,[]],removeCurrentRelations:[!!e&&e.removeCurrentRelations,[]],changeOriginatorToRelatedEntity:[!!e&&e.changeOriginatorToRelatedEntity,[]],entityCacheExpiration:[e?e.entityCacheExpiration:null,[i.Validators.required,i.Validators.min(0)]]})},r.prototype.validatorTriggers=function(){return["entityType"]},r.prototype.updateValidators=function(e){var t=this.createRelationConfigForm.get("entityType").value;t?this.createRelationConfigForm.get("entityNamePattern").setValidators([i.Validators.required,i.Validators.pattern(/.*\S.*/)]):this.createRelationConfigForm.get("entityNamePattern").setValidators([]),!t||t!==a.EntityType.DEVICE&&t!==a.EntityType.ASSET?this.createRelationConfigForm.get("entityTypePattern").setValidators([]):this.createRelationConfigForm.get("entityTypePattern").setValidators([i.Validators.required,i.Validators.pattern(/.*\S.*/)]),this.createRelationConfigForm.get("entityNamePattern").updateValueAndValidity({emitEvent:e}),this.createRelationConfigForm.get("entityTypePattern").updateValueAndValidity({emitEvent:e})},r.prototype.prepareOutputConfig=function(e){return e.entityNamePattern=e.entityNamePattern?e.entityNamePattern.trim():null,e.entityTypePattern=e.entityTypePattern?e.entityTypePattern.trim():null,e},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-create-relation-config",template:'
\n \n relation.direction\n \n \n {{ directionTypeTranslations.get(type) | translate }}\n \n \n \n
\n \n \n \n tb.rulenode.entity-name-pattern\n \n \n {{ \'tb.rulenode.entity-name-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.entity-type-pattern\n \n \n {{ \'tb.rulenode.entity-type-pattern-required\' | translate }}\n \n \n \n
\n \n tb.rulenode.relation-type-pattern\n \n \n {{ \'tb.rulenode.relation-type-pattern-required\' | translate }}\n \n \n \n
\n \n {{ \'tb.rulenode.create-entity-if-not-exists\' | translate }}\n \n
tb.rulenode.create-entity-if-not-exists-hint
\n
\n \n {{ \'tb.rulenode.remove-current-relations\' | translate }}\n \n
tb.rulenode.remove-current-relations-hint
\n \n {{ \'tb.rulenode.change-originator-to-related-entity\' | translate }}\n \n
tb.rulenode.change-originator-to-related-entity-hint
\n \n tb.rulenode.entity-cache-expiration\n \n \n {{ \'tb.rulenode.entity-cache-expiration-required\' | translate }}\n \n \n {{ \'tb.rulenode.entity-cache-expiration-range\' | translate }}\n \n tb.rulenode.entity-cache-expiration-hint\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),A=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.msgDelayConfigForm},r.prototype.onConfigurationSet=function(e){this.msgDelayConfigForm=this.fb.group({useMetadataPeriodInSecondsPatterns:[!!e&&e.useMetadataPeriodInSecondsPatterns,[]],periodInSeconds:[e?e.periodInSeconds:null,[]],periodInSecondsPattern:[e?e.periodInSecondsPattern:null,[]],maxPendingMsgs:[e?e.maxPendingMsgs:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(1e5)]]})},r.prototype.validatorTriggers=function(){return["useMetadataPeriodInSecondsPatterns"]},r.prototype.updateValidators=function(e){this.msgDelayConfigForm.get("useMetadataPeriodInSecondsPatterns").value?(this.msgDelayConfigForm.get("periodInSecondsPattern").setValidators([i.Validators.required]),this.msgDelayConfigForm.get("periodInSeconds").setValidators([])):(this.msgDelayConfigForm.get("periodInSecondsPattern").setValidators([]),this.msgDelayConfigForm.get("periodInSeconds").setValidators([i.Validators.required,i.Validators.min(0)])),this.msgDelayConfigForm.get("periodInSecondsPattern").updateValueAndValidity({emitEvent:e}),this.msgDelayConfigForm.get("periodInSeconds").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-msg-delay-config",template:'
\n \n {{ \'tb.rulenode.use-metadata-period-in-seconds-patterns\' | translate }}\n \n
tb.rulenode.use-metadata-period-in-seconds-patterns-hint
\n \n tb.rulenode.period-seconds\n \n \n {{ \'tb.rulenode.period-seconds-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-period-0-seconds-message\' | translate }}\n \n \n \n \n tb.rulenode.period-in-seconds-pattern\n \n \n {{ \'tb.rulenode.period-in-seconds-pattern-required\' | translate }}\n \n \n \n \n \n tb.rulenode.max-pending-messages\n \n \n {{ \'tb.rulenode.max-pending-messages-required\' | translate }}\n \n \n {{ \'tb.rulenode.max-pending-messages-range\' | translate }}\n \n \n {{ \'tb.rulenode.max-pending-messages-range\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),L=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.directionTypes=Object.keys(a.EntitySearchDirection),n.directionTypeTranslations=a.entitySearchDirectionTranslations,n.entityType=a.EntityType,n}return b(r,e),r.prototype.configForm=function(){return this.deleteRelationConfigForm},r.prototype.onConfigurationSet=function(e){this.deleteRelationConfigForm=this.fb.group({deleteForSingleEntity:[!!e&&e.deleteForSingleEntity,[]],direction:[e?e.direction:null,[i.Validators.required]],entityType:[e?e.entityType:null,[]],entityNamePattern:[e?e.entityNamePattern:null,[]],relationType:[e?e.relationType:null,[i.Validators.required]],entityCacheExpiration:[e?e.entityCacheExpiration:null,[i.Validators.required,i.Validators.min(0)]]})},r.prototype.validatorTriggers=function(){return["deleteForSingleEntity","entityType"]},r.prototype.updateValidators=function(e){var t=this.deleteRelationConfigForm.get("deleteForSingleEntity").value,r=this.deleteRelationConfigForm.get("entityType").value;t?this.deleteRelationConfigForm.get("entityType").setValidators([i.Validators.required]):this.deleteRelationConfigForm.get("entityType").setValidators([]),t&&r?this.deleteRelationConfigForm.get("entityNamePattern").setValidators([i.Validators.required,i.Validators.pattern(/.*\S.*/)]):this.deleteRelationConfigForm.get("entityNamePattern").setValidators([]),this.deleteRelationConfigForm.get("entityType").updateValueAndValidity({emitEvent:!1}),this.deleteRelationConfigForm.get("entityNamePattern").updateValueAndValidity({emitEvent:e})},r.prototype.prepareOutputConfig=function(e){return e.entityNamePattern=e.entityNamePattern?e.entityNamePattern.trim():null,e},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-delete-relation-config",template:'
\n \n {{ \'tb.rulenode.delete-relation-to-specific-entity\' | translate }}\n \n
tb.rulenode.delete-relation-hint
\n \n relation.direction\n \n \n {{ directionTypeTranslations.get(type) | translate }}\n \n \n \n
\n \n \n \n tb.rulenode.entity-name-pattern\n \n \n {{ \'tb.rulenode.entity-name-pattern-required\' | translate }}\n \n \n \n
\n \n tb.rulenode.relation-type-pattern\n \n \n {{ \'tb.rulenode.relation-type-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.entity-cache-expiration\n \n \n {{ \'tb.rulenode.entity-cache-expiration-required\' | translate }}\n \n \n {{ \'tb.rulenode.entity-cache-expiration-range\' | translate }}\n \n tb.rulenode.entity-cache-expiration-hint\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),P=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.generatorConfigForm},r.prototype.onConfigurationSet=function(e){this.generatorConfigForm=this.fb.group({msgCount:[e?e.msgCount:null,[i.Validators.required,i.Validators.min(0)]],periodInSeconds:[e?e.periodInSeconds:null,[i.Validators.required,i.Validators.min(1)]],originator:[e?e.originator:null,[]],jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.prepareInputConfig=function(e){return e&&(e.originatorId&&e.originatorType?e.originator={id:e.originatorId,entityType:e.originatorType}:e.originator=null,delete e.originatorId,delete e.originatorType),e},r.prototype.prepareOutputConfig=function(e){return e.originator?(e.originatorId=e.originator.id,e.originatorType=e.originator.entityType):(e.originatorId=null,e.originatorType=null),delete e.originator,e},r.prototype.testScript=function(){var e=this,t=this.generatorConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"generate",this.translate.instant("tb.rulenode.generator"),"Generate",["prevMsg","prevMetadata","prevMsgType"],this.ruleNodeId).subscribe((function(t){t&&e.generatorConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-action-node-generator-config",template:'
\n \n tb.rulenode.message-count\n \n \n {{ \'tb.rulenode.message-count-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-message-count-message\' | translate }}\n \n \n \n tb.rulenode.period-seconds\n \n \n {{ \'tb.rulenode.period-seconds-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-period-seconds-message\' | translate }}\n \n \n
\n \n \n \n
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent);!function(e){e.CUSTOMER="CUSTOMER",e.TENANT="TENANT",e.RELATED="RELATED",e.ALARM_ORIGINATOR="ALARM_ORIGINATOR"}(F||(F={}));var M,w=new Map([[F.CUSTOMER,"tb.rulenode.originator-customer"],[F.TENANT,"tb.rulenode.originator-tenant"],[F.RELATED,"tb.rulenode.originator-related"],[F.ALARM_ORIGINATOR,"tb.rulenode.originator-alarm-originator"]]);!function(e){e.CIRCLE="CIRCLE",e.POLYGON="POLYGON"}(M||(M={}));var R,D=new Map([[M.CIRCLE,"tb.rulenode.perimeter-circle"],[M.POLYGON,"tb.rulenode.perimeter-polygon"]]);!function(e){e.MILLISECONDS="MILLISECONDS",e.SECONDS="SECONDS",e.MINUTES="MINUTES",e.HOURS="HOURS",e.DAYS="DAYS"}(R||(R={}));var O,K=new Map([[R.MILLISECONDS,"tb.rulenode.time-unit-milliseconds"],[R.SECONDS,"tb.rulenode.time-unit-seconds"],[R.MINUTES,"tb.rulenode.time-unit-minutes"],[R.HOURS,"tb.rulenode.time-unit-hours"],[R.DAYS,"tb.rulenode.time-unit-days"]]);!function(e){e.METER="METER",e.KILOMETER="KILOMETER",e.FOOT="FOOT",e.MILE="MILE",e.NAUTICAL_MILE="NAUTICAL_MILE"}(O||(O={}));var B,G=new Map([[O.METER,"tb.rulenode.range-unit-meter"],[O.KILOMETER,"tb.rulenode.range-unit-kilometer"],[O.FOOT,"tb.rulenode.range-unit-foot"],[O.MILE,"tb.rulenode.range-unit-mile"],[O.NAUTICAL_MILE,"tb.rulenode.range-unit-nautical-mile"]]);!function(e){e.TITLE="TITLE",e.COUNTRY="COUNTRY",e.STATE="STATE",e.ZIP="ZIP",e.ADDRESS="ADDRESS",e.ADDRESS2="ADDRESS2",e.PHONE="PHONE",e.EMAIL="EMAIL",e.ADDITIONAL_INFO="ADDITIONAL_INFO"}(B||(B={}));var H,U,j,z=new Map([[B.TITLE,"tb.rulenode.entity-details-title"],[B.COUNTRY,"tb.rulenode.entity-details-country"],[B.STATE,"tb.rulenode.entity-details-state"],[B.ZIP,"tb.rulenode.entity-details-zip"],[B.ADDRESS,"tb.rulenode.entity-details-address"],[B.ADDRESS2,"tb.rulenode.entity-details-address2"],[B.PHONE,"tb.rulenode.entity-details-phone"],[B.EMAIL,"tb.rulenode.entity-details-email"],[B.ADDITIONAL_INFO,"tb.rulenode.entity-details-additional_info"]]);!function(e){e.FIRST="FIRST",e.LAST="LAST",e.ALL="ALL"}(H||(H={})),function(e){e.ASC="ASC",e.DESC="DESC"}(U||(U={})),function(e){e.STANDARD="STANDARD",e.FIFO="FIFO"}(j||(j={}));var Q,_=new Map([[j.STANDARD,"tb.rulenode.sqs-queue-standard"],[j.FIFO,"tb.rulenode.sqs-queue-fifo"]]),$=["anonymous","basic","cert.PEM"],W=new Map([["anonymous","tb.rulenode.credentials-anonymous"],["basic","tb.rulenode.credentials-basic"],["cert.PEM","tb.rulenode.credentials-pem"]]),J=["sas","cert.PEM"],Y=new Map([["sas","tb.rulenode.credentials-sas"],["cert.PEM","tb.rulenode.credentials-pem"]]);!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE"}(Q||(Q={}));var Z=["US-ASCII","ISO-8859-1","UTF-8","UTF-16BE","UTF-16LE","UTF-16"],X=new Map([["US-ASCII","tb.rulenode.charset-us-ascii"],["ISO-8859-1","tb.rulenode.charset-iso-8859-1"],["UTF-8","tb.rulenode.charset-utf-8"],["UTF-16BE","tb.rulenode.charset-utf-16be"],["UTF-16LE","tb.rulenode.charset-utf-16le"],["UTF-16","tb.rulenode.charset-utf-16"]]),ee=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.perimeterType=M,n.perimeterTypes=Object.keys(M),n.perimeterTypeTranslationMap=D,n.rangeUnits=Object.keys(O),n.rangeUnitTranslationMap=G,n.timeUnits=Object.keys(R),n.timeUnitsTranslationMap=K,n}return b(r,e),r.prototype.configForm=function(){return this.geoActionConfigForm},r.prototype.onConfigurationSet=function(e){this.geoActionConfigForm=this.fb.group({latitudeKeyName:[e?e.latitudeKeyName:null,[i.Validators.required]],longitudeKeyName:[e?e.longitudeKeyName:null,[i.Validators.required]],fetchPerimeterInfoFromMessageMetadata:[!!e&&e.fetchPerimeterInfoFromMessageMetadata,[]],perimeterType:[e?e.perimeterType:null,[]],centerLatitude:[e?e.centerLatitude:null,[]],centerLongitude:[e?e.centerLatitude:null,[]],range:[e?e.range:null,[]],rangeUnit:[e?e.rangeUnit:null,[]],polygonsDefinition:[e?e.polygonsDefinition:null,[]],minInsideDuration:[e?e.minInsideDuration:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(2147483647)]],minInsideDurationTimeUnit:[e?e.minInsideDurationTimeUnit:null,[i.Validators.required]],minOutsideDuration:[e?e.minOutsideDuration:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(2147483647)]],minOutsideDurationTimeUnit:[e?e.minOutsideDurationTimeUnit:null,[i.Validators.required]]})},r.prototype.validatorTriggers=function(){return["fetchPerimeterInfoFromMessageMetadata","perimeterType"]},r.prototype.updateValidators=function(e){var t=this.geoActionConfigForm.get("fetchPerimeterInfoFromMessageMetadata").value,r=this.geoActionConfigForm.get("perimeterType").value;t?this.geoActionConfigForm.get("perimeterType").setValidators([]):this.geoActionConfigForm.get("perimeterType").setValidators([i.Validators.required]),t||r!==M.CIRCLE?(this.geoActionConfigForm.get("centerLatitude").setValidators([]),this.geoActionConfigForm.get("centerLongitude").setValidators([]),this.geoActionConfigForm.get("range").setValidators([]),this.geoActionConfigForm.get("rangeUnit").setValidators([])):(this.geoActionConfigForm.get("centerLatitude").setValidators([i.Validators.required,i.Validators.min(-90),i.Validators.max(90)]),this.geoActionConfigForm.get("centerLongitude").setValidators([i.Validators.required,i.Validators.min(-180),i.Validators.max(180)]),this.geoActionConfigForm.get("range").setValidators([i.Validators.required,i.Validators.min(0)]),this.geoActionConfigForm.get("rangeUnit").setValidators([i.Validators.required])),t||r!==M.POLYGON?this.geoActionConfigForm.get("polygonsDefinition").setValidators([]):this.geoActionConfigForm.get("polygonsDefinition").setValidators([i.Validators.required]),this.geoActionConfigForm.get("perimeterType").updateValueAndValidity({emitEvent:!1}),this.geoActionConfigForm.get("centerLatitude").updateValueAndValidity({emitEvent:e}),this.geoActionConfigForm.get("centerLongitude").updateValueAndValidity({emitEvent:e}),this.geoActionConfigForm.get("range").updateValueAndValidity({emitEvent:e}),this.geoActionConfigForm.get("rangeUnit").updateValueAndValidity({emitEvent:e}),this.geoActionConfigForm.get("polygonsDefinition").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-gps-geofencing-config",template:'
\n \n tb.rulenode.latitude-key-name\n \n \n {{ \'tb.rulenode.latitude-key-name-required\' | translate }}\n \n \n \n tb.rulenode.longitude-key-name\n \n \n {{ \'tb.rulenode.longitude-key-name-required\' | translate }}\n \n \n \n {{ \'tb.rulenode.fetch-perimeter-info-from-message-metadata\' | translate }}\n \n
\n \n tb.rulenode.perimeter-type\n \n \n {{ perimeterTypeTranslationMap.get(type) | translate }}\n \n \n \n
\n
\n
\n \n tb.rulenode.circle-center-latitude\n \n \n {{ \'tb.rulenode.circle-center-latitude-required\' | translate }}\n \n \n \n tb.rulenode.circle-center-longitude\n \n \n {{ \'tb.rulenode.circle-center-longitude-required\' | translate }}\n \n \n
\n
\n \n tb.rulenode.range\n \n \n {{ \'tb.rulenode.range-required\' | translate }}\n \n \n \n tb.rulenode.range-units\n \n \n {{ rangeUnitTranslationMap.get(type) | translate }}\n \n \n \n
\n
\n
\n \n tb.rulenode.polygon-definition\n \n \n {{ \'tb.rulenode.polygon-definition-required\' | translate }}\n \n \n
\n
\n \n tb.rulenode.min-inside-duration\n \n \n {{ \'tb.rulenode.min-inside-duration-value-required\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n \n tb.rulenode.min-inside-duration-time-unit\n \n \n {{ timeUnitsTranslationMap.get(timeUnit) | translate }}\n \n \n \n
\n
\n \n tb.rulenode.min-outside-duration\n \n \n {{ \'tb.rulenode.min-outside-duration-value-required\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n \n tb.rulenode.min-outside-duration-time-unit\n \n \n {{ timeUnitsTranslationMap.get(timeUnit) | translate }}\n \n \n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),te=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.msgCountConfigForm},r.prototype.onConfigurationSet=function(e){this.msgCountConfigForm=this.fb.group({interval:[e?e.interval:null,[i.Validators.required,i.Validators.min(1)]],telemetryPrefix:[e?e.telemetryPrefix:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-msg-count-config",template:'
\n \n tb.rulenode.interval-seconds\n \n \n {{ \'tb.rulenode.interval-seconds-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-interval-seconds-message\' | translate }}\n \n \n \n tb.rulenode.output-timeseries-key-prefix\n \n \n {{ \'tb.rulenode.output-timeseries-key-prefix-required\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),re=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.rpcReplyConfigForm},r.prototype.onConfigurationSet=function(e){this.rpcReplyConfigForm=this.fb.group({requestIdMetaDataAttribute:[e?e.requestIdMetaDataAttribute:null,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-rpc-reply-config",template:'
\n \n tb.rulenode.request-id-metadata-attribute\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ne=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.saveToCustomTableConfigForm},r.prototype.onConfigurationSet=function(e){this.saveToCustomTableConfigForm=this.fb.group({tableName:[e?e.tableName:null,[i.Validators.required,i.Validators.pattern(/.*\S.*/)]],fieldsMapping:[e?e.fieldsMapping:null,[i.Validators.required]]})},r.prototype.prepareOutputConfig=function(e){return e.tableName=e.tableName.trim(),e},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-custom-table-config",template:'
\n \n tb.rulenode.custom-table-name\n \n \n {{ \'tb.rulenode.custom-table-name-required\' | translate }}\n \n tb.rulenode.custom-table-hint\n \n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ae=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.translate=r,o.injector=n,o.fb=a,o.propagateChange=null,o.valueChangeSubscription=null,o}var a;return b(r,e),a=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.ngOnInit=function(){this.ngControl=this.injector.get(i.NgControl),null!=this.ngControl&&(this.ngControl.valueAccessor=this),this.kvListFormGroup=this.fb.group({}),this.kvListFormGroup.addControl("keyVals",this.fb.array([]))},r.prototype.keyValsFormArray=function(){return this.kvListFormGroup.get("keyVals")},r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.setDisabledState=function(e){this.disabled=e,this.disabled?this.kvListFormGroup.disable({emitEvent:!1}):this.kvListFormGroup.enable({emitEvent:!1})},r.prototype.writeValue=function(e){var t,r,n=this;this.valueChangeSubscription&&this.valueChangeSubscription.unsubscribe();var a=[];if(e)try{for(var o=v(Object.keys(e)),l=o.next();!l.done;l=o.next()){var s=l.value;Object.prototype.hasOwnProperty.call(e,s)&&a.push(this.fb.group({key:[s,[i.Validators.required]],value:[e[s],[i.Validators.required]]}))}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}this.kvListFormGroup.setControl("keyVals",this.fb.array(a)),this.valueChangeSubscription=this.kvListFormGroup.valueChanges.subscribe((function(){n.updateModel()}))},r.prototype.removeKeyVal=function(e){this.kvListFormGroup.get("keyVals").removeAt(e)},r.prototype.addKeyVal=function(){this.kvListFormGroup.get("keyVals").push(this.fb.group({key:["",[i.Validators.required]],value:["",[i.Validators.required]]}))},r.prototype.validate=function(e){return!this.kvListFormGroup.get("keyVals").value.length&&this.required?{kvMapRequired:!0}:this.kvListFormGroup.valid?null:{kvFieldsRequired:!0}},r.prototype.updateModel=function(){var e=this.kvListFormGroup.get("keyVals").value;if(this.required&&!e.length||!this.kvListFormGroup.valid)this.propagateChange(null);else{var t={};e.forEach((function(e){t[e.key]=e.value})),this.propagateChange(t)}},r.ctorParameters=function(){return[{type:o.Store},{type:n.TranslateService},{type:t.Injector},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean)],r.prototype,"disabled",void 0),h([t.Input(),C("design:type",String)],r.prototype,"requiredText",void 0),h([t.Input(),C("design:type",String)],r.prototype,"keyText",void 0),h([t.Input(),C("design:type",String)],r.prototype,"keyRequiredText",void 0),h([t.Input(),C("design:type",String)],r.prototype,"valText",void 0),h([t.Input(),C("design:type",String)],r.prototype,"valRequiredText",void 0),h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),r=a=h([t.Component({selector:"tb-kv-map-config",template:'
\n
\n {{ keyText | translate }}\n {{ valText | translate }}\n \n
\n
\n
\n \n \n \n \n {{ keyRequiredText | translate }}\n \n \n \n \n \n \n {{ valRequiredText | translate }}\n \n \n \n
\n
\n \n
\n \n
\n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return a})),multi:!0},{provide:i.NG_VALIDATORS,useExisting:t.forwardRef((function(){return a})),multi:!0}],styles:[":host .tb-kv-map-config{margin-bottom:16px}:host .tb-kv-map-config .header{padding-left:5px;padding-right:5px;padding-bottom:5px}:host .tb-kv-map-config .header .cell{padding-left:5px;padding-right:5px;color:rgba(0,0,0,.54);font-size:12px;font-weight:700;white-space:nowrap}:host .tb-kv-map-config .body{padding-left:5px;padding-right:5px;padding-bottom:20px;max-height:300px;overflow:auto}:host .tb-kv-map-config .body .row{padding-top:5px;max-height:40px}:host .tb-kv-map-config .body .cell{padding-left:5px;padding-right:5px}:host ::ng-deep .tb-kv-map-config .body mat-form-field.cell{margin:0;max-height:40px}:host ::ng-deep .tb-kv-map-config .body mat-form-field.cell .mat-form-field-infix{border-top:0}:host ::ng-deep .tb-kv-map-config .body button.mat-button{margin:0}"]}),C("design:paramtypes",[o.Store,n.TranslateService,t.Injector,i.FormBuilder])],r)}(a.PageComponent),oe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.directionTypes=Object.keys(a.EntitySearchDirection),n.directionTypeTranslations=a.entitySearchDirectionTranslations,n.entityType=a.EntityType,n.propagateChange=null,n}var n;return b(r,e),n=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.ngOnInit=function(){var e=this;this.deviceRelationsQueryFormGroup=this.fb.group({fetchLastLevelOnly:[!1,[]],direction:[null,[i.Validators.required]],maxLevel:[null,[]],relationType:[null],deviceTypes:[null,[i.Validators.required]]}),this.deviceRelationsQueryFormGroup.valueChanges.subscribe((function(t){e.deviceRelationsQueryFormGroup.valid?e.propagateChange(t):e.propagateChange(null)}))},r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.setDisabledState=function(e){this.disabled=e,this.disabled?this.deviceRelationsQueryFormGroup.disable({emitEvent:!1}):this.deviceRelationsQueryFormGroup.enable({emitEvent:!1})},r.prototype.writeValue=function(e){this.deviceRelationsQueryFormGroup.reset(e,{emitEvent:!1})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean)],r.prototype,"disabled",void 0),h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),r=n=h([t.Component({selector:"tb-device-relations-query-config",template:'
\n \n {{ \'alias.last-level-relation\' | translate }}\n \n
\n \n relation.direction\n \n \n {{ directionTypeTranslations.get(type) | translate }}\n \n \n \n \n tb.rulenode.max-relation-level\n \n \n
\n
relation.relation-type
\n \n \n
device.device-types
\n \n \n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return n})),multi:!0}]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.PageComponent),ie=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.directionTypes=Object.keys(a.EntitySearchDirection),n.directionTypeTranslations=a.entitySearchDirectionTranslations,n.propagateChange=null,n}var n;return b(r,e),n=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.ngOnInit=function(){var e=this;this.relationsQueryFormGroup=this.fb.group({fetchLastLevelOnly:[!1,[]],direction:[null,[i.Validators.required]],maxLevel:[null,[]],filters:[null]}),this.relationsQueryFormGroup.valueChanges.subscribe((function(t){e.relationsQueryFormGroup.valid?e.propagateChange(t):e.propagateChange(null)}))},r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.setDisabledState=function(e){this.disabled=e,this.disabled?this.relationsQueryFormGroup.disable({emitEvent:!1}):this.relationsQueryFormGroup.enable({emitEvent:!1})},r.prototype.writeValue=function(e){this.relationsQueryFormGroup.reset(e||{},{emitEvent:!1})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean)],r.prototype,"disabled",void 0),h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),r=n=h([t.Component({selector:"tb-relations-query-config",template:'
\n \n {{ \'alias.last-level-relation\' | translate }}\n \n
\n \n relation.direction\n \n \n {{ directionTypeTranslations.get(type) | translate }}\n \n \n \n \n tb.rulenode.max-relation-level\n \n \n
\n
relation.relation-filters
\n \n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return n})),multi:!0}]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.PageComponent),le=function(e){function r(t,r,n,o){var i,l,s=e.call(this,t)||this;s.store=t,s.translate=r,s.truncate=n,s.fb=o,s.placeholder="tb.rulenode.message-type",s.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],s.messageTypes=[],s.messageTypesList=[],s.searchText="",s.propagateChange=function(e){},s.messageTypeConfigForm=s.fb.group({messageType:[null]});try{for(var u=v(Object.keys(a.MessageType)),d=u.next();!d.done;d=u.next()){var p=d.value;s.messageTypesList.push({name:a.messageTypeNames.get(a.MessageType[p]),value:p})}}catch(e){i={error:e}}finally{try{d&&!d.done&&(l=u.return)&&l.call(u)}finally{if(i)throw i.error}}return s}var l;return b(r,e),l=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.ngOnInit=function(){var e=this;this.filteredMessageTypes=this.messageTypeConfigForm.get("messageType").valueChanges.pipe(f.startWith(""),f.map((function(e){return e||""})),f.mergeMap((function(t){return e.fetchMessageTypes(t)})),f.share())},r.prototype.ngAfterViewInit=function(){},r.prototype.setDisabledState=function(e){this.disabled=e,this.disabled?this.messageTypeConfigForm.disable({emitEvent:!1}):this.messageTypeConfigForm.enable({emitEvent:!1})},r.prototype.writeValue=function(e){var t=this;this.searchText="",this.messageTypes.length=0,e&&e.forEach((function(e){var r=t.messageTypesList.find((function(t){return t.value===e}));r?t.messageTypes.push({name:r.name,value:r.value}):t.messageTypes.push({name:e,value:e})}))},r.prototype.displayMessageTypeFn=function(e){return e?e.name:void 0},r.prototype.textIsNotEmpty=function(e){return!!(e&&null!=e&&e.length>0)},r.prototype.createMessageType=function(e,t){e.preventDefault(),this.transformMessageType(t)},r.prototype.add=function(e){this.transformMessageType(e.value)},r.prototype.fetchMessageTypes=function(e){if(this.searchText=e,this.searchText&&this.searchText.length){var t=this.searchText.toUpperCase();return c.of(this.messageTypesList.filter((function(e){return e.name.toUpperCase().includes(t)})))}return c.of(this.messageTypesList)},r.prototype.transformMessageType=function(e){if((e||"").trim()){var t=null,r=e.trim(),n=this.messageTypesList.find((function(e){return e.name===r}));(t=n?{name:n.name,value:n.value}:{name:r,value:r})&&this.addMessageType(t)}this.clear("")},r.prototype.remove=function(e){var t=this.messageTypes.indexOf(e);t>=0&&(this.messageTypes.splice(t,1),this.updateModel())},r.prototype.selected=function(e){this.addMessageType(e.option.value),this.clear("")},r.prototype.addMessageType=function(e){-1===this.messageTypes.findIndex((function(t){return t.value===e.value}))&&(this.messageTypes.push(e),this.updateModel())},r.prototype.onFocus=function(){this.messageTypeConfigForm.get("messageType").updateValueAndValidity({onlySelf:!0,emitEvent:!0})},r.prototype.clear=function(e){var t=this;void 0===e&&(e=""),this.messageTypeInput.nativeElement.value=e,this.messageTypeConfigForm.get("messageType").patchValue(null,{emitEvent:!0}),setTimeout((function(){t.messageTypeInput.nativeElement.blur(),t.messageTypeInput.nativeElement.focus()}),0)},r.prototype.updateModel=function(){var e=this.messageTypes.map((function(e){return e.value}));this.required?(this.chipList.errorState=!e.length,this.propagateChange(e.length>0?e:null)):(this.chipList.errorState=!1,this.propagateChange(e))},r.ctorParameters=function(){return[{type:o.Store},{type:n.TranslateService},{type:a.TruncatePipe},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),h([t.Input(),C("design:type",String)],r.prototype,"label",void 0),h([t.Input(),C("design:type",Object)],r.prototype,"placeholder",void 0),h([t.Input(),C("design:type",Boolean)],r.prototype,"disabled",void 0),h([t.ViewChild("chipList",{static:!1}),C("design:type",d.MatChipList)],r.prototype,"chipList",void 0),h([t.ViewChild("messageTypeAutocomplete",{static:!1}),C("design:type",p.MatAutocomplete)],r.prototype,"matAutocomplete",void 0),h([t.ViewChild("messageTypeInput",{static:!1}),C("design:type",t.ElementRef)],r.prototype,"messageTypeInput",void 0),r=l=h([t.Component({selector:"tb-message-types-config",template:'\n {{ label }}\n \n \n {{messageType.name}}\n close\n \n \n \n \n \n \n \n \n
\n
\n tb.rulenode.no-message-types-found\n
\n \n \n {{ translate.get(\'tb.rulenode.no-message-type-matching\',\n {messageType: truncate.transform(searchText, true, 6, '...')}) | async }}\n \n \n \n tb.rulenode.create-new-message-type\n \n
\n
\n
\n \n {{ \'tb.rulenode.message-types-required\' | translate }}\n \n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return l})),multi:!0}]}),C("design:paramtypes",[o.Store,n.TranslateService,a.TruncatePipe,i.FormBuilder])],r)}(a.PageComponent),se=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.subscriptions=[],n.disableCertPemCredentials=!1,n.allCredentialsTypes=$,n.credentialsTypeTranslationsMap=W,n.propagateChange=null,n}var n;return b(r,e),n=r,Object.defineProperty(r.prototype,"required",{get:function(){return this.requiredValue},set:function(e){this.requiredValue=u.coerceBooleanProperty(e)},enumerable:!0,configurable:!0}),r.prototype.ngOnInit=function(){var e=this;this.credentialsConfigFormGroup=this.fb.group({type:[null,[i.Validators.required]],username:[null,[]],password:[null,[]],caCert:[null,[]],caCertFileName:[null,[]],privateKey:[null,[]],privateKeyFileName:[null,[]],cert:[null,[]],certFileName:[null,[]]}),this.subscriptions.push(this.credentialsConfigFormGroup.valueChanges.pipe(f.distinctUntilChanged()).subscribe((function(){e.updateView()}))),this.subscriptions.push(this.credentialsConfigFormGroup.get("type").valueChanges.subscribe((function(){e.credentialsTypeChanged()})))},r.prototype.ngOnChanges=function(e){var t,r,n=this;try{for(var a=v(Object.keys(e)),o=a.next();!o.done;o=a.next()){var i=o.value,l=e[i];if(!l.firstChange&&l.currentValue!==l.previousValue)if(l.currentValue&&"disableCertPemCredentials"===i)"cert.PEM"===this.credentialsConfigFormGroup.get("type").value&&setTimeout((function(){n.credentialsConfigFormGroup.get("type").patchValue("anonymous",{emitEvent:!0})}))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}},r.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(e){return e.unsubscribe()}))},r.prototype.writeValue=function(e){s.isDefinedAndNotNull(e)&&(this.credentialsConfigFormGroup.reset(e,{emitEvent:!1}),this.updateValidators(!1))},r.prototype.setDisabledState=function(e){e?this.credentialsConfigFormGroup.disable():(this.credentialsConfigFormGroup.enable(),this.updateValidators())},r.prototype.updateView=function(){var e=this.credentialsConfigFormGroup.value,t=e.type;switch(t){case"anonymous":e={type:t};break;case"basic":e={type:t,username:e.username,password:e.password};break;case"cert.PEM":delete e.username}this.propagateChange(e)},r.prototype.registerOnChange=function(e){this.propagateChange=e},r.prototype.registerOnTouched=function(e){},r.prototype.validate=function(e){return this.credentialsConfigFormGroup.valid?null:{credentialsConfig:{valid:!1}}},r.prototype.credentialsTypeChanged=function(){this.credentialsConfigFormGroup.patchValue({username:null,password:null,caCert:null,caCertFileName:null,privateKey:null,privateKeyFileName:null,cert:null,certFileName:null}),this.updateValidators()},r.prototype.updateValidators=function(e){void 0===e&&(e=!1);var t=this.credentialsConfigFormGroup.get("type").value;switch(e&&this.credentialsConfigFormGroup.reset({type:t},{emitEvent:!1}),this.credentialsConfigFormGroup.setValidators([]),this.credentialsConfigFormGroup.get("username").setValidators([]),this.credentialsConfigFormGroup.get("password").setValidators([]),t){case"anonymous":break;case"basic":this.credentialsConfigFormGroup.get("username").setValidators([i.Validators.required]),this.credentialsConfigFormGroup.get("password").setValidators([i.Validators.required]);break;case"cert.PEM":this.credentialsConfigFormGroup.setValidators([this.requiredFilesSelected(i.Validators.required,[["caCert","caCertFileName"],["privateKey","privateKeyFileName","cert","certFileName"]])])}this.credentialsConfigFormGroup.get("username").updateValueAndValidity({emitEvent:e}),this.credentialsConfigFormGroup.get("password").updateValueAndValidity({emitEvent:e}),this.credentialsConfigFormGroup.updateValueAndValidity({emitEvent:e})},r.prototype.requiredFilesSelected=function(e,t){return void 0===t&&(t=null),function(r){return t||(t=[Object.keys(r.controls)]),(null==r?void 0:r.controls)&&t.some((function(t){return t.every((function(t){return!e(r.controls[t])}))}))?null:{notAllRequiredFilesSelected:!0}}},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},h([t.Input(),C("design:type",Boolean),C("design:paramtypes",[Boolean])],r.prototype,"required",null),h([t.Input(),C("design:type",Object)],r.prototype,"disableCertPemCredentials",void 0),r=n=h([t.Component({selector:"tb-credentials-config",template:'
\n \n \n tb.rulenode.credentials\n \n {{ credentialsTypeTranslationsMap.get(credentialsConfigFormGroup.get(\'type\').value) | translate }}\n \n \n \n \n tb.rulenode.credentials-type\n \n \n {{ credentialsTypeTranslationsMap.get(credentialsType) | translate }}\n \n \n \n {{ \'tb.rulenode.credentials-type-required\' | translate }}\n \n \n
\n \n \n \n \n tb.rulenode.username\n \n \n {{ \'tb.rulenode.username-required\' | translate }}\n \n \n \n tb.rulenode.password\n \n \n {{ \'tb.rulenode.password-required\' | translate }}\n \n \n \n \n
{{ \'tb.rulenode.credentials-pem-hint\' | translate }}
\n \n \n \n \n \n \n \n tb.rulenode.private-key-password\n \n \n
\n
\n
\n
\n
\n',providers:[{provide:i.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return n})),multi:!0},{provide:i.NG_VALIDATORS,useExisting:t.forwardRef((function(){return n})),multi:!0}]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.PageComponent),me=function(){function e(e){this.sanitizer=e}return e.prototype.transform=function(e){return this.sanitizer.bypassSecurityTrustHtml(e)},e.ctorParameters=function(){return[{type:g.DomSanitizer}]},e=h([t.Pipe({name:"safeHtml"}),C("design:paramtypes",[g.DomSanitizer])],e)}(),ue=function(){function e(){}return e=h([t.NgModule({declarations:[ae,oe,ie,le,se,me],imports:[r.CommonModule,a.SharedModule,l.HomeComponentsModule],exports:[ae,oe,ie,le,se,me]})],e)}(),de=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.unassignCustomerConfigForm},r.prototype.onConfigurationSet=function(e){this.unassignCustomerConfigForm=this.fb.group({customerNamePattern:[e?e.customerNamePattern:null,[i.Validators.required,i.Validators.pattern(/.*\S.*/)]],customerCacheExpiration:[e?e.customerCacheExpiration:null,[i.Validators.required,i.Validators.min(0)]]})},r.prototype.prepareOutputConfig=function(e){return e.customerNamePattern=e.customerNamePattern.trim(),e},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-un-assign-to-customer-config",template:'
\n \n tb.rulenode.customer-name-pattern\n \n \n {{ \'tb.rulenode.customer-name-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.customer-cache-expiration\n \n \n {{ \'tb.rulenode.customer-cache-expiration-required\' | translate }}\n \n \n {{ \'tb.rulenode.customer-cache-expiration-range\' | translate }}\n \n tb.rulenode.customer-cache-expiration-hint\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),pe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.snsConfigForm},r.prototype.onConfigurationSet=function(e){this.snsConfigForm=this.fb.group({topicArnPattern:[e?e.topicArnPattern:null,[i.Validators.required]],accessKeyId:[e?e.accessKeyId:null,[i.Validators.required]],secretAccessKey:[e?e.secretAccessKey:null,[i.Validators.required]],region:[e?e.region:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-sns-config",template:'
\n \n tb.rulenode.topic-arn-pattern\n \n \n {{ \'tb.rulenode.topic-arn-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.aws-access-key-id\n \n \n {{ \'tb.rulenode.aws-access-key-id-required\' | translate }}\n \n \n \n tb.rulenode.aws-secret-access-key\n \n \n {{ \'tb.rulenode.aws-secret-access-key-required\' | translate }}\n \n \n \n tb.rulenode.aws-region\n \n \n {{ \'tb.rulenode.aws-region-required\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ce=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.sqsQueueType=j,n.sqsQueueTypes=Object.keys(j),n.sqsQueueTypeTranslationsMap=_,n}return b(r,e),r.prototype.configForm=function(){return this.sqsConfigForm},r.prototype.onConfigurationSet=function(e){this.sqsConfigForm=this.fb.group({queueType:[e?e.queueType:null,[i.Validators.required]],queueUrlPattern:[e?e.queueUrlPattern:null,[i.Validators.required]],delaySeconds:[e?e.delaySeconds:null,[i.Validators.min(0),i.Validators.max(900)]],messageAttributes:[e?e.messageAttributes:null,[]],accessKeyId:[e?e.accessKeyId:null,[i.Validators.required]],secretAccessKey:[e?e.secretAccessKey:null,[i.Validators.required]],region:[e?e.region:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-sqs-config",template:'
\n \n tb.rulenode.queue-type\n \n \n {{ sqsQueueTypeTranslationsMap.get(type) | translate }}\n \n \n \n \n tb.rulenode.queue-url-pattern\n \n \n {{ \'tb.rulenode.queue-url-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.delay-seconds\n \n \n {{ \'tb.rulenode.min-delay-seconds-message\' | translate }}\n \n \n {{ \'tb.rulenode.max-delay-seconds-message\' | translate }}\n \n \n \n
\n \n \n \n tb.rulenode.aws-access-key-id\n \n \n {{ \'tb.rulenode.aws-access-key-id-required\' | translate }}\n \n \n \n tb.rulenode.aws-secret-access-key\n \n \n {{ \'tb.rulenode.aws-secret-access-key-required\' | translate }}\n \n \n \n tb.rulenode.aws-region\n \n \n {{ \'tb.rulenode.aws-region-required\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),fe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.pubSubConfigForm},r.prototype.onConfigurationSet=function(e){this.pubSubConfigForm=this.fb.group({projectId:[e?e.projectId:null,[i.Validators.required]],topicName:[e?e.topicName:null,[i.Validators.required]],serviceAccountKey:[e?e.serviceAccountKey:null,[i.Validators.required]],serviceAccountKeyFileName:[e?e.serviceAccountKeyFileName:null,[i.Validators.required]],messageAttributes:[e?e.messageAttributes:null,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-pub-sub-config",template:'
\n \n tb.rulenode.gcp-project-id\n \n \n {{ \'tb.rulenode.gcp-project-id-required\' | translate }}\n \n \n \n tb.rulenode.pubsub-topic-name\n \n \n {{ \'tb.rulenode.pubsub-topic-name-required\' | translate }}\n \n \n \n \n \n
\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ge=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.ackValues=["all","-1","0","1"],n.ToByteStandartCharsetTypesValues=Z,n.ToByteStandartCharsetTypeTranslationMap=X,n}return b(r,e),r.prototype.configForm=function(){return this.kafkaConfigForm},r.prototype.onConfigurationSet=function(e){this.kafkaConfigForm=this.fb.group({topicPattern:[e?e.topicPattern:null,[i.Validators.required]],bootstrapServers:[e?e.bootstrapServers:null,[i.Validators.required]],retries:[e?e.retries:null,[i.Validators.min(0)]],batchSize:[e?e.batchSize:null,[i.Validators.min(0)]],linger:[e?e.linger:null,[i.Validators.min(0)]],bufferMemory:[e?e.bufferMemory:null,[i.Validators.min(0)]],acks:[e?e.acks:null,[i.Validators.required]],keySerializer:[e?e.keySerializer:null,[i.Validators.required]],valueSerializer:[e?e.valueSerializer:null,[i.Validators.required]],otherProperties:[e?e.otherProperties:null,[]],addMetadataKeyValuesAsKafkaHeaders:[!!e&&e.addMetadataKeyValuesAsKafkaHeaders,[]],kafkaHeadersCharset:[e?e.kafkaHeadersCharset:null,[]]})},r.prototype.validatorTriggers=function(){return["addMetadataKeyValuesAsKafkaHeaders"]},r.prototype.updateValidators=function(e){this.kafkaConfigForm.get("addMetadataKeyValuesAsKafkaHeaders").value?this.kafkaConfigForm.get("kafkaHeadersCharset").setValidators([i.Validators.required]):this.kafkaConfigForm.get("kafkaHeadersCharset").setValidators([]),this.kafkaConfigForm.get("kafkaHeadersCharset").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-kafka-config",template:'
\n \n tb.rulenode.topic-pattern\n \n \n {{ \'tb.rulenode.topic-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.bootstrap-servers\n \n \n {{ \'tb.rulenode.bootstrap-servers-required\' | translate }}\n \n \n \n tb.rulenode.retries\n \n \n {{ \'tb.rulenode.min-retries-message\' | translate }}\n \n \n \n tb.rulenode.batch-size-bytes\n \n \n {{ \'tb.rulenode.min-batch-size-bytes-message\' | translate }}\n \n \n \n tb.rulenode.linger-ms\n \n \n {{ \'tb.rulenode.min-linger-ms-message\' | translate }}\n \n \n \n tb.rulenode.buffer-memory-bytes\n \n \n {{ \'tb.rulenode.min-buffer-memory-bytes-message\' | translate }}\n \n \n \n tb.rulenode.acks\n \n \n {{ ackValue }}\n \n \n \n \n tb.rulenode.key-serializer\n \n \n {{ \'tb.rulenode.key-serializer-required\' | translate }}\n \n \n \n tb.rulenode.value-serializer\n \n \n {{ \'tb.rulenode.value-serializer-required\' | translate }}\n \n \n \n \n \n \n {{ \'tb.rulenode.add-metadata-key-values-as-kafka-headers\' | translate }}\n \n
tb.rulenode.add-metadata-key-values-as-kafka-headers-hint
\n \n tb.rulenode.charset-encoding\n \n \n {{ ToByteStandartCharsetTypeTranslationMap.get(charset) | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ye=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.mqttConfigForm},r.prototype.onConfigurationSet=function(e){this.mqttConfigForm=this.fb.group({topicPattern:[e?e.topicPattern:null,[i.Validators.required]],host:[e?e.host:null,[i.Validators.required]],port:[e?e.port:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]],connectTimeoutSec:[e?e.connectTimeoutSec:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(200)]],clientId:[e?e.clientId:null,[]],cleanSession:[!!e&&e.cleanSession,[]],ssl:[!!e&&e.ssl,[]],credentials:[e?e.credentials:null,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-mqtt-config",template:'
\n \n tb.rulenode.topic-pattern\n \n \n {{ \'tb.rulenode.topic-pattern-required\' | translate }}\n \n \n \n
\n \n tb.rulenode.host\n \n \n {{ \'tb.rulenode.host-required\' | translate }}\n \n \n \n tb.rulenode.port\n \n \n {{ \'tb.rulenode.port-required\' | translate }}\n \n \n {{ \'tb.rulenode.port-range\' | translate }}\n \n \n {{ \'tb.rulenode.port-range\' | translate }}\n \n \n \n tb.rulenode.connect-timeout\n \n \n {{ \'tb.rulenode.connect-timeout-required\' | translate }}\n \n \n {{ \'tb.rulenode.connect-timeout-range\' | translate }}\n \n \n {{ \'tb.rulenode.connect-timeout-range\' | translate }}\n \n \n
\n \n tb.rulenode.client-id\n \n \n \n {{ \'tb.rulenode.clean-session\' | translate }}\n \n \n {{ \'tb.rulenode.enable-ssl\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),be=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.messageProperties=[null,"BASIC","TEXT_PLAIN","MINIMAL_BASIC","MINIMAL_PERSISTENT_BASIC","PERSISTENT_BASIC","PERSISTENT_TEXT_PLAIN"],n}return b(r,e),r.prototype.configForm=function(){return this.rabbitMqConfigForm},r.prototype.onConfigurationSet=function(e){this.rabbitMqConfigForm=this.fb.group({exchangeNamePattern:[e?e.exchangeNamePattern:null,[]],routingKeyPattern:[e?e.routingKeyPattern:null,[]],messageProperties:[e?e.messageProperties:null,[]],host:[e?e.host:null,[i.Validators.required]],port:[e?e.port:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]],virtualHost:[e?e.virtualHost:null,[]],username:[e?e.username:null,[]],password:[e?e.password:null,[]],automaticRecoveryEnabled:[!!e&&e.automaticRecoveryEnabled,[]],connectionTimeout:[e?e.connectionTimeout:null,[i.Validators.min(0)]],handshakeTimeout:[e?e.handshakeTimeout:null,[i.Validators.min(0)]],clientProperties:[e?e.clientProperties:null,[]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-rabbit-mq-config",template:'
\n \n tb.rulenode.exchange-name-pattern\n \n \n \n tb.rulenode.routing-key-pattern\n \n \n \n tb.rulenode.message-properties\n \n \n {{ property }}\n \n \n \n
\n \n tb.rulenode.host\n \n \n {{ \'tb.rulenode.host-required\' | translate }}\n \n \n \n tb.rulenode.port\n \n \n {{ \'tb.rulenode.port-required\' | translate }}\n \n \n {{ \'tb.rulenode.port-range\' | translate }}\n \n \n {{ \'tb.rulenode.port-range\' | translate }}\n \n \n
\n \n tb.rulenode.virtual-host\n \n \n \n tb.rulenode.username\n \n \n \n tb.rulenode.password\n \n \n \n {{ \'tb.rulenode.automatic-recovery\' | translate }}\n \n \n tb.rulenode.connection-timeout-ms\n \n \n {{ \'tb.rulenode.min-connection-timeout-ms-message\' | translate }}\n \n \n \n tb.rulenode.handshake-timeout-ms\n \n \n {{ \'tb.rulenode.min-handshake-timeout-ms-message\' | translate }}\n \n \n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),he=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.proxySchemes=["http","https"],n.httpRequestTypes=Object.keys(Q),n}return b(r,e),r.prototype.configForm=function(){return this.restApiCallConfigForm},r.prototype.onConfigurationSet=function(e){this.restApiCallConfigForm=this.fb.group({restEndpointUrlPattern:[e?e.restEndpointUrlPattern:null,[i.Validators.required]],requestMethod:[e?e.requestMethod:null,[i.Validators.required]],useSimpleClientHttpFactory:[!!e&&e.useSimpleClientHttpFactory,[]],enableProxy:[!!e&&e.enableProxy,[]],useSystemProxyProperties:[!!e&&e.enableProxy,[]],proxyScheme:[e?e.proxyHost:null,[]],proxyHost:[e?e.proxyHost:null,[]],proxyPort:[e?e.proxyPort:null,[]],proxyUser:[e?e.proxyUser:null,[]],proxyPassword:[e?e.proxyPassword:null,[]],readTimeoutMs:[e?e.readTimeoutMs:null,[]],maxParallelRequestsCount:[e?e.maxParallelRequestsCount:null,[i.Validators.min(0)]],headers:[e?e.headers:null,[]],useRedisQueueForMsgPersistence:[!!e&&e.useRedisQueueForMsgPersistence,[]],trimQueue:[!!e&&e.trimQueue,[]],maxQueueSize:[e?e.maxQueueSize:null,[]],credentials:[e?e.credentials:null,[]]})},r.prototype.validatorTriggers=function(){return["useSimpleClientHttpFactory","useRedisQueueForMsgPersistence","enableProxy","useSystemProxyProperties"]},r.prototype.updateValidators=function(e){var t=this.restApiCallConfigForm.get("useSimpleClientHttpFactory").value,r=this.restApiCallConfigForm.get("useRedisQueueForMsgPersistence").value,n=this.restApiCallConfigForm.get("enableProxy").value,a=this.restApiCallConfigForm.get("useSystemProxyProperties").value;n&&!a?(this.restApiCallConfigForm.get("proxyHost").setValidators(n?[i.Validators.required]:[]),this.restApiCallConfigForm.get("proxyPort").setValidators(n?[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]:[])):(this.restApiCallConfigForm.get("proxyHost").setValidators([]),this.restApiCallConfigForm.get("proxyPort").setValidators([]),t?this.restApiCallConfigForm.get("readTimeoutMs").setValidators([]):this.restApiCallConfigForm.get("readTimeoutMs").setValidators([i.Validators.min(0)])),r?this.restApiCallConfigForm.get("maxQueueSize").setValidators([i.Validators.min(0)]):this.restApiCallConfigForm.get("maxQueueSize").setValidators([]),this.restApiCallConfigForm.get("readTimeoutMs").updateValueAndValidity({emitEvent:e}),this.restApiCallConfigForm.get("maxQueueSize").updateValueAndValidity({emitEvent:e}),this.restApiCallConfigForm.get("proxyHost").updateValueAndValidity({emitEvent:e}),this.restApiCallConfigForm.get("proxyPort").updateValueAndValidity({emitEvent:e}),this.restApiCallConfigForm.get("credentials").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-rest-api-call-config",template:'
\n \n tb.rulenode.endpoint-url-pattern\n \n \n {{ \'tb.rulenode.endpoint-url-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.request-method\n \n \n {{ requestType }}\n \n \n \n \n {{ \'tb.rulenode.enable-proxy\' | translate }}\n \n \n {{ \'tb.rulenode.use-simple-client-http-factory\' | translate }}\n \n
\n \n {{ \'tb.rulenode.use-system-proxy-properties\' | translate }}\n \n
\n
\n \n tb.rulenode.proxy-scheme\n \n \n {{ proxyScheme }}\n \n \n \n \n tb.rulenode.proxy-host\n \n \n {{ \'tb.rulenode.proxy-host-required\' | translate }}\n \n \n \n tb.rulenode.proxy-port\n \n \n {{ \'tb.rulenode.proxy-port-required\' | translate }}\n \n \n {{ \'tb.rulenode.proxy-port-range\' | translate }}\n \n \n
\n \n tb.rulenode.proxy-user\n \n \n \n tb.rulenode.proxy-password\n \n \n
\n
\n \n tb.rulenode.read-timeout\n \n tb.rulenode.read-timeout-hint\n \n \n tb.rulenode.max-parallel-requests-count\n \n tb.rulenode.max-parallel-requests-count-hint\n \n \n
\n \n \n \n {{ \'tb.rulenode.use-redis-queue\' | translate }}\n \n
\n \n {{ \'tb.rulenode.trim-redis-queue\' | translate }}\n \n \n tb.rulenode.redis-queue-max-size\n \n \n
\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ce=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.smtpProtocols=["smtp","smtps"],n.tlsVersions=["TLSv1","TLSv1.1","TLSv1.2","TLSv1.3"],n}return b(r,e),r.prototype.configForm=function(){return this.sendEmailConfigForm},r.prototype.onConfigurationSet=function(e){this.sendEmailConfigForm=this.fb.group({useSystemSmtpSettings:[!!e&&e.useSystemSmtpSettings,[]],smtpProtocol:[e?e.smtpProtocol:null,[]],smtpHost:[e?e.smtpHost:null,[]],smtpPort:[e?e.smtpPort:null,[]],timeout:[e?e.timeout:null,[]],enableTls:[!!e&&e.enableTls,[]],tlsVersion:[e?e.tlsVersion:null,[]],enableProxy:[!!e&&e.enableProxy,[]],proxyHost:[e?e.proxyHost:null,[]],proxyPort:[e?e.proxyPort:null,[]],proxyUser:[e?e.proxyUser:null,[]],proxyPassword:[e?e.proxyPassword:null,[]],username:[e?e.username:null,[]],password:[e?e.password:null,[]]})},r.prototype.validatorTriggers=function(){return["useSystemSmtpSettings","enableProxy"]},r.prototype.updateValidators=function(e){var t=this.sendEmailConfigForm.get("useSystemSmtpSettings").value,r=this.sendEmailConfigForm.get("enableProxy").value;t?(this.sendEmailConfigForm.get("smtpProtocol").setValidators([]),this.sendEmailConfigForm.get("smtpHost").setValidators([]),this.sendEmailConfigForm.get("smtpPort").setValidators([]),this.sendEmailConfigForm.get("timeout").setValidators([]),this.sendEmailConfigForm.get("proxyHost").setValidators([]),this.sendEmailConfigForm.get("proxyPort").setValidators([])):(this.sendEmailConfigForm.get("smtpProtocol").setValidators([i.Validators.required]),this.sendEmailConfigForm.get("smtpHost").setValidators([i.Validators.required]),this.sendEmailConfigForm.get("smtpPort").setValidators([i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]),this.sendEmailConfigForm.get("timeout").setValidators([i.Validators.required,i.Validators.min(0)]),this.sendEmailConfigForm.get("proxyHost").setValidators(r?[i.Validators.required]:[]),this.sendEmailConfigForm.get("proxyPort").setValidators(r?[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]:[])),this.sendEmailConfigForm.get("smtpProtocol").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("smtpHost").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("smtpPort").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("timeout").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("proxyHost").updateValueAndValidity({emitEvent:e}),this.sendEmailConfigForm.get("proxyPort").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-send-email-config",template:'
\n \n {{ \'tb.rulenode.use-system-smtp-settings\' | translate }}\n \n
\n \n tb.rulenode.smtp-protocol\n \n \n {{ smtpProtocol.toUpperCase() }}\n \n \n \n
\n \n tb.rulenode.smtp-host\n \n \n {{ \'tb.rulenode.smtp-host-required\' | translate }}\n \n \n \n tb.rulenode.smtp-port\n \n \n {{ \'tb.rulenode.smtp-port-required\' | translate }}\n \n \n {{ \'tb.rulenode.smtp-port-range\' | translate }}\n \n \n {{ \'tb.rulenode.smtp-port-range\' | translate }}\n \n \n
\n \n tb.rulenode.timeout-msec\n \n \n {{ \'tb.rulenode.timeout-required\' | translate }}\n \n \n {{ \'tb.rulenode.min-timeout-msec-message\' | translate }}\n \n \n \n {{ \'tb.rulenode.enable-tls\' | translate }}\n \n \n tb.rulenode.tls-version\n \n \n {{ tlsVersion }}\n \n \n \n \n {{ \'tb.rulenode.enable-proxy\' | translate }}\n \n
\n
\n \n tb.rulenode.proxy-host\n \n \n {{ \'tb.rulenode.proxy-host-required\' | translate }}\n \n \n \n tb.rulenode.proxy-port\n \n \n {{ \'tb.rulenode.proxy-port-required\' | translate }}\n \n \n {{ \'tb.rulenode.proxy-port-range\' | translate }}\n \n \n
\n \n tb.rulenode.proxy-user\n \n \n \n tb.rulenode.proxy-password\n \n \n
\n \n tb.rulenode.username\n \n \n \n tb.rulenode.password\n \n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ve=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.serviceType=a.ServiceType.TB_RULE_ENGINE,n}return b(r,e),r.prototype.configForm=function(){return this.checkPointConfigForm},r.prototype.onConfigurationSet=function(e){this.checkPointConfigForm=this.fb.group({queueName:[e?e.queueName:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-check-point-config",template:'
\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Fe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.allAzureIotHubCredentialsTypes=J,n.azureIotHubCredentialsTypeTranslationsMap=Y,n}return b(r,e),r.prototype.configForm=function(){return this.azureIotHubConfigForm},r.prototype.onConfigurationSet=function(e){this.azureIotHubConfigForm=this.fb.group({topicPattern:[e?e.topicPattern:null,[i.Validators.required]],host:[e?e.host:null,[i.Validators.required]],port:[e?e.port:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(65535)]],connectTimeoutSec:[e?e.connectTimeoutSec:null,[i.Validators.required,i.Validators.min(1),i.Validators.max(200)]],clientId:[e?e.clientId:null,[i.Validators.required]],cleanSession:[!!e&&e.cleanSession,[]],ssl:[!!e&&e.ssl,[]],credentials:this.fb.group({type:[e&&e.credentials?e.credentials.type:null,[i.Validators.required]],sasKey:[e&&e.credentials?e.credentials.sasKey:null,[]],caCert:[e&&e.credentials?e.credentials.caCert:null,[]],caCertFileName:[e&&e.credentials?e.credentials.caCertFileName:null,[]],privateKey:[e&&e.credentials?e.credentials.privateKey:null,[]],privateKeyFileName:[e&&e.credentials?e.credentials.privateKeyFileName:null,[]],cert:[e&&e.credentials?e.credentials.cert:null,[]],certFileName:[e&&e.credentials?e.credentials.certFileName:null,[]],password:[e&&e.credentials?e.credentials.password:null,[]]})})},r.prototype.prepareOutputConfig=function(e){var t=e.credentials.type;return"sas"===t&&(e.credentials={type:t,sasKey:e.credentials.sasKey,caCert:e.credentials.caCert,caCertFileName:e.credentials.caCertFileName}),e},r.prototype.validatorTriggers=function(){return["credentials.type"]},r.prototype.updateValidators=function(e){var t=this.azureIotHubConfigForm.get("credentials"),r=t.get("type").value;switch(e&&t.reset({type:r},{emitEvent:!1}),t.get("sasKey").setValidators([]),t.get("privateKey").setValidators([]),t.get("privateKeyFileName").setValidators([]),t.get("cert").setValidators([]),t.get("certFileName").setValidators([]),r){case"sas":t.get("sasKey").setValidators([i.Validators.required]);break;case"cert.PEM":t.get("privateKey").setValidators([i.Validators.required]),t.get("privateKeyFileName").setValidators([i.Validators.required]),t.get("cert").setValidators([i.Validators.required]),t.get("certFileName").setValidators([i.Validators.required])}t.get("sasKey").updateValueAndValidity({emitEvent:e}),t.get("privateKey").updateValueAndValidity({emitEvent:e}),t.get("privateKeyFileName").updateValueAndValidity({emitEvent:e}),t.get("cert").updateValueAndValidity({emitEvent:e}),t.get("certFileName").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-azure-iot-hub-config",template:'
\n \n tb.rulenode.topic\n \n \n {{ \'tb.rulenode.topic-required\' | translate }}\n \n \n \n tb.rulenode.hostname\n \n \n {{ \'tb.rulenode.hostname-required\' | translate }}\n \n \n \n tb.rulenode.device-id\n \n \n {{ \'tb.rulenode.device-id-required\' | translate }}\n \n \n \n \n \n tb.rulenode.credentials\n \n {{ azureIotHubCredentialsTypeTranslationsMap.get(azureIotHubConfigForm.get(\'credentials.type\').value) | translate }}\n \n \n
\n \n tb.rulenode.credentials-type\n \n \n {{ azureIotHubCredentialsTypeTranslationsMap.get(credentialsType) | translate }}\n \n \n \n {{ \'tb.rulenode.credentials-type-required\' | translate }}\n \n \n
\n \n \n \n \n tb.rulenode.sas-key\n \n \n {{ \'tb.rulenode.sas-key-required\' | translate }}\n \n \n \n \n \n \n \n \n \n \n \n \n \n tb.rulenode.private-key-password\n \n \n \n
\n
\n
\n
\n
\n',styles:[":host .tb-mqtt-credentials-panel-group{margin:0 6px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),xe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.deviceProfile},r.prototype.onConfigurationSet=function(e){this.deviceProfile=this.fb.group({persistAlarmRulesState:[!!e&&e.persistAlarmRulesState,i.Validators.required],fetchAlarmRulesStateOnStart:[!!e&&e.fetchAlarmRulesStateOnStart,i.Validators.required]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-device-profile-config",template:'
\n \n {{ \'tb.rulenode.persist-alarm-rules\' | translate }}\n \n \n {{ \'tb.rulenode.fetch-alarm-rules\' | translate }}\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Te=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.sendSmsConfigForm},r.prototype.onConfigurationSet=function(e){this.sendSmsConfigForm=this.fb.group({numbersToTemplate:[e?e.numbersToTemplate:null,[i.Validators.required]],smsMessageTemplate:[e?e.smsMessageTemplate:null,[i.Validators.required]],useSystemSmsSettings:[!!e&&e.useSystemSmsSettings,[]],smsProviderConfiguration:[e?e.smsProviderConfiguration:null,[]]})},r.prototype.validatorTriggers=function(){return["useSystemSmsSettings"]},r.prototype.updateValidators=function(e){this.sendSmsConfigForm.get("useSystemSmsSettings").value?this.sendSmsConfigForm.get("smsProviderConfiguration").setValidators([]):this.sendSmsConfigForm.get("smsProviderConfiguration").setValidators([i.Validators.required]),this.sendSmsConfigForm.get("smsProviderConfiguration").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-action-node-send-sms-config",template:'
\n \n tb.rulenode.numbers-to-template\n \n \n {{ \'tb.rulenode.numbers-to-template-required\' | translate }}\n \n \n \n \n tb.rulenode.sms-message-template\n \n \n {{ \'tb.rulenode.sms-message-template-required\' | translate }}\n \n \n \n \n {{ \'tb.rulenode.use-system-sms-settings\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),qe=function(){function e(){}return e=h([t.NgModule({declarations:[T,q,S,I,k,N,V,E,A,L,P,ee,te,re,ne,de,pe,ce,fe,ge,ye,be,he,Ce,ve,Fe,xe,Te],imports:[r.CommonModule,a.SharedModule,l.HomeComponentsModule,ue],exports:[T,q,S,I,k,N,V,E,A,L,P,ee,te,re,ne,de,pe,ce,fe,ge,ye,be,he,Ce,ve,Fe,xe,Te]})],e)}(),Se=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n}return b(r,e),r.prototype.configForm=function(){return this.checkMessageConfigForm},r.prototype.onConfigurationSet=function(e){this.checkMessageConfigForm=this.fb.group({messageNames:[e?e.messageNames:null,[]],metadataNames:[e?e.metadataNames:null,[]],checkAllKeys:[!!e&&e.checkAllKeys,[]]})},r.prototype.validateConfig=function(){var e=this.checkMessageConfigForm.get("messageNames").value,t=this.checkMessageConfigForm.get("metadataNames").value;return e.length>0||t.length>0},r.prototype.removeMessageName=function(e){var t=this.checkMessageConfigForm.get("messageNames").value,r=t.indexOf(e);r>=0&&(t.splice(r,1),this.checkMessageConfigForm.get("messageNames").setValue(t,{emitEvent:!0}))},r.prototype.removeMetadataName=function(e){var t=this.checkMessageConfigForm.get("metadataNames").value,r=t.indexOf(e);r>=0&&(t.splice(r,1),this.checkMessageConfigForm.get("metadataNames").setValue(t,{emitEvent:!0}))},r.prototype.addMessageName=function(e){var t=e.input,r=e.value;if((r||"").trim()){r=r.trim();var n=this.checkMessageConfigForm.get("messageNames").value;n&&-1!==n.indexOf(r)||(n||(n=[]),n.push(r),this.checkMessageConfigForm.get("messageNames").setValue(n,{emitEvent:!0}))}t&&(t.value="")},r.prototype.addMetadataName=function(e){var t=e.input,r=e.value;if((r||"").trim()){r=r.trim();var n=this.checkMessageConfigForm.get("metadataNames").value;n&&-1!==n.indexOf(r)||(n||(n=[]),n.push(r),this.checkMessageConfigForm.get("metadataNames").setValue(n,{emitEvent:!0}))}t&&(t.value="")},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-check-message-config",template:'
\n \n \n \n \n \n {{messageName}}\n close\n \n \n \n \n
tb.rulenode.separator-hint
\n \n \n \n \n \n {{metadataName}}\n close\n \n \n \n \n
tb.rulenode.separator-hint
\n \n {{ \'tb.rulenode.check-all-keys\' | translate }}\n \n
tb.rulenode.check-all-keys-hint
\n
\n',styles:[":host label.tb-title{margin-bottom:-10px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ie=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.entitySearchDirection=Object.keys(a.EntitySearchDirection),n.entitySearchDirectionTranslationsMap=a.entitySearchDirectionTranslations,n}return b(r,e),r.prototype.configForm=function(){return this.checkRelationConfigForm},r.prototype.onConfigurationSet=function(e){this.checkRelationConfigForm=this.fb.group({checkForSingleEntity:[!!e&&e.checkForSingleEntity,[]],direction:[e?e.direction:null,[]],entityType:[e?e.entityType:null,e&&e.checkForSingleEntity?[i.Validators.required]:[]],entityId:[e?e.entityId:null,e&&e.checkForSingleEntity?[i.Validators.required]:[]],relationType:[e?e.relationType:null,[i.Validators.required]]})},r.prototype.validatorTriggers=function(){return["checkForSingleEntity"]},r.prototype.updateValidators=function(e){var t=this.checkRelationConfigForm.get("checkForSingleEntity").value;this.checkRelationConfigForm.get("entityType").setValidators(t?[i.Validators.required]:[]),this.checkRelationConfigForm.get("entityType").updateValueAndValidity({emitEvent:e}),this.checkRelationConfigForm.get("entityId").setValidators(t?[i.Validators.required]:[]),this.checkRelationConfigForm.get("entityId").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-check-relation-config",template:'
\n \n {{ \'tb.rulenode.check-relation-to-specific-entity\' | translate }}\n \n
tb.rulenode.check-relation-hint
\n \n relation.direction\n \n \n {{ entitySearchDirectionTranslationsMap.get(direction) | translate }}\n \n \n \n
\n \n \n \n \n
\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ke=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.perimeterType=M,n.perimeterTypes=Object.keys(M),n.perimeterTypeTranslationMap=D,n.rangeUnits=Object.keys(O),n.rangeUnitTranslationMap=G,n}return b(r,e),r.prototype.configForm=function(){return this.geoFilterConfigForm},r.prototype.onConfigurationSet=function(e){this.geoFilterConfigForm=this.fb.group({latitudeKeyName:[e?e.latitudeKeyName:null,[i.Validators.required]],longitudeKeyName:[e?e.longitudeKeyName:null,[i.Validators.required]],fetchPerimeterInfoFromMessageMetadata:[!!e&&e.fetchPerimeterInfoFromMessageMetadata,[]],perimeterType:[e?e.perimeterType:null,[]],centerLatitude:[e?e.centerLatitude:null,[]],centerLongitude:[e?e.centerLatitude:null,[]],range:[e?e.range:null,[]],rangeUnit:[e?e.rangeUnit:null,[]],polygonsDefinition:[e?e.polygonsDefinition:null,[]]})},r.prototype.validatorTriggers=function(){return["fetchPerimeterInfoFromMessageMetadata","perimeterType"]},r.prototype.updateValidators=function(e){var t=this.geoFilterConfigForm.get("fetchPerimeterInfoFromMessageMetadata").value,r=this.geoFilterConfigForm.get("perimeterType").value;t?this.geoFilterConfigForm.get("perimeterType").setValidators([]):this.geoFilterConfigForm.get("perimeterType").setValidators([i.Validators.required]),t||r!==M.CIRCLE?(this.geoFilterConfigForm.get("centerLatitude").setValidators([]),this.geoFilterConfigForm.get("centerLongitude").setValidators([]),this.geoFilterConfigForm.get("range").setValidators([]),this.geoFilterConfigForm.get("rangeUnit").setValidators([])):(this.geoFilterConfigForm.get("centerLatitude").setValidators([i.Validators.required,i.Validators.min(-90),i.Validators.max(90)]),this.geoFilterConfigForm.get("centerLongitude").setValidators([i.Validators.required,i.Validators.min(-180),i.Validators.max(180)]),this.geoFilterConfigForm.get("range").setValidators([i.Validators.required,i.Validators.min(0)]),this.geoFilterConfigForm.get("rangeUnit").setValidators([i.Validators.required])),t||r!==M.POLYGON?this.geoFilterConfigForm.get("polygonsDefinition").setValidators([]):this.geoFilterConfigForm.get("polygonsDefinition").setValidators([i.Validators.required]),this.geoFilterConfigForm.get("perimeterType").updateValueAndValidity({emitEvent:!1}),this.geoFilterConfigForm.get("centerLatitude").updateValueAndValidity({emitEvent:e}),this.geoFilterConfigForm.get("centerLongitude").updateValueAndValidity({emitEvent:e}),this.geoFilterConfigForm.get("range").updateValueAndValidity({emitEvent:e}),this.geoFilterConfigForm.get("rangeUnit").updateValueAndValidity({emitEvent:e}),this.geoFilterConfigForm.get("polygonsDefinition").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-gps-geofencing-config",template:'
\n \n tb.rulenode.latitude-key-name\n \n \n {{ \'tb.rulenode.latitude-key-name-required\' | translate }}\n \n \n \n tb.rulenode.longitude-key-name\n \n \n {{ \'tb.rulenode.longitude-key-name-required\' | translate }}\n \n \n \n {{ \'tb.rulenode.fetch-perimeter-info-from-message-metadata\' | translate }}\n \n
\n \n tb.rulenode.perimeter-type\n \n \n {{ perimeterTypeTranslationMap.get(type) | translate }}\n \n \n \n
\n
\n
\n \n tb.rulenode.circle-center-latitude\n \n \n {{ \'tb.rulenode.circle-center-latitude-required\' | translate }}\n \n \n \n tb.rulenode.circle-center-longitude\n \n \n {{ \'tb.rulenode.circle-center-longitude-required\' | translate }}\n \n \n
\n
\n \n tb.rulenode.range\n \n \n {{ \'tb.rulenode.range-required\' | translate }}\n \n \n \n tb.rulenode.range-units\n \n \n {{ rangeUnitTranslationMap.get(type) | translate }}\n \n \n \n
\n
\n
\n
\n \n tb.rulenode.polygon-definition\n \n \n {{ \'tb.rulenode.polygon-definition-required\' | translate }}\n \n \n
\n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ne=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.messageTypeConfigForm},r.prototype.onConfigurationSet=function(e){this.messageTypeConfigForm=this.fb.group({messageTypes:[e?e.messageTypes:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-message-type-config",template:'
\n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ve=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.allowedEntityTypes=[a.EntityType.DEVICE,a.EntityType.ASSET,a.EntityType.ENTITY_VIEW,a.EntityType.TENANT,a.EntityType.CUSTOMER,a.EntityType.USER,a.EntityType.DASHBOARD,a.EntityType.RULE_CHAIN,a.EntityType.RULE_NODE],n}return b(r,e),r.prototype.configForm=function(){return this.originatorTypeConfigForm},r.prototype.onConfigurationSet=function(e){this.originatorTypeConfigForm=this.fb.group({originatorTypes:[e?e.originatorTypes:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-filter-node-originator-type-config",template:'
\n \n \n \n
\n',styles:[":host ::ng-deep tb-entity-type-list .mat-form-field-flex{padding-top:0}:host ::ng-deep tb-entity-type-list .mat-form-field-infix{border-top:0}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ee=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.scriptConfigForm},r.prototype.onConfigurationSet=function(e){this.scriptConfigForm=this.fb.group({jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.scriptConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"filter",this.translate.instant("tb.rulenode.filter"),"Filter",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.scriptConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-filter-node-script-config",template:'
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),Ae=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.switchConfigForm},r.prototype.onConfigurationSet=function(e){this.switchConfigForm=this.fb.group({jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.switchConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"switch",this.translate.instant("tb.rulenode.switch"),"Switch",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.switchConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-filter-node-switch-config",template:'
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),Le=function(e){function r(t,r,n){var o,l,s=e.call(this,t)||this;s.store=t,s.translate=r,s.fb=n,s.alarmStatusTranslationsMap=a.alarmStatusTranslations,s.alarmStatusList=[],s.searchText="",s.displayStatusFn=s.displayStatus.bind(s);try{for(var m=v(Object.keys(a.AlarmStatus)),u=m.next();!u.done;u=m.next()){var d=u.value;s.alarmStatusList.push(a.AlarmStatus[d])}}catch(e){o={error:e}}finally{try{u&&!u.done&&(l=m.return)&&l.call(m)}finally{if(o)throw o.error}}return s.statusFormControl=new i.FormControl(""),s.filteredAlarmStatus=s.statusFormControl.valueChanges.pipe(f.startWith(""),f.map((function(e){return e||""})),f.mergeMap((function(e){return s.fetchAlarmStatus(e)})),f.share()),s}return b(r,e),r.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this)},r.prototype.configForm=function(){return this.alarmStatusConfigForm},r.prototype.prepareInputConfig=function(e){return this.searchText="",this.statusFormControl.patchValue("",{emitEvent:!0}),e},r.prototype.onConfigurationSet=function(e){this.alarmStatusConfigForm=this.fb.group({alarmStatusList:[e?e.alarmStatusList:null,[i.Validators.required]]})},r.prototype.displayStatus=function(e){return e?this.translate.instant(a.alarmStatusTranslations.get(e)):void 0},r.prototype.fetchAlarmStatus=function(e){var t=this,r=this.getAlarmStatusList();if(this.searchText=e,this.searchText&&this.searchText.length){var n=this.searchText.toUpperCase();return c.of(r.filter((function(e){return t.translate.instant(a.alarmStatusTranslations.get(a.AlarmStatus[e])).toUpperCase().includes(n)})))}return c.of(r)},r.prototype.alarmStatusSelected=function(e){this.addAlarmStatus(e.option.value),this.clear("")},r.prototype.removeAlarmStatus=function(e){var t=this.alarmStatusConfigForm.get("alarmStatusList").value;if(t){var r=t.indexOf(e);r>=0&&(t.splice(r,1),this.alarmStatusConfigForm.get("alarmStatusList").setValue(t))}},r.prototype.addAlarmStatus=function(e){var t=this.alarmStatusConfigForm.get("alarmStatusList").value;t||(t=[]),-1===t.indexOf(e)&&(t.push(e),this.alarmStatusConfigForm.get("alarmStatusList").setValue(t))},r.prototype.getAlarmStatusList=function(){var e=this;return this.alarmStatusList.filter((function(t){return-1===e.alarmStatusConfigForm.get("alarmStatusList").value.indexOf(t)}))},r.prototype.onAlarmStatusInputFocus=function(){this.statusFormControl.updateValueAndValidity({onlySelf:!0,emitEvent:!0})},r.prototype.clear=function(e){var t=this;void 0===e&&(e=""),this.alarmStatusInput.nativeElement.value=e,this.statusFormControl.patchValue(null,{emitEvent:!0}),setTimeout((function(){t.alarmStatusInput.nativeElement.blur(),t.alarmStatusInput.nativeElement.focus()}),0)},r.ctorParameters=function(){return[{type:o.Store},{type:n.TranslateService},{type:i.FormBuilder}]},h([t.ViewChild("alarmStatusInput",{static:!1}),C("design:type",t.ElementRef)],r.prototype,"alarmStatusInput",void 0),r=h([t.Component({selector:"tb-filter-node-check-alarm-status-config",template:'
\n \n tb.rulenode.alarm-status-filter\n \n \n \n {{alarmStatusTranslationsMap.get(alarmStatus) | translate}}\n \n close\n \n \n \n \n \n \n \n \n
\n
\n tb.rulenode.no-alarm-status-matching\n
\n
\n
\n
\n
\n \n
\n\n\n\n'}),C("design:paramtypes",[o.Store,n.TranslateService,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Pe=function(){function e(){}return e=h([t.NgModule({declarations:[Se,Ie,ke,Ne,Ve,Ee,Ae,Le],imports:[r.CommonModule,a.SharedModule,ue],exports:[Se,Ie,ke,Ne,Ve,Ee,Ae,Le]})],e)}(),Me=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.customerAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.customerAttributesConfigForm=this.fb.group({telemetry:[!!e&&e.telemetry,[]],attrMapping:[e?e.attrMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-customer-attributes-config",template:'
\n \n \n {{ \'tb.rulenode.latest-telemetry\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),we=function(e){function r(t,r,n){var a,o,l=e.call(this,t)||this;l.store=t,l.translate=r,l.fb=n,l.entityDetailsTranslationsMap=z,l.entityDetailsList=[],l.searchText="",l.displayDetailsFn=l.displayDetails.bind(l);try{for(var s=v(Object.keys(B)),m=s.next();!m.done;m=s.next()){var u=m.value;l.entityDetailsList.push(B[u])}}catch(e){a={error:e}}finally{try{m&&!m.done&&(o=s.return)&&o.call(s)}finally{if(a)throw a.error}}return l.detailsFormControl=new i.FormControl(""),l.filteredEntityDetails=l.detailsFormControl.valueChanges.pipe(f.startWith(""),f.map((function(e){return e||""})),f.mergeMap((function(e){return l.fetchEntityDetails(e)})),f.share()),l}return b(r,e),r.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this)},r.prototype.configForm=function(){return this.entityDetailsConfigForm},r.prototype.prepareInputConfig=function(e){return this.searchText="",this.detailsFormControl.patchValue("",{emitEvent:!0}),e},r.prototype.onConfigurationSet=function(e){this.entityDetailsConfigForm=this.fb.group({detailsList:[e?e.detailsList:null,[i.Validators.required]],addToMetadata:[!!e&&e.addToMetadata,[]]})},r.prototype.displayDetails=function(e){return e?this.translate.instant(z.get(e)):void 0},r.prototype.fetchEntityDetails=function(e){var t=this;if(this.searchText=e,this.searchText&&this.searchText.length){var r=this.searchText.toUpperCase();return c.of(this.entityDetailsList.filter((function(e){return t.translate.instant(z.get(B[e])).toUpperCase().includes(r)})))}return c.of(this.entityDetailsList)},r.prototype.detailsFieldSelected=function(e){this.addDetailsField(e.option.value),this.clear("")},r.prototype.removeDetailsField=function(e){var t=this.entityDetailsConfigForm.get("detailsList").value;if(t){var r=t.indexOf(e);r>=0&&(t.splice(r,1),this.entityDetailsConfigForm.get("detailsList").setValue(t))}},r.prototype.addDetailsField=function(e){var t=this.entityDetailsConfigForm.get("detailsList").value;t||(t=[]),-1===t.indexOf(e)&&(t.push(e),this.entityDetailsConfigForm.get("detailsList").setValue(t))},r.prototype.onEntityDetailsInputFocus=function(){this.detailsFormControl.updateValueAndValidity({onlySelf:!0,emitEvent:!0})},r.prototype.clear=function(e){var t=this;void 0===e&&(e=""),this.detailsInput.nativeElement.value=e,this.detailsFormControl.patchValue(null,{emitEvent:!0}),setTimeout((function(){t.detailsInput.nativeElement.blur(),t.detailsInput.nativeElement.focus()}),0)},r.ctorParameters=function(){return[{type:o.Store},{type:n.TranslateService},{type:i.FormBuilder}]},h([t.ViewChild("detailsInput",{static:!1}),C("design:type",t.ElementRef)],r.prototype,"detailsInput",void 0),r=h([t.Component({selector:"tb-enrichment-node-entity-details-config",template:'
\n \n tb.rulenode.entity-details\n \n \n \n {{entityDetailsTranslationsMap.get(details) | translate}}\n \n close\n \n \n \n \n \n \n \n \n
\n
\n tb.rulenode.no-entity-details-matching\n
\n
\n
\n
\n
\n \n \n {{ \'tb.rulenode.add-to-metadata\' | translate }}\n \n
tb.rulenode.add-to-metadata-hint
\n
\n',styles:[":host ::ng-deep mat-form-field.entity-fields-list .mat-form-field-wrapper{margin-bottom:-1.25em}"]}),C("design:paramtypes",[o.Store,n.TranslateService,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Re=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n}return b(r,e),r.prototype.configForm=function(){return this.deviceAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.deviceAttributesConfigForm=this.fb.group({deviceRelationsQuery:[e?e.deviceRelationsQuery:null,[i.Validators.required]],tellFailureIfAbsent:[!!e&&e.tellFailureIfAbsent,[]],clientAttributeNames:[e?e.clientAttributeNames:null,[]],sharedAttributeNames:[e?e.sharedAttributeNames:null,[]],serverAttributeNames:[e?e.serverAttributeNames:null,[]],latestTsKeyNames:[e?e.latestTsKeyNames:null,[]],getLatestValueWithTs:[!!e&&e.getLatestValueWithTs,[]]})},r.prototype.removeKey=function(e,t){var r=this.deviceAttributesConfigForm.get(t).value,n=r.indexOf(e);n>=0&&(r.splice(n,1),this.deviceAttributesConfigForm.get(t).setValue(r,{emitEvent:!0}))},r.prototype.addKey=function(e,t){var r=e.input,n=e.value;if((n||"").trim()){n=n.trim();var a=this.deviceAttributesConfigForm.get(t).value;a&&-1!==a.indexOf(n)||(a||(a=[]),a.push(n),this.deviceAttributesConfigForm.get(t).setValue(a,{emitEvent:!0}))}r&&(r.value="")},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-device-attributes-config",template:'
\n \n \n \n \n {{ \'tb.rulenode.tell-failure-if-absent\' | translate }}\n \n
tb.rulenode.tell-failure-if-absent-hint
\n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n {{ \'tb.rulenode.get-latest-value-with-ts\' | translate }}\n \n
tb.rulenode.get-latest-value-with-ts-hint
\n
\n',styles:[":host label.tb-title{margin-bottom:-10px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),De=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n}return b(r,e),r.prototype.configForm=function(){return this.originatorAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.originatorAttributesConfigForm=this.fb.group({tellFailureIfAbsent:[!!e&&e.tellFailureIfAbsent,[]],clientAttributeNames:[e?e.clientAttributeNames:null,[]],sharedAttributeNames:[e?e.sharedAttributeNames:null,[]],serverAttributeNames:[e?e.serverAttributeNames:null,[]],latestTsKeyNames:[e?e.latestTsKeyNames:null,[]],getLatestValueWithTs:[!!e&&e.getLatestValueWithTs,[]]})},r.prototype.removeKey=function(e,t){var r=this.originatorAttributesConfigForm.get(t).value,n=r.indexOf(e);n>=0&&(r.splice(n,1),this.originatorAttributesConfigForm.get(t).setValue(r,{emitEvent:!0}))},r.prototype.addKey=function(e,t){var r=e.input,n=e.value;if((n||"").trim()){n=n.trim();var a=this.originatorAttributesConfigForm.get(t).value;a&&-1!==a.indexOf(n)||(a||(a=[]),a.push(n),this.originatorAttributesConfigForm.get(t).setValue(a,{emitEvent:!0}))}r&&(r.value="")},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-originator-attributes-config",template:'
\n \n {{ \'tb.rulenode.tell-failure-if-absent\' | translate }}\n \n
tb.rulenode.tell-failure-if-absent-hint
\n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n {{ \'tb.rulenode.get-latest-value-with-ts\' | translate }}\n \n
tb.rulenode.get-latest-value-with-ts-hint
\n
\n',styles:[":host label.tb-title{margin-bottom:-10px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Oe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.originatorFieldsConfigForm},r.prototype.onConfigurationSet=function(e){this.originatorFieldsConfigForm=this.fb.group({fieldsMapping:[e?e.fieldsMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-originator-fields-config",template:'
\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ke=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n.fetchMode=H,n.fetchModes=Object.keys(H),n.samplingOrders=Object.keys(U),n.timeUnits=Object.keys(R),n.timeUnitsTranslationMap=K,n}return b(r,e),r.prototype.configForm=function(){return this.getTelemetryFromDatabaseConfigForm},r.prototype.onConfigurationSet=function(e){this.getTelemetryFromDatabaseConfigForm=this.fb.group({latestTsKeyNames:[e?e.latestTsKeyNames:null,[]],fetchMode:[e?e.fetchMode:null,[i.Validators.required]],orderBy:[e?e.orderBy:null,[]],limit:[e?e.limit:null,[]],useMetadataIntervalPatterns:[!!e&&e.useMetadataIntervalPatterns,[]],startInterval:[e?e.startInterval:null,[]],startIntervalTimeUnit:[e?e.startIntervalTimeUnit:null,[]],endInterval:[e?e.endInterval:null,[]],endIntervalTimeUnit:[e?e.endIntervalTimeUnit:null,[]],startIntervalPattern:[e?e.startIntervalPattern:null,[]],endIntervalPattern:[e?e.endIntervalPattern:null,[]]})},r.prototype.validatorTriggers=function(){return["fetchMode","useMetadataIntervalPatterns"]},r.prototype.updateValidators=function(e){var t=this.getTelemetryFromDatabaseConfigForm.get("fetchMode").value,r=this.getTelemetryFromDatabaseConfigForm.get("useMetadataIntervalPatterns").value;t&&t===H.ALL?(this.getTelemetryFromDatabaseConfigForm.get("orderBy").setValidators([i.Validators.required]),this.getTelemetryFromDatabaseConfigForm.get("limit").setValidators([i.Validators.required,i.Validators.min(2),i.Validators.max(1e3)])):(this.getTelemetryFromDatabaseConfigForm.get("orderBy").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("limit").setValidators([])),r?(this.getTelemetryFromDatabaseConfigForm.get("startInterval").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("startIntervalTimeUnit").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("endInterval").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("endIntervalTimeUnit").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("startIntervalPattern").setValidators([i.Validators.required]),this.getTelemetryFromDatabaseConfigForm.get("endIntervalPattern").setValidators([i.Validators.required])):(this.getTelemetryFromDatabaseConfigForm.get("startInterval").setValidators([i.Validators.required,i.Validators.min(1),i.Validators.max(2147483647)]),this.getTelemetryFromDatabaseConfigForm.get("startIntervalTimeUnit").setValidators([i.Validators.required]),this.getTelemetryFromDatabaseConfigForm.get("endInterval").setValidators([i.Validators.required,i.Validators.min(1),i.Validators.max(2147483647)]),this.getTelemetryFromDatabaseConfigForm.get("endIntervalTimeUnit").setValidators([i.Validators.required]),this.getTelemetryFromDatabaseConfigForm.get("startIntervalPattern").setValidators([]),this.getTelemetryFromDatabaseConfigForm.get("endIntervalPattern").setValidators([])),this.getTelemetryFromDatabaseConfigForm.get("orderBy").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("limit").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("startInterval").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("startIntervalTimeUnit").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("endInterval").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("endIntervalTimeUnit").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("startIntervalPattern").updateValueAndValidity({emitEvent:e}),this.getTelemetryFromDatabaseConfigForm.get("endIntervalPattern").updateValueAndValidity({emitEvent:e})},r.prototype.removeKey=function(e,t){var r=this.getTelemetryFromDatabaseConfigForm.get(t).value,n=r.indexOf(e);n>=0&&(r.splice(n,1),this.getTelemetryFromDatabaseConfigForm.get(t).setValue(r,{emitEvent:!0}))},r.prototype.addKey=function(e,t){var r=e.input,n=e.value;if((n||"").trim()){n=n.trim();var a=this.getTelemetryFromDatabaseConfigForm.get(t).value;a&&-1!==a.indexOf(n)||(a||(a=[]),a.push(n),this.getTelemetryFromDatabaseConfigForm.get(t).setValue(a,{emitEvent:!0}))}r&&(r.value="")},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-get-telemetry-from-database",template:'
\n \n \n \n \n \n {{key}}\n close\n \n \n \n \n \n \n tb.rulenode.fetch-mode\n \n \n {{ mode }}\n \n \n tb.rulenode.fetch-mode-hint\n \n
\n \n tb.rulenode.order-by\n \n \n {{ order }}\n \n \n tb.rulenode.order-by-hint\n \n \n tb.rulenode.limit\n \n tb.rulenode.limit-hint\n \n
\n \n {{ \'tb.rulenode.use-metadata-interval-patterns\' | translate }}\n \n
tb.rulenode.use-metadata-interval-patterns-hint
\n
\n
\n \n tb.rulenode.start-interval\n \n \n {{ \'tb.rulenode.start-interval-value-required\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n \n tb.rulenode.start-interval-time-unit\n \n \n {{ timeUnitsTranslationMap.get(timeUnit) | translate }}\n \n \n \n
\n
\n \n tb.rulenode.end-interval\n \n \n {{ \'tb.rulenode.end-interval-value-required\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n {{ \'tb.rulenode.time-value-range\' | translate }}\n \n \n \n tb.rulenode.end-interval-time-unit\n \n \n {{ timeUnitsTranslationMap.get(timeUnit) | translate }}\n \n \n \n
\n
\n \n \n tb.rulenode.start-interval-pattern\n \n \n {{ \'tb.rulenode.start-interval-pattern-required\' | translate }}\n \n \n \n \n tb.rulenode.end-interval-pattern\n \n \n {{ \'tb.rulenode.end-interval-pattern-required\' | translate }}\n \n \n \n \n
\n',styles:[":host label.tb-title{margin-bottom:-10px}"]}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Be=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.relatedAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.relatedAttributesConfigForm=this.fb.group({relationsQuery:[e?e.relationsQuery:null,[i.Validators.required]],telemetry:[!!e&&e.telemetry,[]],attrMapping:[e?e.attrMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-related-attributes-config",template:'
\n \n \n \n \n \n {{ \'tb.rulenode.latest-telemetry\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ge=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.tenantAttributesConfigForm},r.prototype.onConfigurationSet=function(e){this.tenantAttributesConfigForm=this.fb.group({telemetry:[!!e&&e.telemetry,[]],attrMapping:[e?e.attrMapping:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-tenant-attributes-config",template:'
\n \n \n {{ \'tb.rulenode.latest-telemetry\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),He=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.separatorKeysCodes=[m.ENTER,m.COMMA,m.SEMICOLON],n}return b(r,e),r.prototype.configForm=function(){return this.calculateDeltaConfigForm},r.prototype.onConfigurationSet=function(e){this.calculateDeltaConfigForm=this.fb.group({inputValueKey:[e?e.inputValueKey:null,[i.Validators.required]],outputValueKey:[e?e.outputValueKey:null,[i.Validators.required]],useCache:[e?e.useCache:null,[]],addPeriodBetweenMsgs:[!!e&&e.addPeriodBetweenMsgs,[]],periodValueKey:[e?e.periodValueKey:null,[]],round:[e?e.round:null,[i.Validators.min(0),i.Validators.max(15)]],tellFailureIfDeltaIsNegative:[e?e.tellFailureIfDeltaIsNegative:null,[]]})},r.prototype.updateValidators=function(e){this.calculateDeltaConfigForm.get("addPeriodBetweenMsgs").value?this.calculateDeltaConfigForm.get("periodValueKey").setValidators([i.Validators.required]):this.calculateDeltaConfigForm.get("periodValueKey").setValidators([]),this.calculateDeltaConfigForm.get("periodValueKey").updateValueAndValidity({emitEvent:e})},r.prototype.validatorTriggers=function(){return["addPeriodBetweenMsgs"]},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-enrichment-node-calculate-delta-config",template:'
\n
\n \n tb.rulenode.input-value-key\n \n \n {{ \'tb.rulenode.input-value-key-required\' | translate }}\n \n \n \n tb.rulenode.output-value-key\n \n \n {{ \'tb.rulenode.output-value-key-required\' | translate }}\n \n \n \n tb.rulenode.round\n \n \n {{ \'tb.rulenode.round-range\' | translate }}\n \n \n {{ \'tb.rulenode.round-range\' | translate }}\n \n \n
\n \n {{ \'tb.rulenode.use-cache\' | translate }}\n \n \n {{ \'tb.rulenode.tell-failure-if-delta-is-negative\' | translate }}\n \n \n {{ \'tb.rulenode.add-period-between-msgs\' | translate }}\n \n \n tb.rulenode.period-value-key\n \n \n {{ \'tb.rulenode.period-value-key-required\' | translate }}\n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),Ue=function(){function e(){}return e=h([t.NgModule({declarations:[Me,we,Re,De,Oe,Ke,Be,Ge,He],imports:[r.CommonModule,a.SharedModule,ue],exports:[Me,we,Re,De,Oe,Ke,Be,Ge,He]})],e)}(),je=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n.originatorSource=F,n.originatorSources=Object.keys(F),n.originatorSourceTranslationMap=w,n}return b(r,e),r.prototype.configForm=function(){return this.changeOriginatorConfigForm},r.prototype.onConfigurationSet=function(e){this.changeOriginatorConfigForm=this.fb.group({originatorSource:[e?e.originatorSource:null,[i.Validators.required]],relationsQuery:[e?e.relationsQuery:null,[]]})},r.prototype.validatorTriggers=function(){return["originatorSource"]},r.prototype.updateValidators=function(e){var t=this.changeOriginatorConfigForm.get("originatorSource").value;t&&t===F.RELATED?this.changeOriginatorConfigForm.get("relationsQuery").setValidators([i.Validators.required]):this.changeOriginatorConfigForm.get("relationsQuery").setValidators([]),this.changeOriginatorConfigForm.get("relationsQuery").updateValueAndValidity({emitEvent:e})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-transformation-node-change-originator-config",template:'
\n \n tb.rulenode.originator-source\n \n \n {{ originatorSourceTranslationMap.get(source) | translate }}\n \n \n \n
\n \n \n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),ze=function(e){function r(t,r,n,a){var o=e.call(this,t)||this;return o.store=t,o.fb=r,o.nodeScriptTestService=n,o.translate=a,o}return b(r,e),r.prototype.configForm=function(){return this.scriptConfigForm},r.prototype.onConfigurationSet=function(e){this.scriptConfigForm=this.fb.group({jsScript:[e?e.jsScript:null,[i.Validators.required]]})},r.prototype.testScript=function(){var e=this,t=this.scriptConfigForm.get("jsScript").value;this.nodeScriptTestService.testNodeScript(t,"update",this.translate.instant("tb.rulenode.transformer"),"Transform",["msg","metadata","msgType"],this.ruleNodeId).subscribe((function(t){t&&e.scriptConfigForm.get("jsScript").setValue(t)}))},r.prototype.onValidate=function(){this.jsFuncComponent.validateOnSubmit()},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder},{type:s.NodeScriptTestService},{type:n.TranslateService}]},h([t.ViewChild("jsFuncComponent",{static:!0}),C("design:type",a.JsFuncComponent)],r.prototype,"jsFuncComponent",void 0),r=h([t.Component({selector:"tb-transformation-node-script-config",template:'
\n \n \n \n
\n \n
\n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder,s.NodeScriptTestService,n.TranslateService])],r)}(a.RuleNodeConfigurationComponent),Qe=function(e){function r(t,r){var n=e.call(this,t)||this;return n.store=t,n.fb=r,n}return b(r,e),r.prototype.configForm=function(){return this.toEmailConfigForm},r.prototype.onConfigurationSet=function(e){this.toEmailConfigForm=this.fb.group({fromTemplate:[e?e.fromTemplate:null,[i.Validators.required]],toTemplate:[e?e.toTemplate:null,[i.Validators.required]],ccTemplate:[e?e.ccTemplate:null,[]],bccTemplate:[e?e.bccTemplate:null,[]],subjectTemplate:[e?e.subjectTemplate:null,[i.Validators.required]],bodyTemplate:[e?e.bodyTemplate:null,[i.Validators.required]]})},r.ctorParameters=function(){return[{type:o.Store},{type:i.FormBuilder}]},r=h([t.Component({selector:"tb-transformation-node-to-email-config",template:'
\n \n tb.rulenode.from-template\n \n \n {{ \'tb.rulenode.from-template-required\' | translate }}\n \n \n \n \n tb.rulenode.to-template\n \n \n {{ \'tb.rulenode.to-template-required\' | translate }}\n \n \n \n \n tb.rulenode.cc-template\n \n \n \n \n tb.rulenode.bcc-template\n \n \n \n \n tb.rulenode.subject-template\n \n \n {{ \'tb.rulenode.subject-template-required\' | translate }}\n \n \n \n \n tb.rulenode.body-template\n \n \n {{ \'tb.rulenode.body-template-required\' | translate }}\n \n \n \n
\n'}),C("design:paramtypes",[o.Store,i.FormBuilder])],r)}(a.RuleNodeConfigurationComponent),_e=function(){function e(){}return e=h([t.NgModule({declarations:[je,ze,Qe],imports:[r.CommonModule,a.SharedModule,ue],exports:[je,ze,Qe]})],e)}(),$e=function(){function e(e){!function(e){e.setTranslation("en_US",{tb:{rulenode:{"create-entity-if-not-exists":"Create new entity if not exists","create-entity-if-not-exists-hint":"Create a new entity set above if it does not exist.","entity-name-pattern":"Name pattern","entity-name-pattern-required":"Name pattern is required","entity-type-pattern":"Type pattern","entity-type-pattern-required":"Type pattern is required","entity-cache-expiration":"Entities cache expiration time (sec)","entity-cache-expiration-hint":"Specifies maximum time interval allowed to store found entity records. 0 value means that records will never expire.","entity-cache-expiration-required":"Entities cache expiration time is required.","entity-cache-expiration-range":"Entities cache expiration time should be greater than or equal to 0.","customer-name-pattern":"Customer name pattern","customer-name-pattern-required":"Customer name pattern is required","create-customer-if-not-exists":"Create new customer if not exists","customer-cache-expiration":"Customers cache expiration time (sec)","customer-cache-expiration-hint":"Specifies maximum time interval allowed to store found customer records. 0 value means that records will never expire.","customer-cache-expiration-required":"Customers cache expiration time is required.","customer-cache-expiration-range":"Customers cache expiration time should be greater than or equal to 0.","start-interval":"Start Interval","end-interval":"End Interval","start-interval-time-unit":"Start Interval Time Unit","end-interval-time-unit":"End Interval Time Unit","fetch-mode":"Fetch mode","fetch-mode-hint":"If selected fetch mode 'ALL' you able to choose telemetry sampling order.","order-by":"Order by","order-by-hint":"Select to choose telemetry sampling order.",limit:"Limit","limit-hint":"Min limit value is 2, max - 1000. In case you want to fetch a single entry, select fetch mode 'FIRST' or 'LAST'.","time-unit-milliseconds":"Milliseconds","time-unit-seconds":"Seconds","time-unit-minutes":"Minutes","time-unit-hours":"Hours","time-unit-days":"Days","time-value-range":"Time value should be in a range from 1 to 2147483647.","start-interval-value-required":"Start interval value is required.","end-interval-value-required":"End interval value is required.",filter:"Filter",switch:"Switch","message-type":"Message type","message-type-required":"Message type is required.","message-types-filter":"Message types filter","no-message-types-found":"No message types found","no-message-type-matching":"'{{messageType}}' not found.","create-new-message-type":"Create a new one!","message-types-required":"Message types are required.","client-attributes":"Client attributes","shared-attributes":"Shared attributes","server-attributes":"Server attributes","notify-device":"Notify Device","notify-device-hint":"If the message arrives from the device, we will push it back to the device by default.","latest-timeseries":"Latest timeseries","data-keys":"Message data","metadata-keys":"Message metadata","relations-query":"Relations query","device-relations-query":"Device relations query","max-relation-level":"Max relation level","relation-type-pattern":"Relation type pattern","relation-type-pattern-required":"Relation type pattern is required","relation-types-list":"Relation types to propagate","relation-types-list-hint":"If Propagate relation types are not selected, alarms will be propagated without filtering by relation type.","unlimited-level":"Unlimited level","latest-telemetry":"Latest telemetry","attr-mapping":"Attributes mapping","source-attribute":"Source attribute","source-attribute-required":"Source attribute is required.","source-telemetry":"Source telemetry","source-telemetry-required":"Source telemetry is required.","target-attribute":"Target attribute","target-attribute-required":"Target attribute is required.","attr-mapping-required":"At least one attribute mapping should be specified.","fields-mapping":"Fields mapping","fields-mapping-required":"At least one field mapping should be specified.","source-field":"Source field","source-field-required":"Source field is required.","originator-source":"Originator source","originator-customer":"Customer","originator-tenant":"Tenant","originator-related":"Related","originator-alarm-originator":"Alarm Originator","clone-message":"Clone message",transform:"Transform","default-ttl":"Default TTL in seconds","default-ttl-required":"Default TTL is required.","min-default-ttl-message":"Only 0 minimum TTL is allowed.","message-count":"Message count (0 - unlimited)","message-count-required":"Message count is required.","min-message-count-message":"Only 0 minimum message count is allowed.","period-seconds":"Period in seconds","period-seconds-required":"Period is required.","use-metadata-period-in-seconds-patterns":"Use period in seconds pattern","use-metadata-period-in-seconds-patterns-hint":"If selected, rule node use period in seconds interval pattern from message metadata or data assuming that intervals are in the seconds.","period-in-seconds-pattern":"Period in seconds pattern","period-in-seconds-pattern-required":"Period in seconds pattern is required","min-period-seconds-message":"Only 1 second minimum period is allowed.",originator:"Originator","message-body":"Message body","message-metadata":"Message metadata",generate:"Generate","test-generator-function":"Test generator function",generator:"Generator","test-filter-function":"Test filter function","test-switch-function":"Test switch function","test-transformer-function":"Test transformer function",transformer:"Transformer","alarm-create-condition":"Alarm create condition","test-condition-function":"Test condition function","alarm-clear-condition":"Alarm clear condition","alarm-details-builder":"Alarm details builder","test-details-function":"Test details function","alarm-type":"Alarm type","alarm-type-required":"Alarm type is required.","alarm-severity":"Alarm severity","alarm-severity-required":"Alarm severity is required","alarm-status-filter":"Alarm status filter","alarm-status-list-empty":"Alarm status list is empty","no-alarm-status-matching":"No alarm status matching were found.",propagate:"Propagate",condition:"Condition",details:"Details","to-string":"To string","test-to-string-function":"Test to string function","from-template":"From Template","from-template-required":"From Template is required","to-template":"To Template","to-template-required":"To Template is required","mail-address-list-template-hint":'Comma separated address list, use ${metadataKey} for value from metadata, $[messageKey] for value from message body',"cc-template":"Cc Template","bcc-template":"Bcc Template","subject-template":"Subject Template","subject-template-required":"Subject Template is required","body-template":"Body Template","body-template-required":"Body Template is required","request-id-metadata-attribute":"Request Id Metadata attribute name","timeout-sec":"Timeout in seconds","timeout-required":"Timeout is required","min-timeout-message":"Only 0 minimum timeout value is allowed.","endpoint-url-pattern":"Endpoint URL pattern","endpoint-url-pattern-required":"Endpoint URL pattern is required","request-method":"Request method","use-simple-client-http-factory":"Use simple client HTTP factory","read-timeout":"Read timeout in millis","read-timeout-hint":"The value of 0 means an infinite timeout","max-parallel-requests-count":"Max number of parallel requests","max-parallel-requests-count-hint":"The value of 0 specifies no limit in parallel processing",headers:"Headers","headers-hint":'Use ${metadataKey} for value from metadata, $[messageKey] for value from message body in header/value fields',header:"Header","header-required":"Header is required",value:"Value","value-required":"Value is required","topic-pattern":"Topic pattern","topic-pattern-required":"Topic pattern is required",topic:"Topic","topic-required":"Topic is required","bootstrap-servers":"Bootstrap servers","bootstrap-servers-required":"Bootstrap servers value is required","other-properties":"Other properties",key:"Key","key-required":"Key is required",retries:"Automatically retry times if fails","min-retries-message":"Only 0 minimum retries is allowed.","batch-size-bytes":"Produces batch size in bytes","min-batch-size-bytes-message":"Only 0 minimum batch size is allowed.","linger-ms":"Time to buffer locally (ms)","min-linger-ms-message":"Only 0 ms minimum value is allowed.","buffer-memory-bytes":"Client buffer max size in bytes","min-buffer-memory-message":"Only 0 minimum buffer size is allowed.",acks:"Number of acknowledgments","key-serializer":"Key serializer","key-serializer-required":"Key serializer is required","value-serializer":"Value serializer","value-serializer-required":"Value serializer is required","topic-arn-pattern":"Topic ARN pattern","topic-arn-pattern-required":"Topic ARN pattern is required","aws-access-key-id":"AWS Access Key ID","aws-access-key-id-required":"AWS Access Key ID is required","aws-secret-access-key":"AWS Secret Access Key","aws-secret-access-key-required":"AWS Secret Access Key is required","aws-region":"AWS Region","aws-region-required":"AWS Region is required","exchange-name-pattern":"Exchange name pattern","routing-key-pattern":"Routing key pattern","message-properties":"Message properties",host:"Host","host-required":"Host is required",port:"Port","port-required":"Port is required","port-range":"Port should be in a range from 1 to 65535.","virtual-host":"Virtual host",username:"Username",password:"Password","automatic-recovery":"Automatic recovery","connection-timeout-ms":"Connection timeout (ms)","min-connection-timeout-ms-message":"Only 0 ms minimum value is allowed.","handshake-timeout-ms":"Handshake timeout (ms)","min-handshake-timeout-ms-message":"Only 0 ms minimum value is allowed.","client-properties":"Client properties","queue-url-pattern":"Queue URL pattern","queue-url-pattern-required":"Queue URL pattern is required","delay-seconds":"Delay (seconds)","min-delay-seconds-message":"Only 0 seconds minimum value is allowed.","max-delay-seconds-message":"Only 900 seconds maximum value is allowed.",name:"Name","name-required":"Name is required","queue-type":"Queue type","sqs-queue-standard":"Standard","sqs-queue-fifo":"FIFO","gcp-project-id":"GCP project ID","gcp-project-id-required":"GCP project ID is required","gcp-service-account-key":"GCP service account key file","gcp-service-account-key-required":"GCP service account key file is required","pubsub-topic-name":"Topic name","pubsub-topic-name-required":"Topic name is required","message-attributes":"Message attributes","message-attributes-hint":'Use ${metadataKey} for value from metadata, $[messageKey] for value from message body in name/value fields',"connect-timeout":"Connection timeout (sec)","connect-timeout-required":"Connection timeout is required.","connect-timeout-range":"Connection timeout should be in a range from 1 to 200.","client-id":"Client ID","device-id":"Device ID","device-id-required":"Device ID is required.","clean-session":"Clean session","enable-ssl":"Enable SSL",credentials:"Credentials","credentials-type":"Credentials type","credentials-type-required":"Credentials type is required.","credentials-anonymous":"Anonymous","credentials-basic":"Basic","credentials-pem":"PEM","credentials-pem-hint":"At least Server CA certificate file or a pair of Client certificate and Client private key files are required","credentials-sas":"Shared Access Signature","sas-key":"SAS Key","sas-key-required":"SAS Key is required.",hostname:"Hostname","hostname-required":"Hostname is required.","azure-ca-cert":"CA certificate file","username-required":"Username is required.","password-required":"Password is required.","ca-cert":"Server CA certificate file *","private-key":"Client private key file *",cert:"Client certificate file *","no-file":"No file selected.","drop-file":"Drop a file or click to select a file to upload.","private-key-password":"Private key password","use-system-smtp-settings":"Use system SMTP settings","use-metadata-interval-patterns":"Use interval patterns","use-metadata-interval-patterns-hint":"If selected, rule node use start and end interval patterns from message metadata or data assuming that intervals are in the milliseconds.","use-message-alarm-data":"Use message alarm data","check-all-keys":"Check that all selected keys are present","check-all-keys-hint":"If selected, checks that all specified keys are present in the message data and metadata.","check-relation-to-specific-entity":"Check relation to specific entity","check-relation-hint":"Checks existence of relation to specific entity or to any entity based on direction and relation type.","delete-relation-to-specific-entity":"Delete relation to specific entity","delete-relation-hint":"Deletes relation from the originator of the incoming message to the specified entity or list of entities based on direction and type.","remove-current-relations":"Remove current relations","remove-current-relations-hint":"Removes current relations from the originator of the incoming message based on direction and type.","change-originator-to-related-entity":"Change originator to related entity","change-originator-to-related-entity-hint":"Used to process submitted message as a message from another entity.","start-interval-pattern":"Start interval pattern","end-interval-pattern":"End interval pattern","start-interval-pattern-required":"Start interval pattern is required","end-interval-pattern-required":"End interval pattern is required","smtp-protocol":"Protocol","smtp-host":"SMTP host","smtp-host-required":"SMTP host is required.","smtp-port":"SMTP port","smtp-port-required":"You must supply a smtp port.","smtp-port-range":"SMTP port should be in a range from 1 to 65535.","timeout-msec":"Timeout ms","min-timeout-msec-message":"Only 0 ms minimum value is allowed.","enter-username":"Enter username","enter-password":"Enter password","enable-tls":"Enable TLS","tls-version":"TLS version","enable-proxy":"Enable proxy","use-system-proxy-properties":"Use system proxy properties","proxy-host":"Proxy host","proxy-host-required":"Proxy host is required.","proxy-port":"Proxy port","proxy-port-required":"Proxy port is required.","proxy-port-range":"Proxy port should be in a range from 1 to 65535.","proxy-user":"Proxy user","proxy-password":"Proxy password","proxy-scheme":"Proxy scheme","numbers-to-template":"Phone Numbers To Template","numbers-to-template-required":"Phone Numbers To Template is required","numbers-to-template-hint":'Comma separated Phone Numbers, use ${metadataKey} for value from metadata, $[messageKey] for value from message body',"sms-message-template":"SMS message Template","sms-message-template-required":"SMS message Template is required","use-system-sms-settings":"Use system SMS provider settings","min-period-0-seconds-message":"Only 0 second minimum period is allowed.","max-pending-messages":"Maximum pending messages","max-pending-messages-required":"Maximum pending messages is required.","max-pending-messages-range":"Maximum pending messages should be in a range from 1 to 100000.","originator-types-filter":"Originator types filter","interval-seconds":"Interval in seconds","interval-seconds-required":"Interval is required.","min-interval-seconds-message":"Only 1 second minimum interval is allowed.","output-timeseries-key-prefix":"Output timeseries key prefix","output-timeseries-key-prefix-required":"Output timeseries key prefix required.","separator-hint":'You should press "enter" to complete field input.',"entity-details":"Select entity details:","entity-details-title":"Title","entity-details-country":"Country","entity-details-state":"State","entity-details-zip":"Zip","entity-details-address":"Address","entity-details-address2":"Address2","entity-details-additional_info":"Additional Info","entity-details-phone":"Phone","entity-details-email":"Email","add-to-metadata":"Add selected details to message metadata","add-to-metadata-hint":"If selected, adds the selected details keys to the message metadata instead of message data.","entity-details-list-empty":"No entity details selected.","no-entity-details-matching":"No entity details matching were found.","custom-table-name":"Custom table name","custom-table-name-required":"Table Name is required","custom-table-hint":"You should enter the table name without prefix 'cs_tb_'.","message-field":"Message field","message-field-required":"Message field is required.","table-col":"Table column","table-col-required":"Table column is required.","latitude-key-name":"Latitude key name","longitude-key-name":"Longitude key name","latitude-key-name-required":"Latitude key name is required.","longitude-key-name-required":"Longitude key name is required.","fetch-perimeter-info-from-message-metadata":"Fetch perimeter information from message metadata","perimeter-circle":"Circle","perimeter-polygon":"Polygon","perimeter-type":"Perimeter type","circle-center-latitude":"Center latitude","circle-center-latitude-required":"Center latitude is required.","circle-center-longitude":"Center longitude","circle-center-longitude-required":"Center longitude is required.","range-unit-meter":"Meter","range-unit-kilometer":"Kilometer","range-unit-foot":"Foot","range-unit-mile":"Mile","range-unit-nautical-mile":"Nautical mile","range-units":"Range units",range:"Range","range-required":"Range is required.","polygon-definition":"Polygon definition","polygon-definition-required":"Polygon definition is required.","polygon-definition-hint":"Please, use the following format for manual definition of polygon: [[lat1,lon1],[lat2,lon2], ... ,[latN,lonN]].","min-inside-duration":"Minimal inside duration","min-inside-duration-value-required":"Minimal inside duration is required","min-inside-duration-time-unit":"Minimal inside duration time unit","min-outside-duration":"Minimal outside duration","min-outside-duration-value-required":"Minimal outside duration is required","min-outside-duration-time-unit":"Minimal outside duration time unit","tell-failure-if-absent":"Tell Failure","tell-failure-if-absent-hint":'If at least one selected key doesn\'t exist the outbound message will report "Failure".',"get-latest-value-with-ts":"Fetch Latest telemetry with Timestamp","get-latest-value-with-ts-hint":'If selected, latest telemetry values will be added to the outbound message metadata with timestamp, e.g: "temp": "{\\"ts\\":1574329385897,\\"value\\":42}"',"use-redis-queue":"Use redis queue for message persistence","trim-redis-queue":"Trim redis queue","redis-queue-max-size":"Redis queue max size","add-metadata-key-values-as-kafka-headers":"Add Message metadata key-value pairs to Kafka record headers","add-metadata-key-values-as-kafka-headers-hint":"If selected, key-value pairs from message metadata will be added to the outgoing records headers as byte arrays with predefined charset encoding.","charset-encoding":"Charset encoding","charset-encoding-required":"Charset encoding is required.","charset-us-ascii":"US-ASCII","charset-iso-8859-1":"ISO-8859-1","charset-utf-8":"UTF-8","charset-utf-16be":"UTF-16BE","charset-utf-16le":"UTF-16LE","charset-utf-16":"UTF-16","select-queue-hint":"The queue name can be selected from a drop-down list or add a custom name.","persist-alarm-rules":"Persist state of alarm rules","fetch-alarm-rules":"Fetch state of alarm rules","input-value-key":"Input value key","input-value-key-required":"Input value key is required.","output-value-key":"Output value key","output-value-key-required":"Output value key is required.",round:"Decimals","round-range":"Decimals should be in a range from 0 to 15.","use-cache":"Use cache for latest value","tell-failure-if-delta-is-negative":"Tell Failure if delta is negative","add-period-between-msgs":"Add period between messages","period-value-key":"Period value key","period-key-required":"Period value key is required.","general-pattern-hint":'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body'},"key-val":{key:"Key",value:"Value","remove-entry":"Remove entry","add-entry":"Add entry"}}},!0)}(e)}return e.ctorParameters=function(){return[{type:n.TranslateService}]},e=h([t.NgModule({declarations:[x],imports:[r.CommonModule,a.SharedModule],exports:[qe,Pe,Ue,_e,x]}),C("design:paramtypes",[n.TranslateService])],e)}();e.RuleNodeCoreConfigModule=$e,e.ɵa=x,e.ɵb=qe,e.ɵba=ve,e.ɵbb=Fe,e.ɵbc=xe,e.ɵbd=Te,e.ɵbe=ue,e.ɵbf=ae,e.ɵbg=oe,e.ɵbh=ie,e.ɵbi=le,e.ɵbj=se,e.ɵbk=me,e.ɵbl=Pe,e.ɵbm=Se,e.ɵbn=Ie,e.ɵbo=ke,e.ɵbp=Ne,e.ɵbq=Ve,e.ɵbr=Ee,e.ɵbs=Ae,e.ɵbt=Le,e.ɵbu=Ue,e.ɵbv=Me,e.ɵbw=we,e.ɵbx=Re,e.ɵby=De,e.ɵbz=Oe,e.ɵc=T,e.ɵca=Ke,e.ɵcb=Be,e.ɵcc=Ge,e.ɵcd=He,e.ɵce=_e,e.ɵcf=je,e.ɵcg=ze,e.ɵch=Qe,e.ɵd=q,e.ɵe=S,e.ɵf=I,e.ɵg=k,e.ɵh=N,e.ɵi=V,e.ɵj=E,e.ɵk=A,e.ɵl=L,e.ɵm=P,e.ɵn=ee,e.ɵo=te,e.ɵp=re,e.ɵq=ne,e.ɵr=de,e.ɵs=pe,e.ɵt=ce,e.ɵu=fe,e.ɵv=ge,e.ɵw=ye,e.ɵx=be,e.ɵy=he,e.ɵz=Ce,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=rulenode-core-config.umd.min.js.map \ No newline at end of file diff --git a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/AlarmStateTest.java b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/AlarmStateTest.java new file mode 100644 index 0000000000..c7b9eb8a12 --- /dev/null +++ b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/AlarmStateTest.java @@ -0,0 +1,87 @@ +/** + * Copyright © 2016-2021 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.rule.engine.profile; + +import org.junit.Test; +import org.thingsboard.server.common.data.DataConstants; +import org.thingsboard.server.common.data.device.profile.AlarmCondition; +import org.thingsboard.server.common.data.device.profile.AlarmConditionSpec; +import org.thingsboard.server.common.data.device.profile.AlarmConditionSpecType; +import org.thingsboard.server.common.data.device.profile.AlarmRule; +import org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm; +import org.thingsboard.server.common.data.device.profile.DurationAlarmConditionSpec; +import org.thingsboard.server.common.data.device.profile.RepeatingAlarmConditionSpec; +import org.thingsboard.server.common.msg.TbMsgMetaData; + +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.mockito.Mockito.mock; + +public class AlarmStateTest { + + @Test + public void testSetAlarmConditionMetadata_repeatingCondition() { + AlarmRuleState ruleState = createMockAlarmRuleState(new RepeatingAlarmConditionSpec()); + int eventCount = 3; + ruleState.getState().setEventCount(eventCount); + + AlarmState alarmState = createMockAlarmState(); + TbMsgMetaData metaData = new TbMsgMetaData(); + + alarmState.setAlarmConditionMetadata(ruleState, metaData); + + assertEquals(AlarmConditionSpecType.REPEATING, ruleState.getSpec().getType()); + assertNotNull(metaData.getValue(DataConstants.ALARM_CONDITION_REPEATS)); + assertNull(metaData.getValue(DataConstants.ALARM_CONDITION_DURATION)); + assertEquals(String.valueOf(eventCount), metaData.getValue(DataConstants.ALARM_CONDITION_REPEATS)); + } + + @Test + public void testSetAlarmConditionMetadata_durationCondition() { + DurationAlarmConditionSpec spec = new DurationAlarmConditionSpec(); + spec.setUnit(TimeUnit.SECONDS); + AlarmRuleState ruleState = createMockAlarmRuleState(spec); + int duration = 12; + ruleState.getState().setDuration(duration); + + AlarmState alarmState = createMockAlarmState(); + TbMsgMetaData metaData = new TbMsgMetaData(); + + alarmState.setAlarmConditionMetadata(ruleState, metaData); + + assertEquals(AlarmConditionSpecType.DURATION, ruleState.getSpec().getType()); + assertNotNull(metaData.getValue(DataConstants.ALARM_CONDITION_DURATION)); + assertNull(metaData.getValue(DataConstants.ALARM_CONDITION_REPEATS)); + assertEquals(String.valueOf(duration), metaData.getValue(DataConstants.ALARM_CONDITION_DURATION)); + } + + private AlarmRuleState createMockAlarmRuleState(AlarmConditionSpec spec) { + AlarmCondition alarmCondition = new AlarmCondition(); + alarmCondition.setSpec(spec); + + AlarmRule alarmRule = new AlarmRule(); + alarmRule.setCondition(alarmCondition); + + return new AlarmRuleState(null, alarmRule, null, null, null); + } + + private AlarmState createMockAlarmState() { + return new AlarmState(null, null, mock(DeviceProfileAlarm.class), null, null); + } +} diff --git a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/TbDeviceProfileNodeTest.java b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/TbDeviceProfileNodeTest.java index 3cdac17b42..b980423c08 100644 --- a/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/TbDeviceProfileNodeTest.java +++ b/rule-engine/rule-engine-components/src/test/java/org/thingsboard/rule/engine/profile/TbDeviceProfileNodeTest.java @@ -36,6 +36,9 @@ import org.thingsboard.server.common.data.DeviceProfile; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.common.data.alarm.AlarmSeverity; import org.thingsboard.server.common.data.device.profile.AlarmCondition; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilter; +import org.thingsboard.server.common.data.device.profile.AlarmConditionFilterKey; +import org.thingsboard.server.common.data.device.profile.AlarmConditionKeyType; import org.thingsboard.server.common.data.device.profile.AlarmRule; import org.thingsboard.server.common.data.device.profile.DeviceProfileAlarm; import org.thingsboard.server.common.data.device.profile.DeviceProfileData; @@ -44,6 +47,7 @@ import org.thingsboard.server.common.data.id.DeviceId; import org.thingsboard.server.common.data.id.DeviceProfileId; import org.thingsboard.server.common.data.id.TenantId; import org.thingsboard.server.common.data.kv.AttributeKvEntry; +import org.thingsboard.server.common.data.query.BooleanFilterPredicate; import org.thingsboard.server.common.data.query.DynamicValue; import org.thingsboard.server.common.data.query.DynamicValueSourceType; import org.thingsboard.server.common.data.query.EntityKey; @@ -62,6 +66,7 @@ import org.thingsboard.server.dao.model.sql.AttributeKvCompositeKey; import org.thingsboard.server.dao.model.sql.AttributeKvEntity; import org.thingsboard.server.dao.timeseries.TimeseriesService; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Optional; @@ -69,6 +74,7 @@ import java.util.TreeMap; import java.util.UUID; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @RunWith(MockitoJUnitRunner.class) @@ -141,8 +147,8 @@ public class TbDeviceProfileNodeTest { DeviceProfile deviceProfile = new DeviceProfile(); DeviceProfileData deviceProfileData = new DeviceProfileData(); - KeyFilter highTempFilter = new KeyFilter(); - highTempFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter highTempFilter = new AlarmConditionFilter(); + highTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); highTempFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate highTemperaturePredicate = new NumericFilterPredicate(); highTemperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER); @@ -157,8 +163,8 @@ public class TbDeviceProfileNodeTest { dpa.setAlarmType("highTemperatureAlarm"); dpa.setCreateRules(new TreeMap<>(Collections.singletonMap(AlarmSeverity.CRITICAL, alarmRule))); - KeyFilter lowTempFilter = new KeyFilter(); - lowTempFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter lowTempFilter = new AlarmConditionFilter(); + lowTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); lowTempFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate lowTemperaturePredicate = new NumericFilterPredicate(); lowTemperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.LESS); @@ -203,6 +209,175 @@ public class TbDeviceProfileNodeTest { } + @Test + public void testConstantKeyFilterSimple() throws Exception { + init(); + + DeviceProfile deviceProfile = new DeviceProfile(); + deviceProfile.setId(deviceProfileId); + DeviceProfileData deviceProfileData = new DeviceProfileData(); + + Device device = new Device(); + device.setId(deviceId); + device.setCustomerId(customerId); + + AttributeKvCompositeKey compositeKey = new AttributeKvCompositeKey( + EntityType.TENANT, deviceId.getId(), "SERVER_SCOPE", "alarmEnabled" + ); + + AttributeKvEntity attributeKvEntity = new AttributeKvEntity(); + attributeKvEntity.setId(compositeKey); + attributeKvEntity.setBooleanValue(Boolean.TRUE); + attributeKvEntity.setLastUpdateTs(System.currentTimeMillis()); + + AttributeKvEntry entry = attributeKvEntity.toData(); + ListenableFuture> attrListListenableFuture = Futures.immediateFuture(Collections.singletonList(entry)); + + AlarmConditionFilter alarmEnabledFilter = new AlarmConditionFilter(); + alarmEnabledFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.CONSTANT, "alarmEnabled")); + alarmEnabledFilter.setValue(Boolean.TRUE); + alarmEnabledFilter.setValueType(EntityKeyValueType.BOOLEAN); + BooleanFilterPredicate alarmEnabledPredicate = new BooleanFilterPredicate(); + alarmEnabledPredicate.setOperation(BooleanFilterPredicate.BooleanOperation.EQUAL); + alarmEnabledPredicate.setValue(new FilterPredicateValue<>( + Boolean.FALSE, + null, + new DynamicValue<>(DynamicValueSourceType.CURRENT_DEVICE, "alarmEnabled") + )); + alarmEnabledFilter.setPredicate(alarmEnabledPredicate); + + AlarmConditionFilter temperatureFilter = new AlarmConditionFilter(); + temperatureFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); + temperatureFilter.setValueType(EntityKeyValueType.NUMERIC); + NumericFilterPredicate temperaturePredicate = new NumericFilterPredicate(); + temperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER); + temperaturePredicate.setValue(new FilterPredicateValue<>(20.0, null, null)); + temperatureFilter.setPredicate(temperaturePredicate); + + AlarmCondition alarmCondition = new AlarmCondition(); + alarmCondition.setCondition(Arrays.asList(alarmEnabledFilter, temperatureFilter)); + AlarmRule alarmRule = new AlarmRule(); + alarmRule.setCondition(alarmCondition); + DeviceProfileAlarm dpa = new DeviceProfileAlarm(); + dpa.setId("alarmEnabledAlarmID"); + dpa.setAlarmType("alarmEnabledAlarm"); + dpa.setCreateRules(new TreeMap<>(Collections.singletonMap(AlarmSeverity.CRITICAL, alarmRule))); + + deviceProfileData.setAlarms(Collections.singletonList(dpa)); + deviceProfile.setProfileData(deviceProfileData); + + Mockito.when(cache.get(tenantId, deviceId)).thenReturn(deviceProfile); + Mockito.when(timeseriesService.findLatest(tenantId, deviceId, Collections.singleton("temperature"))) + .thenReturn(Futures.immediateFuture(Collections.emptyList())); + Mockito.when(alarmService.findLatestByOriginatorAndType(tenantId, deviceId, "alarmEnabledAlarm")) + .thenReturn(Futures.immediateFuture(null)); + Mockito.when(alarmService.createOrUpdateAlarm(Mockito.any())).thenAnswer(AdditionalAnswers.returnsFirstArg()); + Mockito.when(ctx.getAttributesService()).thenReturn(attributesService); + Mockito.when(attributesService.find(eq(tenantId), eq(deviceId), Mockito.anyString(), Mockito.anySet())) + .thenReturn(attrListListenableFuture); + + TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), ""); + Mockito.when(ctx.newMsg(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.anyString())) + .thenReturn(theMsg); + + ObjectNode data = mapper.createObjectNode(); + data.put("temperature", 21); + TbMsg msg = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), + TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null); + + node.onMsg(ctx, msg); + verify(ctx).tellSuccess(msg); + verify(ctx).tellNext(theMsg, "Alarm Created"); + verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any()); + } + + @Test + public void testConstantKeyFilterInherited() throws Exception { + init(); + + DeviceProfile deviceProfile = new DeviceProfile(); + deviceProfile.setId(deviceProfileId); + DeviceProfileData deviceProfileData = new DeviceProfileData(); + + Device device = new Device(); + device.setId(deviceId); + device.setCustomerId(customerId); + + AttributeKvCompositeKey compositeKey = new AttributeKvCompositeKey( + EntityType.TENANT, tenantId.getId(), "SERVER_SCOPE", "alarmEnabled" + ); + + AttributeKvEntity attributeKvEntity = new AttributeKvEntity(); + attributeKvEntity.setId(compositeKey); + attributeKvEntity.setBooleanValue(Boolean.TRUE); + attributeKvEntity.setLastUpdateTs(System.currentTimeMillis()); + + AttributeKvEntry entry = attributeKvEntity.toData(); + ListenableFuture> attrListListenableFuture = Futures.immediateFuture(Optional.of(entry)); + + AlarmConditionFilter alarmEnabledFilter = new AlarmConditionFilter(); + alarmEnabledFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.CONSTANT, "alarmEnabled")); + alarmEnabledFilter.setValue(Boolean.TRUE); + alarmEnabledFilter.setValueType(EntityKeyValueType.BOOLEAN); + BooleanFilterPredicate alarmEnabledPredicate = new BooleanFilterPredicate(); + alarmEnabledPredicate.setOperation(BooleanFilterPredicate.BooleanOperation.EQUAL); + alarmEnabledPredicate.setValue(new FilterPredicateValue<>( + Boolean.FALSE, + null, + new DynamicValue<>(DynamicValueSourceType.CURRENT_DEVICE, "alarmEnabled", true) + )); + alarmEnabledFilter.setPredicate(alarmEnabledPredicate); + + AlarmConditionFilter temperatureFilter = new AlarmConditionFilter(); + temperatureFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); + temperatureFilter.setValueType(EntityKeyValueType.NUMERIC); + NumericFilterPredicate temperaturePredicate = new NumericFilterPredicate(); + temperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER); + temperaturePredicate.setValue(new FilterPredicateValue<>(20.0, null, null)); + temperatureFilter.setPredicate(temperaturePredicate); + + AlarmCondition alarmCondition = new AlarmCondition(); + alarmCondition.setCondition(Arrays.asList(alarmEnabledFilter, temperatureFilter)); + AlarmRule alarmRule = new AlarmRule(); + alarmRule.setCondition(alarmCondition); + DeviceProfileAlarm dpa = new DeviceProfileAlarm(); + dpa.setId("alarmEnabledAlarmID"); + dpa.setAlarmType("alarmEnabledAlarm"); + dpa.setCreateRules(new TreeMap<>(Collections.singletonMap(AlarmSeverity.CRITICAL, alarmRule))); + + deviceProfileData.setAlarms(Collections.singletonList(dpa)); + deviceProfile.setProfileData(deviceProfileData); + + Mockito.when(deviceService.findDeviceById(tenantId, deviceId)).thenReturn(device); + Mockito.when(cache.get(tenantId, deviceId)).thenReturn(deviceProfile); + Mockito.when(timeseriesService.findLatest(tenantId, deviceId, Collections.singleton("temperature"))) + .thenReturn(Futures.immediateFuture(Collections.emptyList())); + Mockito.when(alarmService.findLatestByOriginatorAndType(tenantId, deviceId, "alarmEnabledAlarm")) + .thenReturn(Futures.immediateFuture(null)); + Mockito.when(alarmService.createOrUpdateAlarm(Mockito.any())).thenAnswer(AdditionalAnswers.returnsFirstArg()); + Mockito.when(ctx.getAttributesService()).thenReturn(attributesService); + Mockito.when(attributesService.find(eq(tenantId), eq(deviceId), Mockito.anyString(), Mockito.anySet())) + .thenReturn(Futures.immediateFuture(Collections.emptyList())); + Mockito.when(attributesService.find(eq(tenantId), eq(customerId), Mockito.anyString(), Mockito.anyString())) + .thenReturn(Futures.immediateFuture(Optional.empty())); + Mockito.when(attributesService.find(eq(tenantId), eq(tenantId), Mockito.anyString(), Mockito.anyString())) + .thenReturn(attrListListenableFuture); + + TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), ""); + Mockito.when(ctx.newMsg(Mockito.anyString(), Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.anyString())) + .thenReturn(theMsg); + + ObjectNode data = mapper.createObjectNode(); + data.put("temperature", 21); + TbMsg msg = TbMsg.newMsg(SessionMsgType.POST_TELEMETRY_REQUEST.name(), deviceId, new TbMsgMetaData(), + TbMsgDataType.JSON, mapper.writeValueAsString(data), null, null); + + node.onMsg(ctx, msg); + verify(ctx).tellSuccess(msg); + verify(ctx).tellNext(theMsg, "Alarm Created"); + verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any()); + } + @Test public void testCurrentDeviceAttributeForDynamicValue() throws Exception { init(); @@ -228,8 +403,8 @@ public class TbDeviceProfileNodeTest { ListenableFuture> listListenableFutureWithLess = Futures.immediateFuture(Collections.singletonList(entry)); - KeyFilter highTempFilter = new KeyFilter(); - highTempFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter highTempFilter = new AlarmConditionFilter(); + highTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); highTempFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate highTemperaturePredicate = new NumericFilterPredicate(); highTemperaturePredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER); @@ -303,8 +478,8 @@ public class TbDeviceProfileNodeTest { ListenableFuture> optionalListenableFutureWithLess = Futures.immediateFuture(Optional.of(entry)); - KeyFilter lowTempFilter = new KeyFilter(); - lowTempFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter lowTempFilter = new AlarmConditionFilter(); + lowTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); lowTempFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate lowTempPredicate = new NumericFilterPredicate(); lowTempPredicate.setOperation(NumericFilterPredicate.NumericOperation.LESS); @@ -382,8 +557,8 @@ public class TbDeviceProfileNodeTest { ListenableFuture> optionalListenableFutureWithLess = Futures.immediateFuture(Optional.of(entry)); - KeyFilter lowTempFilter = new KeyFilter(); - lowTempFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter lowTempFilter = new AlarmConditionFilter(); + lowTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); lowTempFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate lowTempPredicate = new NumericFilterPredicate(); lowTempPredicate.setOperation(NumericFilterPredicate.NumericOperation.LESS); @@ -416,7 +591,7 @@ public class TbDeviceProfileNodeTest { Mockito.when(ctx.getAttributesService()).thenReturn(attributesService); Mockito.when(attributesService.find(eq(tenantId), eq(deviceId), Mockito.anyString(), Mockito.anySet())) .thenReturn(listListenableFutureWithLess); - Mockito.when(attributesService.find(eq(tenantId), eq(tenantId), eq(DataConstants.SERVER_SCOPE), Mockito.anyString())) + Mockito.when(attributesService.find(eq(tenantId), eq(tenantId), eq(DataConstants.SERVER_SCOPE), Mockito.anyString())) .thenReturn(optionalListenableFutureWithLess); TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), ""); @@ -454,8 +629,8 @@ public class TbDeviceProfileNodeTest { ListenableFuture> listListenableFutureWithLess = Futures.immediateFuture(Collections.singletonList(entry)); - KeyFilter lowTempFilter = new KeyFilter(); - lowTempFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter lowTempFilter = new AlarmConditionFilter(); + lowTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); lowTempFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate lowTempPredicate = new NumericFilterPredicate(); lowTempPredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER); @@ -502,9 +677,9 @@ public class TbDeviceProfileNodeTest { verify(ctx).tellSuccess(msg); verify(ctx).tellNext(theMsg, "Alarm Created"); verify(ctx, Mockito.never()).tellFailure(Mockito.any(), Mockito.any()); - } + @Test public void testCustomerInheritModeForDynamicValues() throws Exception { init(); @@ -527,8 +702,8 @@ public class TbDeviceProfileNodeTest { ListenableFuture> optionalListenableFutureWithLess = Futures.immediateFuture(Optional.of(entry)); - KeyFilter lowTempFilter = new KeyFilter(); - lowTempFilter.setKey(new EntityKey(EntityKeyType.TIME_SERIES, "temperature")); + AlarmConditionFilter lowTempFilter = new AlarmConditionFilter(); + lowTempFilter.setKey(new AlarmConditionFilterKey(AlarmConditionKeyType.TIME_SERIES, "temperature")); lowTempFilter.setValueType(EntityKeyValueType.NUMERIC); NumericFilterPredicate lowTempPredicate = new NumericFilterPredicate(); lowTempPredicate.setOperation(NumericFilterPredicate.NumericOperation.GREATER); @@ -561,7 +736,7 @@ public class TbDeviceProfileNodeTest { Mockito.when(ctx.getAttributesService()).thenReturn(attributesService); Mockito.when(attributesService.find(eq(tenantId), eq(deviceId), Mockito.anyString(), Mockito.anySet())) .thenReturn(listListenableFutureWithLess); - Mockito.when(attributesService.find(eq(tenantId), eq(tenantId), eq(DataConstants.SERVER_SCOPE), Mockito.anyString())) + Mockito.when(attributesService.find(eq(tenantId), eq(tenantId), eq(DataConstants.SERVER_SCOPE), Mockito.anyString())) .thenReturn(optionalListenableFutureWithLess); TbMsg theMsg = TbMsg.newMsg("ALARM", deviceId, new TbMsgMetaData(), ""); diff --git a/tools/src/main/shell/keygen.properties b/tools/src/main/shell/keygen.properties index 0fb36d4524..d2733e5b7b 100644 --- a/tools/src/main/shell/keygen.properties +++ b/tools/src/main/shell/keygen.properties @@ -15,6 +15,7 @@ # DOMAIN_SUFFIX="$(hostname)" +SUBJECT_ALTERNATIVE_NAMES="ip:127.0.0.1" ORGANIZATIONAL_UNIT=Thingsboard ORGANIZATION=Thingsboard CITY=SF diff --git a/tools/src/main/shell/server.keygen.sh b/tools/src/main/shell/server.keygen.sh index e01b17b8b2..7679cbd812 100755 --- a/tools/src/main/shell/server.keygen.sh +++ b/tools/src/main/shell/server.keygen.sh @@ -86,6 +86,12 @@ fi echo "Generating SSL Key Pair..." +EXT="" + +if [[ ! -z "$SUBJECT_ALTERNATIVE_NAMES" ]]; then + EXT="-ext san=$SUBJECT_ALTERNATIVE_NAMES " +fi + keytool -genkeypair -v \ -alias $SERVER_KEY_ALIAS \ -dname "CN=$DOMAIN_SUFFIX, OU=$ORGANIZATIONAL_UNIT, O=$ORGANIZATION, L=$CITY, ST=$STATE_OR_PROVINCE, C=$TWO_LETTER_COUNTRY_CODE" \ @@ -94,7 +100,8 @@ keytool -genkeypair -v \ -storepass $SERVER_KEYSTORE_PASSWORD \ -keyalg $SERVER_KEY_ALG \ -keysize $SERVER_KEY_SIZE \ - -validity 9999 + -validity 9999 \ + $EXT status=$? if [[ $status != 0 ]]; then diff --git a/transport/http/src/main/resources/tb-http-transport.yml b/transport/http/src/main/resources/tb-http-transport.yml index 7c98fa46dd..585bf50483 100644 --- a/transport/http/src/main/resources/tb-http-transport.yml +++ b/transport/http/src/main/resources/tb-http-transport.yml @@ -39,6 +39,7 @@ zk: transport: http: request_timeout: "${HTTP_REQUEST_TIMEOUT:60000}" + max_request_timeout: "${HTTP_MAX_REQUEST_TIMEOUT:300000}" sessions: inactivity_timeout: "${TB_TRANSPORT_SESSIONS_INACTIVITY_TIMEOUT:300000}" report_timeout: "${TB_TRANSPORT_SESSIONS_REPORT_TIMEOUT:30000}" diff --git a/transport/lwm2m/src/main/data/models/10241.xml b/transport/lwm2m/src/main/data/models/10241.xml deleted file mode 100644 index 83059a9be8..0000000000 --- a/transport/lwm2m/src/main/data/models/10241.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - HostDeviceInfo - - 10241 - urn:oma:lwm2m:x:10241 - - - Multiple - Optional - - Host Device Manufacturer - R - Multiple - Mandatory - String - - - - - Host Device Model Number - R - Multiple - Mandatory - String - - - - - Host Device Unique ID - R - Multiple - Mandatory - String - - - - - Host Device Software Version - R - Multiple - Mandatory - String - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10242.xml b/transport/lwm2m/src/main/data/models/10242.xml deleted file mode 100644 index f7d1017106..0000000000 --- a/transport/lwm2m/src/main/data/models/10242.xml +++ /dev/null @@ -1,647 +0,0 @@ - - - - - 3-Phase Power Meter - - - - 10242 - urn:oma:lwm2m:x:10242 - 1.0 - 1.0 - Multiple - Optional - - - Manufacturer - R - Single - Optional - String - - - - - - - - Model Number - R - Single - Optional - String - - - - - - - - Serial Number - R - Single - Optional - String - - - - - - - - Description - R - Single - Optional - String - - - - - - - - Tension R - R - Single - Mandatory - Float - - V - - - - - - Current R - R - Single - Mandatory - Float - - A - - - - - - Active Power R - R - Single - Optional - Float - - kW - - - - - - Reactive Power R - R - Single - Optional - Float - - kvar - - - - - - Inductive Reactive Power R - R - Single - Optional - Float - - kvar - - - - - - Capacitive Reactive Power R - R - Single - Optional - Float - - kvar - - - - - - Apparent Power R - R - Single - Optional - Float - - kVA - - - - - - Power Factor R - R - Single - Optional - Float - -1..1 - - - - - - - THD-V R - R - Single - Optional - Float - - /100 - - - - - - THD-A R - R - Single - Optional - Float - - /100 - - - - - - Tension S - R - Single - Mandatory - Float - - V - - - - - - Current S - R - Single - Mandatory - Float - - A - - - - - - Active Power S - R - Single - Optional - Float - - kW - - - - - - Reactive Power S - R - Single - Optional - Float - - kvar - - - - - - Inductive Reactive Power S - R - Single - Optional - Float - - kvar - - - - - - Capacitive Reactive Power S - R - Single - Optional - Float - - kvar - - - - - - Apparent Power S - R - Single - Optional - Float - - kVA - - - - - - Power Factor S - R - Single - Optional - Float - -1..1 - - - - - - - THD-V S - R - Single - Optional - Float - - /100 - - - - - - THD-A S - R - Single - Optional - Float - - /100 - - - - - - Tension T - R - Single - Mandatory - Float - - V - - - - - - Current T - R - Single - Mandatory - Float - - A - - - - - - Active Power T - R - Single - Optional - Float - - kW - - - - - - Reactive Power T - R - Single - Optional - Float - - kvar - - - - - - Inductive Reactive Power T - R - Single - Optional - Float - - kvar - - - - - - Capacitive Reactive Power T - R - Single - Optional - Float - - kvar - - - - - - Apparent Power T - R - Single - Optional - Float - - kVA - - - - - - Power Factor T - R - Single - Optional - Float - -1..1 - - - - - - - THD-V T - R - Single - Optional - Float - - /100 - - - - - - THD-A T - R - Single - Optional - Float - - /100 - - - - - - 3-Phase Active Power - R - Single - Optional - Float - - kW - - - - - - 3-Phase Reactive Power - R - Single - Optional - Float - - kvar - - - - - - 3-Phase Inductive Reactive Power - R - Single - Optional - Float - - kvar - - - - - - 3-Phase Capacitive Reactive Power - R - Single - Optional - Float - - kvar - - - - - - 3-Phase Apparent Power - R - Single - Optional - Float - - kVA - - - - - - 3-Phase Power Factor - R - Single - Optional - Float - -1..1 - - - - - - - 3-Phase phi cosine - R - Single - Optional - Float - -1..1 - - - - - - - Active Energy - R - Single - Optional - Float - - kWh - - - - - - Reactive Energy - R - Single - Optional - Float - - kvarh - - - - - - Inductive Reactive Energy - R - Single - Optional - Float - - kvarh - - - - - - Capacitive Reactive Energy - R - Single - Optional - Float - - kvarh - - - - - - Apparent Energy - R - Single - Optional - Float - - kVAh - - - - - - Tension R-S - R - Single - Optional - Float - - V - - - - - - Tension S-T - R - Single - Optional - Float - - V - - - - - - Tension T-R - R - Single - Optional - Float - - V - - - - - - Frequency - R - Single - Optional - Float - - Hz - - - - - - Neutral Current - R - Single - Optional - Float - - A - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10243.xml b/transport/lwm2m/src/main/data/models/10243.xml deleted file mode 100644 index 7841643a87..0000000000 --- a/transport/lwm2m/src/main/data/models/10243.xml +++ /dev/null @@ -1,251 +0,0 @@ - - - - - Single-Phase Power Meter - - - - 10243 - urn:oma:lwm2m:x:10243 - 1.0 - 1.0 - Multiple - Optional - - - Manufacturer - R - Single - Optional - String - - - - - - - - Model Number - R - Single - Optional - String - - - - - - - - Serial Number - R - Single - Optional - String - - - - - - - - Description - R - Single - Optional - String - - - - - - - - Tension - R - Single - Mandatory - String - - V - - - - - - Current - R - Single - Mandatory - Float - - A - - - - - - Active Power - R - Single - Optional - Float - - kW - - - - - - Reactive Power - R - Single - Optional - Float - - kvar - - - - - - Inductive Reactive Power - R - Single - Optional - Float - - kvar - - - - - - Capacitive Reactive Power - R - Single - Optional - Float - - kvar - - - - - - Apparent Power - R - Single - Optional - Float - - kVA - - - - - - Power Factor - R - Single - Optional - Float - -1..1 - - - - - - - THD-V - R - Single - Optional - Float - - /100 - - - - - - THD-A - R - Single - Optional - Float - - /100 - - - - - - Active Energy - R - Single - Optional - Float - - kWh - - - - - - Reactive Energy - R - Single - Optional - Float - - kvarh - - - - - - Apparent Energy - R - Single - Optional - Float - - kVAh - - - - - - Frequency - R - Single - Optional - Float - - Hz - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10244.xml b/transport/lwm2m/src/main/data/models/10244.xml deleted file mode 100644 index 0eca788cbf..0000000000 --- a/transport/lwm2m/src/main/data/models/10244.xml +++ /dev/null @@ -1,318 +0,0 @@ - - - - VehicleControlUnit - - 10244 - urn:oma:lwm2m:x:10244 - Single - Optional - - Vehicle UI State - R - Single - Mandatory - Integer - 0..15 - - - - Vehicle Speed - R - Single - Mandatory - Integer - - km/h - - - Vehicle Shift Status - R - Single - Mandatory - Integer - 0..3 - - - - Vehicle AP Position - R - Single - Mandatory - Integer - 0..100 - /100 - - - Vehicle Power - R - Single - Optional - Float - - kW - - - Vehicle Drive Energy - R - Single - Optional - Float - - Wh - - - Vehicle Energy Consumption Efficiency - R - Single - Optional - Float - - Wh/km - - - Vehicle Estimated Mileage - R - Single - Optional - Integer - - km - - - Vehicle Charge Cable Status - R - Single - Mandatory - Boolean - - - - - Vehicle Charge Status - R - Single - Mandatory - Integer - 0..15 - - - - Vehicle Charge Voltage - R - Single - Mandatory - Float - - V - - - Vehicle Charge Current - R - Single - Mandatory - Float - - A - - - Vehicle Charge Remaining Time - R - Single - Mandatory - Integer - - min - - - Battery Pack Voltage - R - Single - Mandatory - Float - - V - - - Battery Pack Current - R - Single - Mandatory - Float - - A - - - Battery Pack Remaining Capacity - R - Single - Mandatory - Integer - - Ah - - - Battery Pack SOC - R - Single - Mandatory - Integer - 0..100 - /100 - - - Battery Pack SOH - R - Single - Mandatory - Integer - 0..100 - /100 - - - Battery Cell MinVolt - R - Single - Mandatory - Integer - - mV - - - Battery Cell MaxVolt - R - Single - Mandatory - Integer - - mV - - - Battery Module MinTemp - R - Single - Mandatory - Integer - - Cel - - - Battery Module MaxTemp - R - Single - Mandatory - Integer - - Cel - - - Battery Connection Status - R - Single - Mandatory - Boolean - - - - - - MCU Voltage - R - Single - Mandatory - Integer - - V - - - MCU Temperature - R - Single - Mandatory - Integer - - Cel - - - Motor Speed - R - Single - Mandatory - Integer - - 1/min - - - Motor Temperature - R - Single - Mandatory - Integer - - Cel - - - Motor OT Warning - R - Single - Optional - Boolean - - - - - MCU OT Warning - R - Single - Optional - Boolean - - - - - Battery Pack OT Warning - R - Single - Optional - Boolean - - - - - MCU fault - R - Single - Optional - Boolean - - - - - Motor Error - R - Single - Optional - Boolean - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10245.xml b/transport/lwm2m/src/main/data/models/10245.xml deleted file mode 100644 index 4e16819aca..0000000000 --- a/transport/lwm2m/src/main/data/models/10245.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - Relay Management - This LWM2M Object provides a range of eNB related measurements and parameters of which several are changeable. Furthermore, it includes Resources to enable/disable the eNB. - 10245 - urn:oma:lwm2m:x:10245 - - - Single - Optional - - - eNB Availability - R - Single - Mandatory - Boolean - AVAILABLE; UNAVAILABLE - - This field indicates to the CCC whether or not the eNB of the CrowdBox is available for activation: AVAILABLE = TRUE; UNAVAILABLE = FALSE This is set by the CrowdBox itself using an algorithm specific to the use case and based on parameters known to the CrowdBox which may not necessarily be signalled to the network. In the absence of a more specific algorithm, this parameter should be set to AVAILABLE, unless a fault is detected which would prevent activation of the eNB, in which case it should be set to UNAVAILABLE. - - - GPS Status - R - Single - Mandatory - Boolean - UNSYNCHRONISED; SYNCHRONISED - - States whether the CrowdBox GPS receiver is synchronised to GPS time or not: UNSYCHRONISED = FALSE; SYNCHRONISED = TRUE If more than one GPS receiver is used by the CrowdBox, then SYNCHRONISED should be reported only if all receivers are synchronised. - - - Orientation - R - Single - Optional - Integer - -180..180 - deg - Orientation of CrowdBox with respect to magnetic north. The reference orientation of the CrowdBox shall be the pointing direction of the eNB antenna(s) or, in the case of an omni-directional CrowdBox antenna, as defined in the accompanying product documentation. - - - eNB EARFCN - RW - Single - Mandatory - Integer - 0..65535 - - EARFCN currently used by the eNB. Highest valid value in 3GPP is currently 46589. If the requested EARFCN is not supported by the eNB, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - eNB Bandwidth - RW - Single - Mandatory - Integer - 5, 10, 15, 20 - - Bandwidth of the currently used eNB carrier. If the requested bandwidth is not supported by the eNB, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Backhaul Primary EARFCN - RW - Single - Mandatory - Integer - 0..65535 - - EARFCN of primary cell used for the backhaul. If the requested EARFCN is not supported by the CrowdBox UE, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Backhaul Secondary EARFCN - RW - Multiple - Mandatory - Integer - 0..65535 - - EARFCN of any secondary cells used for the backhaul, in the event that carrier aggregation is being used. If the requested EARFCN is not supported by the CrowdBox UE, the response should be "Bad Request". The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Cumulative Measurement Window - RW - Single - Mandatory - Integer - 0..65535 - s - The current measurement interval over which cumulative statistics are collected for the following resources: Cumulative Number of Unique Users, Cumulative Downlink Throughput per Connected User, Cumulative Uplink Throughput per Connected User. Note that this measurement period is a sliding window rather than a granularity period. Measurements should never be reset, but rather old measurements should be removed from the cumulative total as they fall outside of the window. A value of 0 shall be interpreted as meaning only the current value should be reported. A value of 65535 shall be interpreted as an infinite window size (i.e. old measurements are never discarded). - - - eNB ECI - R - Single - Mandatory - Integer - 0..2^28-1 - - A 28 bit E-UTRAN Cell Identifier (ECI) - - - eNB Status - RW - Single - Mandatory - Boolean - - - This resource indicates the current status of the eNB and can be used by the CCC to change the state from enabled to disabled. TRUE = eNB enabled FALSE = eNB disabled - - - Enable eNB - E - Single - Mandatory - - - - Enables the eNB. In addition the CrowdBox shall also update its configuration to reflect the current state of other relevant parameters. This might require a reboot. - - - eNB Maximum Power - RW - Single - Mandatory - Integer - 0..63 - dBm - Maximum power for the eNB measured as the sum of input powers to all antenna connectors. The maximum power per antenna port is equal to the maximum eNB power divided by the number of antenna ports. If the requested power is above or below the maximum or minimum power levels of the eNB, then the power level should be set to the maximum or minimum respectively. The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Backhaul Primary q-OffsetFreq - RW - Single - Mandatory - Integer - -24..24 - dB - q-OffsetFreq parameter for the backhaul primary EARFCN in SIB5 of the CrowdBox eNB BCCH. See TS 36.331 for details. Range: dB-24; dB-22 .. dB24 The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Backhaul Secondary q-OffsetFreq - RW - Multiple - Mandatory - Integer - -24..24 - dB - q-OffsetFreq parameter for the backhaul secondary EARFCN in SIB5 of the CrowdBox eNB BCCH. See TS 36.331 for details Range: dB-24; dB-22 .. dB24 The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Neighbour CrowdBox EARFCN - RW - Multiple - Mandatory - Integer - 0..66635 - - EARFCN of a neighbour CrowdBox. Each instance of this resource relates to the same instance of resource ID 15. - - - Neighbour CrowdBox q-OffsetFreq - RW - Multiple - Mandatory - Integer - -24..24 - dB - q-OffsetFreq parameter of the Neighbour CrowdBox EARFCN in SIB5 of the Neighbour CrowdBox eNB BCCH. See TS 36.331 for details Range: dB-24; dB-22 .. dB24 Each instance of this resource relates to the same instance of resource ID 14. The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - Serving Macro eNB cellIndividualOffset - RW - Single - Mandatory - Integer - -24..24 - dB - Specifies the value of the cellIndividualOffset parameter applicable to the CrowdBox macro serving cell that is to be signalled to connected UEs in their measurement configuration information . See TS 36.331 for details. The CrowdBox shall only apply a change of this resource upon execution of the “Enable eNB” command. - - - - - diff --git a/transport/lwm2m/src/main/data/models/10246.xml b/transport/lwm2m/src/main/data/models/10246.xml deleted file mode 100644 index d519e6be2c..0000000000 --- a/transport/lwm2m/src/main/data/models/10246.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - CrowdBox Measurements - This LWM2M Object provides CrowdBox-related measurements such as serving cell parameters, backhaul timing advance, and neighbour cell reports. - 10246 - urn:oma:lwm2m:x:10246 - - - Single - Optional - - - Serving Cell ID - R - Single - Mandatory - Integer - 0..2^32-1 - - Serving cell ID as specified by the cellIdentity field broadcast in SIB1 of the serving cell (see TS 36.331). - - - Serving Cell RSRP - R - Single - Mandatory - Integer - 0..97 - - Serving cell RSRP, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 - - - Serving Cell RSRQ - R - Single - Mandatory - Integer - -30..46 - - Serving cell RSRQ, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 - - - Serving Cell SINR - R - Single - Mandatory - Integer - -10..30 - dB - SINR of serving cell as estimated by the CrowdBox. Note that this is a proprietary measurement dependent on the UE chipset manufacturer. The UE chipset used should be stated in the accompanying product documentation. - - - Cumulative Backhaul Timing Advance - R - Single - Optional - Integer - 0..65535 - - The cumulative timing advance signalled by the current serving cell to the CrowdBox. This is the sum of the initial timing advance signalled in the MAC payload of the Random Access Response (11 bits, 0 .. 1282) and subsequent adjustments signalled in the MAC PDU of DL-SCH transmissions (6 bits, -31 .. 32). See TS 36.321 for details. - - - Neighbour Cell Report - R - Multiple - Mandatory - Objlnk - - - A link to the "Neighbour Cell Report" object for each neighbour cell of the CrowdBox. - - - - - diff --git a/transport/lwm2m/src/main/data/models/10247.xml b/transport/lwm2m/src/main/data/models/10247.xml deleted file mode 100644 index aa2cec7ca8..0000000000 --- a/transport/lwm2m/src/main/data/models/10247.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Neighbour Cell Report - This LWM2M Object provides the neighbour cell report. The CrowdBox Measurements Object and the Connected UE Report Object have both Objlnk Resources pointing to this Object. - 10247 - urn:oma:lwm2m:x:10247 - - - Multiple - Optional - - - Neighbour PCI - R - Single - Mandatory - Integer - 0..503 - - Physical Cell ID of neighbouring LTE cell, as defined in TS 36.211 - - - Neighbour Cell ID - R - Single - Optional - Integer - 0..2^32-1 - - Neighbour cell ID as specified by the cellIdentity field broadcast in SIB1 of the neighbour cell (see TS 36.331). - - - Neighbour Cell Rank - R - Single - Mandatory - Integer - 0..255 - - Current neighbour cell rank. Neighbour cells should be ordered (ranked) by the CrowdBox according to neighbour cell RSRP, with a higher RSRP corresponding to a lower index. Hence the neighbouring cell with the highest RSRP should be neighbour cell 0, the second neighbour cell 1, and so on. - - - Neighbour Cell RSRP - R - Single - Mandatory - Integer - 0..97 - - Neighbour cell RSRP, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 - - - Neighbour Cell RSRQ - R - Single - Mandatory - Integer - -30..46 - - Neighbour cell RSRQ, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 - - - - - diff --git a/transport/lwm2m/src/main/data/models/10248.xml b/transport/lwm2m/src/main/data/models/10248.xml deleted file mode 100644 index 945cc4bc0e..0000000000 --- a/transport/lwm2m/src/main/data/models/10248.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Connected UE Measurements - This LWM2M Object provides a range of measurements of connected UEs and provides an Object link to the Connected UE report. - 10248 - urn:oma:lwm2m:x:10248 - - - Single - Optional - - - Number of Connected Users - R - Single - Mandatory - Integer - 0..255 - - The number of different UEs currently connected to the eNB (i.e. in RRC_CONNECTED state). - - - Cumulative Number of Unique Users - R - Single - Mandatory - Integer - 0..65535 - - The number of different UEs that have connected to the eNB over the immediately preceding period specified by the "Cumulative Measurement Window" field. - - - Connected UE Report - R - Multiple - Mandatory - Objlnk - - - Provides an Object link to the Connected UE Report which provides a range of information related to the connected UEs. - - - - - diff --git a/transport/lwm2m/src/main/data/models/10249.xml b/transport/lwm2m/src/main/data/models/10249.xml deleted file mode 100644 index 2f23f8fe74..0000000000 --- a/transport/lwm2m/src/main/data/models/10249.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - Connected UE Report - This LWM2M Object provides a range of information related to the connected UEs. - 10249 - urn:oma:lwm2m:x:10249 - - - Multiple - Optional - - - Connected User MMEC - R - Single - Mandatory - Integer - 0..255 - - MMEC signalled by the UE to the eNB in the RRCConnectionRequest message (see TS 36.331). - - - Connected User M-TMSI - R - Single - Mandatory - Integer - 0..2^32-1 - - M-TMSI signalled by the UE to the eNB in the RRCConnectionRequest message (see TS 36.331). - - - Serving Cell (CrowdBox) eNB RSRP - R - Single - Mandatory - Integer - 0..97 - - The RSRP of the CrowdBox eNB, as defined in TS 36.133, Section 9.1.4. Range: RSRP_00; RSRP_01 .. RSRP_97 - - - Serving Cell (CrowdBox) eNB RSRQ - R - Single - Mandatory - Integer - -30..46 - - The RSRQ of the CrowdBox eNB, as defined in TS 36.133, Section 9.1.7. Range: RSRQ_-30; RSRQ_-29 .. RSRQ_46 - - - Cumulative Timing Advance per Connected User - R - Single - Optional - Integer - 0..65535 - - The cumulative timing advance signalled by the eNB to each currently connected UE. This is the sum of the initial timing advance signalled in the MAC payload of the Random Access Response (11 bits, 0 .. 1282) and subsequent adjustments signalled in the MAC PDU of DL-SCH transmissions (6 bits, -31 .. 32). See TS 36.321 for details. - - - Last downlink CQI report per Connected User - R - Single - Mandatory - Integer - 0..255 - - The last downlink wideband CQI reported by a connected user the eNB. The CQI format is defined in Table 7.2.3-1 of TS 36.213. - - - Cumulative Downlink Throughput per Connected User - R - Single - Mandatory - Integer - 0..2^32-1 - B - The total number of MAC bytes sent to the connected user over the immediately preceding period specified by the "Cumulative Measurement Window" field. - - - Cumulative Uplink Throughput per Connected User - R - Single - Mandatory - Integer - 0..2^32-1 - B - The total number of MAC bytes received from the connected user over the immediately preceding period specified by the "Cumulative Measurement Window" field. - - - Neighbour Cell Report - R - Multiple - Mandatory - Objlnk - - - A link to the "Neighbour Cell Report" object for each neighbour cell reported to the CrowdBox by the connected UE - - - - - diff --git a/transport/lwm2m/src/main/data/models/10250.xml b/transport/lwm2m/src/main/data/models/10250.xml deleted file mode 100644 index 43ca19cb75..0000000000 --- a/transport/lwm2m/src/main/data/models/10250.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - App Data Container - - 10250 - urn:oma:lwm2m:x:10250 - 1.0 - 1.0 - Single - Optional - - - UL data - R - Single - Mandatory - Opaque - - - - - - - - DL data - W - Single - Mandatory - Opaque - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10251.xml b/transport/lwm2m/src/main/data/models/10251.xml deleted file mode 100644 index 33d4a683b4..0000000000 --- a/transport/lwm2m/src/main/data/models/10251.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - AT Command - - 10251 - urn:oma:lwm2m:x:10251 - 1.0 - 1.0 - Multiple - Optional - - - Command - RW - Single - Mandatory - String - - - - - - Response - R - Multiple - Mandatory - String - - - - - - Status - R - Multiple - Mandatory - String - - - - - - Timeout - RW - Single - Optional - Integer - - - - - - Run - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10252.xml b/transport/lwm2m/src/main/data/models/10252.xml deleted file mode 100644 index f5b51f57cd..0000000000 --- a/transport/lwm2m/src/main/data/models/10252.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - - Manifest - - 10252 - urn:oma:lwm2m:x:10252 - 1.0 - 1.0 - Single - Optional - - - Manifest - W - Single - Mandatory - Opaque - - - - - - - - State - R - Single - Mandatory - Integer - 0..8 - - - - - - Manifest Result - R - Single - Mandatory - Integer - 0..19 - - - - - - Payload Result - R - Single - Mandatory - Opaque - - - - - - - - Asset Hash - R - Single - Mandatory - Opaque - - - - - - - - Manifest version - R - Single - Mandatory - Integer - - - - - - - - Asset Installation Progress - R - Single - Mandatory - Integer - - - - - - - - Campaign Id - RW - Single - Mandatory - String - - - - - - - - Manual Trigger - E - Single - Mandatory - - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10253.xml b/transport/lwm2m/src/main/data/models/10253.xml deleted file mode 100644 index e6aa2fe8ba..0000000000 --- a/transport/lwm2m/src/main/data/models/10253.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Confidential Data - - 10253 - urn:oma:lwm2m:x:10253 - 1.0 - 1.0 - Single - Optional - - - Public Key - RW - Single - Mandatory - Opaque - - - - - - - - Application Data - R - Single - Mandatory - Opaque - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10254.xml b/transport/lwm2m/src/main/data/models/10254.xml deleted file mode 100644 index 5c42b8b127..0000000000 --- a/transport/lwm2m/src/main/data/models/10254.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - Current Loop Input - - 10254 - urn:oma:lwm2m:x:10254:1.0 - 1.0 - 1.0 - Multiple - Optional - - - Current Loop Input Current Value - R - Single - Mandatory - Float - 0; 3.8-20.5 - mA - - - - Min Measured Value - R - Single - Optional - Float - - - - - - Max Measured Value - R - Single - Optional - Float - - - - - - Min Range Value - R - Single - Optional - Float - - - - - - Max Range Value - R - Single - Optional - Float - - - - - - Reset Min and Max Measured Values - E - Single - Optional - - - - - - - Sensor Units - R - Single - Optional - String - - - - - - Application Type - RW - Single - Optional - String - - - - - - Current Calibration - RW - Single - Optional - Float - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10255.xml b/transport/lwm2m/src/main/data/models/10255.xml deleted file mode 100644 index 9c41eca0fb..0000000000 --- a/transport/lwm2m/src/main/data/models/10255.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - Device Metadata - - 10255 - urn:oma:lwm2m:x:10255 - 1.0 - 1.0 - Single - Optional - - - Protocol supported - R - Single - Mandatory - Integer - - - - - - - - Bootloader hash - R - Single - Mandatory - Opaque - - - - - - - - OEM bootloader hash - R - Single - Mandatory - Opaque - - - - - - - - Vendor - R - Single - Mandatory - String - - - - - - - - Class - R - Single - Mandatory - String - - - - - - - - Device - R - Single - Mandatory - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10256.xml b/transport/lwm2m/src/main/data/models/10256.xml deleted file mode 100644 index 9d1af33e5d..0000000000 --- a/transport/lwm2m/src/main/data/models/10256.xml +++ /dev/null @@ -1,134 +0,0 @@ - - - - - ECID-Signal Measurement Information - - 10256 - urn:oma:lwm2m:x:10256 - 1.0 - 1.0 - Multiple - Optional - - - physCellId - R - Single - Mandatory - Integer - - - - - - - - ECGI - R - Single - Optional - Integer - - - - - - - - arfcnEUTRA - R - Single - Mandatory - Integer - - - - - - - - rsrp-Result - R - Single - Mandatory - Integer - - - - - - - - rsrq-Result - R - Single - Optional - Integer - - - - - - - - ue-RxTxTimeDiff - R - Single - Optional - Integer - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10257.xml b/transport/lwm2m/src/main/data/models/10257.xml deleted file mode 100644 index f7db654454..0000000000 --- a/transport/lwm2m/src/main/data/models/10257.xml +++ /dev/null @@ -1,292 +0,0 @@ - - - - - Heat / Cooling meter - - 10257 - urn:oma:lwm2m:x:10257 - 1.0 - 1.0 - Multiple - Optional - - - Manufacturer - R - Single - Optional - String - - - - - - Model Number - R - Single - Optional - String - - - - - - Serial Number - R - Single - Optional - String - - - - - - Description - R - Single - Optional - String - - - - - - Error code - R - Multiple - Optional - Integer - - - - - - - Instantaneous active power - R - Single - Optional - Float - - W - - - - Max Measured active power - R - Multiple - Mandatory - Float - - W - - - - Cumulative active power - R - Single - Optional - Float - - Wh - - - - Flow temperature - R - Single - Optional - Float - - Cel - - - - Max Measured flow temperature - R - Single - Optional - Float - - Cel - - - - Return temperature - R - Single - Optional - Float - - Cel - - - - Max Measured return temperature - R - Single - Optional - Float - - Cel - - - - Temperature difference - R - Single - Optional - Float - - K - - - - Flow rate - R - Single - Optional - Float - - m3/s - - - - Max Measured flow - R - Single - Optional - Float - - m3/s - - - - Flow volume - R - Single - Optional - Float - - m3 - - - - Return volume - R - Single - Optional - Float - - m3 - - - - Current Time - RW - Single - Optional - Time - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10258.xml b/transport/lwm2m/src/main/data/models/10258.xml deleted file mode 100644 index e5534a39e6..0000000000 --- a/transport/lwm2m/src/main/data/models/10258.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Current Loop Output - - 10258 - urn:oma:lwm2m:x:10258 - 1.0 - 1.0 - Multiple - Optional - - - Current Loop Output Current Value - RW - Single - Mandatory - Float - 3.8-20.5 - mA - - - - Min Range Value - R - Single - Optional - Float - - - - - - Max Range Value - R - Single - Optional - Float - - - - - - Sensor Units - R - Single - Optional - String - - - - - - Application Type - RW - Single - Optional - String - - - - - - Current Calibration - RW - Single - Optional - Float - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10259.xml b/transport/lwm2m/src/main/data/models/10259.xml deleted file mode 100644 index e81e9aa711..0000000000 --- a/transport/lwm2m/src/main/data/models/10259.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - System Log - - 10259 - urn:oma:lwm2m:x:10259 - 1.0 - 1.0 - Multiple - Optional - - - Name - R - Single - Mandatory - String - - - - - - - - Read All - R - Single - Mandatory - String - - - - - - - - Read - R - Single - Optional - String - - - - - - - - Enabled - RW - Single - Optional - Boolean - - - - - - - - Capture Level - RW - Single - Optional - Integer - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10260-2_0.xml b/transport/lwm2m/src/main/data/models/10260-2_0.xml deleted file mode 100644 index d6e9b0caf0..0000000000 --- a/transport/lwm2m/src/main/data/models/10260-2_0.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - RDB - - 10260 - urn:oma:lwm2m:x:10260:2.0 - 1.0 - 2.0 - Multiple - Optional - - - Key - RW - Single - Mandatory - String - - - - - - - - Value - RW - Single - Optional - String - - - - - - - - Exists - RW - Single - Optional - Boolean - - - - - - - - Persistent - RW - Single - Optional - Boolean - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10262.xml b/transport/lwm2m/src/main/data/models/10262.xml deleted file mode 100644 index bc444c3cfc..0000000000 --- a/transport/lwm2m/src/main/data/models/10262.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Interval Data Delivery - - 10262 - urn:oma:lwm2m:x:10262 - Multiple - Optional - - - Name - RW - Single - Mandatory - String - - - - - - Interval Data Links - RW - Multiple - Mandatory - Objlnk - - - - - - Latest Payload - R - Multiple - Mandatory - Opaque - - - - - - Schedule - RW - Single - Optional - Objlnk - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10263.xml b/transport/lwm2m/src/main/data/models/10263.xml deleted file mode 100644 index efe90b704d..0000000000 --- a/transport/lwm2m/src/main/data/models/10263.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - Event Data Delivery - - 10263 - urn:oma:lwm2m:x:10263 - Multiple - Optional - - - Name - RW - Single - Mandatory - String - - - - - - Event Data Links - RW - Multiple - Mandatory - Objlnk - - - - - - Latest Eventlog - R - Multiple - Mandatory - Opaque - - - - - - Schedule - RW - Single - Mandatory - Objlnk - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10264.xml b/transport/lwm2m/src/main/data/models/10264.xml deleted file mode 100644 index 4f1000a044..0000000000 --- a/transport/lwm2m/src/main/data/models/10264.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - Delivery Schedule - - 10264 - urn:oma:lwm2m:x:10264 - Multiple - Optional - - - Schedule Start Time - RW - Single - Mandatory - Integer - - - - - - Schedule UTC Offset - RW - Single - Mandatory - String - - - - - - Delivery Frequency - RW - Single - Mandatory - Integer - - - - - - Randomised Delivery Window - RW - Single - Optional - Integer - - - - - - Number of Retries - RW - Single - Optional - Integer - - - - - - Retry Period - RW - Single - Optional - Integer - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10265.xml b/transport/lwm2m/src/main/data/models/10265.xml deleted file mode 100644 index bc7e8b32cb..0000000000 --- a/transport/lwm2m/src/main/data/models/10265.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Leakage Detection Configuration - - 10265 - urn:oma:lwm2m:x:10265 - Single - Optional - - - Sample Times - RW - Multiple - Mandatory - Integer - - - - - - Sample UTC Offset - RW - Single - Optional - String - - - - - - Detection Mode - RW - Single - Mandatory - Integer - 0..3 - - - - - Top Frequency Count - RW - Single - Optional - Integer - - - - - - Frequency Thresholds - RW - Multiple - Optional - Integer - 0..999 - - - - - Frequency Values - R - Multiple - Optional - Integer - - - - - - Firmware Version - R - Single - Mandatory - String - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10266.xml b/transport/lwm2m/src/main/data/models/10266.xml deleted file mode 100644 index 9d30d58ed8..0000000000 --- a/transport/lwm2m/src/main/data/models/10266.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Water Flow Readings - - 10266 - urn:oma:lwm2m:x:10266 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10267.xml b/transport/lwm2m/src/main/data/models/10267.xml deleted file mode 100644 index 17e251a1e4..0000000000 --- a/transport/lwm2m/src/main/data/models/10267.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Daily Maximum Flow Rate Readings - - 10267 - urn:oma:lwm2m:x:10267 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10268.xml b/transport/lwm2m/src/main/data/models/10268.xml deleted file mode 100644 index 2e8f405bc0..0000000000 --- a/transport/lwm2m/src/main/data/models/10268.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Temperature Readings - - 10268 - urn:oma:lwm2m:x:10268 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10269.xml b/transport/lwm2m/src/main/data/models/10269.xml deleted file mode 100644 index e72e27428e..0000000000 --- a/transport/lwm2m/src/main/data/models/10269.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Pressure Readings - - 10269 - urn:oma:lwm2m:x:10269 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10270.xml b/transport/lwm2m/src/main/data/models/10270.xml deleted file mode 100644 index 2a9470bad7..0000000000 --- a/transport/lwm2m/src/main/data/models/10270.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Battery Level Readings - - 10270 - urn:oma:lwm2m:x:10270 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10271.xml b/transport/lwm2m/src/main/data/models/10271.xml deleted file mode 100644 index 8a3f65f766..0000000000 --- a/transport/lwm2m/src/main/data/models/10271.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - Communications Activity Time Readings - - 10271 - urn:oma:lwm2m:x:10271 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10272.xml b/transport/lwm2m/src/main/data/models/10272.xml deleted file mode 100644 index b0971bf35c..0000000000 --- a/transport/lwm2m/src/main/data/models/10272.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Water Meter Customer Leakage Alarm - - 10272 - urn:oma:lwm2m:x:10272 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10273.xml b/transport/lwm2m/src/main/data/models/10273.xml deleted file mode 100644 index 49e0b80212..0000000000 --- a/transport/lwm2m/src/main/data/models/10273.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Water Meter Reverse Flow Alarm - - 10273 - urn:oma:lwm2m:x:10273 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10274.xml b/transport/lwm2m/src/main/data/models/10274.xml deleted file mode 100644 index 48f4bb9fbf..0000000000 --- a/transport/lwm2m/src/main/data/models/10274.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Water Meter Empty Pipe Alarm - - 10274 - urn:oma:lwm2m:x:10274 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10275.xml b/transport/lwm2m/src/main/data/models/10275.xml deleted file mode 100644 index a689b6ea41..0000000000 --- a/transport/lwm2m/src/main/data/models/10275.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Water Meter Tamper Alarm - - 10275 - urn:oma:lwm2m:x:10275 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10276.xml b/transport/lwm2m/src/main/data/models/10276.xml deleted file mode 100644 index e6f2980b43..0000000000 --- a/transport/lwm2m/src/main/data/models/10276.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Water Meter High Pressure Alarm - - 10276 - urn:oma:lwm2m:x:10276 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10277.xml b/transport/lwm2m/src/main/data/models/10277.xml deleted file mode 100644 index 53f64a3159..0000000000 --- a/transport/lwm2m/src/main/data/models/10277.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Water Meter Low Pressure Alarm - - 10277 - urn:oma:lwm2m:x:10277 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10278.xml b/transport/lwm2m/src/main/data/models/10278.xml deleted file mode 100644 index 17ac598967..0000000000 --- a/transport/lwm2m/src/main/data/models/10278.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - High Temperature Alarm - - 10278 - urn:oma:lwm2m:x:10278 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10279.xml b/transport/lwm2m/src/main/data/models/10279.xml deleted file mode 100644 index 1ddf9d6350..0000000000 --- a/transport/lwm2m/src/main/data/models/10279.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Low Temperature Alarm - - 10279 - urn:oma:lwm2m:x:10279 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10280.xml b/transport/lwm2m/src/main/data/models/10280.xml deleted file mode 100644 index d3f8f4a9a6..0000000000 --- a/transport/lwm2m/src/main/data/models/10280.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Water Network Leak Alarm - - 10280 - urn:oma:lwm2m:x:10280 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10281.xml b/transport/lwm2m/src/main/data/models/10281.xml deleted file mode 100644 index 449d9ba35d..0000000000 --- a/transport/lwm2m/src/main/data/models/10281.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Low Battery Alarm - - 10281 - urn:oma:lwm2m:x:10281 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10282.xml b/transport/lwm2m/src/main/data/models/10282.xml deleted file mode 100644 index b9d18ebeae..0000000000 --- a/transport/lwm2m/src/main/data/models/10282.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Daughter Board Failure Alarm - - 10282 - urn:oma:lwm2m:x:10282 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10283.xml b/transport/lwm2m/src/main/data/models/10283.xml deleted file mode 100644 index 1d5535c9ea..0000000000 --- a/transport/lwm2m/src/main/data/models/10283.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Device Reboot Event - - 10283 - urn:oma:lwm2m:x:10283 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10284.xml b/transport/lwm2m/src/main/data/models/10284.xml deleted file mode 100644 index 21985ff1b7..0000000000 --- a/transport/lwm2m/src/main/data/models/10284.xml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - Time Synchronisation Event - - 10284 - urn:oma:lwm2m:x:10284 - Multiple - Optional - - - Event Type - RW - Single - Mandatory - Integer - - - - - - Alarm Realtime - RW - Single - Mandatory - Boolean - - - - - - Alarm State - R - Single - Optional - Boolean - - - - - - Alarm Set Threshold - RW - Single - Optional - Float - - - - - - Alarm Set Operator - RW - Single - Optional - Integer - - - - - - Alarm Clear Threshold - RW - Single - Optional - Float - - - - - - Alarm Clear Operator - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Count - RW - Single - Optional - Integer - - - - - - Alarm Maximum Event Period - RW - Single - Optional - Integer - 1..864000 - s - - - - Latest Delivered Event Time - RW - Single - Optional - Time - - - - - - Latest Recorded Event Time - R - Single - Mandatory - Time - - - - - - Alarm Clear - E - Single - Optional - - - - - - - Alarm Auto Clear - RW - Single - Optional - Boolean - - - - - - Event Code - R - Single - Mandatory - Integer - 100..255 - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10286.xml b/transport/lwm2m/src/main/data/models/10286.xml deleted file mode 100644 index 2b82acfd0e..0000000000 --- a/transport/lwm2m/src/main/data/models/10286.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - App Fota Container - - 10286 - urn:oma:lwm2m:x:10286 - 1.0 - 1.0 - Single - Optional - - - UL data - R - Single - Mandatory - Opaque - - - - - - - - DL data - W - Single - Mandatory - Opaque - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10290.xml b/transport/lwm2m/src/main/data/models/10290.xml deleted file mode 100644 index 2986c01370..0000000000 --- a/transport/lwm2m/src/main/data/models/10290.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - - - Voltage Logging - - 10290 - urn:oma:lwm2m:x:10290 - 1.0 - 1.0 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10291.xml b/transport/lwm2m/src/main/data/models/10291.xml deleted file mode 100644 index 9f1e52c986..0000000000 --- a/transport/lwm2m/src/main/data/models/10291.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Voltage Transient - - 10291 - urn:oma:lwm2m:x:10291 - 1.0 - 1.0 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Mandatory - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Mandatory - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - Sample Frequency - RW - Single - Mandatory - Float - 0.0..86400.0 - s - How often the inputs are read/sampled.This value can be changed by doing a write command - - - - - diff --git a/transport/lwm2m/src/main/data/models/10292.xml b/transport/lwm2m/src/main/data/models/10292.xml deleted file mode 100644 index 66f1f0f718..0000000000 --- a/transport/lwm2m/src/main/data/models/10292.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - - Pressure Transient - - 10292 - urn:oma:lwm2m:x:10292 - 1.0 - 1.0 - Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Mandatory - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Mandatory - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - Sample Frequency - RW - Single - Mandatory - Float - 0.0..86400.0 - s - How often the inputs are read/sampled.This value can be changed by doing a write command - - - - - diff --git a/transport/lwm2m/src/main/data/models/10299.xml b/transport/lwm2m/src/main/data/models/10299.xml deleted file mode 100644 index b197dd867b..0000000000 --- a/transport/lwm2m/src/main/data/models/10299.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - HostDevice - This LWM2M Object provides a range of host device related information which can be queried by the LWM2M Server. The host device is any integrated device with an embedded cellular radio module. - 10299 - urn:oma:lwm2m:x:10299 - 1.0 - 1.0 - Single - Optional - - - Manufacturer - R - Single - Mandatory - String - - - Host device manufacturers name (OEM). - - - Model - R - Single - Mandatory - String - - Identifier of the model name or number determined by device manufacturer. - UniqueID - R - Single - Mandatory - String - - - Unique ID assigned by an manufacturer or other body. Used to uniquely identify a host device. Examples include serial # or UUID. - - - FirmwareVersion - R - Single - Mandatory - String - - - Current Firmware version of the host device. (manufacturer specified string). - - SoftwareVersion - R - Single - Optional - String - - - Current software version of the host device. (manufacturer specified string). - - HardwareVersion - R - Single - Optional - String - - - Current hardware version of the host device. (manufacturer specified string). - - - DateStamp - R - Single - Optional - String - - - UTC value of the time and date of the last Firmware or Software update. Format:MM:DD:YYYY HH:MM:SS - - - - - diff --git a/transport/lwm2m/src/main/data/models/10300.xml b/transport/lwm2m/src/main/data/models/10300.xml deleted file mode 100644 index 5dfa17144a..0000000000 --- a/transport/lwm2m/src/main/data/models/10300.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - LWM2M Meta Object - - - - 10300 - urn:oma:lwm2m:x:10300 - 1.0 - 1.0 - Multiple - Optional - - - ObjectID - R - Single - Mandatory - Integer - - - - - - - - ObjectURN - R - Single - Mandatory - String - - - - - - - - ObjectInstanceHandle - R - Single - Optional - Objlnk - - - - - - - - URI - R - Multiple - Mandatory - String - - - - - - - - SHAType - R - Single - Optional - Integer - 0..8 - - - - - - - ChecksumValue - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10308-2_0.xml b/transport/lwm2m/src/main/data/models/10308-2_0.xml deleted file mode 100644 index 802429e508..0000000000 --- a/transport/lwm2m/src/main/data/models/10308-2_0.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - AT&T Connectivity Extension - - 10308 - urn:oma:lwm2m:x:10308:2.0 - 1.0 - 2.0 - Multiple - Optional - - - ICCID - R - Single - Mandatory - String - - - - - - - IMSI - R - Single - Mandatory - String - - - - - - - MSISDN - RW - Single - Mandatory - String - - - - - - - APN Retries - RW - Single - Mandatory - Integer - - - - - - - APN Retry Period - RW - Single - Mandatory - Integer - - - s - - - - APN Retry Back-Off Period - RW - Single - Mandatory - Integer - - - s - - - - SINR - R - Single - Mandatory - Integer - <7 to >12.5 - - - - - SRXLEV - R - Single - Mandatory - Integer - - - - - - - CE_LEVEL - R - Single - Mandatory - Integer - 0,1,2 - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10309.xml b/transport/lwm2m/src/main/data/models/10309.xml deleted file mode 100644 index 6d5ece0364..0000000000 --- a/transport/lwm2m/src/main/data/models/10309.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - Shareparkinglot - - 10309 - urn:oma:lwm2m:x:10309 - 1.0 - 1.0 - Multiple - Optional - - - LockID - R - Single - Mandatory - Integer - - - - - - LockType - R - Single - Optional - String - - - - - - LightSwitchState - R - Multiple - Optional - Boolean - - - - - - RSSI - R - Multiple - Mandatory - Integer - -30..-120 - dBm - - - - BatteryCapacity - R - Multiple - Optional - Float - 0..100 - %EL - - - - DataUpTime - R - Multiple - Mandatory - Time - - - - - - Latitude - R - Multiple - Optional - String - - - - - - Longitude - R - Multiple - Optional - String - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10311.xml b/transport/lwm2m/src/main/data/models/10311.xml deleted file mode 100644 index ae66bde934..0000000000 --- a/transport/lwm2m/src/main/data/models/10311.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - - Solar Radiation - - This object is used to report solar irradiance (SI), i.e. power per unit area received from the Sun in the form of electromagnetic radiation, on a planar surface measured by a pyranometer or similar instrument. A pyranometer measures solar irradiance from the hemisphere above within a wavelength range 0.3 μm to 3 μm. For example, the application of solar radiation measurement can be meteorological networks and solar energy applications. - - 10311 - urn:oma:lwm2m:x:10311 - 1.0 - 1.0 - Multiple - Optional - - - Min Measured Value - R - Single - Optional - Float - - - - The minimum value measured by the sensor since it is ON or Reset, expressed in the unit defined by the "Sensor Units" resource if present. - - - - Max Measured Value - R - Single - Optional - Float - - - - The maximum value measured by the sensor since it is ON or Reset, expressed in the unit defined by the "Sensor Units" resource if present. - - - - Min Range Value - R - Single - Optional - Float - - - - The minimum value that can be measured by the sensor, expressed in the unit defined by the "Sensor Units" resource if present. - - - - Max Range Value - R - Single - Optional - Float - - - - The maximum value that can be measured by the sensor, expressed in the unit defined by the "Sensor Units" resource if present. - - - - Reset Min and Max Measured Values - E - Single - Optional - - - - - Reset the Min and Max Measured Values to current value. - - - - Timestamp - R - Single - Optional - Time - - - The timestamp of when the measurement was performed. - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor expressed in the unit defined by the "Sensor Units" resource if present. - - - Sensor Units - R - Single - Optional - String - - - - Measurement Units Definition. - - - - Application Type - RW - Single - Optional - String - - - - The application type of the sensor or actuator as a string, for instance "Air Pressure". - - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - - - diff --git a/transport/lwm2m/src/main/data/models/10313.xml b/transport/lwm2m/src/main/data/models/10313.xml deleted file mode 100644 index 17378a2ab1..0000000000 --- a/transport/lwm2m/src/main/data/models/10313.xml +++ /dev/null @@ -1,238 +0,0 @@ - - - - - Gas Readings - - 10313 - urn:oma:lwm2m:x:103131.0 - 1.0Multiple - Optional - - - Interval Period - R - Single - Mandatory - Integer - 1..864000 - s - - - - Interval Start Offset - R - Single - Optional - Integer - 0..86399 - s - - - - Interval UTC Offset - R - Single - Optional - String - - - - - - Interval Collection Start Time - R - Single - Mandatory - Time - - - - - - Oldest Recorded Interval - R - Single - Mandatory - Time - - - - - - Last Delivered Interval - RW - Single - Optional - Time - - - - - - Latest Recorded Interval - R - Single - Mandatory - Time - - - - - - Interval Delivery Midnight Aligned - RW - Single - Mandatory - Boolean - - - - - - Interval Historical Read - E - Single - Optional - - - - - - - Interval Historical Read Payload - R - Single - Optional - Opaque - - - - - - Interval Change Configuration - E - Single - Optional - - - - - - - Start - E - Single - Optional - - - - - - - Stop - E - Single - Optional - - - - - - - Status - R - Single - Optional - Integer - - - - - - Latest Payload - R - Single - Mandatory - Opaque - - - - - - Sensor Warm-up Time - RW - Single - Optional - Integer - 0..86400 - s - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10314.xml b/transport/lwm2m/src/main/data/models/10314.xml deleted file mode 100644 index 2c64f9198e..0000000000 --- a/transport/lwm2m/src/main/data/models/10314.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - Particulates - - 10314 - urn:oma:lwm2m:x:10314 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - - - - Min Measured Value - R - Single - Optional - Float - - - - - - Max Measured Value - R - Single - Optional - Float - - - - - - Max Range Value - R - Single - Optional - Float - - - - - - Sensor Units - R - Single - Optional - String - - - - - - Application Type - RW - Single - Optional - String - - - The Application type of the device, for example “Particulate Sensor”. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - - - - Measured Particle Size - R - Single - Mandatory - Float - - m - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10315.xml b/transport/lwm2m/src/main/data/models/10315.xml deleted file mode 100644 index 771fe508aa..0000000000 --- a/transport/lwm2m/src/main/data/models/10315.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Robot - - 10315 - urn:oma:lwm2m:x:10315 - 1.0 - 1.0 - Single - Mandatory - - - Robot ID - R - Single - Mandatory - String - 0..255 - - - - - Robot Type - R - Single - Mandatory - String - 0..63 - - - - - Robot Serial Number - R - Single - Mandatory - String - 0..63 - - - - - Battery Level - R - Single - Mandatory - Integer - 0..100 - % - - - - Charging - R - Single - Mandatory - Boolean - - - - - - On time - RW - Single - Mandatory - Integer - - s - - - - Positioning - R - Single - Optional - Boolean - - - - - - Location - R - Single - Optional - Objlnk - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10316.xml b/transport/lwm2m/src/main/data/models/10316.xml deleted file mode 100644 index 210e421449..0000000000 --- a/transport/lwm2m/src/main/data/models/10316.xml +++ /dev/null @@ -1,219 +0,0 @@ - - - - - RCU - - 10316 - urn:oma:lwm2m:x:10316 - 1.0 - 1.0 - Single - Mandatory - - - RCU ID - R - Single - Mandatory - String - 0..127 - - - - - RCU Serial Number - R - Single - Mandatory - String - 0..63 - - - - - RCU Software Version - R - Single - Mandatory - String - 0..63 - - - - - RCU OS Version - R - Single - Mandatory - String - 0..127 - - - - - RCU CPU Info - R - Single - Mandatory - String - 64 - - - - - RCU RAM Info - R - Single - Mandatory - String - 64 - - - - - RCU ROM Size - R - Single - Mandatory - Integer - - GB - - - - RCU ROM Available Size - R - Single - Mandatory - Integer - - GB - - - - SD Storage - R - Single - Mandatory - Integer - - GB - - - - SD Available Storage - R - Single - Mandatory - Integer - - GB - - - - RCU GPS Location - R - Single - Optional - Objlnk - - - - - - Wi-Fi MAC - R - Single - Optional - String - 12 - - - - - Bluetooth MAC - R - Single - Optional - String - 12 - - - - - Camera Info - R - Single - Optional - String - 64 - - - - - - Battery Level - R - Single - Mandatory - Integer - 0..100 - /100 - - - - - On time - RW - Single - Mandatory - Integer - - s - - - - - Downloaded APP Packages - R - Multiple - Mandatory - String - - - - - - - RCU APPs - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10318.xml b/transport/lwm2m/src/main/data/models/10318.xml deleted file mode 100644 index 845194f859..0000000000 --- a/transport/lwm2m/src/main/data/models/10318.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - RCU PM - - 10318 - urn:oma:lwm2m:x:10318 - 1.0 - 1.0 - Single - Mandatory - - - CPU Usage - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Max CPU Usage - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Memory Usage - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Storage Usage - R - Single - Mandatory - Integer - 0..100 - /100 - - - - - Battery Level - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Network Bandwidth - R - Single - Mandatory - Float - - Mbit/s - - - - Mobile Signal - R - Single - Mandatory - Integer - - - - - - GPS Signal - R - Single - Optional - Integer - - - - - - Wi-Fi Signal - R - Single - Mandatory - Integer - - - - - - UpLink Rate - R - Single - Mandatory - Float - - Mbit/s - - - - DownLink Rate - R - Single - Mandatory - Float - - Mbit/s - - - - Packet Loss Rate - R - Single - Mandatory - Integer - 0..100 - /100 - - - - Network Latency - R - Single - Mandatory - Integer - - ms - - - - - Battery Temperature - R - Single - Mandatory - Float - - Cel - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10319.xml b/transport/lwm2m/src/main/data/models/10319.xml deleted file mode 100644 index 448ba628b3..0000000000 --- a/transport/lwm2m/src/main/data/models/10319.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - RCU Control - - 10319 - urn:oma:lwm2m:x:10319 - 1.0 - 1.0 - Single - Mandatory - - - RCU Diagnostics Mode - R - Single - Optional - Boolean - - - - - - RCU Log Recording - R - Single - Optional - Boolean - - - - - - - RCU Shutdown - E - Single - Mandatory - - - - - - - RCU Restart - E - Single - Mandatory - - - - - - - RCU Deactivate - E - Single - Mandatory - - - - - - - RCU Reset - E - Single - Mandatory - - - - - - - RCU Diagnostics Mode Control - E - Single - Mandatory - - - - - - - RCU Log Recording Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10320.xml b/transport/lwm2m/src/main/data/models/10320.xml deleted file mode 100644 index 4f6dd55410..0000000000 --- a/transport/lwm2m/src/main/data/models/10320.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - - CCU - - 10320 - urn:oma:lwm2m:x:10320 - 1.0 - 1.0 - Multiple - Optional - - - CCU ID - R - Single - Mandatory - String - - - - - - CCU FM Version - R - Single - Mandatory - String - - - - - - CCU SW Version - R - Single - Mandatory - String - - - - - - CCU Memory Size - R - Single - Mandatory - Integer - - GB - - - - CCU Storage - R - Single - Mandatory - Integer - - GB - - - - CCU Available Storage - R - Single - Mandatory - Integer - - GB - - - - - On time - RW - Single - Mandatory - Integer - - s - - - - - Downloaded APP Packages - R - Multiple - Optional - String - - - - - - CCU APPs - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10322.xml b/transport/lwm2m/src/main/data/models/10322.xml deleted file mode 100644 index a09eb22f0e..0000000000 --- a/transport/lwm2m/src/main/data/models/10322.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - CCU PM - - 10322 - urn:oma:lwm2m:x:10322 - 1.0 - 1.0 - Multiple - Optional - - - CPU Usage - R - Single - Optional - Integer - 0..100 - % - - - - Max CPU Usage - R - Single - Optional - Integer - 0..100 - % - - - - Memory Usage - R - Single - Optional - Integer - 0..100 - % - - - - Storage Usage - R - Single - Optional - Integer - 0..100 - % - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10323.xml b/transport/lwm2m/src/main/data/models/10323.xml deleted file mode 100644 index 68fe77dea2..0000000000 --- a/transport/lwm2m/src/main/data/models/10323.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - CCU Control - - 10323 - urn:oma:lwm2m:x:10323 - 1.0 - 1.0 - Multiple - Optional - - - - CCU Restart - E - Single - Mandatory - - - - - - - CCU Reset - E - Single - Mandatory - - - - - - - CCU Self-checking - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10324.xml b/transport/lwm2m/src/main/data/models/10324.xml deleted file mode 100644 index 73e2d1e12a..0000000000 --- a/transport/lwm2m/src/main/data/models/10324.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - ECU - - 10324 - urn:oma:lwm2m:x:10324 - 1.0 - 1.0 - Multiple - Optional - - - ECU ID - R - Single - Mandatory - String - - - - - - ECU FM Version - R - Single - Mandatory - String - - - - - - On time - RW - Single - Mandatory - Integer - - s - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10326.xml b/transport/lwm2m/src/main/data/models/10326.xml deleted file mode 100644 index 4a521e6b90..0000000000 --- a/transport/lwm2m/src/main/data/models/10326.xml +++ /dev/null @@ -1,708 +0,0 @@ - - - - - Robot PM - - 10326 - urn:oma:lwm2m:x:10326 - 1.0 - 1.0 - Single - Mandatory - - - Battery Level - R - Single - Mandatory - Integer - 0..100 - /100 - - - - - Battery Temperature - R - Single - Mandatory - Integer - - Cel - - - - Temperature - R - Single - Optional - Float - - Cel - - - - Humidity - R - Single - Optional - Integer - 0..100 - /100 - - - - PM2.5 - R - Single - Optional - Integer - - ug/m3 - - - - Smog - R - Single - Optional - Float - - ug/m3 - - - - CO - R - Single - Optional - Float - - ppm - - - - CO2 - R - Single - Optional - Float - - ppm - - - - PM10 - R - Single - Optional - Integer - - ug/m3 - - - - Speed - R - Single - Optional - Float - - m/h - - - - Water Used - R - Single - Optional - Integer - 0..100 - /100 - - - - Dust Box Used - R - Single - Optional - Integer - 0..100 - /100 - - - - Obstacle Distance - R - Single - Optional - Integer - - cm - - - - - Robot Temperate - R - Single - Optional - Float - - Cel - - - - Confidence Index - R - Single - Optional - Integer - 0..100 - /100 - - - - - Data Traffic Used - R - Single - Mandatory - Float - - Mbit/s - - - - Images Handled - R - Single - Optional - Integer - - - - - - HARI S-Voice Requests - R - Single - Optional - Integer - - - - - - HARI S-Vision Requests - R - Single - Optional - Integer - - - - - - HARI S-Motion Requests - R - Single - Optional - Integer - - - - - - HARI S-Map Requests - R - Single - Optional - Integer - - - - - - Successful HARI S-Voice Requests - R - Single - Optional - Integer - - - - - - Successful HARI S-Vision Requests - R - Single - Optional - Integer - - - - - - Successful HARI S-Motion Requests - R - Single - Optional - Integer - - - - - - Successful HARI S-Map Requests - R - Single - Optional - Integer - - - - - - Questions Answered - R - Single - Optional - Integer - - - - - - Unknown Questions - R - Single - Optional - Integer - - - - - - Mileage - R - Single - Optional - Integer - - m - - - - Cleaned Times - R - Single - Optional - Integer - - - - - - Cleaned Area - R - Single - Optional - Float - - m2 - - - - Cleaned Time - R - Single - Optional - Integer - - s - - - - ASR Recognized - R - Single - Optional - Integer - - B - - - - Incorrect ASR Recognitions - R - Single - Optional - Integer - - B - - - - Tried TTS Texts - R - Single - Optional - Integer - - B - - - - Successful TTS Texts - R - Single - Optional - Integer - - B - - - - ASR Recognized (CH) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (CH) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (CH) - R - Single - Optional - Integer - - B - - - - ASR Recognized (EN) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (EN) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (EN) - R - Single - Optional - Integer - - B - - - - ASR Recognized (ES) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (ES) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (ES) - R - Single - Optional - Integer - - B - - - - ASR Recognized (JA) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (JA) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (JA) - R - Single - Optional - Integer - - B - - - - ASR Recognized (SCCH) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (SCCH) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (SCCH) - R - Single - Optional - Integer - - B - - - - ASR Recognized (GDCH) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (GDCH) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (GDCH) - R - Single - Optional - Integer - - B - - - - ASR Recognized (TCH) - R - Single - Optional - Integer - - B - - - - Tried TTS Texts (TCH) - R - Single - Optional - Integer - - B - - - - Successful TTS Texts (TCH) - R - Single - Optional - Integer - - B - - - - - Objects Recognition Tries - R - Single - Optional - Integer - - - - - - Successful Object Recognition - R - Single - Optional - Integer - - - - - - Face Recognition Tries - R - Single - Optional - Integer - - - - - - Successful Face Recognitions - R - Single - Optional - Integer - - - - - - Vehicle Plate Recognition Tries - R - Single - Optional - Integer - - - - - - Successful Vehicle Plate Recognitions - R - Single - Optional - Integer - - - - - - Tasks Assigned - R - Single - Mandatory - Integer - - - - - - Successful Tasks Executed - R - Single - Mandatory - Integer - - - - - - Images Uploaded - R - Single - Optional - Integer - - - - - - Videos Uploaded - R - Single - Optional - Integer - - - - - - Images Matted - R - Single - Optional - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10327.xml b/transport/lwm2m/src/main/data/models/10327.xml deleted file mode 100644 index 1dd8d6dc87..0000000000 --- a/transport/lwm2m/src/main/data/models/10327.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Compressor - - 10327 - urn:oma:lwm2m:x:10327 - 1.0 - 1.0 - Multiple - Optional - - - Compressor Name - R - Single - Mandatory - String - - - - - - - Compressor Status - R - Single - Mandatory - Boolean - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10328.xml b/transport/lwm2m/src/main/data/models/10328.xml deleted file mode 100644 index 314e9c78ed..0000000000 --- a/transport/lwm2m/src/main/data/models/10328.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - SCA PM - - 10328 - urn:oma:lwm2m:x:10328 - 1.0 - 1.0 - Multiple - Optional - - - SCA Name - R - Single - Mandatory - String - - - - - - - - - SCA Current - R - Single - Mandatory - Float - - A - - - - SCA Temperate - R - Single - Mandatory - Float - - Cel - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10329.xml b/transport/lwm2m/src/main/data/models/10329.xml deleted file mode 100644 index dce68e80b9..0000000000 --- a/transport/lwm2m/src/main/data/models/10329.xml +++ /dev/null @@ -1,419 +0,0 @@ - - - - - Robot Control - - 10329 - urn:oma:lwm2m:x:10329 - 1.0 - 1.0 - Single - Mandatory - - - Collision Detection - R - Single - Optional - Boolean - - - - - - Drop Detection - R - Single - Optional - Boolean - - - - - - Automatic Navigation - R - Single - Optional - Boolean - - - - - - Robot Shutdown - E - Single - Mandatory - - - - - - - Robot Reboot - E - Single - Mandatory - - - - - - - Robot Reset - E - Single - Mandatory - - - - - - - Robot Wakeup - E - Single - Mandatory - - - - - - - Robot Sleep - E - Single - Mandatory - - - - - - - Robot Self-checking - E - Single - Mandatory - - - - - - - Emergency Braking - E - Single - Mandatory - - - - - - - Emergency Braking Release - E - Single - Mandatory - - - - - - - Action Execution - E - Single - Optional - - - - - - - Action List Upload - E - Single - Optional - - - - - - - Action List Download - E - Single - Optional - - - - - - - Group Dancing Program Control - E - Single - Optional - - - - - - - Navigation Map Upload - E - Single - Optional - - - - - - - Group Dancing Program Control - E - Single - Optional - - - - - - - Navigation Map Download - E - Single - Optional - - - - - - - Route list Execution - E - Single - Optional - - - - - - - Route list Upload - E - Single - Optional - - - - - - - Route list Download - E - Single - Optional - - - - - - - Automatic Navigation Control - E - Single - Optional - - - - - - - Manual Navigation - E - Single - Optional - - - - - - - Moving to Charging Station - E - Single - Optional - - - - - - - Moving to Specified location - E - Single - Optional - - - - - - - Low Frequency Patrol Broadcasting - E - Single - Optional - - - - - - - Task Start - E - Single - Optional - - - - - - - Task Stop - E - Single - Optional - - - - - - - Task Suspend - E - Single - Optional - - - - - - - Task Resume - E - Single - Optional - - - - - - - Video Upload - E - Single - Optional - - - - - - - Picture Upload - E - Single - Optional - - - - - - - Default Language Switching - E - Single - Optional - - - - - - - Intonation Change - E - Single - Optional - - - - - - - Intonation Change - E - Single - Optional - - - - - - - Speaking with Action - E - Single - Optional - - - - - - - Collision Detection Control - E - Single - Mandatory - - - - - - - Drop Detection Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10330.xml b/transport/lwm2m/src/main/data/models/10330.xml deleted file mode 100644 index bbbe3c88f8..0000000000 --- a/transport/lwm2m/src/main/data/models/10330.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - Network Info - - 10330 - urn:oma:lwm2m:x:10330 - 1.0 - 1.0 - Single - Mandatory - - - IMEI - R - Single - Mandatory - String - 15 - - - - - IMSI - R - Single - Mandatory - String - 15 - - - - - Radio Connectivity - R - Single - Mandatory - Objlnk - - - - - - - - GPS Signal Status - R - Single - Optional - Integer - 1..4 - - - - - VBN Connection Status - R - Single - Mandatory - Integer - 0..1 - - - - - HARI Connection Status - R - Single - Mandatory - Integer - 0..1 - - - - - CCU Connection Status - R - Multiple - Optional - Integer - 0..1 - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10331.xml b/transport/lwm2m/src/main/data/models/10331.xml deleted file mode 100644 index 86a64b6c57..0000000000 --- a/transport/lwm2m/src/main/data/models/10331.xml +++ /dev/null @@ -1,207 +0,0 @@ - - - - - Robot Service Info - - 10331 - urn:oma:lwm2m:x:10331 - 1.0 - 1.0 - Single - Mandatory - - - Current status - R - Single - Mandatory - String - 0..127 - - - - - Services Providing - R - Single - Optional - String - 0..127 - - - - - Advertising Contents - R - Single - Mandatory - String - - - - - - Current Language - R - Single - Optional - String - 0..127 - - - - - Volume - R - Single - Optional - String - 0..100 - /100 - - - - Moving Status - R - Single - Optional - Integer - 0..2 - - - - - Moving Speed - R - Single - Optional - Float - - m/h - - - - Location - R - Single - Optional - Objlnk - - - - - - - - Map List - R - Single - Optional - String - - - - - - Planned Route list - R - Single - Optional - String - - - - - - Current Route - R - Single - Optional - String - - - - - - Route to-do List - R - Single - Optional - String - - - - - - Synchronous Whistle - R - Single - Mandatory - Boolean - - - - - - Current Actions - R - Single - Optional - String - - - - - - ASR Type - R - Single - Optional - Integer - 0..2 - - - - - - TTS Vendor - R - Single - Optional - String - - - - - - TTS Speaker - R - Single - Optional - String - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10332.xml b/transport/lwm2m/src/main/data/models/10332.xml deleted file mode 100644 index 7d6f5b96bd..0000000000 --- a/transport/lwm2m/src/main/data/models/10332.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Robot Selfcheck Info - - 10332 - urn:oma:lwm2m:x:10332 - 1.0 - 1.0 - Multiple - Optional - - - Entity - R - Single - Mandatory - String - 4..63 - - - - - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10333.xml b/transport/lwm2m/src/main/data/models/10333.xml deleted file mode 100644 index cfc196772d..0000000000 --- a/transport/lwm2m/src/main/data/models/10333.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - PM Threshold - - 10333 - urn:oma:lwm2m:x:10333 - 1.0 - 1.0 - Single - Optional - - - Entity - RW - Multiple - Mandatory - String - 4..63 - - - - - Performance Type - RW - Multiple - Mandatory - String - - - - - - High Threshold - RW - Multiple - Mandatory - Float - - - - - - Low Threshold - RW - Multiple - Mandatory - Float - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10334.xml b/transport/lwm2m/src/main/data/models/10334.xml deleted file mode 100644 index 4a2ee25614..0000000000 --- a/transport/lwm2m/src/main/data/models/10334.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Robot Alarm - - 10334 - urn:oma:lwm2m:x:10334 - 1.0 - 1.0 - Multiple - Optional - - - Entity - R - Single - Mandatory - String - 4..63 - - - - - Probable Cause - R - Single - Mandatory - Integer - 0..65535 - - - - - Specific Problem - R - Single - Mandatory - String - - - - - - Alarm Type - R - Single - Mandatory - Integer - 2..6 - - - - - Severity - R - Single - Mandatory - Integer - 1..5 - - - - - Report Time - R - Single - Mandatory - Time - - - - - - Sequence No - R - Single - Mandatory - Integer - 0..2^63-1 - - - - - Additional Info - R - Single - Optional - String - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10335.xml b/transport/lwm2m/src/main/data/models/10335.xml deleted file mode 100644 index d7b1d9a027..0000000000 --- a/transport/lwm2m/src/main/data/models/10335.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Event - - 10335 - urn:oma:lwm2m:x:10335 - 1.0 - 1.0 - Multiple - Optional - - - Entity - R - Single - Mandatory - String - 4..63 - - - - - Event Type - R - Single - Mandatory - Integer - 0..65535 - - - - - Time - R - Single - Mandatory - Time - - - - - - Sequence No - R - Single - Mandatory - Integer - 0..2^63-1 - - - - - Additional Info - R - Single - Optional - String - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10336.xml b/transport/lwm2m/src/main/data/models/10336.xml deleted file mode 100644 index e14d64d5aa..0000000000 --- a/transport/lwm2m/src/main/data/models/10336.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - MIC - - 10336 - urn:oma:lwm2m:x:10336 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10337.xml b/transport/lwm2m/src/main/data/models/10337.xml deleted file mode 100644 index 2720bf7cb9..0000000000 --- a/transport/lwm2m/src/main/data/models/10337.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - SCA - - 10337 - urn:oma:lwm2m:x:10337 - 1.0 - 1.0 - Multiple - Optional - - - SCA Name - R - Single - Mandatory - String - - - - - - - - - - SCA Motion Status - R - Single - Optional - Integer - 0..2 - - - - - - SCA Motion Control - E - Single - Optional - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10338.xml b/transport/lwm2m/src/main/data/models/10338.xml deleted file mode 100644 index d3a0584d60..0000000000 --- a/transport/lwm2m/src/main/data/models/10338.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - Speaker - - 10338 - urn:oma:lwm2m:x:10338 - 1.0 - 1.0 - Single - Optional - - - Speaker status - R - Single - Mandatory - Boolean - - - - - - Voice Warning - R - Single - Mandatory - Boolean - - - - - - - Voice Control - E - Single - Mandatory - - - - - - - Voice Warning Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10339.xml b/transport/lwm2m/src/main/data/models/10339.xml deleted file mode 100644 index 1101f1f66a..0000000000 --- a/transport/lwm2m/src/main/data/models/10339.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Tripod Head - - 10339 - urn:oma:lwm2m:x:10339 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - Tripod Direction Control - E - Single - Optional - - - - - - - Tripod Automatic Control - E - Single - Optional - - - - - - - Tripod Reset - E - Single - Optional - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10340.xml b/transport/lwm2m/src/main/data/models/10340.xml deleted file mode 100644 index 5a6105426e..0000000000 --- a/transport/lwm2m/src/main/data/models/10340.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - - Camera - - 10340 - urn:oma:lwm2m:x:10340 - 1.0 - 1.0 - Multiple - Optional - - - Camera Name - R - Single - Mandatory - String - - - - - - - - Camera Status - R - Single - Mandatory - Boolean - - - - - - Connection Status - R - Single - Mandatory - Boolean - - - - - - Working Status - R - Single - Mandatory - Integer - 0..15 - - - - - Local Recording - R - Single - Mandatory - Boolean - - - - - - Image Matting - R - Single - Mandatory - Boolean - - - - - - Camera Snapshot - R - Single - Mandatory - Boolean - - - - - - Camera Recording - R - Single - Mandatory - Boolean - - - - - - - Camera Control - E - Single - Mandatory - - - - - - - Local Recording Control - E - Single - Mandatory - - - - - - - Image Matting Control - E - Single - Mandatory - - - - - - - Camera Snapshot Control - E - Single - Mandatory - - - - - - - Camera Recording Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10341.xml b/transport/lwm2m/src/main/data/models/10341.xml deleted file mode 100644 index a66d9bdc22..0000000000 --- a/transport/lwm2m/src/main/data/models/10341.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - GPS - - 10341 - urn:oma:lwm2m:x:10341 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10342.xml b/transport/lwm2m/src/main/data/models/10342.xml deleted file mode 100644 index 613aa78822..0000000000 --- a/transport/lwm2m/src/main/data/models/10342.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - IMU - - 10342 - urn:oma:lwm2m:x:10342 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10343.xml b/transport/lwm2m/src/main/data/models/10343.xml deleted file mode 100644 index eca0b2f83e..0000000000 --- a/transport/lwm2m/src/main/data/models/10343.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - LiDAR - - 10343 - urn:oma:lwm2m:x:10343 - 1.0 - 1.0 - Multiple - Optional - - - LiDAR Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10344.xml b/transport/lwm2m/src/main/data/models/10344.xml deleted file mode 100644 index ae57e9c433..0000000000 --- a/transport/lwm2m/src/main/data/models/10344.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Arm - - 10344 - urn:oma:lwm2m:x:10344 - 1.0 - 1.0 - Multiple - Optional - - - Arm Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10345.xml b/transport/lwm2m/src/main/data/models/10345.xml deleted file mode 100644 index 0cdbcce721..0000000000 --- a/transport/lwm2m/src/main/data/models/10345.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Leg - - 10345 - urn:oma:lwm2m:x:10345 - 1.0 - 1.0 - Multiple - Optional - - - Leg Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10346.xml b/transport/lwm2m/src/main/data/models/10346.xml deleted file mode 100644 index b07ca48697..0000000000 --- a/transport/lwm2m/src/main/data/models/10346.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Servomotor - - 10346 - urn:oma:lwm2m:x:10346 - 1.0 - 1.0 - Multiple - Optional - - - Servomotor Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10347.xml b/transport/lwm2m/src/main/data/models/10347.xml deleted file mode 100644 index d65e98e26e..0000000000 --- a/transport/lwm2m/src/main/data/models/10347.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - Screen - - 10347 - urn:oma:lwm2m:x:10347 - 1.0 - 1.0 - Single - Optional - - - Screen Status - R - Single - Mandatory - Boolean - - - - - - Startup Page - R - Single - Optional - String - - - The Startup Page of the screen. - - - Current Displaying Page or Current Screen Play List - R - Single - Optional - String - - - Current Displaying Page or Current Screen Play List. - - - - Screen Control - E - Single - Mandatory - - - - - - - Startup Page Set - E - Single - Mandatory - - - - - - - Screen Page Set - E - Single - Mandatory - - - - - - - Screen Play List Set - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10348.xml b/transport/lwm2m/src/main/data/models/10348.xml deleted file mode 100644 index 7791092f62..0000000000 --- a/transport/lwm2m/src/main/data/models/10348.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - Wheel - - 10348 - urn:oma:lwm2m:x:10348 - 1.0 - 1.0 - Multiple - Optional - - - Wheel Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10349.xml b/transport/lwm2m/src/main/data/models/10349.xml deleted file mode 100644 index a04702814e..0000000000 --- a/transport/lwm2m/src/main/data/models/10349.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - Chassis - - 10349 - urn:oma:lwm2m:x:10349 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10350.xml b/transport/lwm2m/src/main/data/models/10350.xml deleted file mode 100644 index 9ae091575d..0000000000 --- a/transport/lwm2m/src/main/data/models/10350.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - Light - - 10350 - urn:oma:lwm2m:x:10350 - 1.0 - 1.0 - Multiple - Optional - - - Light Name - R - Single - Mandatory - String - - - - - - - - Light Status - R - Single - Mandatory - Boolean - - - - - - - Light Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10351.xml b/transport/lwm2m/src/main/data/models/10351.xml deleted file mode 100644 index 09b124236e..0000000000 --- a/transport/lwm2m/src/main/data/models/10351.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - Door - - 10351 - urn:oma:lwm2m:x:10351 - 1.0 - 1.0 - Multiple - Optional - - - Door Name - R - Single - Mandatory - String - - - - - - - Door Status - R - Single - Mandatory - Boolean - - - - - - - Door Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10352.xml b/transport/lwm2m/src/main/data/models/10352.xml deleted file mode 100644 index 3c497de411..0000000000 --- a/transport/lwm2m/src/main/data/models/10352.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - Thermal Imager - - 10352 - urn:oma:lwm2m:x:10352 - 1.0 - 1.0 - Single - Optional - - - - Highest Temperature - R - Single - Mandatory - Float - -100.0..100.0 - Cel - The Highest Temperature of the thermal imager. - - - Lowest Temperature - R - Single - Mandatory - Float - -100.0..100.0 - Cel - The Lowest Temperature of the thermal imager. - - - Average Temperature - R - Single - Mandatory - Float - -100.0..100.0 - Cel - The Average Temperature of the thermal imager. - - - - - diff --git a/transport/lwm2m/src/main/data/models/10353.xml b/transport/lwm2m/src/main/data/models/10353.xml deleted file mode 100644 index 4d40e2c1b7..0000000000 --- a/transport/lwm2m/src/main/data/models/10353.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Warning Light - - 10353 - urn:oma:lwm2m:x:10353 - 1.0 - 1.0 - Single - Optional - - - Light Status - R - Single - Mandatory - Boolean - - - - - - Light Warning - R - Single - Mandatory - Boolean - - - - - - Light Control - E - Single - Mandatory - - - - - - - Light Warning Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10354.xml b/transport/lwm2m/src/main/data/models/10354.xml deleted file mode 100644 index b1b5ab8be1..0000000000 --- a/transport/lwm2m/src/main/data/models/10354.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - APP - - 10354 - urn:oma:lwm2m:x:10354 - 1.0 - 1.0 - Multiple - Mandatory - - - APP Name - RW - Single - Mandatory - String - - - The name of the APP, human readable string. - - - APP Version - RW - Single - Mandatory - String - - - The version of the APP, human readable string. - - - APP Build No - RW - Single - Optional - String - - - The Build No of the APP, human readable string. - - - APP Patch No - RW - Single - Optional - String - - - The Patch No of the APP, human readable string. - - - Package URI - W - Single - Optional - String - 0-255 bytes - - - - - Vendor Name - RW - Single - Optional - String - - - The vendor of the package. - - - Installation Target - RW - Single - Mandatory - Objlnk - - - - - - APP Status - R - Single - Mandatory - Integer - 0..5 - - The Status of the APP, 0:Downloading, 1:Downloaded, 2:Installed, 3:Verified, 4:Activated, 5:Stopped. - - - APP Restart - E - Single - Mandatory - - - - - - - APP Start - E - Single - Mandatory - - - - - - - APP Stop - E - Single - Mandatory - - - - - - - APP Download - E - Single - Mandatory - - - - - - - APP Install - E - Single - Mandatory - - - - - - - APP Uninstall - E - Single - Mandatory - - - - - - - APP Activate - E - Single - Mandatory - - - - - - - APP Deactivate - E - Single - Mandatory - - - - - - - APP Verify - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10355.xml b/transport/lwm2m/src/main/data/models/10355.xml deleted file mode 100644 index f05f470843..0000000000 --- a/transport/lwm2m/src/main/data/models/10355.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - General Info - - 10355 - urn:oma:lwm2m:x:10355 - 1.0 - 1.0 - Single - Optional - - - Robot General Info - R - Single - Mandatory - Objlnk - - - - - - - - RCU General Info - R - Single - Mandatory - Objlnk - - - - - - - - CCU General Info - R - Multiple - Optional - Objlnk - - - - - - - - ECU General Info - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10356.xml b/transport/lwm2m/src/main/data/models/10356.xml deleted file mode 100644 index 082ba8131f..0000000000 --- a/transport/lwm2m/src/main/data/models/10356.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - Service Info - - 10356 - urn:oma:lwm2m:x:10356 - 1.0 - 1.0 - Single - Optional - - - Robot Service Info - R - Single - Mandatory - Objlnk - - - - - - - - SCA Info - R - Multiple - Optional - Objlnk - - - - - - - - Speaker Info - R - Single - Optional - Objlnk - - - - - - - - Camera Info - R - Multiple - Optional - Objlnk - - - - - - - - Screen Info - R - Single - Optional - Objlnk - - - - - - - - Light Info - R - Multiple - Optional - Objlnk - - - - - - - - Warning Light Info - R - Single - Optional - Objlnk - - - - - - - - Door Info - R - Multiple - Optional - Objlnk - - - - - - - - Thermal Imager Info - R - Single - Optional - Objlnk - - - - - - - - Compressor Info - R - Multiple - Optional - Objlnk - - - - - - - - Lock Info - R - Multiple - Optional - Objlnk - - - - - - - - Collision Sensor Info - R - Multiple - Optional - Objlnk - - - - - - - - Drop Sensor Info - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10357.xml b/transport/lwm2m/src/main/data/models/10357.xml deleted file mode 100644 index ea0b0334c1..0000000000 --- a/transport/lwm2m/src/main/data/models/10357.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - PM - - 10357 - urn:oma:lwm2m:x:10357 - 1.0 - 1.0 - Single - Optional - - - Robot PM - R - Single - Mandatory - Objlnk - - - - - - - - RCU PM - R - Single - Mandatory - Objlnk - - - - - - - - CCU PM - R - Multiple - Optional - Objlnk - - - - - - - - SCA PM - R - Multiple - Optional - Objlnk - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10358.xml b/transport/lwm2m/src/main/data/models/10358.xml deleted file mode 100644 index dea3fc72f4..0000000000 --- a/transport/lwm2m/src/main/data/models/10358.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Fan PM - - 10358 - urn:oma:lwm2m:x:10358 - 1.0 - 1.0 - Multiple - Optional - - - Fan Name - R - Single - Mandatory - String - - - - - - - - - Fan Speed - R - Single - Optional - Integer - - 1/min - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10359.xml b/transport/lwm2m/src/main/data/models/10359.xml deleted file mode 100644 index 07e8439600..0000000000 --- a/transport/lwm2m/src/main/data/models/10359.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - Lock - - 10359 - urn:oma:lwm2m:x:10359 - 1.0 - 1.0 - Multiple - Optional - - - Lock Name - R - Single - Mandatory - String - - - - - - Lock Status - R - Single - Optional - Boolean - - - - - - - Lock Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10360.xml b/transport/lwm2m/src/main/data/models/10360.xml deleted file mode 100644 index 71b6591557..0000000000 --- a/transport/lwm2m/src/main/data/models/10360.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Ultrasonic Sensor - - 10360 - urn:oma:lwm2m:x:10360 - 1.0 - 1.0 - Multiple - Optional - - - Name - R - Single - Mandatory - String - - - - - - - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10361.xml b/transport/lwm2m/src/main/data/models/10361.xml deleted file mode 100644 index c2983e8286..0000000000 --- a/transport/lwm2m/src/main/data/models/10361.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - Collision Sensor - - 10361 - urn:oma:lwm2m:x:10361 - 1.0 - 1.0 - Multiple - Optional - - - Name - R - Single - Mandatory - String - - - - - - - - Status - R - Single - Mandatory - Integer - - - - - - - Collision Detection - R - Single - Optional - Boolean - - - - - - - Collision Detection Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10362.xml b/transport/lwm2m/src/main/data/models/10362.xml deleted file mode 100644 index cdbb99ed75..0000000000 --- a/transport/lwm2m/src/main/data/models/10362.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Drop Sensor - - 10362 - urn:oma:lwm2m:x:10362 - 1.0 - 1.0 - Multiple - Optional - - - Name - R - Single - Mandatory - String - - - - - - - - Status - R - Single - Mandatory - Integer - - - - - - Drop Detection - R - Single - Optional - Boolean - - - - - - - Drop Detection Control - E - Single - Mandatory - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10363.xml b/transport/lwm2m/src/main/data/models/10363.xml deleted file mode 100644 index d3daaca10b..0000000000 --- a/transport/lwm2m/src/main/data/models/10363.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Temperature Sensor - - 10363 - urn:oma:lwm2m:x:10363 - 1.0 - 1.0 - Single - Optional - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10364.xml b/transport/lwm2m/src/main/data/models/10364.xml deleted file mode 100644 index 4cd7fd0aa3..0000000000 --- a/transport/lwm2m/src/main/data/models/10364.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Humidity Sensor - - 10364 - urn:oma:lwm2m:x:10364 - 1.0 - 1.0 - Single - Optional - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10365.xml b/transport/lwm2m/src/main/data/models/10365.xml deleted file mode 100644 index 5a97d94374..0000000000 --- a/transport/lwm2m/src/main/data/models/10365.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Gas-Dust Sensor - - 10365 - urn:oma:lwm2m:x:10365 - 1.0 - 1.0 - Single - Optional - - - Status - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10366.xml b/transport/lwm2m/src/main/data/models/10366.xml deleted file mode 100644 index 352bfcbc5e..0000000000 --- a/transport/lwm2m/src/main/data/models/10366.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - Fan - - 10366 - urn:oma:lwm2m:x:10366 - 1.0 - 1.0 - Multiple - Optional - - - Fan Name - R - Single - Mandatory - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10368.xml b/transport/lwm2m/src/main/data/models/10368.xml deleted file mode 100644 index 52838f0209..0000000000 --- a/transport/lwm2m/src/main/data/models/10368.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - SpringMotor - - 10368 - urn:oma:lwm2m:x:10368 - 1.0 - 1.0 - Multiple - Optional - - - SpringMotor Name - R - Single - Mandatory - String - - - - - - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/10369.xml b/transport/lwm2m/src/main/data/models/10369.xml deleted file mode 100644 index 2c9c582091..0000000000 --- a/transport/lwm2m/src/main/data/models/10369.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - MCU - - 10369 - urn:oma:lwm2m:x:10369 - 1.0 - 1.0 - Single - Optional - - - Host Device Unique ID - R - Single - Optional - String - - - - - - - - Host Device Manufacturer - R - Single - Optional - String - - - - - - - - Host Device Model Number - R - Single - Optional - String - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2048.xml b/transport/lwm2m/src/main/data/models/2048.xml deleted file mode 100644 index efdfd2c6aa..0000000000 --- a/transport/lwm2m/src/main/data/models/2048.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - CmdhPolicy - - 2048 - urn:oma:lwm2m:ext:20481.0 - 1.0Multiple - Optional - - Name - RW - Single - Mandatory - String - - - - - DefaultRule - RW - Single - Mandatory - Objlnk - - - - - LimiRules - RW - Multiple - Mandatory - Objlnk - - - - - NetworkAccessECRules - RW - Multiple - Mandatory - Objlnk - - - - - BufferRules - RW - Multiple - Mandatory - Objlnk - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2049.xml b/transport/lwm2m/src/main/data/models/2049.xml deleted file mode 100644 index fbe677bf7c..0000000000 --- a/transport/lwm2m/src/main/data/models/2049.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - ActiveCmdhPolicy - - 2049 - urn:oma:lwm2m:ext:20491.0 - 1.0Single - Optional - - ActiveLink - RW - Single - Mandatory - Objlnk - - - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2050.xml b/transport/lwm2m/src/main/data/models/2050.xml deleted file mode 100644 index c000750fa5..0000000000 --- a/transport/lwm2m/src/main/data/models/2050.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CmdhDefaults - - 2050 - urn:oma:lwm2m:ext:20501.0 - 1.0Multiple - Optional - - DefaultEcRules - RW - Multiple - Mandatory - Objlnk - - - - - - DefaultEcParamRules - RW - Multiple - Mandatory - Objlnk - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2051.xml b/transport/lwm2m/src/main/data/models/2051.xml deleted file mode 100644 index 1cedc6ab7d..0000000000 --- a/transport/lwm2m/src/main/data/models/2051.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - CmdhDefEcValues - - 2051 - urn:oma:lwm2m:ext:20511.0 - 1.0Multiple - Optional - - Order - RW - Single - Mandatory - Integer - - - - - DefEcValue - RW - Single - Mandatory - String - - - - - RequestOrigin - RW - Multiple - Mandatory - String - - - - - RequestContext - RW - Single - Optional - String - - - - - RequestContextNotification - RW - Single - Optional - Boolean - - - - - RequestCharacteristics - RW - Single - Optional - String - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2052.xml b/transport/lwm2m/src/main/data/models/2052.xml deleted file mode 100644 index c42e0ad212..0000000000 --- a/transport/lwm2m/src/main/data/models/2052.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - CmdhEcDefParamValues - - 2052 - urn:oma:lwm2m:ext:20521.0 - 1.0Multiple - Optional - - ApplicableEventCategory - RW - Multiple - Mandatory - Integer - - - - - DefaultRequestExpTime - RW - Single - Mandatory - Integer - - ms - - - - - - - - - DefaultResultExpTime - RW - Single - Mandatory - Integer - - ms - - - - DefaultOpExecTime - RW - Single - Mandatory - Integer - - ms - - - DefaultRespPersistence - RW - Single - Mandatory - Integer - - ms - - - DefaultDelAggregation - RW - Single - Mandatory - Integer - - ms - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2053.xml b/transport/lwm2m/src/main/data/models/2053.xml deleted file mode 100644 index e3c7f749bb..0000000000 --- a/transport/lwm2m/src/main/data/models/2053.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - CmdhLimits - - 2053 - urn:oma:lwm2m:ext:20531.0 - 1.0Multiple - Optional - - Order - RW - Single - Mandatory - Integer - - - - - RequestOrigin - RW - Multiple - Mandatory - String - - - - - - - - - - - RequestContext - RW - Single - Optional - String - - - - - - RequestContextNotificatio - RW - Single - Optional - Boolean - - - - - RequestCharacteristics - RW - Single - Optional - String - - - - - LimitsEventCategory - RW - Multiple - Mandatory - Integer - - - - - LimitsRequestExpTime - RW - Multiple - Mandatory - Integer - 2 Instances - ms - - - LimitsResultExpTime - RW - Multiple - Mandatory - Integer - 2 Instances - ms - - - LimitsOptExpTime - RW - Multiple - Mandatory - Integer - 2 Instances - ms - - - LimitsRespPersistence - RW - Multiple - Mandatory - Integer - 2 Instances - ms - - - LimitsDelAggregation - RW - Multiple - Mandatory - String - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2054.xml b/transport/lwm2m/src/main/data/models/2054.xml deleted file mode 100644 index 638ad74724..0000000000 --- a/transport/lwm2m/src/main/data/models/2054.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - CmdhNetworkAccessRules - - 2054 - urn:oma:lwm2m:ext:20541.0 - 1.0Multiple - Optional - - ApplicableEventCategories - RW - Multiple - Mandatory - Integer - - - - - NetworkAccessRule - RW - Multiple - Optional - Objlnk - - - - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2055.xml b/transport/lwm2m/src/main/data/models/2055.xml deleted file mode 100644 index f519af9abc..0000000000 --- a/transport/lwm2m/src/main/data/models/2055.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - CmdhNwAccessRule - - 2055 - urn:oma:lwm2m:ext:20551.0 - 1.0Multiple - Optional - - TargetNetwork - RW - Multiple - Mandatory - String - - - - - SpreadingWaitTime - RW - Single - Mandatory - Integer - - ms - - - MinReqVolume - RW - Single - Mandatory - Integer - - B - - - BackOffParameters - RW - Single - Mandatory - Objlnk - - - - - OtherConditions - RW - Single - Mandatory - String - - - - - AllowedSchedule - RW - Multiple - Mandatory - String - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2056.xml b/transport/lwm2m/src/main/data/models/2056.xml deleted file mode 100644 index 95d290545e..0000000000 --- a/transport/lwm2m/src/main/data/models/2056.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - CmdhBuffer - - 2056 - urn:oma:lwm2m:ext:20561.0 - 1.0Multiple - Optional - - ApplicableEventCategory - RW - Multiple - Mandatory - Integer - - - - - MaxBufferSize - RW - Single - Mandatory - Integer - - B - - - StoragePriority - RW - Single - Mandatory - Integer - 1..10 - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/2057.xml b/transport/lwm2m/src/main/data/models/2057.xml deleted file mode 100644 index 1b9c159d47..0000000000 --- a/transport/lwm2m/src/main/data/models/2057.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - CmdhBackOffParametersSet - - 2057 - urn:oma:lwm2m:ext:2057 - 1.0 - 1.0 - Multiple - Optional - - NetworkAction - RW - Single - Optional - Integer - 1..5 - - - - InitialBackoffTime - RW - Single - Mandatory - Integer - - ms - - - AdditionalBackoffTime - RW - Single - Mandatory - Integer - - ms - - - MaximumBackoffTime - RW - Single - Mandatory - Integer - - ms - - - OptionalRandomBackoffTime - RW - Multiple - Optional - Integer - - ms - - - - - diff --git a/transport/lwm2m/src/main/data/models/31024.xml b/transport/lwm2m/src/main/data/models/31024.xml deleted file mode 100644 index c6e1992c14..0000000000 --- a/transport/lwm2m/src/main/data/models/31024.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - Test - A Wakaama object for testing purpose. - - 31024 - urn:oma:lwm2m:x:31024 - Multiple - Optional - - - test - RW - Single - Mandatory - Integer - 0-255 - - - - exec - E - Single - Mandatory - - - - dec - RW - Single - Mandatory - Float - - - - - - sig - RW - Single - Optional - Integer - - - 16-bit signed integer - - - - - diff --git a/transport/lwm2m/src/main/data/models/3200.xml b/transport/lwm2m/src/main/data/models/3200.xml deleted file mode 100644 index b74a03a48d..0000000000 --- a/transport/lwm2m/src/main/data/models/3200.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - Digital Input - Generic digital input for non-specific sensors - 3200 - urn:oma:lwm2m:ext:3200 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Mandatory - Boolean - - - The current state of a digital input. - - - Digital Input Counter - R - Single - Optional - Integer - - - The cumulative value of active state detected. - - - Digital Input Polarity - RW - Single - Optional - Boolean - - - The polarity of the digital input as a Boolean (False = Normal, True = Reversed). - - - Digital Input Debounce - RW - Single - Optional - Integer - - ms - The debounce period in ms. - - - Digital Input Edge Selection - RW - Single - Optional - Integer - 1..3 - - The edge selection as an integer (1 = Falling edge, 2 = Rising edge, 3 = Both Rising and Falling edge). - - - Digital Input Counter Reset - E - Single - Optional - - - - Reset the Counter value. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string, for instance, "Air Pressure" - - - Sensor Type - R - Single - Optional - String - - - The type of the sensor (for instance PIR type) - - - - - diff --git a/transport/lwm2m/src/main/data/models/3201.xml b/transport/lwm2m/src/main/data/models/3201.xml deleted file mode 100644 index 935d2665d3..0000000000 --- a/transport/lwm2m/src/main/data/models/3201.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Digital Output - Generic digital output for non-specific actuators - 3201 - urn:oma:lwm2m:ext:3201 - 1.0 - 1.0 - Multiple - Optional - - - Digital Output State - RW - Single - Mandatory - Boolean - - - The current state of a digital output. - - - Digital Output Polarity - RW - Single - Optional - Boolean - - - The polarity of the digital output as a Boolean (False = Normal, True = Reversed). - - - Application Type - RW - Single - Optional - String - - - The application type of the output as a string, for instance, "LED" - - - - - diff --git a/transport/lwm2m/src/main/data/models/3202.xml b/transport/lwm2m/src/main/data/models/3202.xml deleted file mode 100644 index 66f76ef653..0000000000 --- a/transport/lwm2m/src/main/data/models/3202.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - Analog Input - Generic analog input for non-specific sensors - 3202 - urn:oma:lwm2m:ext:3202 - 1.0 - 1.0 - Multiple - Optional - - - Analog Input Current Value - R - Single - Mandatory - Float - - - The current value of the analog input. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string, for instance, "Air Pressure" - - - Sensor Type - R - Single - Optional - String - - - The type of the sensor, for instance PIR type - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/transport/lwm2m/src/main/data/models/3203.xml b/transport/lwm2m/src/main/data/models/3203.xml deleted file mode 100644 index 3b216a246f..0000000000 --- a/transport/lwm2m/src/main/data/models/3203.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Analog Output - This IPSO object is a generic object that can be used with any kind of analog output interface. - 3203 - urn:oma:lwm2m:ext:3203 - 1.0 - 1.0 - Multiple - Optional - - - Analog Output Current Value - RW - Single - Mandatory - Float - 0..1 - - The current state of the analogue output. - - - Application Type - RW - Single - Optional - String - - - If present, the application type of the actuator as a string, for instance, "Valve" - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be set for the output - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be set for the output - - - - - diff --git a/transport/lwm2m/src/main/data/models/3300.xml b/transport/lwm2m/src/main/data/models/3300.xml deleted file mode 100644 index dc805f5a2d..0000000000 --- a/transport/lwm2m/src/main/data/models/3300.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - Generic Sensor - This IPSO object allows the description of a generic sensor. It is based on the description of a value and a unit according to the SenML specification. Thus, any type of value defined within this specification can be reported using this object. This object may be used as a generic object if a dedicated one does not exist. - 3300 - urn:oma:lwm2m:ext:3300 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Application Type - RW - Single - Optional - String - - - If present, the application type of the sensor as a string, for instance, "CO2" - - - Sensor Type - R - Single - Optional - String - - - The type of the sensor (for instance PIR type) - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/transport/lwm2m/src/main/data/models/3301.xml b/transport/lwm2m/src/main/data/models/3301.xml deleted file mode 100644 index ee20fc6546..0000000000 --- a/transport/lwm2m/src/main/data/models/3301.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - Illuminance - Illuminance sensor, example units = lx - 3301 - urn:oma:lwm2m:ext:3301 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - The current value of the luminosity sensor. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3302.xml b/transport/lwm2m/src/main/data/models/3302.xml deleted file mode 100644 index 302980e2f7..0000000000 --- a/transport/lwm2m/src/main/data/models/3302.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Presence - Presence sensor with digital sensing, optional delay parameters - 3302 - urn:oma:lwm2m:ext:3302 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Mandatory - Boolean - - - The current state of the presence sensor - - - Digital Input Counter - R - Single - Optional - Integer - - - The cumulative value of active state detected. - - - Digital Input Counter Reset - E - Single - Optional - - - - Reset the Counter value - - - Sensor Type - R - Single - Optional - String - - - The type of the sensor (for instance PIR type) - - - Busy to Clear delay - RW - Single - Optional - Integer - - ms - Delay from the detection state to the clear state in ms - - - Clear to Busy delay - RW - Single - Optional - Integer - - ms - Delay from the clear state to the busy state in ms - - - - - diff --git a/transport/lwm2m/src/main/data/models/3303.xml b/transport/lwm2m/src/main/data/models/3303.xml deleted file mode 100644 index 33d2a8a50f..0000000000 --- a/transport/lwm2m/src/main/data/models/3303.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - Temperature - This IPSO object should be used with a temperature sensor to report a temperature measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the temperature sensor. An example measurement unit is degrees Celsius. - 3303 - urn:oma:lwm2m:ext:3303 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/transport/lwm2m/src/main/data/models/3304.xml b/transport/lwm2m/src/main/data/models/3304.xml deleted file mode 100644 index 33f01a13b2..0000000000 --- a/transport/lwm2m/src/main/data/models/3304.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - Humidity - This IPSO object should be used with a humidity sensor to report a humidity measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the humidity sensor. An example measurement unit is relative humidity as a percentage. - 3304 - urn:oma:lwm2m:ext:3304 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/transport/lwm2m/src/main/data/models/3305.xml b/transport/lwm2m/src/main/data/models/3305.xml deleted file mode 100644 index 95aef196ac..0000000000 --- a/transport/lwm2m/src/main/data/models/3305.xml +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Power Measurement - This IPSO object should be used over a power measurement sensor to report a remote power measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range for both active and reactive power. It also provides resources for cumulative energy, calibration, and the power factor. - 3305 - urn:oma:lwm2m:ext:3305 - 1.0 - 1.0 - Multiple - Optional - - - Instantaneous active power - R - Single - Mandatory - Float - - W - The current active power - - - Min Measured active power - R - Single - Optional - Float - - W - The minimum active power measured by the sensor since it is ON - - - Max Measured active power - R - Single - Optional - Float - - W - The maximum active power measured by the sensor since it is ON - - - Min Range active power - R - Single - Optional - Float - - W - The minimum active power that can be measured by the sensor - - - Max Range active power - R - Single - Optional - Float - - W - The maximum active power that can be measured by the sensor - - - Cumulative active power - R - Single - Optional - Float - - Wh - The cumulative active power since the last cumulative energy reset or device start - - - Active Power Calibration - W - Single - Optional - Float - - W - Request an active power calibration by writing the value of a calibrated load. - - - Instantaneous reactive power - R - Single - Optional - Float - - var - The current reactive power - - - Min Measured reactive power - R - Single - Optional - Float - - var - The minimum reactive power measured by the sensor since it is ON - - - Max Measured reactive power - R - Single - Optional - Float - - var - The maximum reactive power measured by the sensor since it is ON - - - Min Range reactive power - R - Single - Optional - Float - - var - The minimum active power that can be measured by the sensor - - - Max Range reactive power - R - Single - Optional - Float - - var - The maximum reactive power that can be measured by the sensor - - - Cumulative reactive power - R - Single - Optional - Float - - varh - The cumulative reactive power since the last cumulative energy reset or device start - - - Reactive Power Calibration - W - Single - Optional - Float - - var - Request a reactive power calibration by writing the value of a calibrated load. - - - Power factor - R - Single - Optional - Float - - - If applicable, the power factor of the current consumption. - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Reset Cumulative energy - E - Single - Optional - - - - Reset both cumulative active/reactive power - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/transport/lwm2m/src/main/data/models/3306.xml b/transport/lwm2m/src/main/data/models/3306.xml deleted file mode 100644 index 1395a4dcdd..0000000000 --- a/transport/lwm2m/src/main/data/models/3306.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Actuation - This IPSO object is dedicated to remote actuation such as ON/OFF action or dimming. A multi-state output can also be described as a string. This is useful to send pilot wire orders for instance. It also provides a resource to reflect the time that the device has been switched on. - 3306 - urn:oma:lwm2m:ext:3306 - 1.0 - 1.0 - Multiple - Optional - - - On/Off - RW - Single - Mandatory - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Dimmer - RW - Single - Optional - Integer - 0..100 - /100 - This resource represents a light dimmer setting, which has an Integer value between 0 and 100 as a percentage. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds that the device has been on. Writing a value of 0 resets the counter. - - - Muti-state Output - RW - Single - Optional - String - - - A string describing a state for multiple level output such as Pilot Wire - - - Application Type - RW - Single - Optional - String - - - The Application type of the device, for example "Motion Closure". - - - - - diff --git a/transport/lwm2m/src/main/data/models/3308.xml b/transport/lwm2m/src/main/data/models/3308.xml deleted file mode 100644 index 18e4b04fe2..0000000000 --- a/transport/lwm2m/src/main/data/models/3308.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Set Point - This IPSO object should be used to set a desired value to a controller, such as a thermostat. A special resource is added to set the colour of an object. - 3308 - urn:oma:lwm2m:ext:3308 - 1.0 - 1.0 - Multiple - Optional - - - Set Point Value - RW - Single - Mandatory - Float - - - The setpoint value. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Colour - RW - Single - Optional - String - - - A string representing a value in some color space - - - Application Type - RW - Single - Optional - String - - - The Application type of the device, for example "Motion Closure". - - - - - diff --git a/transport/lwm2m/src/main/data/models/3310.xml b/transport/lwm2m/src/main/data/models/3310.xml deleted file mode 100644 index bd989b1800..0000000000 --- a/transport/lwm2m/src/main/data/models/3310.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Load Control - This Object is used for demand-response load control and other load control in automation application (not limited to power). - 3310 - urn:oma:lwm2m:ext:3310 - 1.0 - 1.0 - Multiple - Optional - - - Event Identifier - RW - Single - Mandatory - String - - - The event identifier as a string. - - - Start Time - RW - Single - Mandatory - Time - - - Time when the event started. - - - Duration In Min - RW - Single - Mandatory - Integer - - min - The duration of the event in minutes. - - - Criticality Level - RW - Single - Optional - Integer - 0..3 - - The criticality of the event. The device receiving the event will react in an appropriate fashion for the device. - - - Avg Load AdjPct - RW - Single - Optional - Integer - 0..100 - /100 - Defines the maximum energy usage of the receiving device, as a percentage of the device's normal maximum energy usage. - - - Duty Cycle - RW - Single - Optional - Integer - 0..100 - /100 - Defines the duty cycle for the load control event, i.e, what percentage of time the receiving device is allowed to be on. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3311.xml b/transport/lwm2m/src/main/data/models/3311.xml deleted file mode 100644 index 2969a5e25c..0000000000 --- a/transport/lwm2m/src/main/data/models/3311.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - Light Control - This Object is used to control a light source, such as a LED or other light. It allows a light to be turned on or off and its dimmer setting to be control as a % between 0 and 100. An optional colour setting enables a string to be used to indicate the desired colour. - 3311 - urn:oma:lwm2m:ext:3311 - 1.0 - 1.0 - Multiple - Optional - - - On/Off - RW - Single - Mandatory - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Dimmer - RW - Single - Optional - Integer - 0..100 - /100 - This resource represents a light dimmer setting, which has an Integer value between 0 and 100 as a percentage. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds that the light has been on. Writing a value of 0 resets the counter. - - - Cumulative active power - R - Single - Optional - Float - - Wh - The total power in Wh that the light has used. - - - Power factor - R - Single - Optional - Float - - - The power factor of the light. - - - Colour - RW - Single - Optional - String - - - A string representing a value in some color space - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string, for instance, "Air Pressure" - - - - - diff --git a/transport/lwm2m/src/main/data/models/3312.xml b/transport/lwm2m/src/main/data/models/3312.xml deleted file mode 100644 index 231878465f..0000000000 --- a/transport/lwm2m/src/main/data/models/3312.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Power Control - This Object is used to control a power source, such as a Smart Plug. It allows a power relay to be turned on or off and its dimmer setting to be control as a % between 0 and 100. - 3312 - urn:oma:lwm2m:ext:3312 - 1.0 - 1.0 - Multiple - Optional - - - On/Off - RW - Single - Mandatory - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Dimmer - RW - Single - Optional - Integer - 0..100 - /100 - This resource represents a power dimmer setting, which has an Integer value between 0 and 100 as a percentage. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds that the power relay has been on. Writing a value of 0 resets the counter. - - - Cumulative active power - R - Single - Optional - Float - - Wh - The total power in Wh that has been used by the load. - - - Power factor - R - Single - Optional - Float - - - The power factor of the load. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string, for instance, "Air Pressure" - - - - - diff --git a/transport/lwm2m/src/main/data/models/3313.xml b/transport/lwm2m/src/main/data/models/3313.xml deleted file mode 100644 index c826b5119d..0000000000 --- a/transport/lwm2m/src/main/data/models/3313.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Accelerometer - This IPSO object can be used to represent a 1-3 axis accelerometer. - 3313 - urn:oma:lwm2m:ext:3313 - 1.0 - 1.0 - Multiple - Optional - - - X Value - R - Single - Mandatory - Float - - - The measured value along the X axis. - - - Y Value - R - Single - Optional - Float - - - The measured value along the Y axis. - - - Z Value - R - Single - Optional - Float - - - The measured value along the Z axis. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - - - diff --git a/transport/lwm2m/src/main/data/models/3314.xml b/transport/lwm2m/src/main/data/models/3314.xml deleted file mode 100644 index 4c4c85b517..0000000000 --- a/transport/lwm2m/src/main/data/models/3314.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Magnetometer - This IPSO object can be used to represent a 1-3 axis magnetometer with optional compass direction. - 3314 - urn:oma:lwm2m:ext:3314 - 1.0 - 1.0 - Multiple - Optional - - - X Value - R - Single - Mandatory - Float - - - The measured value along the X axis. - - - Y Value - R - Single - Optional - Float - - - The measured value along the Y axis. - - - Z Value - R - Single - Optional - Float - - - The measured value along the Z axis. - - - Compass Direction - R - Single - Optional - Float - 0..360 - deg - The measured compass direction. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3315.xml b/transport/lwm2m/src/main/data/models/3315.xml deleted file mode 100644 index e87296c2a8..0000000000 --- a/transport/lwm2m/src/main/data/models/3315.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - Barometer - This IPSO object should be used with an air pressure sensor to report a barometer measurement. It also provides resources for minimum/maximum measured values and the minimum/maximum range that can be measured by the barometer sensor. An example measurement unit is pascals. - 3315 - urn:oma:lwm2m:ext:3315 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - - - diff --git a/transport/lwm2m/src/main/data/models/3316.xml b/transport/lwm2m/src/main/data/models/3316.xml deleted file mode 100644 index 791307f710..0000000000 --- a/transport/lwm2m/src/main/data/models/3316.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Voltage - This IPSO object should be used with voltmeter sensor to report measured voltage between two points. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is volts. - - 3316 - urn:oma:lwm2m:ext:3316 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3317.xml b/transport/lwm2m/src/main/data/models/3317.xml deleted file mode 100644 index 4567e1d1b8..0000000000 --- a/transport/lwm2m/src/main/data/models/3317.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Current - This IPSO object should be used with an ammeter to report measured electric current in amperes. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is ampere. - - 3317 - urn:oma:lwm2m:ext:3317 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3318.xml b/transport/lwm2m/src/main/data/models/3318.xml deleted file mode 100644 index e3b3a2ba51..0000000000 --- a/transport/lwm2m/src/main/data/models/3318.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Frequency - This IPSO object should be used to report frequency measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is hertz. - - 3318 - urn:oma:lwm2m:ext:3318 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3319.xml b/transport/lwm2m/src/main/data/models/3319.xml deleted file mode 100644 index 9bdb7fc290..0000000000 --- a/transport/lwm2m/src/main/data/models/3319.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Depth - This IPSO object should be used to report depth measurements. It can, for example, be used to describe a generic rain gauge that measures the accumulated rainfall in millimetres (mm). - - 3319 - urn:oma:lwm2m:ext:3319 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3320.xml b/transport/lwm2m/src/main/data/models/3320.xml deleted file mode 100644 index 7e6981bcb6..0000000000 --- a/transport/lwm2m/src/main/data/models/3320.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Percentage - This IPSO object should can be used to report measurements relative to a 0-100% scale. For example it could be used to measure the level of a liquid in a vessel or container in units of %. - - 3320 - urn:oma:lwm2m:ext:3320 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3321.xml b/transport/lwm2m/src/main/data/models/3321.xml deleted file mode 100644 index bdccef1146..0000000000 --- a/transport/lwm2m/src/main/data/models/3321.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Altitude - This IPSO object should be used with an altitude sensor to report altitude above sea level in meters. Note that Altitude can be calculated from the measured pressure given the local sea level pressure. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is meters. - - 3321 - urn:oma:lwm2m:ext:3321 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3322.xml b/transport/lwm2m/src/main/data/models/3322.xml deleted file mode 100644 index 6a2fffcd02..0000000000 --- a/transport/lwm2m/src/main/data/models/3322.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Load - This IPSO object should be used with a load sensor (as in a scale) to report the applied weight or force. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is kilograms. - - 3322 - urn:oma:lwm2m:ext:3322 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3323.xml b/transport/lwm2m/src/main/data/models/3323.xml deleted file mode 100644 index b47e8c81f2..0000000000 --- a/transport/lwm2m/src/main/data/models/3323.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Pressure - This IPSO object should be used to report pressure measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is pascals. - - 3323 - urn:oma:lwm2m:ext:3323 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3324.xml b/transport/lwm2m/src/main/data/models/3324.xml deleted file mode 100644 index 68ce6cc5b2..0000000000 --- a/transport/lwm2m/src/main/data/models/3324.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Loudness - This IPSO object should be used to report loudness or noise level measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is decibels. - - 3324 - urn:oma:lwm2m:ext:3324 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3325.xml b/transport/lwm2m/src/main/data/models/3325.xml deleted file mode 100644 index 3df1460efb..0000000000 --- a/transport/lwm2m/src/main/data/models/3325.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Concentration - This IPSO object should be used to the particle concentration measurement of a medium. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is parts per million. - - 3325 - urn:oma:lwm2m:ext:3325 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3326.xml b/transport/lwm2m/src/main/data/models/3326.xml deleted file mode 100644 index 0fbcc361fa..0000000000 --- a/transport/lwm2m/src/main/data/models/3326.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Acidity - This IPSO object should be used to report an acidity measurement of a liquid. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is pH. - - 3326 - urn:oma:lwm2m:ext:3326 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3327.xml b/transport/lwm2m/src/main/data/models/3327.xml deleted file mode 100644 index e6ccea30b0..0000000000 --- a/transport/lwm2m/src/main/data/models/3327.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Conductivity - This IPSO object should be used to report a measurement of the electric conductivity of a medium or sample. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Siemens. - - 3327 - urn:oma:lwm2m:ext:3327 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3328.xml b/transport/lwm2m/src/main/data/models/3328.xml deleted file mode 100644 index 4a1cc8d521..0000000000 --- a/transport/lwm2m/src/main/data/models/3328.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Power - This IPSO object should be used to report power measurements. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Watts. This object may be used for either real power or apparent power measurements. - - 3328 - urn:oma:lwm2m:ext:3328 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3329.xml b/transport/lwm2m/src/main/data/models/3329.xml deleted file mode 100644 index 9d184675e9..0000000000 --- a/transport/lwm2m/src/main/data/models/3329.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Power Factor - This IPSO object should be used to report a measurement or calculation of the power factor of a reactive electrical load. Power Factor is normally the ratio of non-reactive power to total power. This object also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. - - 3329 - urn:oma:lwm2m:ext:3329 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3330.xml b/transport/lwm2m/src/main/data/models/3330.xml deleted file mode 100644 index 047d9419c7..0000000000 --- a/transport/lwm2m/src/main/data/models/3330.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Distance - This IPSO object should be used to report a distance measurement. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is Meters. - - 3330 - urn:oma:lwm2m:ext:3330 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3331.xml b/transport/lwm2m/src/main/data/models/3331.xml deleted file mode 100644 index 9dfada1719..0000000000 --- a/transport/lwm2m/src/main/data/models/3331.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - Energy - This IPSO object should be used to report energy consumption (Cumulative Power) of an electrical load. An example measurement unit is Watt Hours. - - 3331 - urn:oma:lwm2m:ext:3331 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Reset Cumulative energy - E - Single - Optional - - - - Reset both cumulative active/reactive power. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3332.xml b/transport/lwm2m/src/main/data/models/3332.xml deleted file mode 100644 index 1d1a408f1d..0000000000 --- a/transport/lwm2m/src/main/data/models/3332.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - Direction - This IPSO object is used to report the direction indicated by a compass, wind vane, or other directional indicator. The units of measure is plane angle degrees. - - 3332 - urn:oma:lwm2m:ext:3332 - 1.0 - 1.0 - Multiple - Optional - - - Compass Direction - R - Single - Mandatory - Float - 0..360 - deg - The measured compass direction. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset. - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3333.xml b/transport/lwm2m/src/main/data/models/3333.xml deleted file mode 100644 index 1cc818b01b..0000000000 --- a/transport/lwm2m/src/main/data/models/3333.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - Time - This IPSO object is used to report the current time in seconds since January 1, 1970 UTC. There is also a fractional time counter that has a range of less than one second. - - 3333 - urn:oma:lwm2m:ext:3333 - 1.0 - 1.0 - Multiple - Optional - - - Current Time - RW - Single - Mandatory - Time - - - Unix Time. A signed integer representing the number of seconds since Jan 1st, 1970 in the UTC time zone. - - - Fractional Time - RW - Single - Optional - Float - 0..1 - s - Fractional part of the time when sub-second precision is used (e.g., 0.23 for 230 ms). - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3334.xml b/transport/lwm2m/src/main/data/models/3334.xml deleted file mode 100644 index a4a22d2eda..0000000000 --- a/transport/lwm2m/src/main/data/models/3334.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - Gyrometer - This IPSO Object is used to report the current reading of a gyrometer sensor in 3 axes. It provides tracking of the minimum and maximum angular rate in all 3 axes. An example unit of measure is radians per second. - - 3334 - urn:oma:lwm2m:ext:3334 - 1.0 - 1.0 - Multiple - Optional - - - X Value - R - Single - Mandatory - Float - - - The measured value along the X axis. - - - Y Value - R - Single - Optional - Float - - - The measured value along the Y axis. - - - Z Value - R - Single - Optional - Float - - - The measured value along the Z axis. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min X Value - R - Single - Optional - Float - - - The minimum measured value along the X axis - - - Max X Value - R - Single - Optional - Float - - - The maximum measured value along the X axis - - - Min Y Value - R - Single - Optional - Float - - - The minimum measured value along the Y axis - - - Max Y Value - R - Single - Optional - Float - - - The maximum measured value along the Y axis - - - Min Z Value - R - Single - Optional - Float - - - The minimum measured value along the Z axis - - - Max Z Value - R - Single - Optional - Float - - - The maximum measured value along the Z axis - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value. - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3335.xml b/transport/lwm2m/src/main/data/models/3335.xml deleted file mode 100644 index e59e170c4f..0000000000 --- a/transport/lwm2m/src/main/data/models/3335.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - Colour - This IPSO object should be used to report the measured value of a colour sensor in some colour space described by the units resource. - - 3335 - urn:oma:lwm2m:ext:3335 - 1.0 - 1.0 - Multiple - Optional - - - Colour - RW - Single - Mandatory - String - - - A string representing a value in some colour space. - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3336.xml b/transport/lwm2m/src/main/data/models/3336.xml deleted file mode 100644 index 3aede0ed7f..0000000000 --- a/transport/lwm2m/src/main/data/models/3336.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - Location - This IPSO object represents GPS coordinates. This object is compatible with the LWM2M management object for location, but uses reusable resources. - - 3336 - urn:oma:lwm2m:ext:3336 - 1.0 - 1.0 - Multiple - Optional - - - Latitude - R - Single - Mandatory - String - - - The decimal notation of latitude, e.g. -43.5723 (World Geodetic System 1984). - - - Longitude - R - Single - Mandatory - String - - - The decimal notation of longitude, e.g. 153.21760 (World Geodetic System 1984). - - - Uncertainty - R - Single - Optional - String - - - The accuracy of the position in meters. - - - Compass Direction - R - Single - Optional - Float - 0..360 - deg - The measured compass direction. - - - Velocity - R - Single - Optional - Opaque - - - The velocity of the device as defined in 3GPP 23.032 GAD specification. This set of values may not be available if the device is static. - - - Timestamp - R - Single - Optional - Time - - - The timestamp of when the measurement was performed. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3337.xml b/transport/lwm2m/src/main/data/models/3337.xml deleted file mode 100644 index de169a75c6..0000000000 --- a/transport/lwm2m/src/main/data/models/3337.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Positioner - This IPSO object should be used with a generic position actuator with range from 0 to 100%. This object optionally allows setting the transition time for an operation that changes the position of the actuator, and for reading the remaining time of the currently active transition. - - 3337 - urn:oma:lwm2m:ext:3337 - 1.0 - 1.0 - Multiple - Optional - - - Current Position - RW - Single - Mandatory - Float - 0..100 - /100 - Current position or desired position of a positioner actuator. - - - Transition Time - RW - Single - Optional - Float - - s - The time expected to move the actuator to the new position. - - - Remaining Time - R - Single - Optional - Float - - s - The time remaining in an operation. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value set on the actuator since power ON or reset. - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value set on the actuator since power ON or reset. - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value. - - - Min Limit - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor. - - - Max Limit - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3338.xml b/transport/lwm2m/src/main/data/models/3338.xml deleted file mode 100644 index 09e2ebb028..0000000000 --- a/transport/lwm2m/src/main/data/models/3338.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - Buzzer - This IPSO object should be used to actuate an audible alarm such as a buzzer, beeper, or vibration alarm. There is a dimmer control for setting the relative loudness of the alarm, and an optional duration control to limit the length of time the alarm sounds when turned on. Each time "true" is written to the On/Off resource, the alarm will sound again for the configured duration. If no duration is programmed or the setting is "false", writing a "true" to the On/Off resource will result in the alarm sounding continuously until a "false" is written to the On/Off resource. - - 3338 - urn:oma:lwm2m:ext:3338 - 1.0 - 1.0 - Multiple - Optional - - - On/Off - RW - Single - Mandatory - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Level - RW - Single - Optional - Float - 0..100 - /100 - Audio volume control, float value between 0 and 100 as a percentage. - - - Delay Duration - RW - Single - Optional - Float - - s - The duration of the time delay. - - - Minimum Off-time - RW - Single - Mandatory - Float - - s - The off time when On/Off control remains on. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3339.xml b/transport/lwm2m/src/main/data/models/3339.xml deleted file mode 100644 index 9de914fc7c..0000000000 --- a/transport/lwm2m/src/main/data/models/3339.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Audio Clip - This IPSO object should be used for a speaker that plays a pre-recorded audio clip or an audio output that is sent elsewhere. For example, an elevator which announces the floor of the building. A resource is provided to store the clip, a dimmer resource controls the relative sound level of the playback, and a duration resource limits the maximum playback time. After the duration time is reached, any remaining samples in the clip are ignored, and the clip player will be ready to play another clip. - 3339 - urn:oma:lwm2m:ext:3339 - 1.0 - 1.0 - Multiple - Optional - - - Clip - RW - Single - Mandatory - Opaque - - - Audio clip that is playable (e.g., a short audio recording indicating the floor in an elevator). - - - Trigger - E - Single - Optional - - - - Trigger initiating actuation. - - - Level - RW - Single - Optional - Float - 0..100 - /100 - Audio volume control, float value between 0 and 100 as a percentage. - - - Duration - RW - Single - Optional - Float - - s - The duration of the sound once trigger. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3340.xml b/transport/lwm2m/src/main/data/models/3340.xml deleted file mode 100644 index 3494aab3b6..0000000000 --- a/transport/lwm2m/src/main/data/models/3340.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - - Timer - This IPSO object is used to time events and actions, using patterns common to industrial timers. A write to the trigger resource or On/Off input state change starts the timing operation, and the timer remaining time shows zero when the operation is complete. The patterns supported are One-Shot (mode 1), On-Time or Interval (mode 2), Time delay on pick-up or TDPU (mode 3), and Time Delay on Drop-Out or TDDO (mode 4). Mode 0 disables the timer, so the output follows the input with no delay. A counter is provided to count occurrences of the timer output changing from 0 to 1. Writing a value of zero resets the counter. The Digital Input State resource reports the state of the timer output. - - 3340 - urn:oma:lwm2m:ext:3340 - 1.0 - 1.0 - Multiple - Optional - - - Delay Duration - RW - Single - Mandatory - Float - - s - The duration of the time delay. - - - Remaining Time - R - Single - Optional - Float - - s - The time remaining in an operation. - - - Minimum Off-time - RW - Single - Optional - Float - - s - The duration of the rearm delay (i.e. the delay from the end of one cycle until the beginning of the next, the inhibit time). - - - Trigger - E - Single - Optional - - - - Trigger initiating actuation. - - - On/Off - RW - Single - Optional - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input. - - - Cumulative Time - RW - Single - Optional - Float - - s - The total time in seconds that the timer input is true. Writing a 0 resets the time. - - - Digital State - R - Single - Optional - Boolean - - - The current state of the timer output. - - - Counter - RW - Single - Optional - Integer - - - Counts the number of times the timer output transitions from 0 to 1. - - - Timer Mode - RW - Single - Optional - Integer - 0..4 - - Type of timer pattern used by the patterns. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3341.xml b/transport/lwm2m/src/main/data/models/3341.xml deleted file mode 100644 index c8187aa155..0000000000 --- a/transport/lwm2m/src/main/data/models/3341.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Addressable Text Display - This IPSO object is used to send text to a text-only or text mode graphics display. Writing a string of text to the text resource causes it to be displayed at the selected X and Y locations on the display. If X or Y are set to a value greater than the size of the display, the position "wraps around" to the modulus of the setting and the display size. Likewise, if the text string overflows the display size, the text "wraps around" and displays on the next line down or, if the last line has been written, wraps around to the top of the display. Brightness and Contrast controls are provided to allow control of various display types including STN and DSTN type LCD character displays. Writing an empty payload to the Clear Display resource causes the display to be erased. - - 3341 - urn:oma:lwm2m:ext:3341 - 1.0 - 1.0 - Multiple - Optional - - - Text - RW - Single - Mandatory - String - - - A string of text. - - - X Coordinate - RW - Single - Optional - Integer - - - X Coordinate. - - - Y Coordinate - RW - Single - Optional - Integer - - - Y Coordinate. - - - Max X Coordinate - R - Single - Optional - Integer - - - The highest X coordinate the display supports before wrapping to the next line. - - - Max Y Coordinate - R - Single - Optional - Integer - - - The highest Y coordinate the display supports before wrapping to the next line. - - - Clear Display - E - Single - Optional - - - - Command to clear the display. - - - Level - RW - Single - Optional - Float - 0..100 - /100 - Brightness control, integer value between 0 and 100 as a percentage. - - - Contrast - RW - Single - Optional - Float - 0..100 - /100 - Proportional control, integer value between 0 and 100 as a percentage. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3342.xml b/transport/lwm2m/src/main/data/models/3342.xml deleted file mode 100644 index eadcb7a810..0000000000 --- a/transport/lwm2m/src/main/data/models/3342.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - On/Off switch - This IPSO object should be used with an On/Off switch to report the state of the switch. - 3342 - urn:oma:lwm2m:ext:3342 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Mandatory - Boolean - - - The current state of a digital input. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input transitions from 0 to 1. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds since the On command was sent. Writing a value of 0 resets the counter. - - - Off Time - RW - Single - Optional - Integer - - s - The time in seconds since the Off command was sent. Writing a value of 0 resets the counter. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3343.xml b/transport/lwm2m/src/main/data/models/3343.xml deleted file mode 100644 index f3ceaa1bef..0000000000 --- a/transport/lwm2m/src/main/data/models/3343.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - Dimmer - This IPSO object should be used with a dimmer or level control to report the state of the control. - - 3343 - urn:oma:lwm2m:ext:3343 - 1.0 - 1.0 - Multiple - Optional - - - Level - RW - Single - Mandatory - Float - 0..100 - /100 - Proportional control, integer value between 0 and 100 as a percentage. - - - On time - RW - Single - Optional - Integer - - s - The time in seconds that the dimmer has been on (Dimmer value has to be > 0). Writing a value of 0 resets the counter. - - - Off Time - RW - Single - Optional - Integer - - s - The time in seconds that the dimmer has been off (dimmer value less or equal to 0) Writing a value of 0 resets the counter. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3344.xml b/transport/lwm2m/src/main/data/models/3344.xml deleted file mode 100644 index e83c2a7054..0000000000 --- a/transport/lwm2m/src/main/data/models/3344.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - Up/Down Control - This IPSO object is used to report the state of an up/down control element like a pair of push buttons or a rotary encoder. Counters for increase and decrease operations are provided for counting pulses from a quadrature encoder. - - 3344 - urn:oma:lwm2m:ext:3344 - 1.0 - 1.0 - Multiple - Optional - - - Increase Input State - R - Single - Mandatory - Boolean - - - Indicates an increase control action. - - - Decrease Input State - R - Single - Mandatory - Boolean - - - Indicates a decrease control action. - - - Up Counter - RW - Single - Optional - Integer - - - Counts the number of times the increase control has been operated. Writing a 0 resets the counter. - - - Down Counter - RW - Single - Optional - Integer - - - Counts the times the decrease control has been operated. Writing a 0 resets the counter. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3345.xml b/transport/lwm2m/src/main/data/models/3345.xml deleted file mode 100644 index 3aeae67f44..0000000000 --- a/transport/lwm2m/src/main/data/models/3345.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - Multiple Axis Joystick - This IPSO object can be used to report the position of a shuttle or joystick control. A digital input is provided to report the state of an associated push button. - - 3345 - urn:oma:lwm2m:ext:3345 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Optional - Boolean - - - The current state of a digital input. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input transitions from 0 to 1. - - - X Value - R - Single - Optional - Float - - - The measured value along the X axis. - - - Y Value - R - Single - Optional - Float - - - The measured value along the Y axis. - - - Z Value - R - Single - Optional - Float - - - The measured value along the Z axis. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3346.xml b/transport/lwm2m/src/main/data/models/3346.xml deleted file mode 100644 index eb5336f7e0..0000000000 --- a/transport/lwm2m/src/main/data/models/3346.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - Rate - This object type should be used to report a rate measurement, for example the speed of a vehicle, or the rotational speed of a drive shaft. It also provides resources for minimum and maximum measured values, as well as the minimum and maximum range that can be measured by the sensor. An example measurement unit is meters per second (m/s). - - 3346 - urn:oma:lwm2m:ext:3346 - 1.0 - 1.0 - Multiple - Optional - - - Sensor Value - R - Single - Mandatory - Float - - - Last or Current Measured Value from the Sensor - - - Sensor Units - R - Single - Optional - String - - - Measurement Units Definition. - - - Min Measured Value - R - Single - Optional - Float - - - The minimum value measured by the sensor since power ON or reset - - - Max Measured Value - R - Single - Optional - Float - - - The maximum value measured by the sensor since power ON or reset - - - Min Range Value - R - Single - Optional - Float - - - The minimum value that can be measured by the sensor - - - Max Range Value - R - Single - Optional - Float - - - The maximum value that can be measured by the sensor - - - Reset Min and Max Measured Values - E - Single - Optional - - - - Reset the Min and Max Measured Values to Current Value - - - Current Calibration - RW - Single - Optional - Float - - - Read or Write the current calibration coefficient - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case - - - - - diff --git a/transport/lwm2m/src/main/data/models/3347.xml b/transport/lwm2m/src/main/data/models/3347.xml deleted file mode 100644 index 0b188d5a7e..0000000000 --- a/transport/lwm2m/src/main/data/models/3347.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - Push button - This IPSO object is used to report the state of a momentary action push button control and to count the number of times the control has been operated since the last observation. - - 3347 - urn:oma:lwm2m:ext:3347 - 1.0 - 1.0 - Multiple - Optional - - - Digital Input State - R - Single - Mandatory - Boolean - - - The current state of a digital input. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input transitions from 0 to 1. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3348.xml b/transport/lwm2m/src/main/data/models/3348.xml deleted file mode 100644 index d8937c4fea..0000000000 --- a/transport/lwm2m/src/main/data/models/3348.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Multi-state Selector - This IPSO object is used to represent the state of a Multi-state selector switch with a number of fixed positions. - - 3348 - urn:oma:lwm2m:ext:3348 - 1.0 - 1.0 - Multiple - Optional - - - Multi-state Input - R - Single - Mandatory - Integer - - - The current state of a Multi-state input or selector. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3349.xml b/transport/lwm2m/src/main/data/models/3349.xml deleted file mode 100644 index e07d1f711b..0000000000 --- a/transport/lwm2m/src/main/data/models/3349.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Bitmap - Summarize several digital inputs to one value by mapping each bit to a digital input. - 3349 - urn:oma:lwm2m:ext:3349 - 1.0 - 1.0 - Multiple - Optional - - - Bitmap Input - R - Single - Mandatory - Integer - - - Integer in which each of the bits are associated with specific digital input value. Represented as a binary signed integer in network byte order, and in two's complement representation. Using values in range 0-127 is recommended to avoid ambiguities with byte order and negative values. - - - Bitmap Input Reset - E - Single - Optional - - - - Reset the Bitmap Input value. - - - Element Description - RW - Multiple - Optional - String - - - The description of each bit as a string. First instance describes the least significant bit, second instance the second least significant bit. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3350.xml b/transport/lwm2m/src/main/data/models/3350.xml deleted file mode 100644 index dc9b0fcafc..0000000000 --- a/transport/lwm2m/src/main/data/models/3350.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Stopwatch - An ascending timer that counts how long time has passed since the timer was started after reset. - 3350 - urn:oma:lwm2m:ext:3350 - 1.0 - 1.0 - Multiple - Optional - - - Cumulative Time - RW - Single - Mandatory - Float - - s - The total time in seconds that the stopwatch has been on. Writing a 0 resets the time. - - - On/Off - RW - Single - Optional - Boolean - - - On/off control. Boolean value where True is On and False is Off. - - - Digital Input Counter - R - Single - Optional - Integer - - - The number of times the input transitions from off to on. - - - Application Type - RW - Single - Optional - String - - - The application type of the sensor or actuator as a string depending on the use case. - - - - - diff --git a/transport/lwm2m/src/main/data/models/3351.xml b/transport/lwm2m/src/main/data/models/3351.xml deleted file mode 100644 index 8f6db38357..0000000000 --- a/transport/lwm2m/src/main/data/models/3351.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - powerupLog - - 3351 - urn:oma:lwm2m:ext:3351 - 1.0 - 1.0 - Single - Optional - - deviceName - R - Single - Mandatory - String - - - - - toolVersion - R - Single - Mandatory - String - - - - - IMEI - R - Single - Mandatory - String - - - - - IMSI - R - Single - Mandatory - String - - - - - MSISDN - R - Single - Mandatory - String - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3352.xml b/transport/lwm2m/src/main/data/models/3352.xml deleted file mode 100644 index c0d3f73c6c..0000000000 --- a/transport/lwm2m/src/main/data/models/3352.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - plmnSearchEvent - - 3352 - urn:oma:lwm2m:ext:3352 - 1.0 - 1.0 - Multiple - Optional - - timeScanStart - R - Single - Mandatory - Integer - - - - - plmnID - R - Single - Mandatory - Integer - - - - - BandIndicator - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3353.xml b/transport/lwm2m/src/main/data/models/3353.xml deleted file mode 100644 index b09c4e62c8..0000000000 --- a/transport/lwm2m/src/main/data/models/3353.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - scellID - - 3353 - urn:oma:lwm2m:ext:3353 - 1.0 - 1.0 - Single - Optional - - plmnID - R - Single - Mandatory - Integer - - - - - BandIndicator - R - Single - Mandatory - Integer - - - - - TrackingAreaCode - R - Single - Mandatory - Integer - - - - - CellID - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3354.xml b/transport/lwm2m/src/main/data/models/3354.xml deleted file mode 100644 index e05d2d4328..0000000000 --- a/transport/lwm2m/src/main/data/models/3354.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - cellReselectionEvent - - 3354 - urn:oma:lwm2m:ext:3354 - 1.0 - 1.0 - Single - Optional - - timeReselectionStart - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - CellID - R - Single - Mandatory - Integer - - - - - failureType - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3355.xml b/transport/lwm2m/src/main/data/models/3355.xml deleted file mode 100644 index 061e1ae92f..0000000000 --- a/transport/lwm2m/src/main/data/models/3355.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - - handoverEvent - - 3355 - urn:oma:lwm2m:ext:3355 - 1.0 - 1.0 - Single - Optional - - timeHandoverStart - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - CellID - R - Single - Mandatory - Integer - - - - - handoverResult - R - Single - Mandatory - Integer - - - - - - TargetEarfcn - R - Single - Mandatory - Integer - - - - - TargetPhysicalCellID - R - Single - Mandatory - Integer - - - - - targetCellRsrp - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3356.xml b/transport/lwm2m/src/main/data/models/3356.xml deleted file mode 100644 index 7ebd3050d5..0000000000 --- a/transport/lwm2m/src/main/data/models/3356.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - radioLinkFailureEvent - - 3356 - urn:oma:lwm2m:ext:3356 - 1.0 - 1.0 - Single - Optional - - timeRLF - R - Single - Mandatory - Integer - - - - - rlfCause - R - Single - Mandatory - Integer - - - - - - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3357.xml b/transport/lwm2m/src/main/data/models/3357.xml deleted file mode 100644 index 76ed482171..0000000000 --- a/transport/lwm2m/src/main/data/models/3357.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - rrcStateChangeEvent - - 3357 - urn:oma:lwm2m:ext:3357 - 1.0 - 1.0 - Single - Optional - - rrcState - R - Single - Mandatory - Integer - - - - - rrcStateChangeCause - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3358.xml b/transport/lwm2m/src/main/data/models/3358.xml deleted file mode 100644 index dbbb9e82a8..0000000000 --- a/transport/lwm2m/src/main/data/models/3358.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - rrcTimerExpiryEvent - - 3358 - urn:oma:lwm2m:ext:3358 - 1.0 - 1.0 - Single - Optional - - RrcTimerExpiryEvent - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3359.xml b/transport/lwm2m/src/main/data/models/3359.xml deleted file mode 100644 index 8dbd810603..0000000000 --- a/transport/lwm2m/src/main/data/models/3359.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - cellBlacklistEvent - - 3359 - urn:oma:lwm2m:ext:3359 - 1.0 - 1.0 - Single - Optional - - dlEarfcn - R - Single - Mandatory - Integer - - - - - CellID - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3360.xml b/transport/lwm2m/src/main/data/models/3360.xml deleted file mode 100644 index e920a18637..0000000000 --- a/transport/lwm2m/src/main/data/models/3360.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - esmContextInfo - - 3360 - urn:oma:lwm2m:ext:3360 - 1.0 - 1.0 - Single - Optional - - contextType - R - Single - Mandatory - Integer - - - - - bearerState - R - Single - Mandatory - Integer - - - - - radioBearerId - R - Single - Mandatory - Integer - - - - - qci - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3361.xml b/transport/lwm2m/src/main/data/models/3361.xml deleted file mode 100644 index 60b149e2aa..0000000000 --- a/transport/lwm2m/src/main/data/models/3361.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - - emmStateValue - - 3361 - urn:oma:lwm2m:ext:3361 - 1.0 - 1.0 - Single - Optional - - EmmState - R - Single - Mandatory - Integer - - - - - emmSubstate - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3362.xml b/transport/lwm2m/src/main/data/models/3362.xml deleted file mode 100644 index ca096314fb..0000000000 --- a/transport/lwm2m/src/main/data/models/3362.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - nasEmmTimerExpiryEvent - - 3362 - urn:oma:lwm2m:ext:3362 - 1.0 - 1.0 - Single - Optional - - NasEmmTimerExpiryEvent - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3363.xml b/transport/lwm2m/src/main/data/models/3363.xml deleted file mode 100644 index bfde9d423a..0000000000 --- a/transport/lwm2m/src/main/data/models/3363.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - nasEsmExpiryEvent - - 3363 - urn:oma:lwm2m:ext:3363 - 1.0 - 1.0 - Single - Optional - - NasEsmExpiryEvent - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3364.xml b/transport/lwm2m/src/main/data/models/3364.xml deleted file mode 100644 index 732c1548c1..0000000000 --- a/transport/lwm2m/src/main/data/models/3364.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - emmFailureCauseEvent - - 3364 - urn:oma:lwm2m:ext:3364 - 1.0 - 1.0 - Single - Optional - - EMMCause - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3365.xml b/transport/lwm2m/src/main/data/models/3365.xml deleted file mode 100644 index 1f07528f8a..0000000000 --- a/transport/lwm2m/src/main/data/models/3365.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - rachLatency_delay - - 3365 - urn:oma:lwm2m:ext:3365 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - rachLatencyVal - R - Single - Mandatory - Integer - - - - - delay - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3366.xml b/transport/lwm2m/src/main/data/models/3366.xml deleted file mode 100644 index e4f793b96a..0000000000 --- a/transport/lwm2m/src/main/data/models/3366.xml +++ /dev/null @@ -1,193 +0,0 @@ - - - - macRachAttemptEvent - - 3366 - urn:oma:lwm2m:ext:3366 - 1.0 - 1.0 - Single - Optional - - rachAttemptCounter - R - Single - Mandatory - Integer - - - - - MacRachAttemptEventType - R - Single - Mandatory - Integer - - - - - contentionBased - R - Single - Mandatory - Boolean - - - - - rachMessage - R - Single - Mandatory - Integer - - - - - preambleIndex - R - Single - Mandatory - Integer - - - - - preamblePowerOffset - R - Single - Mandatory - Integer - - - - - backoffTime - R - Single - Mandatory - Integer - - - - - msg2Result - R - Single - Mandatory - Boolean - - - - - timingAdjustmentValue - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3367.xml b/transport/lwm2m/src/main/data/models/3367.xml deleted file mode 100644 index a97a3d3994..0000000000 --- a/transport/lwm2m/src/main/data/models/3367.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - macRachAttemptReasonEvent - - 3367 - urn:oma:lwm2m:ext:3367 - 1.0 - 1.0 - Single - Optional - - MacRachAttemptReasonType - R - Single - Mandatory - Integer - - - - - ueID - R - Single - Mandatory - Integer - - - - - contentionBased - R - Single - Mandatory - Boolean - - - - - preamble - R - Single - Mandatory - Integer - - - - - preambleGroupChosen - R - Single - Mandatory - Boolean - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3368.xml b/transport/lwm2m/src/main/data/models/3368.xml deleted file mode 100644 index 2f1abcaeba..0000000000 --- a/transport/lwm2m/src/main/data/models/3368.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - macTimerStatusEvent - - 3368 - urn:oma:lwm2m:ext:3368 - 1.0 - 1.0 - Single - Optional - - macTimerName - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3369.xml b/transport/lwm2m/src/main/data/models/3369.xml deleted file mode 100644 index c905081c07..0000000000 --- a/transport/lwm2m/src/main/data/models/3369.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - macTimingAdvanceEvent - - 3369 - urn:oma:lwm2m:ext:3369 - 1.0 - 1.0 - Single - Optional - - timerValue - R - Single - Mandatory - Integer - - - - - timingAdvance - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3370.xml b/transport/lwm2m/src/main/data/models/3370.xml deleted file mode 100644 index a9da3758ce..0000000000 --- a/transport/lwm2m/src/main/data/models/3370.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - ServingCellMeasurement - - 3370 - urn:oma:lwm2m:ext:3370 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - pci - R - Single - Mandatory - Integer - - - - - rsrp - R - Single - Mandatory - Integer - - - - - rsrq - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3371.xml b/transport/lwm2m/src/main/data/models/3371.xml deleted file mode 100644 index 32c0583d91..0000000000 --- a/transport/lwm2m/src/main/data/models/3371.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - NeighborCellMeasurements - - 3371 - urn:oma:lwm2m:ext:3371 - 1.0 - 1.0 - Multiple - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - pci - R - Single - Mandatory - Integer - - - - - rsrp - R - Single - Mandatory - Integer - - - - - rsrq - R - Single - Mandatory - Integer - - - - - dlEarfcn - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3372.xml b/transport/lwm2m/src/main/data/models/3372.xml deleted file mode 100644 index 3b7cf1ca8f..0000000000 --- a/transport/lwm2m/src/main/data/models/3372.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - TimingAdvance - - 3372 - urn:oma:lwm2m:ext:3372 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - timingAdvance - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3373.xml b/transport/lwm2m/src/main/data/models/3373.xml deleted file mode 100644 index 597b3f6842..0000000000 --- a/transport/lwm2m/src/main/data/models/3373.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - txPowerHeadroomEvent - - 3373 - urn:oma:lwm2m:ext:3373 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - headroom-value - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3374.xml b/transport/lwm2m/src/main/data/models/3374.xml deleted file mode 100644 index a74899c7e5..0000000000 --- a/transport/lwm2m/src/main/data/models/3374.xml +++ /dev/null @@ -1,149 +0,0 @@ - - - - radioLinkMonitoring - - 3374 - urn:oma:lwm2m:ext:3374 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - outOfSyncCount - R - Single - Mandatory - Integer - - - - - inSyncCount - R - Single - Mandatory - Integer - - - - - t310Timer - R - Single - Mandatory - Boolean - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3375.xml b/transport/lwm2m/src/main/data/models/3375.xml deleted file mode 100644 index 76c7c1ae20..0000000000 --- a/transport/lwm2m/src/main/data/models/3375.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - PagingDRX - - 3375 - urn:oma:lwm2m:ext:3375 - 1.0 - 1.0 - Single - Optional - - dlEarfcn - R - Single - Mandatory - Integer - - - - - pci - R - Single - Mandatory - Integer - - - - - pagingCycle - R - Single - Mandatory - Integer - - - - - DrxNb - R - Single - Mandatory - Integer - - - - - ueID - R - Single - Mandatory - Integer - - - - - drxSysFrameNumOffset - R - Single - Mandatory - Integer - - - - - drxSubFrameNumOffset - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3376.xml b/transport/lwm2m/src/main/data/models/3376.xml deleted file mode 100644 index 39542f5962..0000000000 --- a/transport/lwm2m/src/main/data/models/3376.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - txPowerBackOffEvent - - 3376 - urn:oma:lwm2m:ext:3376 - 1.0 - 1.0 - Single - Optional - - TxPowerBackoff - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3377.xml b/transport/lwm2m/src/main/data/models/3377.xml deleted file mode 100644 index afcddb10d5..0000000000 --- a/transport/lwm2m/src/main/data/models/3377.xml +++ /dev/null @@ -1,185 +0,0 @@ - - - - Message3Report - - 3377 - urn:oma:lwm2m:ext:3377 - 1.0 - 1.0 - Single - Optional - - tpc - R - Single - Mandatory - Integer - - - - - resourceIndicatorValue - R - Single - Mandatory - Integer - - - - - cqi - R - Single - Mandatory - Integer - - - - - uplinkDelay - R - Single - Mandatory - Boolean - - - - - hoppingEnabled - R - Single - Mandatory - Boolean - - - - - numRb - R - Single - Mandatory - Integer - - - - - transportBlockSizeIndex - R - Single - Mandatory - Integer - - - - - ModulationType - R - Single - Mandatory - Integer - - - - - redundancyVersionIndex - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3378.xml b/transport/lwm2m/src/main/data/models/3378.xml deleted file mode 100644 index 3c3972b43e..0000000000 --- a/transport/lwm2m/src/main/data/models/3378.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - PbchDecodingResults - - 3378 - urn:oma:lwm2m:ext:3378 - 1.0 - 1.0 - Single - Optional - - servingCellID - R - Single - Mandatory - Integer - - - - - crcResult - R - Single - Mandatory - Boolean - - - - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3379.xml b/transport/lwm2m/src/main/data/models/3379.xml deleted file mode 100644 index 12062a953e..0000000000 --- a/transport/lwm2m/src/main/data/models/3379.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - pucchPowerControl - - 3379 - urn:oma:lwm2m:ext:3379 - 1.0 - 1.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - pucchTxPowerValue - - Single - Mandatory - Integer - - - - - dlPathLoss - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3380-2_0.xml b/transport/lwm2m/src/main/data/models/3380-2_0.xml deleted file mode 100644 index c1b8822e21..0000000000 --- a/transport/lwm2m/src/main/data/models/3380-2_0.xml +++ /dev/null @@ -1,221 +0,0 @@ - - - - PrachReport - - 3380 - urn:oma:lwm2m:ext:3380:2.0 - 1.0 - 2.0 - Single - Optional - - sysFrameNumber - R - Single - Mandatory - Integer - - - - - subFrameNumber - R - Single - Mandatory - Integer - - - - - rachTxPower - R - Single - Mandatory - Integer - - - - - zadOffSeqNum - R - Single - Mandatory - Integer - - - - - prachConfig - R - Single - Mandatory - Integer - - - - - preambleFormat - R - Single - Mandatory - Integer - - - - - maxTransmissionMsg3 - R - Single - Mandatory - Integer - - - - - raResponseWindowSize - R - Single - Mandatory - Integer - - - - - RachRequestResult - R - Single - Mandatory - Boolean - - - - - ce_mode - R - Single - Mandatory - Integer - - - - - ce_level - R - Single - Mandatory - Integer - - - - - num_prach_repetition - R - Single - Mandatory - Integer - - - - - prach_repetition_seq - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3381.xml b/transport/lwm2m/src/main/data/models/3381.xml deleted file mode 100644 index b029984980..0000000000 --- a/transport/lwm2m/src/main/data/models/3381.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - VolteCallEvent - - 3381 - urn:oma:lwm2m:ext:3381 - 1.0 - 1.0 - Single - Optional - - callStatus - R - Single - Mandatory - Integer - - - - - callType - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3382.xml b/transport/lwm2m/src/main/data/models/3382.xml deleted file mode 100644 index 7be3dde5e9..0000000000 --- a/transport/lwm2m/src/main/data/models/3382.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - SipRegistrationEvent - - 3382 - urn:oma:lwm2m:ext:3382 - 1.0 - 1.0 - Single - Optional - - registrationType - R - Single - Mandatory - Integer - - - - - registrationResult - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3383.xml b/transport/lwm2m/src/main/data/models/3383.xml deleted file mode 100644 index 5b094cb491..0000000000 --- a/transport/lwm2m/src/main/data/models/3383.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - sipPublishEvent - - 3383 - urn:oma:lwm2m:ext:3383 - 1.0 - 1.0 - Single - Optional - - publishResult - R - Single - Mandatory - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3384.xml b/transport/lwm2m/src/main/data/models/3384.xml deleted file mode 100644 index ee5c6922fb..0000000000 --- a/transport/lwm2m/src/main/data/models/3384.xml +++ /dev/null @@ -1,129 +0,0 @@ - - - - sipSubscriptionEvent - - 3384 - urn:oma:lwm2m:ext:3384 - 1.0 - 1.0 - Single - Optional - - eventType - R - Single - Mandatory - Integer - - - - - subscriptionResult - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3385.xml b/transport/lwm2m/src/main/data/models/3385.xml deleted file mode 100644 index 7039bd3cd4..0000000000 --- a/transport/lwm2m/src/main/data/models/3385.xml +++ /dev/null @@ -1,127 +0,0 @@ - - - - volteCallStateChangeEvent - - 3385 - urn:oma:lwm2m:ext:3385 - 1.0 - 1.0 - Single - Optional - - callStatus - R - Single - Mandatory - Integer - - - - - VolteCallStateChangeCause - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/3386.xml b/transport/lwm2m/src/main/data/models/3386.xml deleted file mode 100644 index 4afb12684e..0000000000 --- a/transport/lwm2m/src/main/data/models/3386.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - VoLTErtpPacketLoss - 1]]> - 3386 - urn:oma:lwm2m:ext:3386 - 1.0 - 1.0 - Single - Optional - - ssrc - R - Single - Mandatory - Integer - - - - - packetsLost - R - Single - Mandatory - Integer - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/LWM2M_APN_Connection_Profile-v1_0_1.xml b/transport/lwm2m/src/main/data/models/LWM2M_APN_Connection_Profile-v1_0_1.xml deleted file mode 100644 index cb37a20f0c..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_APN_Connection_Profile-v1_0_1.xml +++ /dev/null @@ -1,287 +0,0 @@ - - - - - LWM2M APN Connection Profile - - 11 - - urn:oma:lwm2m:oma:11 - 1.0 - 1.0 - Multiple - Optional - - Profile name - RW - Single - Mandatory - String - - - - - APN - RW - Single - Optional - String - - - - - Auto select APN by device - RW - Single - Optional - Boolean - - - - - Enable status - RW - Single - Optional - Boolean - - - - - Authentication Type - RW - Single - Mandatory - Integer - - - - - User Name - RW - Single - Optional - String - - - - - Secret - RW - Single - Optional - String - - - - - Reconnect Schedule - RW - Single - Optional - String - - - - - Validity (MCC, MNC) - RW - Multiple - Optional - String - - - - - Connection establishment time (1) - R - Multiple - Optional - Time - - - - - Connection establishment result (1) - R - Multiple - Optional - Integer - - - - - - Connection establishment reject cause (1) - R - Multiple - Optional - Integer - 0..111 - - - - Connection end time (1) - R - Multiple - Optional - Time - - - - - TotalBytesSent - R - Single - Optional - Integer - - - - - TotalBytesReceived - R - Single - Optional - Integer - - - - - IP address (2) - RW - Multiple - Optional - String - - - - - Prefix length(2) - RW - Multiple - Optional - String - - - - - Subnet mask (2) - RW - Multiple - Optional - String - - - - - Gateway (2) - RW - Multiple - Optional - String - - - - - Primary DNS address (2) - RW - Multiple - Optional - String - - - - - Secondary DNS address (2) - RW - Multiple - Optional - String - - - - - QCI (3) - R - Single - Optional - Integer - 1..9 - - - - Vendor specific extensions - R - Single - Optional - Objlnk - - - - - TotalPacketsSent - R - Single - Optional - Integer - - - - - PDN Type - RW - Single - Optional - Integer - - - - - - APN Rate Control - R - Single - Optional - Integer - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/LWM2M_Bearer_Selection-v1_0_1.xml b/transport/lwm2m/src/main/data/models/LWM2M_Bearer_Selection-v1_0_1.xml deleted file mode 100644 index 36e5922107..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_Bearer_Selection-v1_0_1.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - LWM2M Bearer Selection - - 13 - urn:oma:lwm2m:oma:13 - 1.0 - 1.0 - Single - Optional - - Preferred Communications Bearer - RW - Multiple - Optional - Integer - 8 bit - - - - Acceptable RSSI (GSM) - RW - Single - Optional - Integer - - - - - Acceptable RSCP (UMTS) - RW - Single - Optional - Integer - - - - - Acceptable RSRP (LTE) - RW - Single - Optional - Integer - - - - - Acceptable RSSI (1xEV-DO) - RW - Single - Optional - Integer - - - - - Cell lock list - RW - Single - Optional - String - - - - - Operator list - RW - Single - Optional - String - - - - - Operator list mode - RW - Single - Optional - Boolean - - - - - List of available PLMNs - R - Single - Optional - String - - - - - Vendor specific extensions - R - Single - Optional - Objlnk - - - - - Acceptable RSRP (NB-IoT) - RW - Single - Optional - Integer - - - - - Higher Priority PLMN Search Timer - RW - Single - Optional - Integer - - - - - Attach without PDN connection - RW - Single - Optional - Boolean - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/LWM2M_Cellular_Connectivity-v1_0_1.xml b/transport/lwm2m/src/main/data/models/LWM2M_Cellular_Connectivity-v1_0_1.xml deleted file mode 100644 index 6c2cbf0fdc..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_Cellular_Connectivity-v1_0_1.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - LWM2M Cellular Connectivity - - 10 - urn:oma:lwm2m:oma:10 - 1.0 - 1.0 - Single - Optional - - SMSC address - RW - Single - Optional - String - - - - - Disable radio period - RW - Single - Optional - Integer - 0..65535 - - 0 the device SHALL disconnect. When the period has elapsed the device MAY reconnect.]]> - - Module activation code - RW - Single - Optional - String - - - - - Vendor specific extensions - R - Single - Optional - Objlnk - - - - - PSM Timer (1) - RW - Single - Optional - Integer - - s - - - Active Timer (1) - RW - Single - Optional - Integer - - s - - - Serving PLMN Rate control - R - Single - Optional - Integer - - - - - eDRX parameters for Iu mode (1) - RW - Single - Optional - Opaque - 8 bit - - - - eDRX parameters for WB-S1 mode (1) - RW - Single - Optional - Opaque - 8 bit - - - - eDRX parameters for NB-S1 mode (1) - RW - Single - Optional - Opaque - 8 bit - - - - eDRX parameters for A/Gb mode (1) - RW - Single - Optional - Opaque - 8 bit - - - - Activated Profile Names - R - Multiple - Mandatory - Objlnk - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/LWM2M_DevCapMgmt-v1_0.xml b/transport/lwm2m/src/main/data/models/LWM2M_DevCapMgmt-v1_0.xml deleted file mode 100644 index a7f51720db..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_DevCapMgmt-v1_0.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - DevCapMgmt - - 15 - urn:oma:lwm2m:oma:15 - Multiple - Optional - - Property - R - Single - Mandatory - String - - - - - Group - R - Single - Mandatory - Integer - 0-15 - - - - Description - R - Single - Optional - String - - - - - Attached - R - Single - Optional - Boolean - - - - - Enabled - R - Single - Mandatory - Boolean - - - - - opEnable - E - Single - Mandatory - - - - - - opDisable - E - Multiple - Mandatory - - - - - - NotifyEn - RW - Single - Optional - Boolean - - - - - - - \ No newline at end of file diff --git a/transport/lwm2m/src/main/data/models/LWM2M_LOCKWIPE-v1_0_1.xml b/transport/lwm2m/src/main/data/models/LWM2M_LOCKWIPE-v1_0_1.xml deleted file mode 100644 index cad8b9366f..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_LOCKWIPE-v1_0_1.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - Lock and Wipe - - 8 - urn:oma:lwm2m:oma:8 - Single - Optional - - State - RW - Single - Mandatory - Integer - 0-2 - - - - Lock target - W - Multiple - Mandatory - String - - - - - Wipe item - R - Multiple - Optional - String - - - - - Wipe - E - Single - Mandatory - - - - - - - Wipe target - W - Multiple - Mandatory - String - - - - Lock or Wipe Operation Result - R - Single - Mandatory - Integer - 0-8 - - - - - - \ No newline at end of file diff --git a/transport/lwm2m/src/main/data/models/LWM2M_Portfolio-v1_0.xml b/transport/lwm2m/src/main/data/models/LWM2M_Portfolio-v1_0.xml deleted file mode 100644 index a023383bae..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_Portfolio-v1_0.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - Portfolio - - 16 - urn:oma:lwm2m:oma:161.0 - 1.0Multiple - Optional - - Identity - RW - Multiple - Mandatory - String - - - - - GetAuthData - E - Single - Optional - - - - - - AuthData - R - Multiple - Optional - Opaque - - - - - AuthStatus - R - Single - Optional - Integer - [0-2] - - - - - - \ No newline at end of file diff --git a/transport/lwm2m/src/main/data/models/LWM2M_Software_Component-v1_0.xml b/transport/lwm2m/src/main/data/models/LWM2M_Software_Component-v1_0.xml deleted file mode 100644 index 596c54b751..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_Software_Component-v1_0.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - LWM2M Software Component - - 14 - urn:oma:lwm2m:oma:14 - Multiple - Optional - - - Component Identity - R - Single - Optional - String - 0-255 bytes - - - - - Component Pack - R - Single - Optional - Opaque - - - - - - Component Version - R - Single - Optional - String - 0-255 bytes - - - - - Activate - E - Single - Optional - - - - - - - Deactivate - E - Single - Optional - - - - - - Activation State - R - Single - Optional - Boolean - - - - - - - - diff --git a/transport/lwm2m/src/main/data/models/LWM2M_Software_Management-v1_0.xml b/transport/lwm2m/src/main/data/models/LWM2M_Software_Management-v1_0.xml deleted file mode 100644 index fd880e0963..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_Software_Management-v1_0.xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - - LWM2M Software Management - - 9 - urn:oma:lwm2m:oma:9 - Multiple - Optional - - - PkgName - R - Single - Mandatory - String - 0-255 bytes - - - - - PkgVersion - R - Single - Mandatory - String - 0-255 bytes - - - - - Package - W - Single - Optional - Opaque - - - - - - Package URI - W - Single - Optional - String - 0-255 bytes - - - - - Install - E - Single - Mandatory - - - - - - Checkpoint - R - Single - Optional - Objlnk - - - - - Uninstall - E - Single - Mandatory - - - - - - Update State - R - Single - Mandatory - Integer - 0-4 - - - - Update Supported Objects - RW - Single - Optional - Boolean - - - - - Update Result - R - Single - Mandatory - Integer - 0-200 - - - - Activate - E - Single - Mandatory - - - - - - Deactivate - E - Single - Mandatory - - - - - - Activation State - R - Single - Mandatory - Boolean - - - - - Package Settings - RW - Single - Optional - Objlnk - - - - - User Name - W - Single - Optional - String - 0-255 bytes - - - - Password - W - Single - Optional - String - 0-255 bytes - - - - - - diff --git a/transport/lwm2m/src/main/data/models/LWM2M_WLAN_connectivity4-v1_0.xml b/transport/lwm2m/src/main/data/models/LWM2M_WLAN_connectivity4-v1_0.xml deleted file mode 100644 index 57550f2b36..0000000000 --- a/transport/lwm2m/src/main/data/models/LWM2M_WLAN_connectivity4-v1_0.xml +++ /dev/null @@ -1,528 +0,0 @@ - - - - - WLAN connectivity - - 12 - urn:oma:lwm2m:oma:12 - - - Multiple - Optional - - Interface name - RW - Single - Mandatory - String - - - - - Enable - RW - Single - Mandatory - Boolean - - - - - Radio Enabled - RW - Single - Optional - Integer - - - - - Status - R - Single - Mandatory - Integer - - - - - BSSID - R - Single - Mandatory - String - 12 bytes - - - - SSID - RW - Single - Mandatory - String - 1-32 Bytes - - - - Broadcast SSID - RW - Single - Optional - Boolean - - - - - Beacon Enabled - RW - Single - Optional - Boolean - - - - - Mode - RW - Single - Mandatory - Integer - - - - - Channel - RW - Single - Mandatory - Integer - 0-255 - - - - Auto Channel - RW - Single - Optional - Boolean - - - - - Supported Channels - RW - Multiple - Optional - Integer - - - - - Channels In Use - RW - Multiple - Optional - Integer - - - - - Regulatory Domain - RW - Single - Optional - String - 3 Bytes - - - - Standard - RW - Single - Mandatory - Integer - - - - - Authentication Mode - RW - Single - Mandatory - Integer - - - - - Encryption Mode - RW - Single - Optional - Integer - - - - - WPA Pre Shared Key - W - Single - Optional - String - 64 Bytes - - - - WPA Key Phrase - W - Single - Optional - String - 1-64 Bytes - - - - WEP Encryption Type - RW - Single - Optional - Integer - - - - - WEP Key Index - RW - Single - Optional - Integer - [1:4] - - - - WEP Key Phrase - W - Single - Optional - String - 1-64 Bytes - - - - WEP Key 1 - W - Single - Optional - String - 0 or 26 Bytes - - - - WEP Key 2 - W - Single - Optional - String - 0 or 26 Bytes - - - - WEP Key 3 - W - Single - Optional - String - 10 or 26 Bytes - - - - WEP Key 4 - W - Single - Optional - String - 10 or 26 Bytes - - - - RADIUS Server - RW - Single - Optional - String - 1-256 Bytes - - - - RADIUS Server Port - RW - Single - Optional - Integer - - - - - RADIUS Secret - W - Single - Optional - String - 1-256 Bytes - - - - WMM Supported - R - Single - Optional - Boolean - - - - - WMM Enabled - RW - Single - Optional - Boolean - - - - - MAC Control Enabled - RW - Single - Optional - Boolean - - - - - MAC Address List - RW - Multiple - Optional - String - 12 Bytes - - - - Total Bytes Sent - R - Single - Optional - Integer - - - - - Total Bytes Received - R - Single - Optional - Integer - - - - - Total Packets Sent - R - Single - Optional - Integer - - - - - Total Packets Received - R - Single - Optional - Integer - - - - - Transmit Errors - R - Single - Optional - Integer - - - - - Receive Errors - R - Single - Optional - Integer - - - - - Unicast Packets Sent - R - Single - Optional - Integer - - - - - Unicast Packets Received - R - Single - Optional - Integer - - - - - Multicast Packets Received - R - Single - Optional - Integer - - - - - Multicast Packets Received - R - Single - Optional - Integer - - - - - Broadcast Packets Sent - R - Single - Optional - Integer - - - - - 44 Broadcast Packets Received - R - Single - Optional - Integer - - - - - Discard Packets Sent - R - Single - Optional - Integer - - - - - Discard Packets Received - R - Single - Optional - Integer - - - - - Unknown Packets Received - R - Single - Optional - Integer - - - - - Vendor specific extensions - R - Single - Optional - Objlnk - - - - - - - \ No newline at end of file diff --git a/transport/lwm2m/src/main/data/models/LwM2M_EventLog-V1_0.xml b/transport/lwm2m/src/main/data/models/LwM2M_EventLog-V1_0.xml deleted file mode 100644 index 4129dd8ce8..0000000000 --- a/transport/lwm2m/src/main/data/models/LwM2M_EventLog-V1_0.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - Event Log - - 20 - urn:oma:lwm2m:oma:20 - 1.0 - 1.0 - Single - Optional - - LogClass - RW - Single - Optional - Integer - 255 - - - - LogStart - E - Single - Optional - - - - - - LogStop - E - Single - Optional - - - - - - LogStatus - R - Single - Optional - Integer - 8-Bits - - - - LogData - R - Single - Mandatory - Opaque - - - - - LogDataFormat - RW - Single - Optional - Integer - 255 - - - - - - \ No newline at end of file diff --git a/ui-ngx/package.json b/ui-ngx/package.json index 13913d8d97..775a685ae8 100644 --- a/ui-ngx/package.json +++ b/ui-ngx/package.json @@ -68,6 +68,7 @@ "ngx-clipboard": "^13.0.1", "ngx-color-picker": "^10.1.0", "ngx-daterangepicker-material": "^4.0.1", + "ngx-drag-drop": "^2.0.0", "ngx-flowchart": "git://github.com/thingsboard/ngx-flowchart.git#master", "ngx-hm-carousel": "^2.0.0-rc.1", "ngx-sharebuttons": "^8.0.1", diff --git a/ui-ngx/src/app/core/api/alias-controller.ts b/ui-ngx/src/app/core/api/alias-controller.ts index 6ca208c506..5f7474a31b 100644 --- a/ui-ngx/src/app/core/api/alias-controller.ts +++ b/ui-ngx/src/app/core/api/alias-controller.ts @@ -16,7 +16,7 @@ import { AliasInfo, IAliasController, StateControllerHolder, StateEntityInfo } from '@core/api/widget-api.models'; import { forkJoin, Observable, of, ReplaySubject, Subject } from 'rxjs'; -import { Datasource, DatasourceType } from '@app/shared/models/widget.models'; +import { Datasource, DatasourceType, datasourceTypeTranslationMap } from '@app/shared/models/widget.models'; import { deepClone, isEqual } from '@core/utils'; import { EntityService } from '@core/http/entity.service'; import { UtilsService } from '@core/services/utils.service'; @@ -27,6 +27,7 @@ import { defaultEntityDataPageLink, Filter, FilterInfo, filterInfoToKeyFilters, Filters, KeyFilter, singleEntityDataPageLink, updateDatasourceFromEntityInfo } from '@shared/models/query/query.models'; +import { TranslateService } from '@ngx-translate/core'; export class AliasController implements IAliasController { @@ -50,6 +51,7 @@ export class AliasController implements IAliasController { constructor(private utils: UtilsService, private entityService: EntityService, + private translate: TranslateService, private stateControllerHolder: StateControllerHolder, private origEntityAliases: EntityAliases, private origFilters: Filters) { @@ -241,7 +243,7 @@ export class AliasController implements IAliasController { private resolveDatasource(datasource: Datasource, forceFilter = false): Observable { const newDatasource = deepClone(datasource); - if (newDatasource.type === DatasourceType.entity) { + if (newDatasource.type === DatasourceType.entity || newDatasource.type === DatasourceType.entityCount) { if (newDatasource.filterId) { newDatasource.keyFilters = this.getKeyFilters(newDatasource.filterId); } @@ -329,16 +331,23 @@ export class AliasController implements IAliasController { return forkJoin(observables).pipe( map((result) => { let functionIndex = 0; + let entityCountIndex = 0; result.forEach((datasource) => { - if (datasource.type === DatasourceType.function) { + if (datasource.type === DatasourceType.function || datasource.type === DatasourceType.entityCount) { let name: string; if (datasource.name && datasource.name.length) { name = datasource.name; } else { - functionIndex++; - name = DatasourceType.function; - if (functionIndex > 1) { + if (datasource.type === DatasourceType.function) { + functionIndex++; + } else { + entityCountIndex++; + } + name = this.translate.instant(datasourceTypeTranslationMap.get(datasource.type)); + if (datasource.type === DatasourceType.function && functionIndex > 1) { name += ' ' + functionIndex; + } else if (datasource.type === DatasourceType.entityCount && entityCountIndex > 1) { + name += ' ' + entityCountIndex; } } datasource.name = name; diff --git a/ui-ngx/src/app/core/api/data-aggregator.ts b/ui-ngx/src/app/core/api/data-aggregator.ts index b78c0ad029..4437538719 100644 --- a/ui-ngx/src/app/core/api/data-aggregator.ts +++ b/ui-ngx/src/app/core/api/data-aggregator.ts @@ -71,6 +71,7 @@ export class DataAggregator { private dataReceived = false; private resetPending = false; + private updatedData = false; private noAggregation = this.aggregationType === AggregationType.NONE; private aggregationTimeout = Math.max(this.interval, 1000); @@ -90,7 +91,8 @@ export class DataAggregator { private timeWindow: number, private interval: number, private stateData: boolean, - private utils: UtilsService) { + private utils: UtilsService, + private ignoreDataUpdateOnIntervalTick: boolean) { this.tsKeyNames.forEach((key) => { this.dataBuffer[key] = []; }); @@ -140,6 +142,7 @@ export class DataAggregator { this.elapsed = 0; this.aggregationTimeout = Math.max(this.interval, 1000); this.resetPending = true; + this.updatedData = false; this.intervalTimeoutHandle = setTimeout(this.onInterval.bind(this), this.aggregationTimeout); } @@ -180,6 +183,7 @@ export class DataAggregator { this.onInterval(history, detectChanges); } } + this.updatedData = true; } private onInterval(history?: boolean, detectChanges?: boolean) { @@ -201,8 +205,9 @@ export class DataAggregator { } else { this.data = this.updateData(); } - if (this.onDataCb) { + if (this.onDataCb && (!this.ignoreDataUpdateOnIntervalTick || this.updatedData)) { this.onDataCb(this.data, detectChanges); + this.updatedData = false; } if (!history) { this.intervalTimeoutHandle = setTimeout(this.onInterval.bind(this), this.aggregationTimeout); @@ -223,6 +228,7 @@ export class DataAggregator { this.lastPrevKvPairData[key] = [aggTimestamp, aggData.aggValue]; } aggKeyData.delete(aggTimestamp); + this.updatedData = true; } else if (aggTimestamp <= this.endTs) { const kvPair: [number, any] = [aggTimestamp, aggData.aggValue]; keyData.push(kvPair); diff --git a/ui-ngx/src/app/core/api/entity-data-subscription.ts b/ui-ngx/src/app/core/api/entity-data-subscription.ts index 6a8e21a389..dbc9bd2adb 100644 --- a/ui-ngx/src/app/core/api/entity-data-subscription.ts +++ b/ui-ngx/src/app/core/api/entity-data-subscription.ts @@ -22,12 +22,14 @@ import { EntityFilter, EntityKey, EntityKeyType, - entityKeyTypeToDataKeyType, entityPageDataChanged, + entityKeyTypeToDataKeyType, + entityPageDataChanged, KeyFilter, TsValue } from '@shared/models/query/query.models'; import { DataKeyType, + EntityCountCmd, EntityDataCmd, SubscriptionData, SubscriptionDataHolder, @@ -42,6 +44,7 @@ import { DataAggregator } from '@core/api/data-aggregator'; import { NULL_UUID } from '@shared/models/id/has-uuid'; import { EntityType } from '@shared/models/entity-type.models'; import { Observable, of, ReplaySubject, Subject } from 'rxjs'; +import { EntityId } from '@shared/models/id/entity-id'; import Timeout = NodeJS.Timeout; declare type DataKeyFunction = (time: number, prevValue: any) => any; @@ -66,6 +69,7 @@ export interface EntityDataSubscriptionOptions { type: widgetType; entityFilter?: EntityFilter; isPaginatedDataSubscription?: boolean; + ignoreDataUpdateOnIntervalTick?: boolean; pageLink?: EntityDataPageLink; keyFilters?: Array; additionalKeyFilters?: Array; @@ -82,6 +86,7 @@ export class EntityDataSubscription { private subscriber: TelemetrySubscriber; private dataCommand: EntityDataCmd; private subsCommand: EntityDataCmd; + private countCommand: EntityCountCmd; private attrFields: Array; private tsFields: Array; @@ -91,7 +96,7 @@ export class EntityDataSubscription { private pageData: PageData; private subsTw: SubscriptionTimewindow; private dataAggregators: Array; - private dataKeys: {[key: string]: Array | SubscriptionDataKey} = {} + private dataKeys: {[key: string]: Array | SubscriptionDataKey} = {}; private datasourceData: {[index: number]: {[key: string]: DataSetHolder}}; private datasourceOrigData: {[index: number]: {[key: string]: DataSetHolder}}; private entityIdToDataIndex: {[id: string]: number}; @@ -125,7 +130,8 @@ export class EntityDataSubscription { } } let key: string; - if (this.datasourceType === DatasourceType.entity || this.entityDataSubscriptionOptions.type === widgetType.timeseries) { + if (this.datasourceType === DatasourceType.entity || this.datasourceType === DatasourceType.entityCount || + this.entityDataSubscriptionOptions.type === widgetType.timeseries) { if (this.datasourceType === DatasourceType.function) { key = `${dataKey.name}_${dataKey.index}_${dataKey.type}`; } else { @@ -150,7 +156,7 @@ export class EntityDataSubscription { clearTimeout(this.timer); this.timer = null; } - if (this.datasourceType === DatasourceType.entity) { + if (this.datasourceType === DatasourceType.entity || this.datasourceType === DatasourceType.entityCount) { if (this.subscriber) { this.subscriber.unsubscribe(); this.subscriber = null; @@ -159,7 +165,7 @@ export class EntityDataSubscription { if (this.dataAggregators) { this.dataAggregators.forEach((aggregator) => { aggregator.destroy(); - }) + }); this.dataAggregators = null; } this.pageData = null; @@ -291,6 +297,79 @@ export class EntityDataSubscription { totalPages: 1 }; this.onPageData(pageData); + } else if (this.datasourceType === DatasourceType.entityCount) { + this.subscriber = new TelemetrySubscriber(this.telemetryService); + this.countCommand = new EntityCountCmd(); + let keyFilters = this.entityDataSubscriptionOptions.keyFilters; + if (this.entityDataSubscriptionOptions.additionalKeyFilters) { + if (keyFilters) { + keyFilters = keyFilters.concat(this.entityDataSubscriptionOptions.additionalKeyFilters); + } else { + keyFilters = this.entityDataSubscriptionOptions.additionalKeyFilters; + } + } + this.countCommand.query = { + entityFilter: this.entityDataSubscriptionOptions.entityFilter, + keyFilters + }; + this.subscriber.subscriptionCommands.push(this.countCommand); + + const entityId: EntityId = { + id: NULL_UUID, + entityType: null + }; + + const countKey = this.entityDataSubscriptionOptions.dataKeys[0]; + + let dataReceived = false; + + this.subscriber.entityCount$.subscribe( + (entityCountUpdate) => { + if (!dataReceived) { + const entityData: EntityData = { + entityId, + latest: { + [EntityKeyType.ENTITY_FIELD]: { + name: { + ts: Date.now(), + value: DatasourceType.entityCount + } + }, + [EntityKeyType.COUNT]: { + [countKey.name]: { + ts: Date.now(), + value: entityCountUpdate.count + '' + } + } + }, + timeseries: {} + }; + const pageData: PageData = { + data: [entityData], + hasNext: false, + totalElements: 1, + totalPages: 1 + }; + this.onPageData(pageData); + dataReceived = true; + } else { + const update: EntityData[] = [{ + entityId, + latest: { + [EntityKeyType.COUNT]: { + [countKey.name]: { + ts: Date.now(), + value: entityCountUpdate.count + '' + } + } + }, + timeseries: {} + }]; + this.onDataUpdate(update); + } + } + ); + this.subscriber.subscribe(); } if (this.entityDataSubscriptionOptions.isPaginatedDataSubscription) { return of(null); @@ -347,7 +426,7 @@ export class EntityDataSubscription { limit: this.subsTw.aggregation.limit, agg: this.subsTw.aggregation.type, fetchLatestPreviousPoint: this.subsTw.aggregation.stateData - } + }; } } } else if (this.entityDataSubscriptionOptions.type === widgetType.latest) { @@ -381,7 +460,7 @@ export class EntityDataSubscription { if (this.dataAggregators) { this.dataAggregators.forEach((aggregator) => { aggregator.destroy(); - }) + }); } this.dataAggregators = []; this.resetData(); @@ -419,7 +498,8 @@ export class EntityDataSubscription { this.datasourceData[dataIndex] = {}; for (const key of Object.keys(this.dataKeys)) { const dataKey = this.dataKeys[key]; - if (this.datasourceType === DatasourceType.entity || this.entityDataSubscriptionOptions.type === widgetType.timeseries) { + if (this.datasourceType === DatasourceType.entity || this.datasourceType === DatasourceType.entityCount || + this.entityDataSubscriptionOptions.type === widgetType.timeseries) { const dataKeysList = dataKey as Array; for (let index = 0; index < dataKeysList.length; index++) { this.datasourceData[dataIndex][key + '_' + index] = { @@ -671,7 +751,8 @@ export class EntityDataSubscription { subsTw.aggregation.timeWindow, subsTw.aggregation.interval, subsTw.aggregation.stateData, - this.utils + this.utils, + this.entityDataSubscriptionOptions.ignoreDataUpdateOnIntervalTick ); } diff --git a/ui-ngx/src/app/core/api/entity-data.service.ts b/ui-ngx/src/app/core/api/entity-data.service.ts index c02f36a290..6466ba918f 100644 --- a/ui-ngx/src/app/core/api/entity-data.service.ts +++ b/ui-ngx/src/app/core/api/entity-data.service.ts @@ -60,7 +60,8 @@ export class EntityDataService { constructor(private telemetryService: TelemetryWebsocketService, private utils: UtilsService) {} - public prepareSubscription(listener: EntityDataListener): Observable { + public prepareSubscription(listener: EntityDataListener, + ignoreDataUpdateOnIntervalTick = false): Observable { const datasource = listener.configDatasource; listener.subscriptionOptions = this.createSubscriptionOptions( datasource, @@ -68,7 +69,8 @@ export class EntityDataService { datasource.pageLink, datasource.keyFilters, null, - false); + false, + ignoreDataUpdateOnIntervalTick); if (datasource.type === DatasourceType.entity && (!datasource.entityFilter || !datasource.pageLink)) { return of(null); } @@ -87,7 +89,8 @@ export class EntityDataService { public subscribeForPaginatedData(listener: EntityDataListener, pageLink: EntityDataPageLink, - keyFilters: KeyFilter[]): Observable { + keyFilters: KeyFilter[], + ignoreDataUpdateOnIntervalTick = false): Observable { const datasource = listener.configDatasource; listener.subscriptionOptions = this.createSubscriptionOptions( datasource, @@ -95,7 +98,8 @@ export class EntityDataService { pageLink, datasource.keyFilters, keyFilters, - true); + true, + ignoreDataUpdateOnIntervalTick); if (datasource.type === DatasourceType.entity && (!datasource.entityFilter || !pageLink)) { listener.dataLoaded(emptyPageData(), [], listener.configDatasourceIndex, listener.subscriptionOptions.pageLink); @@ -119,7 +123,8 @@ export class EntityDataService { pageLink: EntityDataPageLink, keyFilters: KeyFilter[], additionalKeyFilters: KeyFilter[], - isPaginatedDataSubscription: boolean): EntityDataSubscriptionOptions { + isPaginatedDataSubscription: boolean, + ignoreDataUpdateOnIntervalTick: boolean): EntityDataSubscriptionOptions { const subscriptionDataKeys: Array = []; datasource.dataKeys.forEach((dataKey) => { const subscriptionDataKey: SubscriptionDataKey = { @@ -135,13 +140,17 @@ export class EntityDataService { dataKeys: subscriptionDataKeys, type: subscriptionType }; - if (entityDataSubscriptionOptions.datasourceType === DatasourceType.entity) { + if (entityDataSubscriptionOptions.datasourceType === DatasourceType.entity || + entityDataSubscriptionOptions.datasourceType === DatasourceType.entityCount) { entityDataSubscriptionOptions.entityFilter = datasource.entityFilter; - entityDataSubscriptionOptions.pageLink = pageLink; entityDataSubscriptionOptions.keyFilters = keyFilters; entityDataSubscriptionOptions.additionalKeyFilters = additionalKeyFilters; + if (entityDataSubscriptionOptions.datasourceType === DatasourceType.entity) { + entityDataSubscriptionOptions.pageLink = pageLink; + } } entityDataSubscriptionOptions.isPaginatedDataSubscription = isPaginatedDataSubscription; + entityDataSubscriptionOptions.ignoreDataUpdateOnIntervalTick = ignoreDataUpdateOnIntervalTick; return entityDataSubscriptionOptions; } } diff --git a/ui-ngx/src/app/core/api/widget-api.models.ts b/ui-ngx/src/app/core/api/widget-api.models.ts index 1579ae8d1e..eff95a6f2d 100644 --- a/ui-ngx/src/app/core/api/widget-api.models.ts +++ b/ui-ngx/src/app/core/api/widget-api.models.ts @@ -226,6 +226,7 @@ export interface WidgetSubscriptionOptions { hasDataPageLink?: boolean; singleEntity?: boolean; warnOnPageDataOverflow?: boolean; + ignoreDataUpdateOnIntervalTick?: boolean; targetDeviceAliasIds?: Array; targetDeviceIds?: Array; useDashboardTimewindow?: boolean; diff --git a/ui-ngx/src/app/core/api/widget-subscription.ts b/ui-ngx/src/app/core/api/widget-subscription.ts index 3e3537941b..ce36f57e10 100644 --- a/ui-ngx/src/app/core/api/widget-subscription.ts +++ b/ui-ngx/src/app/core/api/widget-subscription.ts @@ -83,6 +83,7 @@ export class WidgetSubscription implements IWidgetSubscription { hasDataPageLink: boolean; singleEntity: boolean; warnOnPageDataOverflow: boolean; + ignoreDataUpdateOnIntervalTick: boolean; datasourcePages: PageData[]; dataPages: PageData>[]; @@ -200,6 +201,7 @@ export class WidgetSubscription implements IWidgetSubscription { this.hasDataPageLink = options.hasDataPageLink; this.singleEntity = options.singleEntity; this.warnOnPageDataOverflow = options.warnOnPageDataOverflow; + this.ignoreDataUpdateOnIntervalTick = options.ignoreDataUpdateOnIntervalTick; this.datasourcePages = []; this.datasources = []; this.dataPages = []; @@ -423,7 +425,7 @@ export class WidgetSubscription implements IWidgetSubscription { } }; this.entityDataListeners.push(listener); - return this.ctx.entityDataService.prepareSubscription(listener); + return this.ctx.entityDataService.prepareSubscription(listener, this.ignoreDataUpdateOnIntervalTick); }); return forkJoin(resolveResultObservables).pipe( map((resolveResults) => { @@ -465,7 +467,15 @@ export class WidgetSubscription implements IWidgetSubscription { entityName = this.targetDeviceName; } } else if (this.type === widgetType.alarm) { - if (this.alarms && this.alarms.data.length) { + if (this.alarmSource && this.alarmSource.entityType && this.alarmSource.entityId) { + entityId = { + entityType: this.alarmSource.entityType, + id: this.alarmSource.entityId + }; + entityName = this.alarmSource.entityName; + entityLabel = this.alarmSource.entityLabel; + entityDescription = this.alarmSource.entityDescription; + } else if (this.alarms && this.alarms.data.length) { const data = this.alarms.data[0]; entityId = data.originator; entityName = data.originatorName; @@ -815,7 +825,8 @@ export class WidgetSubscription implements IWidgetSubscription { } }; this.entityDataListeners[datasourceIndex] = entityDataListener; - return this.ctx.entityDataService.subscribeForPaginatedData(entityDataListener, pageLink, keyFilters); + return this.ctx.entityDataService.subscribeForPaginatedData(entityDataListener, pageLink, keyFilters, + this.ignoreDataUpdateOnIntervalTick); } else { return of(null); } diff --git a/ui-ngx/src/app/core/auth/auth.service.ts b/ui-ngx/src/app/core/auth/auth.service.ts index b58100934d..37802a08ed 100644 --- a/ui-ngx/src/app/core/auth/auth.service.ts +++ b/ui-ngx/src/app/core/auth/auth.service.ts @@ -149,8 +149,11 @@ export class AuthService { } public changePassword(currentPassword: string, newPassword: string) { - return this.http.post('/api/auth/changePassword', - {currentPassword, newPassword}, defaultHttpOptions()); + return this.http.post('/api/auth/changePassword', {currentPassword, newPassword}, defaultHttpOptions()).pipe( + tap((loginResponse: LoginResponse) => { + this.setUserFromJwtToken(loginResponse.token, loginResponse.refreshToken, false); + } + )); } public activateByEmailCode(emailCode: string): Observable { diff --git a/ui-ngx/src/app/core/http/entity.service.ts b/ui-ngx/src/app/core/http/entity.service.ts index e0afb0a2e4..90275f1016 100644 --- a/ui-ngx/src/app/core/http/entity.service.ts +++ b/ui-ngx/src/app/core/http/entity.service.ts @@ -442,6 +442,7 @@ export class EntityService { { key: nameField, valueType: EntityKeyValueType.STRING, + value: null, predicate: { type: FilterPredicateType.STRING, operation: StringOperation.STARTS_WITH, @@ -508,6 +509,8 @@ export class EntityService { return entityTypes.indexOf(filter.entityType) > -1 ? true : false; case AliasFilterType.entityName: return entityTypes.indexOf(filter.entityType) > -1 ? true : false; + case AliasFilterType.entityType: + return entityTypes.indexOf(filter.entityType) > -1 ? true : false; case AliasFilterType.stateEntity: return true; case AliasFilterType.assetType: @@ -571,6 +574,8 @@ export class EntityService { return true; case AliasFilterType.entityName: return true; + case AliasFilterType.entityType: + return true; case AliasFilterType.stateEntity: return true; case AliasFilterType.assetType: @@ -849,6 +854,9 @@ export class EntityService { case AliasFilterType.entityName: result.entityFilter = deepClone(filter); return of(result); + case AliasFilterType.entityType: + result.entityFilter = deepClone(filter); + return of(result); case AliasFilterType.stateEntity: result.stateEntity = true; if (stateEntityId) { @@ -1214,10 +1222,10 @@ export class EntityService { dataKeys: [] }; this.prepareEntityFilterFromSubscriptionInfo(datasource, subscriptionInfo); - } else if (subscriptionInfo.type === DatasourceType.function) { + } else if (subscriptionInfo.type === DatasourceType.function || subscriptionInfo.type === DatasourceType.entityCount) { datasource = { type: subscriptionInfo.type, - name: subscriptionInfo.name || DatasourceType.function, + name: subscriptionInfo.name || subscriptionInfo.type, dataKeys: [] }; } @@ -1234,6 +1242,10 @@ export class EntityService { if (subscriptionInfo.alarmFields) { this.createDatasourceKeys(subscriptionInfo.alarmFields, DataKeyType.alarm, datasource); } + if (subscriptionInfo.type === DatasourceType.entityCount) { + const dataKey = this.utils.createKey({ name: 'count'}, DataKeyType.count); + datasource.dataKeys.push(dataKey); + } } return datasource; } diff --git a/ui-ngx/src/app/core/services/item-buffer.service.ts b/ui-ngx/src/app/core/services/item-buffer.service.ts index 5626f26759..6b0b9df4d0 100644 --- a/ui-ngx/src/app/core/services/item-buffer.service.ts +++ b/ui-ngx/src/app/core/services/item-buffer.service.ts @@ -93,7 +93,7 @@ export class ItemBufferService { if (widget.config.datasources) { for (let i = 0; i < widget.config.datasources.length; i++) { const datasource = widget.config.datasources[i]; - if (datasource.type === DatasourceType.entity && datasource.entityAliasId) { + if ((datasource.type === DatasourceType.entity || datasource.type === DatasourceType.entityCount) && datasource.entityAliasId) { entityAlias = dashboard.configuration.entityAliases[datasource.entityAliasId]; if (entityAlias) { aliasesInfo.datasourceAliases[i] = this.prepareAliasInfo(entityAlias); @@ -119,7 +119,7 @@ export class ItemBufferService { if (widget.config.datasources) { for (let i = 0; i < widget.config.datasources.length; i++) { const datasource = widget.config.datasources[i]; - if (datasource.type === DatasourceType.entity && datasource.filterId) { + if ((datasource.type === DatasourceType.entity || datasource.type === DatasourceType.entityCount) && datasource.filterId) { filter = dashboard.configuration.filters[datasource.filterId]; if (filter) { filtersInfo.datasourceFilters[i] = this.prepareFilterInfo(filter); diff --git a/ui-ngx/src/app/core/services/utils.service.ts b/ui-ngx/src/app/core/services/utils.service.ts index 90b2989834..3c1c659e95 100644 --- a/ui-ngx/src/app/core/services/utils.service.ts +++ b/ui-ngx/src/app/core/services/utils.service.ts @@ -27,7 +27,8 @@ import { deleteNullProperties, guid, isDefined, - isDefinedAndNotNull, isString, + isDefinedAndNotNull, + isString, isUndefined } from '@core/utils'; import { WindowMessage } from '@shared/models/window-message.model'; diff --git a/ui-ngx/src/app/core/utils.ts b/ui-ngx/src/app/core/utils.ts index ac79c0f04e..c03b10d4d1 100644 --- a/ui-ngx/src/app/core/utils.ts +++ b/ui-ngx/src/app/core/utils.ts @@ -324,6 +324,9 @@ export function snakeCase(name: string, separator: string): string { } export function getDescendantProp(obj: any, path: string): any { + if (obj.hasOwnProperty(path)) { + return obj[path]; + } return path.split('.').reduce((acc, part) => acc && acc[part], obj); } diff --git a/ui-ngx/src/app/core/ws/telemetry-websocket.service.ts b/ui-ngx/src/app/core/ws/telemetry-websocket.service.ts index facdd0f60a..a3fc6eb767 100644 --- a/ui-ngx/src/app/core/ws/telemetry-websocket.service.ts +++ b/ui-ngx/src/app/core/ws/telemetry-websocket.service.ts @@ -16,18 +16,27 @@ import { Inject, Injectable, NgZone } from '@angular/core'; import { - AlarmDataCmd, AlarmDataUnsubscribeCmd, + AlarmDataCmd, + AlarmDataUnsubscribeCmd, AlarmDataUpdate, - AttributesSubscriptionCmd, EntityDataCmd, EntityDataUnsubscribeCmd, EntityDataUpdate, - GetHistoryCmd, isAlarmDataUpdateMsg, isEntityDataUpdateMsg, + AttributesSubscriptionCmd, + EntityCountCmd, EntityCountUnsubscribeCmd, + EntityCountUpdate, + EntityDataCmd, + EntityDataUnsubscribeCmd, + EntityDataUpdate, + GetHistoryCmd, + isAlarmDataUpdateMsg, + isEntityCountUpdateMsg, + isEntityDataUpdateMsg, SubscriptionCmd, SubscriptionUpdate, - SubscriptionUpdateMsg, TelemetryFeature, TelemetryPluginCmdsWrapper, TelemetryService, TelemetrySubscriber, - TimeseriesSubscriptionCmd, WebsocketDataMsg + TimeseriesSubscriptionCmd, + WebsocketDataMsg } from '@app/shared/models/telemetry/telemetry.models'; import { select, Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; @@ -111,6 +120,8 @@ export class TelemetryWebsocketService implements TelemetryService { this.cmdsWrapper.entityDataCmds.push(subscriptionCommand); } else if (subscriptionCommand instanceof AlarmDataCmd) { this.cmdsWrapper.alarmDataCmds.push(subscriptionCommand); + } else if (subscriptionCommand instanceof EntityCountCmd) { + this.cmdsWrapper.entityCountCmds.push(subscriptionCommand); } } ); @@ -150,6 +161,10 @@ export class TelemetryWebsocketService implements TelemetryService { const alarmDataUnsubscribeCmd = new AlarmDataUnsubscribeCmd(); alarmDataUnsubscribeCmd.cmdId = subscriptionCommand.cmdId; this.cmdsWrapper.alarmDataUnsubscribeCmds.push(alarmDataUnsubscribeCmd); + } else if (subscriptionCommand instanceof EntityCountCmd) { + const entityCountUnsubscribeCmd = new EntityCountUnsubscribeCmd(); + entityCountUnsubscribeCmd.cmdId = subscriptionCommand.cmdId; + this.cmdsWrapper.entityCountUnsubscribeCmds.push(entityCountUnsubscribeCmd); } const cmdId = subscriptionCommand.cmdId; if (cmdId) { @@ -236,7 +251,7 @@ export class TelemetryWebsocketService implements TelemetryService { { url: uri, openObserver: { - next: (e: Event) => { + next: () => { this.onOpen(); } }, @@ -294,6 +309,11 @@ export class TelemetryWebsocketService implements TelemetryService { if (subscriber) { subscriber.onAlarmData(new AlarmDataUpdate(message)); } + } else if (isEntityCountUpdateMsg(message)) { + subscriber = this.subscribersMap.get(message.cmdId); + if (subscriber) { + subscriber.onEntityCount(new EntityCountUpdate(message)); + } } else if (message.subscriptionId) { subscriber = this.subscribersMap.get(message.subscriptionId); if (subscriber) { diff --git a/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts b/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts index 6456e6d6ed..7e83c67ec6 100644 --- a/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts +++ b/ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.ts @@ -403,6 +403,7 @@ export class AttributeTableComponent extends PageComponent implements AfterViewI this.aliasController = new AliasController(this.utils, this.entityService, + this.translate, () => stateController, entitiAliases, filters); const dataKeyType: DataKeyType = this.attributeScope === LatestTelemetry.LATEST_TELEMETRY ? diff --git a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts index 46ca1e4d1f..44ee29ce84 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts +++ b/ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.ts @@ -315,6 +315,7 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC this.dashboardCtx.aliasController = new AliasController(this.utils, this.entityService, + this.translate, () => this.dashboardCtx.stateController, this.dashboardConfiguration.entityAliases, this.dashboardConfiguration.filters); diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts index 1efcc9211e..0eebbc353e 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity-details-panel.component.ts @@ -280,7 +280,11 @@ export class EntityDetailsPanelComponent extends PageComponent implements OnInit saveEntity() { if (this.detailsForm.valid) { - const editingEntity = mergeDeep(this.editingEntity, this.entityComponent.entityFormValue()); + const editingEntity = {...this.editingEntity, ...this.entityComponent.entityFormValue()}; + if (this.editingEntity.hasOwnProperty('additionalInfo')) { + editingEntity.additionalInfo = + mergeDeep((this.editingEntity as any).additionalInfo, this.entityComponent.entityFormValue()?.additionalInfo); + } this.entitiesTableConfig.saveEntity(editingEntity).subscribe( (entity) => { this.entity = entity; diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-filter-view.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-filter-view.component.ts index fac42881ef..65af0f8e81 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-filter-view.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity-filter-view.component.ts @@ -76,6 +76,10 @@ export class EntityFilterViewComponent implements ControlValueAccessor { this.filterDisplayValue = this.translate.instant(entityTypeTranslations.get(entityType).nameStartsWith, {prefix}); break; + case AliasFilterType.entityType: + entityType = this.filter.entityType; + this.filterDisplayValue = this.translate.instant(entityTypeTranslations.get(entityType).typePlural); + break; case AliasFilterType.stateEntity: this.filterDisplayValue = this.translate.instant('alias.filter-type-state-entity-description'); break; diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html b/ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html index 77d5f631c5..e45c700b08 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html +++ b/ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html @@ -59,6 +59,13 @@ + + + + alias.state-entity-parameter-name diff --git a/ui-ngx/src/app/modules/home/components/entity/entity-filter.component.ts b/ui-ngx/src/app/modules/home/components/entity/entity-filter.component.ts index d235d25596..666749130a 100644 --- a/ui-ngx/src/app/modules/home/components/entity/entity-filter.component.ts +++ b/ui-ngx/src/app/modules/home/components/entity/entity-filter.component.ts @@ -123,6 +123,11 @@ export class EntityFilterComponent implements ControlValueAccessor, OnInit { entityNameFilter: [filter ? filter.entityNameFilter : '', [Validators.required]], }); break; + case AliasFilterType.entityType: + this.filterFormGroup = this.fb.group({ + entityType: [filter ? filter.entityType : null, [Validators.required]] + }); + break; case AliasFilterType.stateEntity: this.filterFormGroup = this.fb.group({ stateEntityParamName: [filter ? filter.stateEntityParamName : null, []], diff --git a/ui-ngx/src/app/modules/home/components/filter/boolean-filter-predicate.component.html b/ui-ngx/src/app/modules/home/components/filter/boolean-filter-predicate.component.html index 253f7e2138..f7bae7d797 100644 --- a/ui-ngx/src/app/modules/home/components/filter/boolean-filter-predicate.component.html +++ b/ui-ngx/src/app/modules/home/components/filter/boolean-filter-predicate.component.html @@ -25,6 +25,7 @@ diff --git a/ui-ngx/src/app/modules/home/components/filter/boolean-filter-predicate.component.ts b/ui-ngx/src/app/modules/home/components/filter/boolean-filter-predicate.component.ts index fbd329dc16..c6c8a5ed51 100644 --- a/ui-ngx/src/app/modules/home/components/filter/boolean-filter-predicate.component.ts +++ b/ui-ngx/src/app/modules/home/components/filter/boolean-filter-predicate.component.ts @@ -41,6 +41,8 @@ export class BooleanFilterPredicateComponent implements ControlValueAccessor, On @Input() allowUserDynamicSource = true; + @Input() onlyUserDynamicSource = false; + valueTypeEnum = EntityKeyValueType; booleanFilterPredicateFormGroup: FormGroup; diff --git a/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate-dialog.component.html b/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate-dialog.component.html index bbf4887e5f..e2bee07a3f 100644 --- a/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate-dialog.component.html @@ -39,6 +39,7 @@ [valueType]="data.valueType" [displayUserParameters]="data.displayUserParameters" [allowUserDynamicSource]="data.allowUserDynamicSource" + [onlyUserDynamicSource]="data.onlyUserDynamicSource" [operation]="complexFilterFormGroup.get('operation').value" [key]="data.key" formControlName="predicates"> diff --git a/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate-dialog.component.ts b/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate-dialog.component.ts index 447546ba2f..3f1bb3cace 100644 --- a/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate-dialog.component.ts @@ -37,6 +37,7 @@ export interface ComplexFilterPredicateDialogData { valueType: EntityKeyValueType; displayUserParameters: boolean; allowUserDynamicSource: boolean; + onlyUserDynamicSource: boolean; } @Component({ diff --git a/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate.component.ts b/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate.component.ts index 0843583a52..9f4acfc3c6 100644 --- a/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate.component.ts +++ b/ui-ngx/src/app/modules/home/components/filter/complex-filter-predicate.component.ts @@ -52,6 +52,8 @@ export class ComplexFilterPredicateComponent implements ControlValueAccessor, On @Input() allowUserDynamicSource = true; + @Input() onlyUserDynamicSource = false; + private propagateChange = null; private complexFilterPredicate: ComplexFilterPredicateInfo; @@ -89,7 +91,8 @@ export class ComplexFilterPredicateComponent implements ControlValueAccessor, On isAdd: false, key: this.key, displayUserParameters: this.displayUserParameters, - allowUserDynamicSource: this.allowUserDynamicSource + allowUserDynamicSource: this.allowUserDynamicSource, + onlyUserDynamicSource: this.onlyUserDynamicSource } }).afterClosed().subscribe( (result) => { diff --git a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-list.component.html b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-list.component.html index c6aee52976..e5bb27f20c 100644 --- a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-list.component.html +++ b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-list.component.html @@ -53,6 +53,7 @@ [valueType]="valueType" [displayUserParameters]="displayUserParameters" [allowUserDynamicSource]="allowUserDynamicSource" + [onlyUserDynamicSource]="onlyUserDynamicSource" [key]="key" [formControl]="predicateControl"> diff --git a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-list.component.ts b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-list.component.ts index e89489e6bb..3c16b01319 100644 --- a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-list.component.ts +++ b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-list.component.ts @@ -66,6 +66,8 @@ export class FilterPredicateListComponent implements ControlValueAccessor, OnIni @Input() allowUserDynamicSource = true; + @Input() onlyUserDynamicSource = false; + filterListFormGroup: FormGroup; valueTypeEnum = EntityKeyValueType; @@ -159,7 +161,8 @@ export class FilterPredicateListComponent implements ControlValueAccessor, OnIni key: this.key, isAdd: true, displayUserParameters: this.displayUserParameters, - allowUserDynamicSource: this.allowUserDynamicSource + allowUserDynamicSource: this.allowUserDynamicSource, + onlyUserDynamicSource: this.onlyUserDynamicSource } }).afterClosed().pipe( map((result) => { diff --git a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.html b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.html index dd1b92cf7f..4bc249837a 100644 --- a/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.html +++ b/ui-ngx/src/app/modules/home/components/filter/filter-predicate-value.component.html @@ -16,7 +16,7 @@ -->
-
+
@@ -45,7 +45,7 @@
filter.default-value
-
+
@@ -78,7 +78,7 @@
-
diff --git a/ui-ngx/src/app/modules/home/components/filter/string-filter-predicate.component.ts b/ui-ngx/src/app/modules/home/components/filter/string-filter-predicate.component.ts index b52f36a572..11b4dad275 100644 --- a/ui-ngx/src/app/modules/home/components/filter/string-filter-predicate.component.ts +++ b/ui-ngx/src/app/modules/home/components/filter/string-filter-predicate.component.ts @@ -42,6 +42,8 @@ export class StringFilterPredicateComponent implements ControlValueAccessor, OnI @Input() allowUserDynamicSource = true; + @Input() onlyUserDynamicSource = false; + valueTypeEnum = EntityKeyValueType; stringFilterPredicateFormGroup: FormGroup; diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html index 672098d88a..36dea4c42b 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/lwm2m-device-profile-transport-configuration.component.html @@ -29,17 +29,6 @@ {count: +lwm2mDeviceProfileFormGroup.get('clientOnlyObserveAfterConnect').value} }}
-
- - {{ 'device-profile.lwm2m.client-update-value-after-connect' | translate: - {count: +lwm2mDeviceProfileFormGroup.get('clientUpdateValueAfterConnect').value} }} - -
{ - } + private propagateChange = (v: any) => { } constructor(private store: Store, private fb: FormBuilder, @@ -73,7 +78,6 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro @Inject(WINDOW) private window: Window) { this.lwm2mDeviceProfileFormGroup = this.fb.group({ clientOnlyObserveAfterConnect: [true, []], - clientUpdateValueAfterConnect: [false, []], objectIds: [null, Validators.required], observeAttrTelemetry: [null, Validators.required], shortId: [null, Validators.required], @@ -144,7 +148,6 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro private updateWriteValue = (value: ModelValue): void => { this.lwm2mDeviceProfileFormGroup.patchValue({ clientOnlyObserveAfterConnect: this.configurationValue.clientLwM2mSettings.clientOnlyObserveAfterConnect, - clientUpdateValueAfterConnect: this.configurationValue.clientLwM2mSettings.clientUpdateValueAfterConnect, objectIds: value, observeAttrTelemetry: this.getObserveAttrTelemetryObjects(value['objectsList']), shortId: this.configurationValue.bootstrap.servers.shortId, @@ -178,8 +181,6 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro if (this.lwm2mDeviceProfileFormGroup.valid) { this.configurationValue.clientLwM2mSettings.clientOnlyObserveAfterConnect = config.clientOnlyObserveAfterConnect; - this.configurationValue.clientLwM2mSettings.clientUpdateValueAfterConnect = - config.clientUpdateValueAfterConnect; this.updateObserveAttrTelemetryFromGroupToJson(config.observeAttrTelemetry.clientLwM2M); this.configurationValue.bootstrap.bootstrapServer = config.bootstrapServer; this.configurationValue.bootstrap.lwm2mServer = config.lwm2mServer; @@ -200,7 +201,7 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro const observeArray = this.configurationValue.observeAttr.observe; const attributeArray = this.configurationValue.observeAttr.attribute; const telemetryArray = this.configurationValue.observeAttr.telemetry; - const keyNameJson = this.configurationValue.observeAttr.keyName; + let keyNameJson = this.configurationValue.observeAttr.keyName; if (this.includesNotZeroInstance(attributeArray, telemetryArray)) { this.addInstances(attributeArray, telemetryArray, clientObserveAttrTelemetry); } @@ -214,7 +215,9 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro this.updateObserveAttrTelemetryObjects(telemetryArray, clientObserveAttrTelemetry, TELEMETRY); } if (isDefinedAndNotNull(keyNameJson)) { - this.updateKeyNameObjects(keyNameJson, clientObserveAttrTelemetry); + this.configurationValue.observeAttr.keyName = this.validateKeyNameObjects(keyNameJson, attributeArray, telemetryArray); + this.upDateJsonAllConfig(); + this.updateKeyNameObjects(clientObserveAttrTelemetry); } } return {clientLwM2M: clientObserveAttrTelemetry}; @@ -253,15 +256,26 @@ export class Lwm2mDeviceProfileTransportConfigurationComponent implements Contro }); } - private updateKeyNameObjects = (nameJson: JsonObject, clientObserveAttrTelemetry: ObjectLwM2M[]): void => { - const keyName = JSON.parse(JSON.stringify(nameJson)); - Object.keys(keyName).forEach(key => { + private updateKeyNameObjects = (clientObserveAttrTelemetry: ObjectLwM2M[]): void => { + Object.keys(this.configurationValue.observeAttr.keyName).forEach(key => { const [objectId, instanceId, resourceId] = Array.from(key.substring(1).split('/'), Number); clientObserveAttrTelemetry.find(objectLwm2m => objectLwm2m.id === objectId) .instances.find(instance => instance.id === instanceId) .resources.find(resource => resource.id === resourceId) - .keyName = keyName[key]; + .keyName = this.configurationValue.observeAttr.keyName[key]; + }); + } + + private validateKeyNameObjects = (nameJson: JsonObject, attributeArray: JsonArray, telemetryArray: JsonArray): {} => { + const keyName = JSON.parse(JSON.stringify(nameJson)); + let keyNameValidate = {}; + const keyAttrTelemetry = attributeArray.concat(telemetryArray) ; + Object.keys(keyName).forEach(key => { + if (keyAttrTelemetry.includes(key)) { + keyNameValidate[key] = keyName[key]; + } }); + return keyNameValidate; } private updateObserveAttrTelemetryFromGroupToJson = (val: ObjectLwM2M[]): void => { diff --git a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/profile-config.models.ts b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/profile-config.models.ts index 7142648061..b4c0e9a539 100644 --- a/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/profile-config.models.ts +++ b/ui-ngx/src/app/modules/home/components/profile/device/lwm2m/profile-config.models.ts @@ -98,7 +98,6 @@ export interface ProfileConfigModels { export interface ClientLwM2mSettings { clientOnlyObserveAfterConnect: boolean; - clientUpdateValueAfterConnect: boolean; } export interface ObservableAttributes { observe: string[]; @@ -157,8 +156,7 @@ function getDefaultProfileObserveAttrConfig(): ObservableAttributes { function getDefaultProfileClientLwM2mSettingsConfig(): ClientLwM2mSettings { return { - clientOnlyObserveAfterConnect: true, - clientUpdateValueAfterConnect: false + clientOnlyObserveAfterConnect: true }; } diff --git a/ui-ngx/src/app/modules/home/components/relation/relation-filters.component.ts b/ui-ngx/src/app/modules/home/components/relation/relation-filters.component.ts index c9bbf02173..43dbfc45f6 100644 --- a/ui-ngx/src/app/modules/home/components/relation/relation-filters.component.ts +++ b/ui-ngx/src/app/modules/home/components/relation/relation-filters.component.ts @@ -24,7 +24,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { AliasEntityType, EntityType } from '@shared/models/entity-type.models'; -import { EntityTypeFilter } from '@shared/models/relation.models'; +import { RelationEntityTypeFilter } from '@shared/models/relation.models'; import { PageComponent } from '@shared/components/page.component'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; @@ -80,7 +80,7 @@ export class RelationFiltersComponent extends PageComponent implements ControlVa this.disabled = isDisabled; } - writeValue(filters: Array): void { + writeValue(filters: Array): void { if (this.valueChangeSubscription) { this.valueChangeSubscription.unsubscribe(); } @@ -102,14 +102,14 @@ export class RelationFiltersComponent extends PageComponent implements ControlVa public addFilter() { const relationFiltersFormArray = this.relationFiltersFormGroup.get('relationFilters') as FormArray; - const filter: EntityTypeFilter = { + const filter: RelationEntityTypeFilter = { relationType: null, entityTypes: [] }; relationFiltersFormArray.push(this.createRelationFilterFormGroup(filter)); } - private createRelationFilterFormGroup(filter: EntityTypeFilter): AbstractControl { + private createRelationFilterFormGroup(filter: RelationEntityTypeFilter): AbstractControl { return this.fb.group({ relationType: [filter ? filter.relationType : null], entityTypes: [filter ? filter.entityTypes : []] @@ -117,7 +117,7 @@ export class RelationFiltersComponent extends PageComponent implements ControlVa } private updateModel() { - const filters: Array = this.relationFiltersFormGroup.get('relationFilters').value; + const filters: Array = this.relationFiltersFormGroup.get('relationFilters').value; this.propagateChange(filters); } } diff --git a/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.html b/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.html index b6308223ac..3af73e8932 100644 --- a/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.html +++ b/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.html @@ -18,14 +18,14 @@
admin.number-from - + {{ 'admin.number-from-required' | translate }} - {{ 'admin.phone-number-pattern' | translate }} + {{ 'admin.phone-number-pattern-twilio' | translate }} - + admin.twilio-account-sid @@ -36,7 +36,7 @@ admin.twilio-account-token - + {{ 'admin.twilio-account-token-required' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.ts b/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.ts index 759b9448ee..f4c31cd442 100644 --- a/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.ts +++ b/ui-ngx/src/app/modules/home/components/sms/twilio-sms-provider-configuration.component.ts @@ -21,8 +21,9 @@ import { AppState } from '@app/core/core.state'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { isDefinedAndNotNull } from '@core/utils'; import { - phoneNumberPattern, - SmsProviderConfiguration, SmsProviderType, + phoneNumberPatternTwilio, + SmsProviderConfiguration, + SmsProviderType, TwilioSmsProviderConfiguration } from '@shared/models/settings.models'; @@ -40,7 +41,7 @@ export class TwilioSmsProviderConfigurationComponent implements ControlValueAcce twilioSmsProviderConfigurationFormGroup: FormGroup; - phoneNumberPattern = phoneNumberPattern; + phoneNumberPatternTwilio = phoneNumberPatternTwilio; private requiredValue: boolean; @@ -71,9 +72,9 @@ export class TwilioSmsProviderConfigurationComponent implements ControlValueAcce ngOnInit() { this.twilioSmsProviderConfigurationFormGroup = this.fb.group({ - numberFrom: [null, [Validators.required, Validators.pattern(phoneNumberPattern)]], - accountSid: [null, [Validators.required]], - accountToken: [null, [Validators.required]] + numberFrom: [null, [Validators.required, Validators.pattern(phoneNumberPatternTwilio)]], + accountSid: [null, Validators.required], + accountToken: [null, Validators.required] }); this.twilioSmsProviderConfigurationFormGroup.valueChanges.subscribe(() => { this.updateModel(); diff --git a/ui-ngx/src/app/modules/home/components/widget/data-key-config.component.html b/ui-ngx/src/app/modules/home/components/widget/data-key-config.component.html index 45cc3a8087..fbc62010da 100644 --- a/ui-ngx/src/app/modules/home/components/widget/data-key-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/data-key-config.component.html @@ -25,7 +25,7 @@ formControlName="name" required [matAutocomplete]="keyAutocomplete"> - - close + close
- + @@ -128,7 +128,7 @@ {{ translate.get('entity.no-key-matching', {key: truncate.transform(searchText, true, 6, '...')}) | async }} - + entity.create-new-key diff --git a/ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts b/ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts index c3f138cb80..96bd8c702f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/data-keys.component.ts @@ -16,26 +16,26 @@ import { COMMA, ENTER, SEMICOLON } from '@angular/cdk/keycodes'; import { - AfterViewInit, - Component, - ElementRef, - forwardRef, - Input, - OnChanges, - OnInit, - SimpleChanges, - SkipSelf, - ViewChild + AfterViewInit, + Component, + ElementRef, + forwardRef, + Input, + OnChanges, + OnInit, + SimpleChanges, + SkipSelf, + ViewChild } from '@angular/core'; import { - ControlValueAccessor, - FormBuilder, - FormControl, - FormGroup, - FormGroupDirective, - NG_VALUE_ACCESSOR, - NgForm, - Validators + ControlValueAccessor, + FormBuilder, + FormControl, + FormGroup, + FormGroupDirective, + NG_VALUE_ACCESSOR, + NgForm, + Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { filter, map, mergeMap, publishReplay, refCount, share, tap } from 'rxjs/operators'; @@ -56,8 +56,8 @@ import { TruncatePipe } from '@shared/pipe/truncate.pipe'; import { DialogService } from '@core/services/dialog.service'; import { MatDialog } from '@angular/material/dialog'; import { - DataKeyConfigDialogComponent, - DataKeyConfigDialogData + DataKeyConfigDialogComponent, + DataKeyConfigDialogData } from '@home/components/widget/data-key-config-dialog.component'; import { deepClone } from '@core/utils'; import { MatChipDropEvent } from '@app/shared/components/mat-chip-draggable.directive'; @@ -94,8 +94,15 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, AfterVie @Input() datasourceType: DatasourceType; + private maxDataKeysValue: number; + get maxDataKeys(): number { + return this.datasourceType === DatasourceType.entityCount ? 1 : this.maxDataKeysValue; + } + @Input() - maxDataKeys: number; + set maxDataKeys(value: number) { + this.maxDataKeysValue = value; + } @Input() optDataKeys: boolean; @@ -114,7 +121,7 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, AfterVie private requiredValue: boolean; get required(): boolean { - return this.requiredValue || !this.optDataKeys; + return this.requiredValue || !this.optDataKeys || this.datasourceType === DatasourceType.entityCount; } @Input() set required(value: boolean) { @@ -210,8 +217,10 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, AfterVie if (this.maxDataKeys !== null && this.maxDataKeys > -1) { if (this.datasourceType === DatasourceType.function) { return this.translate.instant('datakey.maximum-function-types', {count: this.maxDataKeys}); - } else { + } else if (this.datasourceType !== DatasourceType.entityCount) { return this.translate.instant('datakey.maximum-timeseries-or-attributes', {count: this.maxDataKeys}); + } else { + return ''; } } else { return ''; @@ -241,6 +250,8 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, AfterVie private reset() { if (this.widgetType === widgetType.alarm) { this.keys = this.utils.getDefaultAlarmDataKeys(); + } else if (this.datasourceType === DatasourceType.entityCount) { + this.keys = [this.callbacks.generateDataKey('count', DataKeyType.count)]; } else { this.keys = []; } @@ -426,7 +437,7 @@ export class DataKeysComponent implements ControlValueAccessor, OnInit, AfterVie const targetKeysList = this.widgetType === widgetType.alarm ? this.alarmKeys : this.functionTypeKeys; fetchObservable = of(targetKeysList); } else { - if (this.entityAliasId) { + if (this.datasourceType !== DatasourceType.entityCount && this.entityAliasId) { const dataKeyTypes = [DataKeyType.timeseries]; if (this.widgetType === widgetType.latest || this.widgetType === widgetType.alarm) { dataKeyTypes.push(DataKeyType.attribute); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts index d58ace0a6b..36d96ee875 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/alarms-table-widget.component.ts @@ -35,7 +35,7 @@ import { DataKey, WidgetActionDescriptor, WidgetConfig } from '@shared/models/wi import { IWidgetSubscription } from '@core/api/widget-api.models'; import { UtilsService } from '@core/services/utils.service'; import { TranslateService } from '@ngx-translate/core'; -import { createLabelFromDatasource, deepClone, hashCode, isDefined, isNumber } from '@core/utils'; +import { createLabelFromDatasource, deepClone, hashCode, isDefined, isNumber, isObject } from '@core/utils'; import cssjs from '@core/css/css'; import { sortItems } from '@shared/models/page/page-link'; import { Direction } from '@shared/models/page/sort-order'; @@ -598,8 +598,16 @@ export class AlarmsTableWidgetComponent extends PageComponent implements OnInit, if (styleInfo.useCellStyleFunction && styleInfo.cellStyleFunction) { try { style = styleInfo.cellStyleFunction(value); + if (!isObject(style)) { + throw new TypeError(`${style === null ? 'null' : typeof style} instead of style object`); + } + if (Array.isArray(style)) { + throw new TypeError(`Array instead of style object`); + } } catch (e) { style = {}; + console.warn(`Cell style function for data key '${key.label}' in widget '${this.ctx.widgetTitle}' ` + + `returns '${e}'. Please check your cell style function.`); } } else { style = this.defaultStyle(key, value); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.component.ts index e79f6ef0e4..5fb11d025b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.component.ts @@ -84,7 +84,6 @@ export class EntitiesHierarchyWidgetComponent extends PageComponent implements O private widgetConfig: WidgetConfig; private subscription: IWidgetSubscription; private datasources: Array; - private data: Array>; private nodesMap: {[nodeId: string]: HierarchyNavTreeNode} = {}; private pendingUpdateNodeTasks: {[nodeId: string]: () => void} = {}; @@ -121,7 +120,6 @@ export class EntitiesHierarchyWidgetComponent extends PageComponent implements O this.widgetConfig = this.ctx.widgetConfig; this.subscription = this.ctx.defaultSubscription; this.datasources = this.subscription.datasources as Array; - this.data = this.subscription.dataPages[0].data; this.initializeConfig(); this.ctx.updateWidgetParams(); } @@ -252,12 +250,16 @@ export class EntitiesHierarchyWidgetComponent extends PageComponent implements O public loadNodes: LoadNodesCallback = (node, cb) => { if (node.id === '#') { const childNodes: HierarchyNavTreeNode[] = []; + let dataIndex = 0; this.datasources.forEach((childDatasource, index) => { - childNodes.push(this.datasourceToNode(childDatasource as HierarchyNodeDatasource, this.data[index])); + const datasourceData = this.subscription.data.slice(dataIndex); + childNodes.push(this.datasourceToNode(childDatasource as HierarchyNodeDatasource, datasourceData)); + dataIndex += childDatasource.dataKeys.length; }); cb(this.prepareNodes(childNodes)); } else { - if (node.data && node.data.nodeCtx.entity && node.data.nodeCtx.entity.id && node.data.nodeCtx.entity.id.entityType !== 'function') { + if (node.data && node.data.nodeCtx.entity && node.data.nodeCtx.entity.id && node.data.datasource.type === DatasourceType.entity + && node.data.nodeCtx.entity.id.entityType !== 'function') { this.loadChildren(node, node.data.datasource, cb); /* (error) => { // TODO: let errorText = 'Failed to get relations!'; @@ -369,8 +371,8 @@ export class EntitiesHierarchyWidgetComponent extends PageComponent implements O } private datasourceToNode(datasource: HierarchyNodeDatasource, - data: DatasourceData[], - parentNodeCtx?: HierarchyNodeContext): HierarchyNavTreeNode { + data: DatasourceData[], + parentNodeCtx?: HierarchyNodeContext): HierarchyNavTreeNode { const node: HierarchyNavTreeNode = { id: (++this.nodeIdCounter) + '' }; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.models.ts b/ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.models.ts index 07ab91fe5d..74166b1742 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.models.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/entities-hierarchy-widget.models.ts @@ -153,7 +153,16 @@ export const defaultNodeOpenedFunction: NodeOpenedFunction = nodeCtx => { }; export const defaultNodesSortFunction: NodesSortFunction = (nodeCtx1, nodeCtx2) => { - let result = nodeCtx1.entity.id.entityType.localeCompare(nodeCtx2.entity.id.entityType); + let result = 0; + if (!nodeCtx1.entity.id.entityType || !nodeCtx2.entity.id.entityType ) { + if (nodeCtx1.entity.id.entityType) { + result = 1; + } else if (nodeCtx2.entity.id.entityType) { + result = -1; + } + } else { + result = nodeCtx1.entity.id.entityType.localeCompare(nodeCtx2.entity.id.entityType); + } if (result === 0) { result = nodeCtx1.entity.name.localeCompare(nodeCtx2.entity.name); } diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts index 25b036a467..9d1722ad26 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/entities-table-widget.component.ts @@ -40,7 +40,7 @@ import { import { IWidgetSubscription } from '@core/api/widget-api.models'; import { UtilsService } from '@core/services/utils.service'; import { TranslateService } from '@ngx-translate/core'; -import { createLabelFromDatasource, deepClone, hashCode, isDefined, isNumber } from '@core/utils'; +import { createLabelFromDatasource, deepClone, hashCode, isDefined, isNumber, isObject } from '@core/utils'; import cssjs from '@core/css/css'; import { CollectionViewer, DataSource } from '@angular/cdk/collections'; import { DataKeyType } from '@shared/models/telemetry/telemetry.models'; @@ -515,8 +515,16 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni if (styleInfo.useCellStyleFunction && styleInfo.cellStyleFunction) { try { style = styleInfo.cellStyleFunction(value); + if (!isObject(style)) { + throw new TypeError(`${style === null ? 'null' : typeof style} instead of style object`); + } + if (Array.isArray(style)) { + throw new TypeError(`Array instead of style object`); + } } catch (e) { style = {}; + console.warn(`Cell style function for data key '${key.label}' in widget '${this.ctx.widgetTitle}' ` + + `returns '${e}'. Please check your cell style function.`); } } else { style = {}; @@ -538,7 +546,7 @@ export class EntitiesTableWidgetComponent extends PageComponent implements OnIni try { content = contentInfo.cellContentFunction(value, entity, this.ctx); } catch (e) { - content = '' + value; + content = '' + value; } } else { content = this.defaultContent(key, contentInfo, value); diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts b/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts index 2d7514014d..4850d08723 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/flot-widget.ts @@ -1289,6 +1289,7 @@ export class TbFlot { let value: any; let lastValue = 0; let minDistanceHistorical: number; + let deltaX = 0; const results: TbFlotHoverInfo[] = [{ seriesHover: [] }]; @@ -1297,6 +1298,13 @@ export class TbFlot { seriesHover: [] }); } + if (this.chartType === 'bar' && this.options.series.bars.align !== 'left') { + if (this.options.series.bars.align === 'center') { + deltaX = this.options.series.bars.barWidth / 2; + } else { + deltaX = this.options.series.bars.barWidth; + } + } for (i = 0; i < seriesList.length; i++) { series = seriesList[i]; let posx: number; @@ -1305,6 +1313,7 @@ export class TbFlot { } else { posx = pos.x; } + posx += deltaX; hoverIndex = this.findHoverIndexFromData(posx, series); if (series.data[hoverIndex] && series.data[hoverIndex][0]) { hoverDistance = posx - series.data[hoverIndex][0]; diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html index 5f8c94727d..0b41d35785 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.html @@ -39,73 +39,75 @@ - -
- - - Timestamp - - - - - {{ h.dataKey.label }} - - - - - - - -
- -
-
- - -
+ + Timestamp + + + + + {{ h.dataKey.label }} + + + + + + + +
+ - -
-
-
- - -
- widget.no-data-found -
- - +
+
+ + + + +
+ + + + + + widget.no-data-found + + + +
diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts index 4ce340d8ea..de4a5628ef 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/timeseries-table-widget.component.ts @@ -40,12 +40,12 @@ import { } from '@shared/models/widget.models'; import { UtilsService } from '@core/services/utils.service'; import { TranslateService } from '@ngx-translate/core'; -import {hashCode, isDefined, isDefinedAndNotNull, isNumber} from '@core/utils'; +import { hashCode, isDefined, isNumber, isObject } from '@core/utils'; import cssjs from '@core/css/css'; import { PageLink } from '@shared/models/page/page-link'; import { Direction, SortOrder, sortOrderFromString } from '@shared/models/page/sort-order'; import { CollectionViewer, DataSource } from '@angular/cdk/collections'; -import { BehaviorSubject, fromEvent, merge, Observable, of } from 'rxjs'; +import { BehaviorSubject, fromEvent, merge, Observable, of, Subscription } from 'rxjs'; import { emptyPageData, PageData } from '@shared/models/page/page-data'; import { catchError, debounceTime, distinctUntilChanged, map, tap } from 'rxjs/operators'; import { MatPaginator } from '@angular/material/paginator'; @@ -129,6 +129,8 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI public showTimestamp = true; private dateFormatFilter: string; + private subscriptions: Subscription[] = []; + private searchAction: WidgetAction = { name: 'action.search', show: true, @@ -166,40 +168,27 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI debounceTime(150), distinctUntilChanged(), tap(() => { - if (this.displayPagination) { - this.paginators.forEach((paginator) => { - paginator.pageIndex = 0; - }); - } this.sources.forEach((source) => { source.pageLink.textSearch = this.textSearch; + if (this.displayPagination) { + source.pageLink.page = 0; + } }); - this.updateAllData(); + this.loadCurrentSourceRow(); + this.ctx.detectChanges(); }) ) .subscribe(); - if (this.displayPagination) { - this.sorts.forEach((sort, index) => { - sort.sortChange.subscribe(() => this.paginators.toArray()[index].pageIndex = 0); - }); - } - this.sorts.forEach((sort, index) => { - const paginator = this.displayPagination ? this.paginators.toArray()[index] : null; - sort.sortChange.subscribe(() => this.paginators.toArray()[index].pageIndex = 0); - ((this.displayPagination ? merge(sort.sortChange, paginator.page) : sort.sortChange) as Observable) - .pipe( - tap(() => this.updateData(sort, paginator, index)) - ) - .subscribe(); + this.sorts.changes.subscribe(() => { + this.initSubscriptionsToSortAndPaginator(); }); - this.updateAllData(); + + this.initSubscriptionsToSortAndPaginator(); } public onDataUpdated() { - this.sources.forEach((source) => { - source.timeseriesDatasource.dataUpdated(this.data); - }); + this.updateCurrentSourceData(); } private initialize() { @@ -305,7 +294,27 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI this.ctx.activeEntityInfo = activeEntityInfo; } + private initSubscriptionsToSortAndPaginator() { + this.subscriptions.forEach(subscription => subscription.unsubscribe()); + this.sorts.forEach((sort, index) => { + let paginator = null; + const observables = [sort.sortChange]; + if (this.displayPagination) { + paginator = this.paginators.toArray()[index]; + this.subscriptions.push( + sort.sortChange.subscribe(() => paginator.pageIndex = 0) + ); + observables.push(paginator.page); + } + this.updateData(sort, paginator); + this.subscriptions.push(merge(...observables).pipe( + tap(() => this.updateData(sort, paginator)) + ).subscribe()); + }); + } + onSourceIndexChanged() { + this.updateCurrentSourceData(); this.updateActiveEntityInfo(); } @@ -326,30 +335,19 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI exitFilterMode() { this.textSearchMode = false; this.textSearch = null; - this.sources.forEach((source, index) => { + this.sources.forEach((source) => { source.pageLink.textSearch = this.textSearch; - const sort = this.sorts.toArray()[index]; - let paginator = null; if (this.displayPagination) { - paginator = this.paginators.toArray()[index]; - paginator.pageIndex = 0; + source.pageLink.page = 0; } - this.updateData(sort, paginator, index); }); + this.loadCurrentSourceRow(); this.ctx.hideTitlePanel = false; this.ctx.detectChanges(true); } - private updateAllData() { - this.sources.forEach((source, index) => { - const sort = this.sorts.toArray()[index]; - const paginator = this.displayPagination ? this.paginators.toArray()[index] : null; - this.updateData(sort, paginator, index); - }); - } - - private updateData(sort: MatSort, paginator: MatPaginator, index: number) { - const source = this.sources[index]; + private updateData(sort: MatSort, paginator: MatPaginator) { + const source = this.sources[this.sourceIndex]; if (this.displayPagination) { source.pageLink.page = paginator.pageIndex; source.pageLink.pageSize = paginator.pageSize; @@ -385,8 +383,16 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI if (styleInfo.useCellStyleFunction && styleInfo.cellStyleFunction) { try { style = styleInfo.cellStyleFunction(value); + if (!isObject(style)) { + throw new TypeError(`${style === null ? 'null' : typeof style} instead of style object`); + } + if (Array.isArray(style)) { + throw new TypeError(`Array instead of style object`); + } } catch (e) { style = {}; + console.warn(`Cell style function for data key '${source.header[index - 1].dataKey.label}' in widget ` + + `'${this.ctx.widgetConfig.title}' returns '${e}'. Please check your cell style function.`); } } } @@ -418,7 +424,6 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI if (!isDefined(content)) { return ''; - } else { switch (typeof content) { case 'string': @@ -462,6 +467,18 @@ export class TimeseriesTableWidgetComponent extends PageComponent implements OnI } this.ctx.actionsApi.handleWidgetAction($event, actionDescriptor, entityId, entityName, row, entityLabel); } + + public isActiveTab(index: number): boolean { + return index === this.sourceIndex; + } + + private updateCurrentSourceData() { + this.sources[this.sourceIndex].timeseriesDatasource.dataUpdated(this.data); + } + + private loadCurrentSourceRow() { + this.sources[this.sourceIndex].timeseriesDatasource.loadRows(); + } } class TimeseriesDatasource implements DataSource { @@ -482,6 +499,10 @@ class TimeseriesDatasource implements DataSource { } connect(collectionViewer: CollectionViewer): Observable> { + if (this.rowsSubject.isStopped) { + this.rowsSubject.isStopped = false; + this.pageDataSubject.isStopped = false; + } return this.rowsSubject.asObservable(); } diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-component.service.ts b/ui-ngx/src/app/modules/home/components/widget/widget-component.service.ts index 2b5c001628..5166a845f9 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget-component.service.ts +++ b/ui-ngx/src/app/modules/home/components/widget/widget-component.service.ts @@ -485,6 +485,9 @@ export class WidgetComponentService { if (isUndefined(result.typeParameters.warnOnPageDataOverflow)) { result.typeParameters.warnOnPageDataOverflow = true; } + if (isUndefined(result.typeParameters.ignoreDataUpdateOnIntervalTick)) { + result.typeParameters.ignoreDataUpdateOnIntervalTick = false; + } if (isUndefined(result.typeParameters.dataKeysOptional)) { result.typeParameters.dataKeysOptional = false; } diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html index e47d96bebe..8b745c480f 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.html @@ -100,87 +100,115 @@
- +
- widget-config.datasource-type + widget-config.datasource-type widget-config.datasource-parameters
-
- {{$index + 1}}. -
-
- - - - {{ datasourceTypesTranslations.get(datasourceType) | translate }} - - - -
- - - - + + + + +
+
+ + {{$index + 1}}. +
+
+
+ + + + {{ datasourceTypesTranslations.get(datasourceType) | translate }} + + - - -
- - - - +
+ + + + + + + + + + + + + + + +
- -
- - -
- -
-
+ + +
+ +
+
+ +
diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.scss b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.scss index 39182661f1..6e1e1cabdf 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.scss @@ -23,10 +23,34 @@ .tb-advanced-widget-config { height: 100%; } + .tb-datasources { + + .handle { + cursor: move; + } + + .mat-list { + min-height: 68px; + padding-left: 0; + } + + .mat-list-item { + height: auto; + min-height: 68px; + display: block; + &.dndDraggingSource { + display: none; + } + &.dndPlaceholder { + display: block; + background-color: #ddd; + } + } + } .tb-datasource-type { - min-width: 110px; + min-width: 120px; @media #{$mat-gt-sm} { - max-width: 110px; + max-width: 120px; } } .tb-datasource { @@ -70,13 +94,18 @@ white-space: normal; } .mat-expansion-panel { - &.tb-datasources{ + &.tb-datasources { &.mat-expanded { overflow: visible; } .mat-expansion-panel-body{ padding: 0 12px 16px; } + .mat-list-base .mat-list-item { + .mat-list-item-content { + padding: 0; + } + } } .mat-expansion-panel-content { font: inherit; @@ -110,6 +139,11 @@ } } } + .tb-datasource-name.no-border-top { + .mat-form-field-infix { + border-top: 0; + } + } } .tb-data-keys { @media #{$mat-gt-sm} { diff --git a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts index 05c6264a92..523913afe4 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/widget-config.component.ts @@ -40,7 +40,7 @@ import { Validators } from '@angular/forms'; import { WidgetConfigComponentData } from '@home/models/widget-component.models'; -import { deepClone, isDefined, isObject } from '@app/core/utils'; +import { deepClone, isDefined, isObject, isUndefined } from '@app/core/utils'; import { alarmFields, AlarmSearchStatus, @@ -71,6 +71,7 @@ import { Filter, Filters } from '@shared/models/query/query.models'; import { FilterDialogComponent, FilterDialogData } from '@home/components/filter/filter-dialog.component'; import { COMMA, ENTER, SEMICOLON } from '@angular/cdk/keycodes'; import { MatChipInputEvent } from '@angular/material/chips'; +import { DndDropEvent } from 'ngx-drag-drop'; const emptySettingsSchema: JsonSchema = { type: 'object', @@ -141,7 +142,7 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont widgetType: widgetType; datasourceType = DatasourceType; - datasourceTypes: Array; + datasourceTypes: Array = []; datasourceTypesTranslations = datasourceTypeTranslationMap; widgetConfigCallbacks: WidgetConfigCallbacks = { @@ -186,11 +187,6 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont } ngOnInit(): void { - if (this.functionsOnly) { - this.datasourceTypes = [DatasourceType.function]; - } else { - this.datasourceTypes = [DatasourceType.function, DatasourceType.entity]; - } this.dataSettings = this.fb.group({}); this.targetDeviceSettings = this.fb.group({}); this.alarmSourceSettings = this.fb.group({}); @@ -295,6 +291,14 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont } private buildForms() { + if (this.functionsOnly) { + this.datasourceTypes = [DatasourceType.function]; + } else { + this.datasourceTypes = [DatasourceType.function, DatasourceType.entity]; + if (this.widgetType === widgetType.latest) { + this.datasourceTypes.push(DatasourceType.entityCount); + } + } this.dataSettings = this.fb.group({}); this.targetDeviceSettings = this.fb.group({}); this.alarmSourceSettings = this.fb.group({}); @@ -517,22 +521,28 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont } private buildDatasourceForm(datasource?: Datasource): FormGroup { - const dataKeysRequired = !this.modelValue.typeParameters || !this.modelValue.typeParameters.dataKeysOptional; + let dataKeysRequired = !this.modelValue.typeParameters || !this.modelValue.typeParameters.dataKeysOptional + || datasource?.type === DatasourceType.entityCount; const datasourceFormGroup = this.fb.group( { type: [datasource ? datasource.type : null, [Validators.required]], name: [datasource ? datasource.name : null, []], entityAliasId: [datasource ? datasource.entityAliasId : null, - datasource && datasource.type === DatasourceType.entity ? [Validators.required] : []], + datasource && (datasource.type === DatasourceType.entity || + datasource.type === DatasourceType.entityCount) ? [Validators.required] : []], filterId: [datasource ? datasource.filterId : null, []], dataKeys: [datasource ? datasource.dataKeys : null, dataKeysRequired ? [Validators.required] : []] } ); datasourceFormGroup.get('type').valueChanges.subscribe((type: DatasourceType) => { datasourceFormGroup.get('entityAliasId').setValidators( - type === DatasourceType.entity ? [Validators.required] : [] + (type === DatasourceType.entity || type === DatasourceType.entityCount) ? [Validators.required] : [] ); + dataKeysRequired = !this.modelValue.typeParameters || !this.modelValue.typeParameters.dataKeysOptional + || type === DatasourceType.entityCount; + datasourceFormGroup.get('dataKeys').setValidators(dataKeysRequired ? [Validators.required] : []); datasourceFormGroup.get('entityAliasId').updateValueAndValidity(); + datasourceFormGroup.get('dataKeys').updateValueAndValidity(); }); return datasourceFormGroup; } @@ -659,8 +669,22 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont return !!this.modelValue && !!this.modelValue.settingsSchema && !!this.modelValue.settingsSchema.schema; } + public dndDatasourceMoved(index: number) { + this.datasourcesFormArray().removeAt(index); + } + + public onDatasourceDrop(event: DndDropEvent) { + let index = event.index; + if (isUndefined(index)) { + index = this.datasourcesFormArray().length; + } + this.datasourcesFormArray().insert(index, + this.buildDatasourceForm(event.data) + ); + } + public removeDatasource(index: number) { - (this.dataSettings.get('datasources') as FormArray).removeAt(index); + this.datasourcesFormArray().removeAt(index); } public addDatasource() { @@ -673,8 +697,7 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont dataKeys: [] }; } - const datasourcesFormArray = this.dataSettings.get('datasources') as FormArray; - datasourcesFormArray.push(this.buildDatasourceForm(newDatasource)); + this.datasourcesFormArray().push(this.buildDatasourceForm(newDatasource)); } public generateDataKey(chip: any, type: DataKeyType): DataKey { @@ -704,6 +727,8 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, Cont if (!result.funcBody) { result.funcBody = 'return prevValue + 1;'; } + } else if (type === DataKeyType.count) { + result.name = 'count'; } if (isDefined(this.modelValue.dataKeySettingsSchema.schema)) { result.settings = this.utils.generateObjectFromJsonSchema(this.modelValue.dataKeySettingsSchema.schema); diff --git a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts index 7838f7e7ba..aa47b97c20 100644 --- a/ui-ngx/src/app/modules/home/components/widget/widget.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/widget.component.ts @@ -895,6 +895,7 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI hasDataPageLink: this.typeParameters.hasDataPageLink, singleEntity: this.typeParameters.singleEntity, warnOnPageDataOverflow: this.typeParameters.warnOnPageDataOverflow, + ignoreDataUpdateOnIntervalTick: this.typeParameters.ignoreDataUpdateOnIntervalTick, comparisonEnabled: comparisonSettings.comparisonEnabled, timeForComparison: comparisonSettings.timeForComparison }; diff --git a/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html b/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html index 8022439213..f1a7af1e46 100644 --- a/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html +++ b/ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html @@ -42,7 +42,7 @@
diff --git a/ui-ngx/src/app/modules/home/pages/user/user.component.html b/ui-ngx/src/app/modules/home/pages/user/user.component.html index 20821031b0..63154139e3 100644 --- a/ui-ngx/src/app/modules/home/pages/user/user.component.html +++ b/ui-ngx/src/app/modules/home/pages/user/user.component.html @@ -19,13 +19,13 @@ - +
+
+ +
+
diff --git a/ui-ngx/src/app/shared/components/json-content.component.html b/ui-ngx/src/app/shared/components/json-content.component.html index 596c2fcb36..b815ec6315 100644 --- a/ui-ngx/src/app/shared/components/json-content.component.html +++ b/ui-ngx/src/app/shared/components/json-content.component.html @@ -29,12 +29,16 @@ mat-button *ngIf="!readonly && !disabled" class="tidy" (click)="minifyJSON()"> {{'js-func.mini' | translate }} - +
+
+ +
+
diff --git a/ui-ngx/src/app/shared/components/mat-chip-draggable.directive.ts b/ui-ngx/src/app/shared/components/mat-chip-draggable.directive.ts index 246f38b87a..f9ada15d64 100644 --- a/ui-ngx/src/app/shared/components/mat-chip-draggable.directive.ts +++ b/ui-ngx/src/app/shared/components/mat-chip-draggable.directive.ts @@ -124,6 +124,7 @@ class DraggableChip { if (this.preventDrag) { event.preventDefault(); } else { + event.stopPropagation(); this.dragging = true; globalDraggingChipListId = this.chipListElement.id; this.chipListElement.classList.add(draggingClassName); @@ -159,6 +160,7 @@ class DraggableChip { } private onDragEnd(event: Event | any) { + event.stopPropagation(); this.dragging = false; globalDraggingChipListId = null; this.chipListElement.classList.remove(draggingClassName); diff --git a/ui-ngx/src/app/shared/models/alias.models.ts b/ui-ngx/src/app/shared/models/alias.models.ts index 608eb1b46c..1f900d29a1 100644 --- a/ui-ngx/src/app/shared/models/alias.models.ts +++ b/ui-ngx/src/app/shared/models/alias.models.ts @@ -16,13 +16,14 @@ import { EntityType } from '@shared/models/entity-type.models'; import { EntityId } from '@shared/models/id/entity-id'; -import { EntitySearchDirection, EntityTypeFilter } from '@shared/models/relation.models'; +import { EntitySearchDirection, RelationEntityTypeFilter } from '@shared/models/relation.models'; import { EntityFilter } from '@shared/models/query/query.models'; export enum AliasFilterType { singleEntity = 'singleEntity', entityList = 'entityList', entityName = 'entityName', + entityType = 'entityType', stateEntity = 'stateEntity', assetType = 'assetType', deviceType = 'deviceType', @@ -41,6 +42,7 @@ export const aliasFilterTypeTranslationMap = new Map( [ AliasFilterType.singleEntity, 'alias.filter-type-single-entity' ], [ AliasFilterType.entityList, 'alias.filter-type-entity-list' ], [ AliasFilterType.entityName, 'alias.filter-type-entity-name' ], + [ AliasFilterType.entityType, 'alias.filter-type-entity-type' ], [ AliasFilterType.stateEntity, 'alias.filter-type-state-entity' ], [ AliasFilterType.assetType, 'alias.filter-type-asset-type' ], [ AliasFilterType.deviceType, 'alias.filter-type-device-type' ], @@ -69,6 +71,10 @@ export interface EntityNameFilter { entityNameFilter?: string; } +export interface EntityTypeFilter { + entityType?: EntityType; +} + export interface StateEntityFilter { stateEntityParamName?: string; defaultStateEntity?: EntityId; @@ -100,7 +106,7 @@ export interface RelationsQueryFilter { defaultStateEntity?: EntityId; rootEntity?: EntityId; direction?: EntitySearchDirection; - filters?: Array; + filters?: Array; maxLevel?: number; fetchLastLevelOnly?: boolean; } @@ -141,6 +147,7 @@ export type EntityFilters = SingleEntityFilter & EntityListFilter & EntityNameFilter & + EntityTypeFilter & StateEntityFilter & AssetTypeFilter & DeviceTypeFilter & diff --git a/ui-ngx/src/app/shared/models/page/page-link.ts b/ui-ngx/src/app/shared/models/page/page-link.ts index 96fb7d2925..92fe4634f5 100644 --- a/ui-ngx/src/app/shared/models/page/page-link.ts +++ b/ui-ngx/src/app/shared/models/page/page-link.ts @@ -108,7 +108,8 @@ export class PageLink { public toQuery(): string { let query = `?pageSize=${this.pageSize}&page=${this.page}`; if (this.textSearch && this.textSearch.length) { - query += `&textSearch=${this.textSearch}`; + const textSearch = encodeURIComponent(this.textSearch); + query += `&textSearch=${textSearch}`; } if (this.sortOrder) { query += `&sortProperty=${this.sortOrder.property}&sortOrder=${this.sortOrder.direction}`; diff --git a/ui-ngx/src/app/shared/models/query/query.models.ts b/ui-ngx/src/app/shared/models/query/query.models.ts index dcc89852b7..6bc2d74487 100644 --- a/ui-ngx/src/app/shared/models/query/query.models.ts +++ b/ui-ngx/src/app/shared/models/query/query.models.ts @@ -35,14 +35,17 @@ export enum EntityKeyType { SERVER_ATTRIBUTE = 'SERVER_ATTRIBUTE', TIME_SERIES = 'TIME_SERIES', ENTITY_FIELD = 'ENTITY_FIELD', - ALARM_FIELD = 'ALARM_FIELD' + ALARM_FIELD = 'ALARM_FIELD', + CONSTANT = 'CONSTANT', + COUNT = 'COUNT' } export const entityKeyTypeTranslationMap = new Map( [ [EntityKeyType.ATTRIBUTE, 'filter.key-type.attribute'], [EntityKeyType.TIME_SERIES, 'filter.key-type.timeseries'], - [EntityKeyType.ENTITY_FIELD, 'filter.key-type.entity-field'] + [EntityKeyType.ENTITY_FIELD, 'filter.key-type.entity-field'], + [EntityKeyType.CONSTANT, 'filter.key-type.constant'] ] ); @@ -59,6 +62,8 @@ export function entityKeyTypeToDataKeyType(entityKeyType: EntityKeyType): DataKe return DataKeyType.entityField; case EntityKeyType.ALARM_FIELD: return DataKeyType.alarm; + case EntityKeyType.COUNT: + return DataKeyType.count; } } @@ -74,6 +79,8 @@ export function dataKeyTypeToEntityKeyType(dataKeyType: DataKeyType): EntityKeyT return EntityKeyType.ALARM_FIELD; case DataKeyType.entityField: return EntityKeyType.ENTITY_FIELD; + case DataKeyType.count: + return EntityKeyType.COUNT; } } @@ -344,12 +351,14 @@ export interface KeyFilterPredicateInfo { export interface KeyFilter { key: EntityKey; valueType: EntityKeyValueType; + value?: string | number | boolean; predicate: KeyFilterPredicate; } export interface KeyFilterInfo { key: EntityKey; valueType: EntityKeyValueType; + value?: string | number | boolean; predicates: Array; } @@ -446,7 +455,9 @@ function simpleKeyFilterPredicateToText(translate: TranslateService, break; case FilterPredicateType.BOOLEAN: operation = translate.instant(booleanOperationTranslationMap.get(keyFilterPredicate.operation)); - value = translate.instant(keyFilterPredicate.value.defaultValue ? 'value.true' : 'value.false'); + if (!dynamicValue) { + value = translate.instant(keyFilterPredicate.value.defaultValue ? 'value.true' : 'value.false'); + } break; } if (!dynamicValue) { @@ -466,6 +477,7 @@ export function keyFilterInfosToKeyFilters(keyFilterInfos: Array) const keyFilter: KeyFilter = { key, valueType: keyFilterInfo.valueType, + value: keyFilterInfo.value, predicate: keyFilterPredicateInfoToKeyFilterPredicate(predicate) }; keyFilters.push(keyFilter); @@ -486,6 +498,7 @@ export function keyFiltersToKeyFilterInfos(keyFilters: Array): Array< keyFilterInfo = { key, valueType: keyFilter.valueType, + value: keyFilter.value, predicates: [] }; keyFilterInfoMap[infoKey] = keyFilterInfo; @@ -508,6 +521,7 @@ export function filterInfoToKeyFilters(filter: FilterInfo): Array { const keyFilter: KeyFilter = { key, valueType: keyFilterInfo.valueType, + value: keyFilterInfo.value, predicate: keyFilterPredicateInfoToKeyFilterPredicate(predicate) }; keyFilters.push(keyFilter); @@ -709,13 +723,13 @@ export const defaultEntityDataPageLink: EntityDataPageLink = createDefaultEntity export interface EntityCountQuery { entityFilter: EntityFilter; + keyFilters?: Array; } export interface AbstractDataQuery extends EntityCountQuery { pageLink: T; entityFields?: Array; latestValues?: Array; - keyFilters?: Array; } export interface EntityDataQuery extends AbstractDataQuery { diff --git a/ui-ngx/src/app/shared/models/relation.models.ts b/ui-ngx/src/app/shared/models/relation.models.ts index 2f0f2b456f..c9037a5dab 100644 --- a/ui-ngx/src/app/shared/models/relation.models.ts +++ b/ui-ngx/src/app/shared/models/relation.models.ts @@ -52,7 +52,7 @@ export const directionTypeTranslations = new Map( ] ); -export interface EntityTypeFilter { +export interface RelationEntityTypeFilter { relationType: string; entityTypes: Array; } @@ -68,7 +68,7 @@ export interface RelationsSearchParameters { export interface EntityRelationsQuery { parameters: RelationsSearchParameters; - filters: Array; + filters: Array; } export interface EntitySearchQuery { diff --git a/ui-ngx/src/app/shared/models/settings.models.ts b/ui-ngx/src/app/shared/models/settings.models.ts index b4a428daf8..3877488671 100644 --- a/ui-ngx/src/app/shared/models/settings.models.ts +++ b/ui-ngx/src/app/shared/models/settings.models.ts @@ -65,6 +65,7 @@ export interface UpdateMessage { } export const phoneNumberPattern = /^\+[1-9]\d{1,14}$/; +export const phoneNumberPatternTwilio = /^\+[1-9]\d{1,14}$|^(MG|PN).*$/; export enum SmsProviderType { AWS_SNS = 'AWS_SNS', diff --git a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts b/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts index 1e77285667..cfbde53233 100644 --- a/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts +++ b/ui-ngx/src/app/shared/models/telemetry/telemetry.models.ts @@ -23,7 +23,7 @@ import { map } from 'rxjs/operators'; import { NgZone } from '@angular/core'; import { AlarmData, - AlarmDataQuery, + AlarmDataQuery, EntityCountQuery, EntityData, EntityDataQuery, EntityKey, @@ -36,7 +36,8 @@ export enum DataKeyType { attribute = 'attribute', function = 'function', alarm = 'alarm', - entityField = 'entityField' + entityField = 'entityField', + count = 'count' } export enum LatestTelemetry { @@ -181,6 +182,11 @@ export class EntityDataCmd implements WebsocketCmd { } } +export class EntityCountCmd implements WebsocketCmd { + cmdId: number; + query?: EntityCountQuery; +} + export class AlarmDataCmd implements WebsocketCmd { cmdId: number; query?: AlarmDataQuery; @@ -194,6 +200,10 @@ export class EntityDataUnsubscribeCmd implements WebsocketCmd { cmdId: number; } +export class EntityCountUnsubscribeCmd implements WebsocketCmd { + cmdId: number; +} + export class AlarmDataUnsubscribeCmd implements WebsocketCmd { cmdId: number; } @@ -206,6 +216,8 @@ export class TelemetryPluginCmdsWrapper { entityDataUnsubscribeCmds: Array; alarmDataCmds: Array; alarmDataUnsubscribeCmds: Array; + entityCountCmds: Array; + entityCountUnsubscribeCmds: Array; constructor() { this.attrSubCmds = []; @@ -215,6 +227,8 @@ export class TelemetryPluginCmdsWrapper { this.entityDataUnsubscribeCmds = []; this.alarmDataCmds = []; this.alarmDataUnsubscribeCmds = []; + this.entityCountCmds = []; + this.entityCountUnsubscribeCmds = []; } public hasCommands(): boolean { @@ -224,7 +238,9 @@ export class TelemetryPluginCmdsWrapper { this.entityDataCmds.length > 0 || this.entityDataUnsubscribeCmds.length > 0 || this.alarmDataCmds.length > 0 || - this.alarmDataUnsubscribeCmds.length > 0; + this.alarmDataUnsubscribeCmds.length > 0 || + this.entityCountCmds.length > 0 || + this.entityCountUnsubscribeCmds.length > 0; } public clear() { @@ -235,6 +251,8 @@ export class TelemetryPluginCmdsWrapper { this.entityDataUnsubscribeCmds.length = 0; this.alarmDataCmds.length = 0; this.alarmDataUnsubscribeCmds.length = 0; + this.entityCountCmds.length = 0; + this.entityCountUnsubscribeCmds.length = 0; } public preparePublishCommands(maxCommands: number): TelemetryPluginCmdsWrapper { @@ -253,6 +271,10 @@ export class TelemetryPluginCmdsWrapper { preparedWrapper.alarmDataCmds = this.popCmds(this.alarmDataCmds, leftCount); leftCount -= preparedWrapper.alarmDataCmds.length; preparedWrapper.alarmDataUnsubscribeCmds = this.popCmds(this.alarmDataUnsubscribeCmds, leftCount); + leftCount -= preparedWrapper.alarmDataUnsubscribeCmds.length; + preparedWrapper.entityCountCmds = this.popCmds(this.entityCountCmds, leftCount); + leftCount -= preparedWrapper.entityCountCmds.length; + preparedWrapper.entityCountUnsubscribeCmds = this.popCmds(this.entityCountUnsubscribeCmds, leftCount); return preparedWrapper; } @@ -280,40 +302,54 @@ export interface SubscriptionUpdateMsg extends SubscriptionDataHolder { errorMsg: string; } -export enum DataUpdateType { +export enum CmdUpdateType { ENTITY_DATA = 'ENTITY_DATA', - ALARM_DATA = 'ALARM_DATA' + ALARM_DATA = 'ALARM_DATA', + COUNT_DATA = 'COUNT_DATA' } -export interface DataUpdateMsg { +export interface CmdUpdateMsg { cmdId: number; - data?: PageData; - update?: Array; errorCode: number; errorMsg: string; - dataUpdateType: DataUpdateType; + cmdUpdateType: CmdUpdateType; +} + +export interface DataUpdateMsg extends CmdUpdateMsg { + data?: PageData; + update?: Array; } export interface EntityDataUpdateMsg extends DataUpdateMsg { - dataUpdateType: DataUpdateType.ENTITY_DATA; + cmdUpdateType: CmdUpdateType.ENTITY_DATA; } export interface AlarmDataUpdateMsg extends DataUpdateMsg { - dataUpdateType: DataUpdateType.ALARM_DATA; + cmdUpdateType: CmdUpdateType.ALARM_DATA; allowedEntities: number; totalEntities: number; } -export type WebsocketDataMsg = AlarmDataUpdateMsg | EntityDataUpdateMsg | SubscriptionUpdateMsg; +export interface EntityCountUpdateMsg extends CmdUpdateMsg { + cmdUpdateType: CmdUpdateType.COUNT_DATA; + count: number; +} + +export type WebsocketDataMsg = AlarmDataUpdateMsg | EntityDataUpdateMsg | EntityCountUpdateMsg | SubscriptionUpdateMsg; export function isEntityDataUpdateMsg(message: WebsocketDataMsg): message is EntityDataUpdateMsg { - const updateMsg = (message as DataUpdateMsg); - return updateMsg.cmdId !== undefined && updateMsg.dataUpdateType === DataUpdateType.ENTITY_DATA; + const updateMsg = (message as CmdUpdateMsg); + return updateMsg.cmdId !== undefined && updateMsg.cmdUpdateType === CmdUpdateType.ENTITY_DATA; } export function isAlarmDataUpdateMsg(message: WebsocketDataMsg): message is AlarmDataUpdateMsg { - const updateMsg = (message as DataUpdateMsg); - return updateMsg.cmdId !== undefined && updateMsg.dataUpdateType === DataUpdateType.ALARM_DATA; + const updateMsg = (message as CmdUpdateMsg); + return updateMsg.cmdId !== undefined && updateMsg.cmdUpdateType === CmdUpdateType.ALARM_DATA; +} + +export function isEntityCountUpdateMsg(message: WebsocketDataMsg): message is EntityCountUpdateMsg { + const updateMsg = (message as CmdUpdateMsg); + return updateMsg.cmdId !== undefined && updateMsg.cmdUpdateType === CmdUpdateType.COUNT_DATA; } export class SubscriptionUpdate implements SubscriptionUpdateMsg { @@ -365,21 +401,28 @@ export class SubscriptionUpdate implements SubscriptionUpdateMsg { } } -export class DataUpdate implements DataUpdateMsg { +export class CmdUpdate implements CmdUpdateMsg { cmdId: number; errorCode: number; errorMsg: string; - data?: PageData; - update?: Array; - dataUpdateType: DataUpdateType; + cmdUpdateType: CmdUpdateType; - constructor(msg: DataUpdateMsg) { + constructor(msg: CmdUpdateMsg) { this.cmdId = msg.cmdId; this.errorCode = msg.errorCode; this.errorMsg = msg.errorMsg; + this.cmdUpdateType = msg.cmdUpdateType; + } +} + +export class DataUpdate extends CmdUpdate implements DataUpdateMsg { + data?: PageData; + update?: Array; + + constructor(msg: DataUpdateMsg) { + super(msg); this.data = msg.data; this.update = msg.update; - this.dataUpdateType = msg.dataUpdateType; } } @@ -400,6 +443,15 @@ export class AlarmDataUpdate extends DataUpdate { } } +export class EntityCountUpdate extends CmdUpdate { + count: number; + + constructor(msg: EntityCountUpdateMsg) { + super(msg); + this.count = msg.count; + } +} + export interface TelemetryService { subscribe(subscriber: TelemetrySubscriber); update(subscriber: TelemetrySubscriber); @@ -411,6 +463,7 @@ export class TelemetrySubscriber { private dataSubject = new ReplaySubject(1); private entityDataSubject = new ReplaySubject(1); private alarmDataSubject = new ReplaySubject(1); + private entityCountSubject = new ReplaySubject(1); private reconnectSubject = new Subject(); private zone: NgZone; @@ -420,6 +473,7 @@ export class TelemetrySubscriber { public data$ = this.dataSubject.asObservable(); public entityData$ = this.entityDataSubject.asObservable(); public alarmData$ = this.alarmDataSubject.asObservable(); + public entityCount$ = this.entityCountSubject.asObservable(); public reconnect$ = this.reconnectSubject.asObservable(); public static createEntityAttributesSubscription(telemetryService: TelemetryService, @@ -464,6 +518,7 @@ export class TelemetrySubscriber { this.dataSubject.complete(); this.entityDataSubject.complete(); this.alarmDataSubject.complete(); + this.entityCountSubject.complete(); this.reconnectSubject.complete(); } @@ -513,6 +568,18 @@ export class TelemetrySubscriber { } } + public onEntityCount(message: EntityCountUpdate) { + if (this.zone) { + this.zone.run( + () => { + this.entityCountSubject.next(message); + } + ); + } else { + this.entityCountSubject.next(message); + } + } + public onReconnected() { this.reconnectSubject.next(); } diff --git a/ui-ngx/src/app/shared/models/widget.models.ts b/ui-ngx/src/app/shared/models/widget.models.ts index 179a6ff47b..33b12045c6 100644 --- a/ui-ngx/src/app/shared/models/widget.models.ts +++ b/ui-ngx/src/app/shared/models/widget.models.ts @@ -154,6 +154,7 @@ export interface WidgetTypeParameters { hasDataPageLink?: boolean; singleEntity?: boolean; warnOnPageDataOverflow?: boolean; + ignoreDataUpdateOnIntervalTick?: boolean; } export interface WidgetControllerDescriptor { @@ -246,13 +247,15 @@ export interface DataKey extends KeyInfo { export enum DatasourceType { function = 'function', - entity = 'entity' + entity = 'entity', + entityCount = 'entityCount' } export const datasourceTypeTranslationMap = new Map( [ [ DatasourceType.function, 'function.function' ], - [ DatasourceType.entity, 'entity.entity' ] + [ DatasourceType.entity, 'entity.entity' ], + [ DatasourceType.entityCount, 'entity.entities-count' ] ] ); diff --git a/ui-ngx/src/app/shared/shared.module.ts b/ui-ngx/src/app/shared/shared.module.ts index ba56ad72fc..a142a48e90 100644 --- a/ui-ngx/src/app/shared/shared.module.ts +++ b/ui-ngx/src/app/shared/shared.module.ts @@ -52,6 +52,7 @@ import { MatTableModule } from '@angular/material/table'; import { MatTabsModule } from '@angular/material/tabs'; import { MatToolbarModule } from '@angular/material/toolbar'; import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatListModule } from '@angular/material/list'; import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core'; import { NgxDaterangepickerMd } from 'ngx-daterangepicker-material'; import { GridsterModule } from 'angular-gridster2'; @@ -132,6 +133,7 @@ import { TbJsonToStringDirective } from '@shared/components/directives/tb-json-t import { JsonObjectEditDialogComponent } from '@shared/components/dialog/json-object-edit-dialog.component'; import { HistorySelectorComponent } from './components/time/history-selector/history-selector.component'; import { EntityGatewaySelectComponent } from '@shared/components/entity/entity-gateway-select.component'; +import { DndModule } from 'ngx-drag-drop'; import { QueueTypeListComponent } from '@shared/components/queue/queue-type-list.component'; import { ContactComponent } from '@shared/components/contact.component'; import { TimezoneSelectComponent } from '@shared/components/time/timezone-select.component'; @@ -259,6 +261,7 @@ import { TimezoneSelectComponent } from '@shared/components/time/timezone-select MatStepperModule, MatAutocompleteModule, MatChipsModule, + MatListModule, GridsterModule, ClipboardModule, FlexLayoutModule.withConfig({addFlexToParent: false}), @@ -269,6 +272,7 @@ import { TimezoneSelectComponent } from '@shared/components/time/timezone-select HotkeyModule, ColorPickerModule, NgxHmCarouselModule, + DndModule, NgxFlowModule, NgxFlowchartModule ], @@ -348,6 +352,7 @@ import { TimezoneSelectComponent } from '@shared/components/time/timezone-select MatStepperModule, MatAutocompleteModule, MatChipsModule, + MatListModule, GridsterModule, ClipboardModule, FlexLayoutModule, @@ -358,6 +363,7 @@ import { TimezoneSelectComponent } from '@shared/components/time/timezone-select HotkeyModule, ColorPickerModule, NgxHmCarouselModule, + DndModule, NgxFlowchartModule, ConfirmDialogComponent, AlertDialogComponent, diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 6b8440da89..86b503823f 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -122,7 +122,9 @@ "number-to": "Phone Number To", "number-to-required": "Phone Number To is required.", "phone-number-hint": "Phone Number in E.164 format, ex. +19995550123", + "phone-number-hint-twilio": "Phone Number in E.164 format/Phone Number's SID/Messaging Service SID, ex. +19995550123/PNXXX/MGXXX", "phone-number-pattern": "Invalid phone number. Should be in E.164 format, ex. +19995550123.", + "phone-number-pattern-twilio": "Invalid phone number. Should be in E.164 format/Phone Number's SID/Messaging Service SID, ex. +19995550123/PNXXX/MGXXX.", "sms-message": "SMS message", "sms-message-required": "SMS message is required.", "sms-message-max-length": "SMS message can't be longer 1600 characters", @@ -299,6 +301,7 @@ "filter-type-single-entity": "Single entity", "filter-type-entity-list": "Entity list", "filter-type-entity-name": "Entity name", + "filter-type-entity-type": "Entity type", "filter-type-state-entity": "Entity from dashboard state", "filter-type-state-entity-description": "Entity taken from dashboard state parameters", "filter-type-asset-type": "Asset type", @@ -826,6 +829,7 @@ "datasource": { "type": "Datasource type", "name": "Name", + "label": "Label", "add-datasource-prompt": "Please add datasource" }, "details": { @@ -1137,10 +1141,8 @@ "schedule-time-to": "To", "schedule-days-of-week-required": "At least one day of week should be selected.", "lwm2m": { - "client-only-observe-after-connect": "{ count, plural, 1 {Only Observe Request to the client after registration} other {Read&Observe Request to the client after registration} }", - "client-only-observe-after-connect-tip": "{ count, plural, 1 {Only Observe Request to the client marked as observe from the profile configuration.} other {Read Request to the client after registration to read the values of the resources then Observe Request to the client marked as observe from the profile configuration.} }", - "client-update-value-after-connect": "{ count, plural, 1 {Request to the client after registration for All resource values} other {Request to the client after registration to read values only as attributes or telemetry} }", - "client-update-value-after-connect-tip": "{ count, plural, 1 {Request to the client after registration to read all resource values for all objects} other {Request to the client after registration to read the values of the resources marked as attribute or telemetry from the profile configuration.} }", + "client-only-observe-after-connect": "{ count, plural, 1 {Strategy 1: Only Observe Request to the client after the initial connection} other {Strategy 2: Read All Resources & Observe Request to the client after registration} }", + "client-only-observe-after-connect-tip": "{ count, plural, 1 {Strategy 1: After the initial connection of the LWM2M Client, the server sends Observe resources Request to the client, those resources that are marked as observation in the Device profile and which exist on the LWM2M client.} other {Strategy 2: After the registration, request the client to read all the resource values for all objects that the LWM2M client has,\n then execute: the server sends Observe resources Request to the client, those resources that are marked as observation in the Device profile and which exist on the LWM2M client.} }", "object-list": "Object list", "object-list-empty": "No objects selected.", "no-objects-matching": "No objects matching '{{object}}' were found.", @@ -1342,6 +1344,7 @@ "entity": { "entity": "Entity", "entities": "Entities", + "entities-count": "Entities count", "aliases": "Entity aliases", "entity-alias": "Entity alias", "unable-delete-entity-alias-title": "Unable to delete entity alias", @@ -1823,7 +1826,8 @@ "key-type": "Key type", "attribute": "Attribute", "timeseries": "Timeseries", - "entity-field": "Entity field" + "entity-field": "Entity field", + "constant": "Constant" }, "value-type": { "value-type": "Value type", diff --git a/ui-ngx/yarn.lock b/ui-ngx/yarn.lock index b993a8dbd4..b1c5167ac9 100644 --- a/ui-ngx/yarn.lock +++ b/ui-ngx/yarn.lock @@ -6534,6 +6534,13 @@ ngx-daterangepicker-material@^4.0.1: dependencies: tslib "^1.10.0" +ngx-drag-drop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ngx-drag-drop/-/ngx-drag-drop-2.0.0.tgz#65d970229964803726fb7b9af4aec24005c810c7" + integrity sha512-t+4/eiC8zaXKqU1ruNfFEfGs1GpMNwpffD0baopvZFKjQHCb5rhNqFilJ54wO4T0OwGp4/RnsVhlcxe1mX6UJg== + dependencies: + tslib "^1.9.0" + "ngx-flowchart@git://github.com/thingsboard/ngx-flowchart.git#master": version "0.0.0" resolved "git://github.com/thingsboard/ngx-flowchart.git#078bfd2cedeeab412dee922e8066a19be6da7278"