thingsboard-memoizeit
Changes
application/build.gradle 3(+1 -2)
application/pom.xml 4(+2 -2)
application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/device/ToDeviceRpcRequestMetadata.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/plugin/PluginActorMessageProcessor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java 80(+74 -6)
application/src/main/java/org/thingsboard/server/actors/plugin/SharedPluginProcessingContext.java 5(+4 -1)
application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionCreateRequestMsg.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMessageProcessor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/rule/RuleContextAwareMsgProcessor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/session/AbstractSessionActorMsgProcessor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/shared/AbstractContextAwareMsgProcessor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/shared/plugin/SystemPluginManager.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/actors/shared/plugin/TenantPluginManager.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/config/ThingsboardMessageConfiguration.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java 8(+7 -1)
application/src/main/java/org/thingsboard/server/controller/ComponentDescriptorController.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/controller/plugin/PluginApiController.java 8(+6 -2)
application/src/main/java/org/thingsboard/server/controller/plugin/PluginNotFoundException.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketHandler.java 7(+5 -2)
application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketMsgEndpoint.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponseHandler.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/install/ThingsboardInstallConfiguration.java 33(+33 -0)
application/src/main/java/org/thingsboard/server/service/cluster/discovery/CurrentServerInstanceService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryServiceListener.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/discovery/DummyDiscoveryService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstance.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstanceService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/discovery/ZkDiscoveryService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/routing/ClusterRoutingService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/routing/ConsistentClusterRoutingService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterGrpcService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterRpcService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSessionListener.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcSessionCreationFuture.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/component/AnnotationComponentDiscoveryService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/component/ComponentDiscoveryService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/environment/EnvironmentLogService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseSchemaService.java 3(+1 -2)
application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseUpgradeService.java 45(+37 -8)
application/src/main/java/org/thingsboard/server/service/install/cql/CassandraDbHelper.java 30(+24 -6)
application/src/main/java/org/thingsboard/server/service/install/cql/CQLStatementsParser.java 3(+1 -2)
application/src/main/java/org/thingsboard/server/service/install/DatabaseSchemaService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/install/DatabaseUpgradeService.java 3(+1 -2)
application/src/main/java/org/thingsboard/server/service/install/DefaultSystemDataLoaderService.java 9(+5 -4)
application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseSchemaService.java 3(+1 -2)
application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseUpgradeService.java 40(+38 -2)
application/src/main/java/org/thingsboard/server/service/install/SystemDataLoaderService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/AbstractJwtAuthenticationToken.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtHeaderTokenExtractor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtQueryTokenExtractor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/TokenExtractor.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtAuthenticationProvider.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtTokenAuthenticationProcessingFilter.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenAuthenticationProvider.java 5(+3 -2)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenProcessingFilter.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRepository.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRequest.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/jwt/SkipPathRequestMatcher.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/JwtAuthenticationToken.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/RefreshAuthenticationToken.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginRequest.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/rest/PublicLoginRequest.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAuthenticationProvider.java 5(+3 -2)
application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationFailureHandler.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationSuccessHandler.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestLoginProcessingFilter.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestPublicLoginProcessingFilter.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/device/DefaultDeviceAuthService.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/exception/AuthMethodNotSupportedException.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/exception/JwtExpiredTokenException.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/model/token/AccessJwtToken.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/model/token/JwtToken.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/model/token/JwtTokenFactory.java 2(+1 -1)
application/src/main/java/org/thingsboard/server/service/security/model/token/RawAccessJwtToken.java 2(+1 -1)
application/src/main/resources/thingsboard.yml 103(+85 -18)
application/src/test/java/org/thingsboard/server/controller/BaseAuditLogControllerTest.java 148(+148 -0)
application/src/test/java/org/thingsboard/server/controller/BaseComponentDescriptorControllerTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/BaseCustomerControllerTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/BaseDashboardControllerTest.java 120(+18 -102)
application/src/test/java/org/thingsboard/server/controller/BaseWidgetsBundleControllerTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/BaseWidgetTypeControllerTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/AdminControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/AssetControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/AuditLogControllerNoSqlTest.java 23(+23 -0)
application/src/test/java/org/thingsboard/server/controller/nosql/AuthControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/ComponentDescriptorControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/CustomerControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/DashboardControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/DeviceControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/PluginControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/RuleControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/TenantControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/UserControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/WidgetsBundleControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/nosql/WidgetTypeControllerNoSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/AdminControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/AssetControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/AuditLogControllerSqlTest.java 23(+23 -0)
application/src/test/java/org/thingsboard/server/controller/sql/ComponentDescriptorControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/CustomerControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/DashboardControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/DeviceControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/PluginControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/TenantControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/WidgetsBundleControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/controller/sql/WidgetTypeControllerSqlTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/mqtt/rpc/AbstractMqttServerSideRpcIntegrationTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/mqtt/rpc/nosql/MqttServerSideRpcNoSqlIntegrationTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/mqtt/rpc/sql/MqttServerSideRpcSqlIntegrationTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/mqtt/telemetry/AbstractMqttTelemetryIntegrationTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/mqtt/telemetry/nosql/MqttTelemetryNoSqlIntegrationTest.java 2(+1 -1)
application/src/test/java/org/thingsboard/server/mqtt/telemetry/sql/MqttTelemetrySqlIntegrationTest.java 2(+1 -1)
common/data/pom.xml 4(+2 -2)
common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentDescriptor.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleEvent.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleState.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelation.java 24(+18 -6)
common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationInfo.java 3(+1 -2)
common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationsQuery.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/relation/EntitySearchDirection.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityTypeFilter.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationsSearchParameters.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java 5(+3 -2)
common/data/src/main/java/org/thingsboard/server/common/data/SearchTextBasedWithAdditionalInfo.java 105(+105 -0)
common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentials.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsFilter.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsType.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceTokenCredentials.java 2(+1 -1)
common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceX509Credentials.java 2(+1 -1)
common/message/pom.xml 4(+2 -2)
common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ClusterEventMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesSubscribeMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUnsubscribeMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUpdateNotification.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicCommandAckResponse.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesRequest.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesResponse.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicStatusCodeResponse.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicTelemetryUploadRequest.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicToDeviceSessionActorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicUpdateAttributesRequest.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesRequest.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesResponse.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineErrorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseNotification.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/StatusCodeResponse.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/TelemetryUploadRequest.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcRequestMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcResponseMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceSessionActorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcRequestMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcResponseMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/core/UpdateAttributesRequest.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/device/BasicToDeviceActorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/device/ToDeviceActorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/plugin/ComponentLifecycleMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/AdaptorToSessionActorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicAdaptorToSessionActorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionActorToAdaptorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicToDeviceActorSessionMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/ctrl/SessionCloseMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/ProcessingTimeoutException.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionAuthException.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionException.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceRequestMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionActorToAdaptorMsg.java 2(+1 -1)
common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceActorSessionMsg.java 2(+1 -1)
common/pom.xml 4(+2 -2)
common/transport/pom.xml 16(+14 -2)
common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/AdaptorException.java 2(+1 -1)
common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverter.java 2(+1 -1)
common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthResult.java 2(+1 -1)
common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthService.java 2(+1 -1)
common/transport/src/main/java/org/thingsboard/server/common/transport/quota/HostRequestLimitPolicy.java 38(+38 -0)
common/transport/src/main/java/org/thingsboard/server/common/transport/quota/HostRequestsQuotaService.java 76(+76 -0)
common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/HostRequestIntervalRegistry.java 83(+83 -0)
common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalCount.java 68(+68 -0)
common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryCleaner.java 66(+66 -0)
common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryLogger.java 95(+95 -0)
common/transport/src/main/java/org/thingsboard/server/common/transport/quota/QuotaService.java 25(+25 -0)
common/transport/src/main/java/org/thingsboard/server/common/transport/session/DeviceAwareSessionContext.java 2(+1 -1)
common/transport/src/main/java/org/thingsboard/server/common/transport/SessionMsgProcessor.java 2(+1 -1)
common/transport/src/main/java/org/thingsboard/server/common/transport/TransportAdaptor.java 2(+1 -1)
common/transport/src/test/java/org/thingsboard/server/common/transport/quota/ClockTest.java 66(+66 -0)
common/transport/src/test/java/org/thingsboard/server/common/transport/quota/HostRequestLimitPolicyTest.java 46(+46 -0)
common/transport/src/test/java/org/thingsboard/server/common/transport/quota/HostRequestsQuotaServiceTest.java 76(+76 -0)
common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/HostRequestIntervalRegistryTest.java 85(+85 -0)
common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalCountTest.java 65(+65 -0)
common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryLoggerTest.java 61(+61 -0)
dao/pom.xml 31(+28 -3)
dao/src/main/java/org/thingsboard/server/dao/cache/PreviousDeviceCredentialsIdKeyGenerator.java 6(+4 -2)
dao/src/main/java/org/thingsboard/server/dao/component/CassandraBaseComponentDescriptorDao.java 2(+1 -1)
dao/src/main/java/org/thingsboard/server/dao/sql/component/ComponentDescriptorRepository.java 2(+1 -1)
dao/src/main/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDao.java 2(+1 -1)
dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDaoListeningExecutorService.java 2(+1 -1)
dao/src/main/java/org/thingsboard/server/dao/util/mapping/AbstractJsonSqlTypeDescriptor.java 2(+1 -1)
dao/src/main/resources/cassandra/schema.cql 93(+80 -13)
dao/src/main/resources/sql/schema.sql 19(+17 -2)
dao/src/test/java/org/thingsboard/server/dao/service/attributes/BaseAttributesServiceTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/attributes/nosql/AttributesServiceNoSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/attributes/sql/AttributesServiceSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/event/nosql/EventServiceNoSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/nosql/AdminSettingsServiceNoSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialCacheNoSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialServiceNoSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetsBundleServiceNoSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/plugin/nosql/PluginServiceNoSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsCacheSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsServiceSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/timeseries/nosql/TimeseriesServiceNoSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/service/timeseries/sql/TimeseriesServiceSqlTest.java 2(+1 -1)
dao/src/test/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDaoTest.java 2(+1 -1)
docker/cassandra/Dockerfile 4(+2 -2)
docker/cassandra/Makefile 2(+1 -1)
docker/cassandra/ready-probe.sh 2(+1 -1)
docker/cassandra-setup/Dockerfile 2(+1 -1)
docker/cassandra-setup/install.sh 2(+1 -1)
docker/cassandra-setup/Makefile 2(+1 -1)
docker/docker-compose.static.yml 2(+1 -1)
docker/docker-compose.yml 8(+4 -4)
docker/docker-compose-tests.yml 27(+27 -0)
docker/k8s/cassandra.yaml 4(+2 -2)
docker/k8s/cassandra-setup.yaml 4(+2 -2)
docker/k8s/common.yaml 2(+1 -1)
docker/k8s/tb.yaml 4(+2 -2)
docker/k8s/zookeeper.yaml 4(+2 -2)
docker/tb/Dockerfile 2(+1 -1)
docker/tb/Makefile 2(+1 -1)
docker/tb/run-application.sh 2(+1 -1)
docker/zookeeper/Dockerfile 4(+2 -2)
docker/zookeeper/Makefile 2(+1 -1)
docker/zookeeper/zk-gen-config.sh 2(+1 -1)
docker/zookeeper/zk-ok.sh 2(+1 -1)
extensions/extension-kafka/pom.xml 4(+2 -2)
extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionMsg.java 2(+1 -1)
extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionPayload.java 2(+1 -1)
extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginAction.java 2(+1 -1)
extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginActionConfiguration.java 2(+1 -1)
extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaMsgHandler.java 2(+1 -1)
extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPlugin.java 2(+1 -1)
extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPluginConfiguration.java 2(+1 -1)
extensions/extension-kafka/src/test/java/org/thingsboard/server/extensions/kafka/KafkaDemoClient.java 2(+1 -1)
extensions/extension-mqtt/pom.xml 4(+2 -2)
extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionMsg.java 2(+1 -1)
extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionPayload.java 2(+1 -1)
extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginAction.java 2(+1 -1)
extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginActionConfiguration.java 2(+1 -1)
extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttMsgHandler.java 2(+1 -1)
extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPlugin.java 2(+1 -1)
extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPluginConfiguration.java 2(+1 -1)
extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionMsg.java 2(+1 -1)
extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionPayload.java 2(+1 -1)
extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginAction.java 2(+1 -1)
extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginActionConfiguration.java 2(+1 -1)
extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqMsgHandler.java 2(+1 -1)
extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPlugin.java 2(+1 -1)
extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPluginConfiguration.java 2(+1 -1)
extensions/extension-rabbitmq/src/test/java/org/thingsboard/server/extensions/rabbitmq/RabbitMqDemoClient.java 2(+1 -1)
extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionMsg.java 2(+1 -1)
extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionPayload.java 2(+1 -1)
extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginAction.java 2(+1 -1)
extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginActionConfiguration.java 2(+1 -1)
extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallMsgHandler.java 2(+1 -1)
extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPlugin.java 2(+1 -1)
extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPluginConfiguration.java 2(+1 -1)
extensions/extension-rest-api-call/src/test/java/org/thingsboard/server/extensions/rest/RestApiCallDemoClient.java 2(+1 -1)
extensions/extension-sns/pom.xml 4(+2 -2)
extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionMsg.java 2(+1 -1)
extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionPayload.java 2(+1 -1)
extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginAction.java 2(+1 -1)
extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginActionConfiguration.java 2(+1 -1)
extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsMessageHandler.java 2(+1 -1)
extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPlugin.java 2(+1 -1)
extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPluginConfiguration.java 2(+1 -1)
extensions/extension-sqs/pom.xml 4(+2 -2)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionMsg.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionPayload.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginAction.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginActionConfiguration.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionMsg.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionPayload.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginAction.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginActionConfiguration.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsMessageHandler.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPlugin.java 2(+1 -1)
extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPluginConfiguration.java 2(+1 -1)
extensions/extension-sqs/src/test/java/org/thingsboard/server/extensions/sqs/SqsDemoClient.java 2(+1 -1)
extensions/pom.xml 4(+2 -2)
extensions-api/pom.xml 4(+2 -2)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/ConfigurableComponent.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/EmptyComponentConfiguration.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Processor.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configurable.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configuration.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/ConfigurationValidationException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributes.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributesEventNotificationMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceCredentialsUpdateNotificationMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceMetaData.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceNameOrTypeUpdateMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/ToDeviceActorNotificationMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/AccessDeniedException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/EntityNotFoundException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InternalErrorException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InvalidParametersException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/ToErrorResponseEntity.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UnauthorizedException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UncheckedApiException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/AbstractPlugin.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRestMsgHandler.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRpcMsgHandler.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRuleMsgHandler.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultWebsocketMsgHandler.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RestMsgHandler.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RpcMsgHandler.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RuleMsgHandler.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/WebsocketMsgHandler.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractPluginToRuleMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractRuleToPluginMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/FromDeviceRpcResponse.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetAttributesRequestRuleToPluginMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetRequestRuleToPluginMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/PluginToRuleMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ResponsePluginToRuleMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcError.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcRequestRuleToPluginMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcResponsePluginToRuleMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RuleToPluginMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TelemetryUploadRequestRuleToPluginMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutIntMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutUUIDMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequest.java 4(+3 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestBody.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestPluginMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginActorMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginRpcResponseDeviceMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/UpdateAttributesRequestRuleToPluginMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginAction.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginApiCallSecurityContext.java 22(+16 -6)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginCallback.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginConstants.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginContext.java 13(+9 -4)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginInitializationException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/BasicPluginRestMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/PluginRestMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/RestRequest.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/PluginRpcMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/BasicPluginWebsocketSessionRef.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/AbstractPluginWebSocketMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/BinaryPluginWebSocketMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/EmptyPluginWebsocketMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PingPluginWebsocketMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PluginWebsocketMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PongPluginWebsocketMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/SessionEventPluginWebSocketMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/TextPluginWebSocketMsg.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/PluginWebsocketSessionRef.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/SessionEvent.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/WsSessionMetaData.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleInitializationException.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleLifecycleComponent.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessingMetaData.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessor.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/SimpleRuleLifecycleComponent.java 2(+1 -1)
extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/ToRuleActorMsg.java 2(+1 -1)
extensions-core/pom.xml 4(+2 -2)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailAction.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionMsg.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailRuleToPluginActionMsg.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/RpcPluginAction.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallAction.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionMsg.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallRuleToPluginActionMsg.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginAction.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginActionConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/AbstractTemplatePluginAction.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/TemplateActionConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/BasicJsFilter.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilter.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTelemetryFilter.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilter.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilterConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/JsFilterConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilter.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilterConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilter.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilterConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/NashornJsEvaluator.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/KeyValuePluginProperties.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPlugin.java 8(+4 -4)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPluginConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPlugin.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPluginConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingRuleMsgHandler.java 4(+2 -2)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/PendingRpcRequestMetadata.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/cmd/RpcRequest.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRestMsgHandler.java 12(+9 -3)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRuleMsgHandler.java 4(+2 -2)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/LocalRequestMetaData.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcManager.java 6(+3 -3)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPlugin.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPluginConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/AttributeData.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/AttributesSubscriptionCmd.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/GetHistoryCmd.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/SubscriptionCmd.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmd.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmdsWrapper.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TimeseriesSubscriptionCmd.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/BiPluginCallBack.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryFeature.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRestMsgHandler.java 29(+20 -9)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRpcMsgHandler.java 5(+3 -2)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRuleMsgHandler.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryWebsocketMsgHandler.java 10(+5 -5)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/Subscription.java 6(+5 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionErrorCode.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionState.java 3(+2 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionType.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionUpdate.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/SubscriptionManager.java 12(+9 -3)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TelemetryStoragePlugin.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TsData.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePlugin.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePluginConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessor.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessorConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessor.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessorConfiguration.java 2(+1 -1)
extensions-core/src/main/java/org/thingsboard/server/extensions/core/utils/VelocityUtils.java 2(+1 -1)
extensions-core/src/test/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterTest.java 2(+1 -1)
license-header-template.txt 2(+1 -1)
pom.xml 30(+27 -3)
resume.bat 2(+1 -1)
tools/pom.xml 4(+2 -2)
transport/coap/pom.xml 4(+2 -2)
transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/CoapTransportAdaptor.java 2(+1 -1)
transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/JsonCoapAdaptor.java 2(+1 -1)
transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DeviceEmulator.java 2(+1 -1)
transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportResource.java 14(+12 -2)
transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportService.java 31(+17 -14)
transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapExchangeObserverProxy.java 2(+1 -1)
transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionCtx.java 2(+1 -1)
transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionId.java 2(+1 -1)
transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTestConfiguration.java 2(+1 -1)
transport/http/pom.xml 4(+2 -2)
transport/http/src/main/java/org/thingsboard/server/transport/http/DeviceApiController.java 60(+48 -12)
transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionCtx.java 2(+1 -1)
transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionId.java 2(+1 -1)
transport/mqtt/pom.xml 4(+2 -2)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/JsonMqttAdaptor.java 2(+1 -1)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/MqttTransportAdaptor.java 2(+1 -1)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttSslHandlerProvider.java 2(+1 -1)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java 75(+42 -33)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportServerInitializer.java 22(+9 -13)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportService.java 11(+9 -2)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/DeviceSessionCtx.java 2(+1 -1)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewayDeviceSessionCtx.java 2(+1 -1)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java 21(+10 -11)
transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/MqttSessionId.java 2(+1 -1)
transport/pom.xml 4(+2 -2)
ui/package.json 2(+1 -1)
ui/pom.xml 4(+2 -2)
ui/server.js 2(+1 -1)
ui/src/app/admin/admin.controller.js 2(+1 -1)
ui/src/app/admin/admin.routes.js 2(+1 -1)
ui/src/app/admin/index.js 2(+1 -1)
ui/src/app/alarm/alarm.scss 3(+1 -2)
ui/src/app/alarm/alarm-row.tpl.html 2(+1 -1)
ui/src/app/alarm/index.js 3(+1 -2)
ui/src/app/api/admin.service.js 2(+1 -1)
ui/src/app/api/alarm.service.js 2(+1 -1)
ui/src/app/api/alias-controller.js 3(+1 -2)
ui/src/app/api/asset.service.js 2(+1 -1)
ui/src/app/api/attribute.service.js 2(+1 -1)
ui/src/app/api/audit-log.service.js 116(+116 -0)
ui/src/app/api/customer.service.js 2(+1 -1)
ui/src/app/api/dashboard.service.js 152(+105 -47)
ui/src/app/api/data-aggregator.js 3(+1 -2)
ui/src/app/api/datasource.service.js 2(+1 -1)
ui/src/app/api/device.service.js 29(+21 -8)
ui/src/app/api/entity.service.js 45(+36 -9)
ui/src/app/api/event.service.js 2(+1 -1)
ui/src/app/api/login.service.js 2(+1 -1)
ui/src/app/api/plugin.service.js 2(+1 -1)
ui/src/app/api/rule.service.js 2(+1 -1)
ui/src/app/api/subscription.js 3(+1 -2)
ui/src/app/api/tenant.service.js 2(+1 -1)
ui/src/app/api/time.service.js 2(+1 -1)
ui/src/app/api/user.service.js 15(+12 -3)
ui/src/app/api/widget.service.js 2(+1 -1)
ui/src/app/app.config.js 3(+2 -1)
ui/src/app/app.js 7(+5 -2)
ui/src/app/app.run.js 10(+8 -2)
ui/src/app/asset/add-asset.tpl.html 2(+1 -1)
ui/src/app/asset/asset.controller.js 2(+1 -1)
ui/src/app/asset/asset.directive.js 2(+1 -1)
ui/src/app/asset/asset.routes.js 2(+1 -1)
ui/src/app/asset/asset-card.tpl.html 2(+1 -1)
ui/src/app/asset/assets.tpl.html 8(+7 -1)
ui/src/app/asset/index.js 2(+1 -1)
ui/src/app/audit/audit-log.routes.js 44(+44 -0)
ui/src/app/audit/audit-log.scss 90(+90 -0)
ui/src/app/audit/audit-log-header.tpl.html 24(+24 -0)
ui/src/app/audit/audit-log-row.directive.js 67(+67 -0)
ui/src/app/audit/audit-log-row.tpl.html 36(+36 -0)
ui/src/app/audit/audit-logs.controller.js 23(+23 -0)
ui/src/app/audit/audit-logs.tpl.html 22(+22 -0)
ui/src/app/audit/audit-log-table.directive.js 262(+262 -0)
ui/src/app/audit/audit-log-table.tpl.html 68(+68 -0)
ui/src/app/audit/index.js 30(+30 -0)
ui/src/app/common/raf.provider.js 3(+1 -2)
ui/src/app/common/types.constant.js 66(+65 -1)
ui/src/app/common/utf8-support.js 3(+1 -2)
ui/src/app/common/utils.service.js 7(+4 -3)
ui/src/app/component/index.js 2(+1 -1)
ui/src/app/components/dashboard.scss 2(+1 -1)
ui/src/app/components/grid.scss 2(+1 -1)
ui/src/app/components/grid.tpl.html 2(+1 -1)
ui/src/app/components/js-func.scss 2(+1 -1)
ui/src/app/components/json-form.scss 2(+1 -1)
ui/src/app/components/legend.scss 3(+1 -2)
ui/src/app/components/menu-link.scss 2(+1 -1)
ui/src/app/components/side-menu.scss 2(+1 -1)
ui/src/app/customer/index.js 2(+1 -1)
ui/src/app/dashboard/dashboard.directive.js 31(+7 -24)
ui/src/app/dashboard/dashboard.scss 3(+1 -2)
ui/src/app/dashboard/dashboard-card.scss 26(+26 -0)
ui/src/app/dashboard/dashboard-fieldset.tpl.html 29(+17 -12)
ui/src/app/dashboard/dashboards.controller.js 228(+123 -105)
ui/src/app/dashboard/dashboards.tpl.html 33(+23 -10)
ui/src/app/dashboard/index.js 6(+3 -3)
ui/src/app/dashboard/states/index.js 3(+1 -2)
ui/src/app/device/device.directive.js 29(+16 -13)
ui/src/app/device/device.routes.js 2(+1 -1)
ui/src/app/device/devices.tpl.html 8(+7 -1)
ui/src/app/device/index.js 2(+1 -1)
ui/src/app/entity/entity-filter.scss 3(+1 -2)
ui/src/app/entity/entity-filter.tpl.html 10(+9 -1)
ui/src/app/entity/entity-list.scss 3(+1 -2)
ui/src/app/entity/entity-select.scss 3(+1 -2)
ui/src/app/entity/index.js 3(+1 -2)
ui/src/app/event/event.scss 2(+1 -1)
ui/src/app/event/event-table.tpl.html 13(+10 -3)
ui/src/app/event/index.js 2(+1 -1)
ui/src/app/extension/index.js 3(+1 -2)
ui/src/app/help/help.directive.js 2(+1 -1)
ui/src/app/help/help.scss 2(+1 -1)
ui/src/app/home/home-links.routes.js 2(+1 -1)
ui/src/app/home/home-links.scss 3(+1 -2)
ui/src/app/home/home-links.tpl.html 2(+1 -1)
ui/src/app/home/index.js 2(+1 -1)
ui/src/app/ie.support.js 3(+1 -2)
ui/src/app/import-export/index.js 2(+1 -1)
ui/src/app/jsonform/index.js 2(+1 -1)
ui/src/app/jsonform/jsonform.scss 2(+1 -1)
ui/src/app/layout/home.controller.js 3(+1 -2)
ui/src/app/layout/home.routes.js 2(+1 -1)
ui/src/app/layout/home.scss 2(+1 -1)
ui/src/app/layout/home.tpl.html 2(+1 -1)
ui/src/app/layout/index.js 4(+3 -1)
ui/src/app/layout/user-menu.scss 3(+1 -2)
ui/src/app/layout/user-menu.tpl.html 2(+1 -1)
ui/src/app/locale/locale.constant.js 54(+49 -5)
ui/src/app/login/index.js 2(+1 -1)
ui/src/app/login/login.controller.js 10(+9 -1)
ui/src/app/login/login.routes.js 2(+1 -1)
ui/src/app/login/login.scss 10(+9 -1)
ui/src/app/login/login.tpl.html 8(+3 -5)
ui/src/app/plugin/index.js 2(+1 -1)
ui/src/app/plugin/plugin.routes.js 2(+1 -1)
ui/src/app/plugin/plugin.scss 2(+1 -1)
ui/src/app/plugin/plugins.tpl.html 9(+8 -1)
ui/src/app/profile/index.js 2(+1 -1)
ui/src/app/profile/profile.routes.js 2(+1 -1)
ui/src/app/profile/profile.tpl.html 2(+1 -1)
ui/src/app/rule/add-rule.tpl.html 2(+1 -1)
ui/src/app/rule/index.js 2(+1 -1)
ui/src/app/rule/rule.controller.js 2(+1 -1)
ui/src/app/rule/rule.directive.js 2(+1 -1)
ui/src/app/rule/rule.routes.js 2(+1 -1)
ui/src/app/rule/rule.scss 2(+1 -1)
ui/src/app/rule/rule-card.tpl.html 2(+1 -1)
ui/src/app/rule/rules.tpl.html 9(+8 -1)
ui/src/app/services/clipboard.service.js 128(+128 -0)
ui/src/app/services/menu.service.js 18(+17 -1)
ui/src/app/services/toast.js 2(+1 -1)
ui/src/app/services/toast.scss 3(+1 -2)
ui/src/app/services/toast.service.js 2(+1 -1)
ui/src/app/tenant/index.js 2(+1 -1)
ui/src/app/tenant/tenant.routes.js 2(+1 -1)
ui/src/app/tenant/tenants.tpl.html 3(+1 -2)
ui/src/app/url.handler.js 3(+1 -2)
ui/src/app/user/add-user.tpl.html 2(+1 -1)
ui/src/app/user/index.js 2(+1 -1)
ui/src/app/user/user.controller.js 4(+3 -1)
ui/src/app/user/user.directive.js 3(+1 -2)
ui/src/app/user/user.routes.js 2(+1 -1)
ui/src/app/user/user-card.tpl.html 2(+1 -1)
ui/src/app/user/user-fieldset.scss 3(+1 -2)
ui/src/app/user/users.tpl.html 24(+17 -7)
ui/src/app/widget/index.js 2(+1 -1)
ui/src/app/widget/lib/flot-widget.js 84(+65 -19)
ui/src/app/widget/lib/google-map.js 2(+1 -1)
ui/src/app/widget/lib/image-map.js 2(+1 -1)
ui/src/app/widget/lib/map-widget.js 4(+2 -2)
ui/src/app/widget/lib/map-widget2.js 2(+1 -1)
ui/src/app/widget/lib/rpc/index.js 3(+1 -2)
ui/src/app/widget/lib/rpc/knob.scss 3(+1 -2)
ui/src/app/widget/lib/tencent-map.js 3(+1 -2)
ui/src/app/widget/widget-editor.scss 2(+1 -1)
ui/src/index.html 2(+1 -1)
ui/src/scss/animations.scss 2(+1 -1)
ui/src/scss/constants.scss 2(+1 -1)
ui/src/scss/fonts.scss 2(+1 -1)
ui/src/scss/main.scss 15(+14 -1)
ui/src/scss/mixins.scss 2(+1 -1)
ui/src/vendor/css.js/css.js 3(+2 -1)
ui/webpack.config.dev.js 2(+1 -1)
ui/webpack.config.js 2(+1 -1)
ui/webpack.config.prod.js 2(+1 -1)
Details
application/build.gradle 3(+1 -2)
diff --git a/application/build.gradle b/application/build.gradle
index 1d8a526..0176169 100644
--- a/application/build.gradle
+++ b/application/build.gradle
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
application/pom.xml 4(+2 -2)
diff --git a/application/pom.xml b/application/pom.xml
index e5a4a4e..8449246 100644
--- a/application/pom.xml
+++ b/application/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
diff --git a/application/src/main/assembly/windows.xml b/application/src/main/assembly/windows.xml
index 5c6e0ee..ab8ac6a 100644
--- a/application/src/main/assembly/windows.xml
+++ b/application/src/main/assembly/windows.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/application/src/main/conf/logback.xml b/application/src/main/conf/logback.xml
index a5af6cd..ea670d6 100644
--- a/application/src/main/conf/logback.xml
+++ b/application/src/main/conf/logback.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/application/src/main/conf/thingsboard.conf b/application/src/main/conf/thingsboard.conf
index 5ca6f26..a6e404d 100644
--- a/application/src/main/conf/thingsboard.conf
+++ b/application/src/main/conf/thingsboard.conf
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
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 ddb90db..803f1d3 100644
--- a/application/src/main/data/json/system/widget_bundles/cards.json
+++ b/application/src/main/data/json/system/widget_bundles/cards.json
@@ -66,7 +66,7 @@
"controllerScript": "self.onInit = function() {\n self.ctx.varsRegex = /\\$\\{([^\\}]*)\\}/g;\n self.ctx.htmlSet = false;\n \n var cssParser = new cssjs();\n cssParser.testMode = false;\n var namespace = 'html-value-card-' + hashCode(self.ctx.settings.cardCss);\n cssParser.cssPreviewNamespace = namespace;\n cssParser.createStyleElement(namespace, self.ctx.settings.cardCss);\n self.ctx.$container.addClass(namespace);\n self.ctx.html = self.ctx.settings.cardHtml;\n self.ctx.replaceInfo = processHtmlPattern(self.ctx.html, self.ctx.data);\n \n updateHtml();\n \n function hashCode(str) {\n var hash = 0;\n var i, char;\n if (str.length === 0) return hash;\n for (i = 0; i < str.length; i++) {\n char = str.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash;\n }\n return hash;\n }\n \n function processHtmlPattern(pattern, data) {\n var match = self.ctx.varsRegex.exec(pattern);\n var replaceInfo = {};\n replaceInfo.variables = [];\n while (match !== null) {\n var variableInfo = {};\n variableInfo.dataKeyIndex = -1;\n var variable = match[0];\n var label = match[1];\n var valDec = 2;\n var splitVals = label.split(':');\n if (splitVals.length > 1) {\n label = splitVals[0];\n valDec = parseFloat(splitVals[1]);\n }\n variableInfo.variable = variable;\n variableInfo.valDec = valDec;\n if (label == 'entityName') {\n variableInfo.isEntityName = true;\n } else if (label.startsWith('#')) {\n var keyIndexStr = label.substring(1);\n var n = Math.floor(Number(keyIndexStr));\n if (String(n) === keyIndexStr && n >= 0) {\n variableInfo.dataKeyIndex = n;\n }\n }\n if (!variableInfo.isEntityName && variableInfo.dataKeyIndex === -1) {\n for (var i = 0; i < data.length; i++) {\n var datasourceData = data[i];\n var dataKey = datasourceData.dataKey;\n if (dataKey.label === label) {\n variableInfo.dataKeyIndex = i;\n break;\n }\n }\n }\n replaceInfo.variables.push(variableInfo);\n match = self.ctx.varsRegex.exec(pattern);\n }\n return replaceInfo;\n } \n}\n\nself.onDataUpdated = function() {\n updateHtml();\n}\n\nself.onDestroy = function() {\n}\n\nfunction isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n}\n\nfunction padValue(val, dec, int) {\n var i = 0;\n var s, strVal, n;\n\n val = parseFloat(val);\n n = (val < 0);\n val = Math.abs(val);\n\n if (dec > 0) {\n strVal = val.toFixed(dec).toString().split('.');\n s = int - strVal[0].length;\n\n for (; i < s; ++i) {\n strVal[0] = '0' + strVal[0];\n }\n\n strVal = (n ? '-' : '') + strVal[0] + '.' + strVal[1];\n }\n\n else {\n strVal = Math.round(val).toString();\n s = int - strVal.length;\n\n for (; i < s; ++i) {\n strVal = '0' + strVal;\n }\n\n strVal = (n ? '-' : '') + strVal;\n }\n\n return strVal;\n}\n\nfunction updateHtml() {\n var text = self.ctx.html;\n var updated = false;\n for (var v in self.ctx.replaceInfo.variables) {\n var variableInfo = self.ctx.replaceInfo.variables[v];\n var txtVal = '';\n if (variableInfo.dataKeyIndex > -1) {\n var varData = self.ctx.data[variableInfo.dataKeyIndex].data;\n if (varData.length > 0) {\n var val = varData[varData.length-1][1];\n if (isNumber(val)) {\n txtVal = padValue(val, variableInfo.valDec, 0);\n } else {\n txtVal = val;\n }\n }\n } else if (variableInfo.isEntityName) {\n if (self.ctx.defaultSubscription.datasources.length) {\n txtVal = self.ctx.defaultSubscription.datasources[0].entityName;\n } else {\n txtVal = 'Unknown';\n }\n }\n if (typeof variableInfo.lastVal === undefined ||\n variableInfo.lastVal !== txtVal) {\n updated = true;\n variableInfo.lastVal = txtVal;\n }\n text = text.split(variableInfo.variable).join(txtVal);\n }\n if (updated || !self.ctx.htmlSet) {\n self.ctx.$container.html(text);\n if (!self.ctx.htmlSet) {\n self.ctx.htmlSet = true;\n }\n }\n}\n\n",
"settingsSchema": "{\n \"schema\": {\n \"type\": \"object\",\n \"title\": \"Settings\",\n \"required\": [\"cardHtml\"],\n \"properties\": {\n \"cardCss\": {\n \"title\": \"CSS\",\n \"type\": \"string\",\n \"default\": \".card {\\n font-weight: bold; \\n}\"\n },\n \"cardHtml\": {\n \"title\": \"HTML\",\n \"type\": \"string\",\n \"default\": \"<div class='card'>HTML code here</div>\"\n }\n }\n },\n \"form\": [\n {\n \"key\": \"cardCss\",\n \"type\": \"css\"\n }, \n {\n \"key\": \"cardHtml\",\n \"type\": \"html\"\n } \n ]\n}",
"dataKeySettingsSchema": "{}\n",
- "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"My value\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.random() * 5.45;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"cardCss\":\".card {\\n width: 100%;\\n height: 100%;\\n border: 2px solid #ccc;\\n box-sizing: border-box;\\n}\\n\\n.card .content {\\n padding: 20px;\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n justify-content: space-around;\\n height: 100%;\\n box-sizing: border-box;\\n}\\n\\n.card .content .column {\\n display: flex;\\n flex-direction: column; \\n justify-content: space-around;\\n height: 100%;\\n}\\n\\n.card h1 {\\n text-transform: uppercase;\\n color: #999;\\n font-size: 20px;\\n font-weight: bold;\\n margin: 0;\\n padding-bottom: 10px;\\n line-height: 32px;\\n}\\n\\n.card .value {\\n font-size: 38px;\\n font-weight: 200;\\n}\\n\\n.card .description {\\n font-size: 20px;\\n color: #999;\\n}\\n\",\"cardHtml\":\"<div class='card'>\\n <div class='content'>\\n <div class='column'>\\n <h1>Value title</h1>\\n <div class='value'>\\n ${My value:2} units.\\n </div> \\n <div class='description'>\\n Value description text\\n </div>\\n </div>\\n <img height=\\\"80px\\\" src=\\\"https://thingsboard.io/images/logo_small.png\\\" />\\n </div>\\n</div>\"},\"title\":\"HTML Value Card\",\"dropShadow\":false,\"enableFullscreen\":true,\"widgetStyle\":{},\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"useDashboardTimewindow\":true,\"showLegend\":false,\"actions\":{}}"
+ "defaultConfig": "{\"datasources\":[{\"type\":\"function\",\"name\":\"function\",\"dataKeys\":[{\"name\":\"f(x)\",\"type\":\"function\",\"label\":\"My value\",\"color\":\"#2196f3\",\"settings\":{},\"_hash\":0.15479322438769105,\"funcBody\":\"return Math.random() * 5.45;\"}]}],\"timewindow\":{\"realtime\":{\"timewindowMs\":60000}},\"showTitle\":false,\"backgroundColor\":\"#fff\",\"color\":\"rgba(0, 0, 0, 0.87)\",\"padding\":\"0px\",\"settings\":{\"cardCss\":\".card {\\n width: 100%;\\n height: 100%;\\n border: 2px solid #ccc;\\n box-sizing: border-box;\\n}\\n\\n.card .content {\\n padding: 20px;\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n justify-content: space-around;\\n height: 100%;\\n box-sizing: border-box;\\n}\\n\\n.card .content .column {\\n display: flex;\\n flex-direction: column; \\n justify-content: space-around;\\n height: 100%;\\n}\\n\\n.card h1 {\\n text-transform: uppercase;\\n color: #999;\\n font-size: 20px;\\n font-weight: bold;\\n margin: 0;\\n padding-bottom: 10px;\\n line-height: 32px;\\n}\\n\\n.card .value {\\n font-size: 38px;\\n font-weight: 200;\\n}\\n\\n.card .description {\\n font-size: 20px;\\n color: #999;\\n}\\n\",\"cardHtml\":\"<div class='card'>\\n <div class='content'>\\n <div class='column'>\\n <h1>Value title</h1>\\n <div class='value'>\\n ${My value:2} units.\\n </div> \\n <div class='description'>\\n Value description text\\n </div>\\n </div>\\n <img height=\\\"80px\\\" src=\\\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIwIiB3aWR0aD0iMzIwIj48ZyBzdHJva2Utd2lkdGg9IjI4Ij48ZyBmaWxsPSIjMzA1NjgwIiBjb2xvcj0iIzAwMCIgd2hpdGUtc3BhY2U9Im5vcm1hbCI+PHBhdGggc3R5bGU9InRleHQtZGVjb3JhdGlvbi1jb2xvcjojMDAwO2lzb2xhdGlvbjphdXRvO21peC1ibGVuZC1tb2RlOm5vcm1hbDtibG9jay1wcm9ncmVzc2lvbjp0Yjt0ZXh0LWRlY29yYXRpb24tbGluZTpub25lO3RleHQtZGVjb3JhdGlvbi1zdHlsZTpzb2xpZDt0ZXh0LWluZGVudDowO3RleHQtdHJhbnNmb3JtOm5vbmUiIGQ9Ik0xNTEuMTMgMGMtMjguMzYzIDAtNTQuOTE1IDcuOTE1LTc3LjYxMyAyMS41MzdhMzYuNTc4IDM2LjU3OCAwIDAgMC0yMy4wNjctOC4xOTQgOC43NjYgOC43NjYgMCAwIDAtLjAwNCAwYy0yMC4xNTQuMDAxLTM2LjY3OSAxNi41MjgtMzYuNjc4IDM2LjY4MmE4Ljc2NiA4Ljc2NiAwIDAgMCAwIC4wMSAzNi42OSAzNi42OSAwIDAgMCA4LjEwNCAyMi45MjhjLTEzLjgzIDIyLjgzLTIxLjg3IDQ5LjU4LTIxLjg3IDc4LjE3YTguNzY2IDguNzY2IDAgMSAwIDE3LjUzIDBjMC0yNC43MDIgNi43Mi00Ny43NDggMTguMzc5LTY3LjU3NCA0LjU2NiAxLjk4NSA5LjQ3MiAzLjE1IDE0LjUxOSAzLjE1N2E4Ljc2NiA4Ljc2NiAwIDAgMCAuMDEyIDBjMjAuMTU1IDAgMzYuNjgzLTE2LjUyNyAzNi42ODItMzYuNjgyYTguNzY2IDguNzY2IDAgMCAwIDAtLjAwNGMtLjAwMS01LTEuMTM4LTkuODYzLTMuMDgzLTE0LjM5NyAxOS43MTctMTEuNDg0IDQyLjU4NS0xOC4wOTUgNjcuMDg1LTE4LjA5NWE4Ljc2NiA4Ljc2NiAwIDEgMCAwLTE3LjUzek01MC40NCAzMC44OGM1LjkxMy4wMDIgMTEuMTkxIDIuNTEyIDE0LjgzNiA3LjA3N2E4Ljc2NiA4Ljc2NiAwIDAgMCAuMTgzLjIxNCAxOS4xMzcgMTkuMTM3IDAgMCAxIDQuMTM0IDExLjg2M2MtLjAwMiAxMC42NzctOC40NjggMTkuMTQ0LTE5LjE0NCAxOS4xNDhhMTkuMTQ1IDE5LjE0NSAwIDAgMS0xMi00LjI1NCA4Ljc2NiA4Ljc2NiAwIDAgMC0uMDEzLS4wMSAxOS4xMzYgMTkuMTM2IDAgMCAxLTcuMTQ0LTE0Ljg5MmMuMDAzLTEwLjY3NyA4LjQ3LTE5LjE0NCAxOS4xNDgtMTkuMTQ2eiIvPjxwYXRoIHN0eWxlPSJ0ZXh0LWRlY29yYXRpb24tY29sb3I6IzAwMDtpc29sYXRpb246YXV0bzttaXgtYmxlbmQtbW9kZTpub3JtYWw7YmxvY2stcHJvZ3Jlc3Npb246dGI7dGV4dC1kZWNvcmF0aW9uLWxpbmU6bm9uZTt0ZXh0LWRlY29yYXRpb24tc3R5bGU6c29saWQ7dGV4dC1pbmRlbnQ6MDt0ZXh0LXRyYW5zZm9ybTpub25lIiBkPSJNNjYuOTkyIDEwMi44M2E4LjE4NyA4LjE4NyAwIDAgMC0yLjI1OCA2LjA3MSA4LjYwNCA4LjYwNCAwIDAgMCAyLjMzOCA1LjUxOGM2LjgwNSA2Ljg1NiAyMC4yMjMgMjAuMjIzIDIwLjIyMyAyMC4yMjNsMTEuODQ0LTExLjgzcy0xMi45NzMtMTIuOTYxLTIwLjE3Ni0yMC4xNzFjLTEuNjA0LTEuNjMyLTMuNzUtMi4zMTQtNi4wMTItMi4zMjRhOC4xNSA4LjE1IDAgMCAwLTUuOTYgMi41MTJ6bTMyLjE0NyAxOS45ODNMNjIuNSAxNTkuNDUyYy0zLjk3NSAzLjk3Ni0zLjk3NSAxMC40MjEgMCAxNC4zOTdsMTguMTU2IDE4LjE1NiAzMS43NTMgMzEuNzUzIDMwLjQ3OCAzMC40NzhjMy45NzYgMy45NzYgMTAuNDIyIDMuOTc2IDE0LjM5OCAwbDI0Ljc5MS0yNC43OTEgMzcuOTE0LTM3LjkxNCAzNi42MzktMzYuNjM5YzMuOTc1LTMuOTc2IDMuOTc1LTEwLjQyMiAwLTE0LjM5OGwtMTguNjMtMTguNjMtMzEuNzUtMzEuNzYtMzAuMDEtMzBjLTMuOTc3LTMuOTc1LTEwLjQyMi0zLjk3NS0xNC4zOTggMGwtMjQuNzkgMjQuNzktMzcuOTEgMzcuOTF6bTM3LjkxMS0zNy45MXMtMTIuOTczLTEyLjk2MS0yMC4xNzYtMjAuMTcxYy0xLjYwNC0xLjYzMi0zLjc1LTIuMzE0LTYuMDEyLTIuMzI0LTQuNzE3LS4wMjMtOC40MzQgMy44NjEtOC4yMTcgOC41ODNhOC42MDQgOC42MDQgMCAwIDAgMi4zMzcgNS41MThjNi44MDUgNi44NTYgMjAuMjIzIDIwLjIyMyAyMC4yMjMgMjAuMjIzbDExLjg0NC0xMS44M3ptNjkuMTkzIDUuMjEzczEyLjk2MS0xMi45NzMgMjAuMTcxLTIwLjE3NmMxLjYzMy0xLjYwNCAyLjMxNC0zLjc1IDIuMzI0LTYuMDEyLjAyMy00LjcxNi0zLjg2MS04LjQzNC04LjU4My04LjIxN2E4LjYwNCA4LjYwNCAwIDAgMC01LjUxOCAyLjMzOGMtNi44NTYgNi44MDUtMjAuMjIzIDIwLjIyMy0yMC4yMjMgMjAuMjIzbDExLjgzIDExLjg0NHptMzEuNzUzIDMxLjc1M3MxMi45NjEtMTIuOTczIDIwLjE3MS0yMC4xNzZjMS42MzMtMS42MDQgMi4zMTQtMy43NSAyLjMyNC02LjAxMi4wMjMtNC43MTYtMy44NjEtOC40MzQtOC41ODMtOC4yMTdhOC42MDQgOC42MDQgMCAwIDAtNS41MTggMi4zMzhjLTYuODU2IDYuODA1LTIwLjIyMyAyMC4yMjMtMjAuMjIzIDIwLjIyM2wxMS44MyAxMS44NDR6bS0xOC4wMDkgNjkuNjY3czEyLjk3MyAxMi45NjEgMjAuMTc4IDIwLjE3YzEuNjA0IDEuNjMyIDMuNzUgMi4zMTMgNi4wMTIgMi4zMjQgNC43MTcuMDIyIDguNDM0LTMuODYyIDguMjE3LTguNTg0bC0uMDAyLjAwMmE4LjYwNiA4LjYwNiAwIDAgMC0yLjMzOC01LjUxOGMtNi44MDUtNi44NTYtMjAuMjIyLTIwLjIyMi0yMC4yMjItMjAuMjIybC0xMS44NDQgMTEuODN6bS0zNy45MTQgMzcuOTE0czEyLjk3MyAxMi45NjEgMjAuMTc4IDIwLjE3YzEuNjA0IDEuNjMyIDMuNzUgMi4zMTMgNi4wMTIgMi4zMjMgNC43MTcuMDIzIDguNDM0LTMuODYxIDguMjE3LTguNTgzaC0uMDAyYTguNjAzIDguNjAzIDAgMCAwLTIuMzM3LTUuNTE4Yy02LjgwNS02Ljg1Ni0yMC4yMjMtMjAuMjIzLTIwLjIyMy0yMC4yMjNsLTExLjg0NCAxMS44M3ptLTY5LjY2Ny01LjY4N3MtMTIuOTYxIDEyLjk3My0yMC4xNjkgMjAuMTc4Yy0xLjYzMiAxLjYwNC0yLjMxNCAzLjc1LTIuMzI0IDYuMDEyLS4wMjMgNC43MTcgMy44NjEgOC40MzQgOC41ODMgOC4yMTdoLS4wMDJhOC42MDIgOC42MDIgMCAwIDAgNS41MTgtMi4zMzdjNi44NTYtNi44MDUgMjAuMjIzLTIwLjIyMyAyMC4yMjMtMjAuMjIzbC0xMS44Mi0xMS44NHptLTMxLjc0My0zMS43NHMtMTIuOTYxIDEyLjk3My0yMC4xNjkgMjAuMTc4Yy0xLjYzMiAxLjYwNC0yLjMxNCAzLjc1LTIuMzI0IDYuMDEyLS4wMjMgNC43MTcgMy44NjEgOC40MzQgOC41ODMgOC4yMTdoLS4wMDJhOC42MDQgOC42MDQgMCAwIDAgNS41MTgtMi4zMzdjNi44NTYtNi44MDUgMjAuMjIzLTIwLjIyMyAyMC4yMjMtMjAuMjIzbC0xMS44My0xMS44NXpNMTY3LjkgMTAxLjQ3YzEuNjgtMS43MDYgMy45NjctMi42NiA2LjI5Ny0yLjYyNmE3Ljg5IDcuODkgMCAwIDEgNC41NjMgMS41MWwxNi40OTkgMTIuMWMzLjIgMi4yOTcgNC4xNDQgNi42NTkgMi4yMyAxMC4zMTItMS45MTMgMy42NTMtNi4xMjMgNS41MjQtOS45NSA0LjQyM2w2LjEyNCAyMy45NDhjMS4xMTMgNC4zNTEtMS41NjQgOC45NjctNS45ODQgMTAuMzE3bC00NC42NDIgMTMuNjMgOC4yNDYgMzEuODg0YzEuMTczIDQuMzctMS41MDIgOS4wNDQtNS45NTUgMTAuNDA3cy04Ljk3NS0xLjExMS0xMC4wNjgtNS41MDVsLTEwLjI4Mi0zOS43N2MtMS4xMjYtNC4zNTUgMS41NS04Ljk4NCA1Ljk3Ni0xMC4zMzdsNDQuNjYxLTEzLjYzNy00LjEyMi0xNi4xMThjLTIuNzYzIDMuMDY0LTcuMjMzIDMuODA4LTEwLjU4NiAxLjc2MS0zLjM1My0yLjA0Ny00LjYxNC02LjI5LTIuOTg2LTEwLjA0N2w4LjExNy0xOS40NTRhOC44NzIgOC44NzIgMCAwIDEgMS44NjMtMi43OTd6IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48cGF0aCBzdHlsZT0idGV4dC1kZWNvcmF0aW9uLWNvbG9yOiMwMDA7aXNvbGF0aW9uOmF1dG87bWl4LWJsZW5kLW1vZGU6bm9ybWFsO2Jsb2NrLXByb2dyZXNzaW9uOnRiO3RleHQtZGVjb3JhdGlvbi1saW5lOm5vbmU7dGV4dC1kZWNvcmF0aW9uLXN0eWxlOnNvbGlkO3RleHQtaW5kZW50OjA7dGV4dC10cmFuc2Zvcm06bm9uZSIgZD0iTTE2OC44NyAzMjAuMDRjMjguMzYzIDAgNTQuOTE1LTcuOTE1IDc3LjYxNC0yMS41MzhhMzYuNTc4IDM2LjU3OCAwIDAgMCAyMy4wNjcgOC4xOTQgOC43NjYgOC43NjYgMCAwIDAgLjAwNCAwYzIwLjE1NSAwIDM2LjY4LTE2LjUyOCAzNi42NzktMzYuNjgyYTguNzY2IDguNzY2IDAgMCAwIDAtLjAxMSAzNi42ODggMzYuNjg4IDAgMCAwLTguMTAzLTIyLjkyN2MxMy44MjUtMjIuODIgMjEuODY2LTQ5LjU3MiAyMS44NjYtNzguMTYyYTguNzY2IDguNzY2IDAgMSAwLTE3LjUzMSAwYzAgMjQuNzAzLTYuNzIgNDcuNzQ5LTE4LjM3OCA2Ny41NzUtNC41NjctMS45ODUtOS40NzMtMy4xNS0xNC41Mi0zLjE1N2E4Ljc2NiA4Ljc2NiAwIDAgMC0uMDEyIDBjLTIwLjE1NS0uMDAxLTM2LjY4MyAxNi41MjctMzYuNjgyIDM2LjY4Mi4wMDIgNC45OTkgMS4xMzkgOS44NjIgMy4wODMgMTQuMzk3LTE5LjcxNyAxMS40ODQtNDIuNTg2IDE4LjA5NS02Ny4wODYgMTguMDk1YTguNzY2IDguNzY2IDAgMSAwIDAgMTcuNTN6bTEwMC42OS0zMC44NzVjLTUuOTEzIDAtMTEuMTkxLTIuNTEyLTE0LjgzNi03LjA3N2E4Ljc2NiA4Ljc2NiAwIDAgMC0uMTgzLS4yMTQgMTkuMTM2IDE5LjEzNiAwIDAgMS00LjEzNC0xMS44NjNjLjAwMi0xMC42NzcgOC40NjgtMTkuMTQ0IDE5LjE0NC0xOS4xNDhhMTkuMTQ1IDE5LjE0NSAwIDAgMSAxMiA0LjI1NCA4Ljc2NiA4Ljc2NiAwIDAgMCAuMDEzLjAxIDE5LjEzNiAxOS4xMzYgMCAwIDEgNy4xNDQgMTQuODkyYy0uMDAzIDEwLjY3Ny04LjQ3IDE5LjE0NS0xOS4xNDggMTkuMTQ2eiIvPjwvZz48L2c+PC9zdmc+\\\" />\\n </div>\\n</div>\"},\"title\":\"HTML Value Card\",\"dropShadow\":false,\"enableFullscreen\":true,\"widgetStyle\":{},\"titleStyle\":{\"fontSize\":\"16px\",\"fontWeight\":400},\"useDashboardTimewindow\":true,\"showLegend\":false,\"actions\":{}}"
}
},
{
diff --git a/application/src/main/data/upgrade/1.3.0/schema_update.cql b/application/src/main/data/upgrade/1.3.0/schema_update.cql
index 1e4302d..55e0a8c 100644
--- a/application/src/main/data/upgrade/1.3.0/schema_update.cql
+++ b/application/src/main/data/upgrade/1.3.0/schema_update.cql
@@ -1,5 +1,5 @@
--
--- Copyright © 2016-2017 The Thingsboard Authors
+-- Copyright © 2016-2018 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.
diff --git a/application/src/main/data/upgrade/1.3.1/schema_update.sql b/application/src/main/data/upgrade/1.3.1/schema_update.sql
index 5a4ef4f..78b8aff 100644
--- a/application/src/main/data/upgrade/1.3.1/schema_update.sql
+++ b/application/src/main/data/upgrade/1.3.1/schema_update.sql
@@ -1,5 +1,5 @@
--
--- Copyright © 2016-2017 The Thingsboard Authors
+-- Copyright © 2016-2018 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.
diff --git a/application/src/main/data/upgrade/1.4.0/schema_update.cql b/application/src/main/data/upgrade/1.4.0/schema_update.cql
new file mode 100644
index 0000000..19585c6
--- /dev/null
+++ b/application/src/main/data/upgrade/1.4.0/schema_update.cql
@@ -0,0 +1,112 @@
+--
+-- Copyright © 2016-2018 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.
+--
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_entity_id (
+ tenant_id timeuuid,
+ id timeuuid,
+ customer_id timeuuid,
+ entity_id timeuuid,
+ entity_type text,
+ entity_name text,
+ user_id timeuuid,
+ user_name text,
+ action_type text,
+ action_data text,
+ action_status text,
+ action_failure_details text,
+ PRIMARY KEY ((tenant_id, entity_id, entity_type), id)
+);
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_customer_id (
+ tenant_id timeuuid,
+ id timeuuid,
+ customer_id timeuuid,
+ entity_id timeuuid,
+ entity_type text,
+ entity_name text,
+ user_id timeuuid,
+ user_name text,
+ action_type text,
+ action_data text,
+ action_status text,
+ action_failure_details text,
+ PRIMARY KEY ((tenant_id, customer_id), id)
+);
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_user_id (
+ tenant_id timeuuid,
+ id timeuuid,
+ customer_id timeuuid,
+ entity_id timeuuid,
+ entity_type text,
+ entity_name text,
+ user_id timeuuid,
+ user_name text,
+ action_type text,
+ action_data text,
+ action_status text,
+ action_failure_details text,
+ PRIMARY KEY ((tenant_id, user_id), id)
+);
+
+
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_tenant_id (
+ tenant_id timeuuid,
+ id timeuuid,
+ partition bigint,
+ customer_id timeuuid,
+ entity_id timeuuid,
+ entity_type text,
+ entity_name text,
+ user_id timeuuid,
+ user_name text,
+ action_type text,
+ action_data text,
+ action_status text,
+ action_failure_details text,
+ PRIMARY KEY ((tenant_id, partition), id)
+);
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_tenant_id_partitions (
+ tenant_id timeuuid,
+ partition bigint,
+ PRIMARY KEY (( tenant_id ), partition)
+) WITH CLUSTERING ORDER BY ( partition ASC )
+AND compaction = { 'class' : 'LeveledCompactionStrategy' };
+
+DROP MATERIALIZED VIEW IF EXISTS thingsboard.dashboard_by_tenant_and_search_text;
+DROP MATERIALIZED VIEW IF EXISTS thingsboard.dashboard_by_customer_and_search_text;
+
+DROP TABLE IF EXISTS thingsboard.dashboard;
+
+CREATE TABLE IF NOT EXISTS thingsboard.dashboard (
+ id timeuuid,
+ tenant_id timeuuid,
+ title text,
+ search_text text,
+ assigned_customers text,
+ configuration text,
+ PRIMARY KEY (id, tenant_id)
+);
+
+CREATE MATERIALIZED VIEW IF NOT EXISTS thingsboard.dashboard_by_tenant_and_search_text AS
+ SELECT *
+ from thingsboard.dashboard
+ WHERE tenant_id IS NOT NULL AND search_text IS NOT NULL AND id IS NOT NULL
+ PRIMARY KEY ( tenant_id, search_text, id )
+ WITH CLUSTERING ORDER BY ( search_text ASC, id DESC );
+
diff --git a/application/src/main/data/upgrade/1.4.0/schema_update.sql b/application/src/main/data/upgrade/1.4.0/schema_update.sql
new file mode 100644
index 0000000..769f381
--- /dev/null
+++ b/application/src/main/data/upgrade/1.4.0/schema_update.sql
@@ -0,0 +1,41 @@
+--
+-- Copyright © 2016-2018 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.
+--
+
+CREATE TABLE IF NOT EXISTS audit_log (
+ id varchar(31) NOT NULL CONSTRAINT audit_log_pkey PRIMARY KEY,
+ tenant_id varchar(31),
+ customer_id varchar(31),
+ entity_id varchar(31),
+ entity_type varchar(255),
+ entity_name varchar(255),
+ user_id varchar(31),
+ user_name varchar(255),
+ action_type varchar(255),
+ action_data varchar(1000000),
+ action_status varchar(255),
+ action_failure_details varchar(1000000)
+);
+
+DROP TABLE IF EXISTS dashboard;
+
+CREATE TABLE IF NOT EXISTS dashboard (
+ id varchar(31) NOT NULL CONSTRAINT dashboard_pkey PRIMARY KEY,
+ configuration varchar(10000000),
+ assigned_customers varchar(1000000),
+ search_text varchar(255),
+ tenant_id varchar(31),
+ title varchar(255)
+);
diff --git a/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java b/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java
index f45028a..77953c9 100644
--- a/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java
+++ b/application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -40,6 +40,7 @@ import org.thingsboard.server.controller.plugin.PluginWebSocketMsgEndpoint;
import org.thingsboard.server.dao.alarm.AlarmService;
import org.thingsboard.server.dao.asset.AssetService;
import org.thingsboard.server.dao.attributes.AttributesService;
+import org.thingsboard.server.dao.audit.AuditLogService;
import org.thingsboard.server.dao.customer.CustomerService;
import org.thingsboard.server.dao.device.DeviceService;
import org.thingsboard.server.dao.event.EventService;
@@ -114,6 +115,9 @@ public class ActorSystemContext {
@Getter private RelationService relationService;
@Autowired
+ @Getter private AuditLogService auditLogService;
+
+ @Autowired
@Getter @Setter private PluginWebSocketMsgEndpoint wsMsgEndpoint;
@Value("${actors.session.sync.timeout}")
diff --git a/application/src/main/java/org/thingsboard/server/actors/app/AppActor.java b/application/src/main/java/org/thingsboard/server/actors/app/AppActor.java
index d2d4dce..b475277 100644
--- a/application/src/main/java/org/thingsboard/server/actors/app/AppActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/app/AppActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/device/DeviceActor.java b/application/src/main/java/org/thingsboard/server/actors/device/DeviceActor.java
index 29b1589..861c405 100644
--- a/application/src/main/java/org/thingsboard/server/actors/device/DeviceActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/device/DeviceActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java b/application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java
index 14ff096..21112bf 100644
--- a/application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/device/SessionInfo.java b/application/src/main/java/org/thingsboard/server/actors/device/SessionInfo.java
index 3eb92a5..e039b96 100644
--- a/application/src/main/java/org/thingsboard/server/actors/device/SessionInfo.java
+++ b/application/src/main/java/org/thingsboard/server/actors/device/SessionInfo.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/device/ToDeviceRpcRequestMetadata.java b/application/src/main/java/org/thingsboard/server/actors/device/ToDeviceRpcRequestMetadata.java
index 2dd0b27..01342fd 100644
--- a/application/src/main/java/org/thingsboard/server/actors/device/ToDeviceRpcRequestMetadata.java
+++ b/application/src/main/java/org/thingsboard/server/actors/device/ToDeviceRpcRequestMetadata.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginActor.java b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginActor.java
index 719a536..265da38 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginActorMessageProcessor.java b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginActorMessageProcessor.java
index c388748..6e78e20 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginActorMessageProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginActorMessageProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginCallbackMessage.java b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginCallbackMessage.java
index b78a505..539a874 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginCallbackMessage.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginCallbackMessage.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java
index d2d9b7a..ce95ee4 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginProcessingContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -26,6 +26,7 @@ import org.thingsboard.server.common.data.Device;
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.audit.ActionType;
import org.thingsboard.server.common.data.id.*;
import org.thingsboard.server.common.data.kv.AttributeKey;
import org.thingsboard.server.common.data.kv.AttributeKvEntry;
@@ -41,9 +42,7 @@ import org.thingsboard.server.extensions.api.device.DeviceAttributesEventNotific
import org.thingsboard.server.extensions.api.plugins.PluginApiCallSecurityContext;
import org.thingsboard.server.extensions.api.plugins.PluginCallback;
import org.thingsboard.server.extensions.api.plugins.PluginContext;
-import org.thingsboard.server.extensions.api.plugins.msg.PluginToRuleMsg;
-import org.thingsboard.server.extensions.api.plugins.msg.TimeoutMsg;
-import org.thingsboard.server.extensions.api.plugins.msg.ToDeviceRpcRequest;
+import org.thingsboard.server.extensions.api.plugins.msg.*;
import org.thingsboard.server.extensions.api.plugins.rpc.PluginRpcMsg;
import org.thingsboard.server.extensions.api.plugins.rpc.RpcMsg;
import org.thingsboard.server.extensions.api.plugins.ws.PluginWebsocketSessionRef;
@@ -197,6 +196,52 @@ public final class PluginProcessingContext implements PluginContext {
}
@Override
+ public void logAttributesUpdated(PluginApiCallSecurityContext ctx, EntityId entityId, String attributeType,
+ List<AttributeKvEntry> attributes, Exception e) {
+ pluginCtx.auditLogService.logEntityAction(
+ ctx.getTenantId(),
+ ctx.getCustomerId(),
+ ctx.getUserId(),
+ ctx.getUserName(),
+ (UUIDBased & EntityId)entityId,
+ null,
+ ActionType.ATTRIBUTES_UPDATED,
+ e,
+ attributeType,
+ attributes);
+ }
+
+ @Override
+ public void logAttributesDeleted(PluginApiCallSecurityContext ctx, EntityId entityId, String attributeType, List<String> keys, Exception e) {
+ pluginCtx.auditLogService.logEntityAction(
+ ctx.getTenantId(),
+ ctx.getCustomerId(),
+ ctx.getUserId(),
+ ctx.getUserName(),
+ (UUIDBased & EntityId)entityId,
+ null,
+ ActionType.ATTRIBUTES_DELETED,
+ e,
+ attributeType,
+ keys);
+ }
+
+ @Override
+ public void logAttributesRead(PluginApiCallSecurityContext ctx, EntityId entityId, String attributeType, List<String> keys, Exception e) {
+ pluginCtx.auditLogService.logEntityAction(
+ ctx.getTenantId(),
+ ctx.getCustomerId(),
+ ctx.getUserId(),
+ ctx.getUserName(),
+ (UUIDBased & EntityId)entityId,
+ null,
+ ActionType.ATTRIBUTES_READ,
+ e,
+ attributeType,
+ keys);
+ }
+
+ @Override
public void loadLatestTimeseries(final EntityId entityId, final Collection<String> keys, final PluginCallback<List<TsKvEntry>> callback) {
validate(entityId, new ValidationCallback(callback, ctx -> {
ListenableFuture<List<TsKvEntry>> rsListFuture = pluginCtx.tsService.findLatest(entityId, keys);
@@ -429,12 +474,12 @@ public final class PluginProcessingContext implements PluginContext {
@Override
public ListenableFuture<List<EntityRelation>> findByFromAndType(EntityId from, String relationType) {
- return this.pluginCtx.relationService.findByFromAndType(from, relationType, RelationTypeGroup.COMMON);
+ return this.pluginCtx.relationService.findByFromAndTypeAsync(from, relationType, RelationTypeGroup.COMMON);
}
@Override
public ListenableFuture<List<EntityRelation>> findByToAndType(EntityId from, String relationType) {
- return this.pluginCtx.relationService.findByToAndType(from, relationType, RelationTypeGroup.COMMON);
+ return this.pluginCtx.relationService.findByToAndTypeAsync(from, relationType, RelationTypeGroup.COMMON);
}
@Override
@@ -461,6 +506,29 @@ public final class PluginProcessingContext implements PluginContext {
}
@Override
+ public void logRpcRequest(PluginApiCallSecurityContext ctx, DeviceId deviceId, ToDeviceRpcRequestBody body, boolean oneWay, Optional<RpcError> rpcError, Exception e) {
+ String rpcErrorStr = "";
+ if (rpcError.isPresent()) {
+ rpcErrorStr = "RPC Error: " + rpcError.get().name();
+ }
+ String method = body.getMethod();
+ String params = body.getParams();
+ pluginCtx.auditLogService.logEntityAction(
+ ctx.getTenantId(),
+ ctx.getCustomerId(),
+ ctx.getUserId(),
+ ctx.getUserName(),
+ deviceId,
+ null,
+ ActionType.RPC_CALL,
+ e,
+ rpcErrorStr,
+ new Boolean(oneWay),
+ method,
+ params);
+ }
+
+ @Override
public void scheduleTimeoutMsg(TimeoutMsg msg) {
pluginCtx.scheduleTimeoutMsg(msg);
}
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginTerminationMsg.java b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginTerminationMsg.java
index 4a753aa..99b1e64 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/PluginTerminationMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/PluginTerminationMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/RuleToPluginMsgWrapper.java b/application/src/main/java/org/thingsboard/server/actors/plugin/RuleToPluginMsgWrapper.java
index b4463d4..4b2268c 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/RuleToPluginMsgWrapper.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/RuleToPluginMsgWrapper.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/SharedPluginProcessingContext.java b/application/src/main/java/org/thingsboard/server/actors/plugin/SharedPluginProcessingContext.java
index de859a2..06138a3 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/SharedPluginProcessingContext.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/SharedPluginProcessingContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -27,6 +27,7 @@ import org.thingsboard.server.controller.plugin.PluginWebSocketMsgEndpoint;
import org.thingsboard.server.common.data.id.PluginId;
import org.thingsboard.server.dao.asset.AssetService;
import org.thingsboard.server.dao.attributes.AttributesService;
+import org.thingsboard.server.dao.audit.AuditLogService;
import org.thingsboard.server.dao.customer.CustomerService;
import org.thingsboard.server.dao.device.DeviceService;
import org.thingsboard.server.dao.plugin.PluginService;
@@ -63,6 +64,7 @@ public final class SharedPluginProcessingContext {
final ClusterRpcService rpcService;
final ClusterRoutingService routingService;
final RelationService relationService;
+ final AuditLogService auditLogService;
final PluginId pluginId;
final TenantId tenantId;
@@ -86,6 +88,7 @@ public final class SharedPluginProcessingContext {
this.customerService = sysContext.getCustomerService();
this.tenantService = sysContext.getTenantService();
this.relationService = sysContext.getRelationService();
+ this.auditLogService = sysContext.getAuditLogService();
}
public PluginId getPluginId() {
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/TimeoutScheduler.java b/application/src/main/java/org/thingsboard/server/actors/plugin/TimeoutScheduler.java
index fe2d61f..f504e3f 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/TimeoutScheduler.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/TimeoutScheduler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationCallback.java b/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationCallback.java
index 735ef16..f856ed6 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationCallback.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationCallback.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationResult.java b/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationResult.java
index f0a59e1..f135ffb 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationResult.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationResult.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationResultCode.java b/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationResultCode.java
index 3a89c54..2fd93ec 100644
--- a/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationResultCode.java
+++ b/application/src/main/java/org/thingsboard/server/actors/plugin/ValidationResultCode.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/BasicRpcSessionListener.java b/application/src/main/java/org/thingsboard/server/actors/rpc/BasicRpcSessionListener.java
index 6250897..4fa2227 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/BasicRpcSessionListener.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/BasicRpcSessionListener.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -148,7 +148,7 @@ public class BasicRpcSessionListener implements GrpcSessionListener {
DeviceId deviceId = new DeviceId(toUUID(msg.getDeviceId()));
ToDeviceRpcRequestBody requestBody = new ToDeviceRpcRequestBody(msg.getMethod(), msg.getParams());
- ToDeviceRpcRequest request = new ToDeviceRpcRequest(toUUID(msg.getMsgId()), deviceTenantId, deviceId, msg.getOneway(), msg.getExpTime(), requestBody);
+ ToDeviceRpcRequest request = new ToDeviceRpcRequest(toUUID(msg.getMsgId()), null, deviceTenantId, deviceId, msg.getOneway(), msg.getExpTime(), requestBody);
return new ToDeviceRpcRequestPluginMsg(serverAddress, pluginId, pluginTenantId, request);
}
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcBroadcastMsg.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcBroadcastMsg.java
index 6c87e3c..3718a22 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcBroadcastMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcBroadcastMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java
index b26dcee..9290a8f 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcManagerActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionActor.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionActor.java
index d05b452..db029fa 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionClosedMsg.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionClosedMsg.java
index 3935c2b..47be96a 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionClosedMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionClosedMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionConnectedMsg.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionConnectedMsg.java
index cf65d74..6e24ce6 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionConnectedMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionConnectedMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionCreateRequestMsg.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionCreateRequestMsg.java
index 288b8ef..5bcf1d6 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionCreateRequestMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionCreateRequestMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionDisconnectedMsg.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionDisconnectedMsg.java
index 0efdced..fc2bfd1 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionDisconnectedMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionDisconnectedMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionTellMsg.java b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionTellMsg.java
index c1369c9..5a61044 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionTellMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/RpcSessionTellMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rpc/SessionActorInfo.java b/application/src/main/java/org/thingsboard/server/actors/rpc/SessionActorInfo.java
index 64e1674..9fe8488 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rpc/SessionActorInfo.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rpc/SessionActorInfo.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/ChainProcessingContext.java b/application/src/main/java/org/thingsboard/server/actors/rule/ChainProcessingContext.java
index 63043ee..8723a68 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/ChainProcessingContext.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/ChainProcessingContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/ChainProcessingMetaData.java b/application/src/main/java/org/thingsboard/server/actors/rule/ChainProcessingMetaData.java
index 8fcbd4f..8080d4e 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/ChainProcessingMetaData.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/ChainProcessingMetaData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/ComplexRuleActorChain.java b/application/src/main/java/org/thingsboard/server/actors/rule/ComplexRuleActorChain.java
index e3e8bab..89d31bd 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/ComplexRuleActorChain.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/ComplexRuleActorChain.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/CompoundRuleActorChain.java b/application/src/main/java/org/thingsboard/server/actors/rule/CompoundRuleActorChain.java
index 473aa85..b2eb53f 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/CompoundRuleActorChain.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/CompoundRuleActorChain.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleActor.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleActor.java
index 7137d86..062da2a 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorChain.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorChain.java
index dfa89b8..3f3bd36 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorChain.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorChain.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMessageProcessor.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMessageProcessor.java
index 7a7e3ff..2ebebfc 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMessageProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMessageProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMetaData.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMetaData.java
index 2776ce7..df7adac 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMetaData.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleActorMetaData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleContextAwareMsgProcessor.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleContextAwareMsgProcessor.java
index 6122872..c0d0705 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleContextAwareMsgProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleContextAwareMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleProcessingContext.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleProcessingContext.java
index 4c31fd0..179307b 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleProcessingContext.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleProcessingContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleProcessingMsg.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleProcessingMsg.java
index c8f9c78..291a9a7 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleProcessingMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleProcessingMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RulesProcessedMsg.java b/application/src/main/java/org/thingsboard/server/actors/rule/RulesProcessedMsg.java
index 615cfff..82b6a67 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RulesProcessedMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RulesProcessedMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleTerminationMsg.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleTerminationMsg.java
index e8e4bf6..4458e52 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleTerminationMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleTerminationMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/RuleToPluginTimeoutMsg.java b/application/src/main/java/org/thingsboard/server/actors/rule/RuleToPluginTimeoutMsg.java
index 7d51f76..0258bce 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/RuleToPluginTimeoutMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/RuleToPluginTimeoutMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/rule/SimpleRuleActorChain.java b/application/src/main/java/org/thingsboard/server/actors/rule/SimpleRuleActorChain.java
index 10c682e..70a26e4 100644
--- a/application/src/main/java/org/thingsboard/server/actors/rule/SimpleRuleActorChain.java
+++ b/application/src/main/java/org/thingsboard/server/actors/rule/SimpleRuleActorChain.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/service/ActorService.java b/application/src/main/java/org/thingsboard/server/actors/service/ActorService.java
index dea16f0..baae376 100644
--- a/application/src/main/java/org/thingsboard/server/actors/service/ActorService.java
+++ b/application/src/main/java/org/thingsboard/server/actors/service/ActorService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/service/ComponentActor.java b/application/src/main/java/org/thingsboard/server/actors/service/ComponentActor.java
index 970436a..76b9be9 100644
--- a/application/src/main/java/org/thingsboard/server/actors/service/ComponentActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/service/ComponentActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/service/ContextAwareActor.java b/application/src/main/java/org/thingsboard/server/actors/service/ContextAwareActor.java
index b16dd87..825c971 100644
--- a/application/src/main/java/org/thingsboard/server/actors/service/ContextAwareActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/service/ContextAwareActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/service/ContextBasedCreator.java b/application/src/main/java/org/thingsboard/server/actors/service/ContextBasedCreator.java
index 98cfe00..e6d7ff8 100644
--- a/application/src/main/java/org/thingsboard/server/actors/service/ContextBasedCreator.java
+++ b/application/src/main/java/org/thingsboard/server/actors/service/ContextBasedCreator.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/service/DefaultActorService.java b/application/src/main/java/org/thingsboard/server/actors/service/DefaultActorService.java
index 77ef40f..bb84a30 100644
--- a/application/src/main/java/org/thingsboard/server/actors/service/DefaultActorService.java
+++ b/application/src/main/java/org/thingsboard/server/actors/service/DefaultActorService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/service/RestMsgProcessor.java b/application/src/main/java/org/thingsboard/server/actors/service/RestMsgProcessor.java
index f6446e2..3568618 100644
--- a/application/src/main/java/org/thingsboard/server/actors/service/RestMsgProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/service/RestMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/service/WebSocketMsgProcessor.java b/application/src/main/java/org/thingsboard/server/actors/service/WebSocketMsgProcessor.java
index ed9f8d6..d0c9ca6 100644
--- a/application/src/main/java/org/thingsboard/server/actors/service/WebSocketMsgProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/service/WebSocketMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/session/AbstractSessionActorMsgProcessor.java b/application/src/main/java/org/thingsboard/server/actors/session/AbstractSessionActorMsgProcessor.java
index 483c034..96526dd 100644
--- a/application/src/main/java/org/thingsboard/server/actors/session/AbstractSessionActorMsgProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/session/AbstractSessionActorMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/session/ASyncMsgProcessor.java b/application/src/main/java/org/thingsboard/server/actors/session/ASyncMsgProcessor.java
index 051c5d7..ab75cdb 100644
--- a/application/src/main/java/org/thingsboard/server/actors/session/ASyncMsgProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/session/ASyncMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/session/SessionActor.java b/application/src/main/java/org/thingsboard/server/actors/session/SessionActor.java
index 0dfa3f1..37827d6 100644
--- a/application/src/main/java/org/thingsboard/server/actors/session/SessionActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/session/SessionActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/session/SessionManagerActor.java b/application/src/main/java/org/thingsboard/server/actors/session/SessionManagerActor.java
index f9b54a8..9d67dab 100644
--- a/application/src/main/java/org/thingsboard/server/actors/session/SessionManagerActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/session/SessionManagerActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/session/SessionTerminationMsg.java b/application/src/main/java/org/thingsboard/server/actors/session/SessionTerminationMsg.java
index 233a4d0..38cf878 100644
--- a/application/src/main/java/org/thingsboard/server/actors/session/SessionTerminationMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/session/SessionTerminationMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/session/SyncMsgProcessor.java b/application/src/main/java/org/thingsboard/server/actors/session/SyncMsgProcessor.java
index 63690d0..d696503 100644
--- a/application/src/main/java/org/thingsboard/server/actors/session/SyncMsgProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/session/SyncMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/AbstractContextAwareMsgProcessor.java b/application/src/main/java/org/thingsboard/server/actors/shared/AbstractContextAwareMsgProcessor.java
index 07f8794..73b221f 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/AbstractContextAwareMsgProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/AbstractContextAwareMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/ActorTerminationMsg.java b/application/src/main/java/org/thingsboard/server/actors/shared/ActorTerminationMsg.java
index 72dedc3..f74ac64 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/ActorTerminationMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/ActorTerminationMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/ComponentMsgProcessor.java b/application/src/main/java/org/thingsboard/server/actors/shared/ComponentMsgProcessor.java
index b46eb39..18d32d9 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/ComponentMsgProcessor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/ComponentMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/plugin/PluginManager.java b/application/src/main/java/org/thingsboard/server/actors/shared/plugin/PluginManager.java
index 19a8d11..4f5871f 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/plugin/PluginManager.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/plugin/PluginManager.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/plugin/SystemPluginManager.java b/application/src/main/java/org/thingsboard/server/actors/shared/plugin/SystemPluginManager.java
index 9abe694..0888e23 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/plugin/SystemPluginManager.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/plugin/SystemPluginManager.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/plugin/TenantPluginManager.java b/application/src/main/java/org/thingsboard/server/actors/shared/plugin/TenantPluginManager.java
index 1df39ec..14ea2aa 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/plugin/TenantPluginManager.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/plugin/TenantPluginManager.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/rule/RuleManager.java b/application/src/main/java/org/thingsboard/server/actors/shared/rule/RuleManager.java
index e7e7a63..95d762a 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/rule/RuleManager.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/rule/RuleManager.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/rule/SystemRuleManager.java b/application/src/main/java/org/thingsboard/server/actors/shared/rule/SystemRuleManager.java
index 8158d77..d10731c 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/rule/SystemRuleManager.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/rule/SystemRuleManager.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/rule/TenantRuleManager.java b/application/src/main/java/org/thingsboard/server/actors/shared/rule/TenantRuleManager.java
index 913d8c6..e4d023c 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/rule/TenantRuleManager.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/rule/TenantRuleManager.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/shared/SessionTimeoutMsg.java b/application/src/main/java/org/thingsboard/server/actors/shared/SessionTimeoutMsg.java
index b253dfc..7d6dbca 100644
--- a/application/src/main/java/org/thingsboard/server/actors/shared/SessionTimeoutMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/shared/SessionTimeoutMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/stats/StatsActor.java b/application/src/main/java/org/thingsboard/server/actors/stats/StatsActor.java
index dedf1aa..ccc31cc 100644
--- a/application/src/main/java/org/thingsboard/server/actors/stats/StatsActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/stats/StatsActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/stats/StatsPersistMsg.java b/application/src/main/java/org/thingsboard/server/actors/stats/StatsPersistMsg.java
index f29f24b..6cb9de1 100644
--- a/application/src/main/java/org/thingsboard/server/actors/stats/StatsPersistMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/stats/StatsPersistMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/stats/StatsPersistTick.java b/application/src/main/java/org/thingsboard/server/actors/stats/StatsPersistTick.java
index adfcccc..24188d4 100644
--- a/application/src/main/java/org/thingsboard/server/actors/stats/StatsPersistTick.java
+++ b/application/src/main/java/org/thingsboard/server/actors/stats/StatsPersistTick.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/tenant/RuleChainDeviceMsg.java b/application/src/main/java/org/thingsboard/server/actors/tenant/RuleChainDeviceMsg.java
index d4f3599..a84e0b5 100644
--- a/application/src/main/java/org/thingsboard/server/actors/tenant/RuleChainDeviceMsg.java
+++ b/application/src/main/java/org/thingsboard/server/actors/tenant/RuleChainDeviceMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java b/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java
index 26bd188..b923fe1 100644
--- a/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java
+++ b/application/src/main/java/org/thingsboard/server/actors/tenant/TenantActor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/config/AuditLogLevelProperties.java b/application/src/main/java/org/thingsboard/server/config/AuditLogLevelProperties.java
new file mode 100644
index 0000000..34afd35
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/config/AuditLogLevelProperties.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright © 2016-2018 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.audit.ActionType;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@Configuration
+@ConfigurationProperties(prefix = "audit_log.logging_level")
+public class AuditLogLevelProperties {
+
+ private Map<String, String> mask = new HashMap<>();
+
+ public AuditLogLevelProperties() {
+ super();
+ }
+
+ public void setMask(Map<String, String> mask) {
+ this.mask = mask;
+ }
+
+ public Map<String, String> getMask() {
+ return this.mask;
+ }
+}
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 62c6213..611e293 100644
--- a/application/src/main/java/org/thingsboard/server/config/JwtSettings.java
+++ b/application/src/main/java/org/thingsboard/server/config/JwtSettings.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/config/MvcCorsProperties.java b/application/src/main/java/org/thingsboard/server/config/MvcCorsProperties.java
index 0b024de..4be6e24 100644
--- a/application/src/main/java/org/thingsboard/server/config/MvcCorsProperties.java
+++ b/application/src/main/java/org/thingsboard/server/config/MvcCorsProperties.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java
index 3690c62..87b187e 100644
--- a/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java
+++ b/application/src/main/java/org/thingsboard/server/config/SwaggerConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/config/ThingsboardMessageConfiguration.java b/application/src/main/java/org/thingsboard/server/config/ThingsboardMessageConfiguration.java
index 9276c18..038f8bc 100644
--- a/application/src/main/java/org/thingsboard/server/config/ThingsboardMessageConfiguration.java
+++ b/application/src/main/java/org/thingsboard/server/config/ThingsboardMessageConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 6755408..2952529 100644
--- a/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java
+++ b/application/src/main/java/org/thingsboard/server/config/ThingsboardSecurityConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -40,6 +40,7 @@ import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import org.springframework.web.cors.CorsUtils;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
+import org.thingsboard.server.dao.audit.AuditLogLevelFilter;
import org.thingsboard.server.exception.ThingsboardErrorResponseHandler;
import org.thingsboard.server.service.security.auth.rest.RestAuthenticationProvider;
import org.thingsboard.server.service.security.auth.rest.RestLoginProcessingFilter;
@@ -198,4 +199,9 @@ public class ThingsboardSecurityConfiguration extends WebSecurityConfigurerAdapt
return new CorsFilter(source);
}
}
+
+ @Bean
+ public AuditLogLevelFilter auditLogLevelFilter(@Autowired AuditLogLevelProperties auditLogLevelProperties) {
+ return new AuditLogLevelFilter(auditLogLevelProperties.getMask());
+ }
}
diff --git a/application/src/main/java/org/thingsboard/server/config/WebConfig.java b/application/src/main/java/org/thingsboard/server/config/WebConfig.java
index 43ac4db..0702aaa 100644
--- a/application/src/main/java/org/thingsboard/server/config/WebConfig.java
+++ b/application/src/main/java/org/thingsboard/server/config/WebConfig.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/config/WebSocketConfiguration.java b/application/src/main/java/org/thingsboard/server/config/WebSocketConfiguration.java
index 9f7c08f..a75ecb1 100644
--- a/application/src/main/java/org/thingsboard/server/config/WebSocketConfiguration.java
+++ b/application/src/main/java/org/thingsboard/server/config/WebSocketConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/AdminController.java b/application/src/main/java/org/thingsboard/server/controller/AdminController.java
index bc3c47e..e9a6ba3 100644
--- a/application/src/main/java/org/thingsboard/server/controller/AdminController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/AdminController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/AlarmController.java b/application/src/main/java/org/thingsboard/server/controller/AlarmController.java
index 988de17..1959f4e 100644
--- a/application/src/main/java/org/thingsboard/server/controller/AlarmController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/AlarmController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/AssetController.java b/application/src/main/java/org/thingsboard/server/controller/AssetController.java
index 194b7d8..9b43913 100644
--- a/application/src/main/java/org/thingsboard/server/controller/AssetController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/AssetController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -21,7 +21,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.thingsboard.server.common.data.Customer;
import org.thingsboard.server.common.data.EntitySubtype;
+import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.asset.Asset;
+import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.id.AssetId;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.TenantId;
@@ -73,8 +75,16 @@ public class AssetController extends BaseController {
checkCustomerId(asset.getCustomerId());
}
}
- return checkNotNull(assetService.saveAsset(asset));
+ Asset savedAsset = checkNotNull(assetService.saveAsset(asset));
+
+ logEntityAction(savedAsset.getId(), savedAsset,
+ savedAsset.getCustomerId(),
+ asset.getId() == null ? ActionType.ADDED : ActionType.UPDATED, null);
+
+ return savedAsset;
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.ASSET), asset,
+ null, asset.getId() == null ? ActionType.ADDED : ActionType.UPDATED, e);
throw handleException(e);
}
}
@@ -86,9 +96,18 @@ public class AssetController extends BaseController {
checkParameter(ASSET_ID, strAssetId);
try {
AssetId assetId = new AssetId(toUUID(strAssetId));
- checkAssetId(assetId);
+ Asset asset = checkAssetId(assetId);
assetService.deleteAsset(assetId);
+
+ logEntityAction(assetId, asset,
+ asset.getCustomerId(),
+ ActionType.DELETED, null, strAssetId);
+
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.ASSET),
+ null,
+ null,
+ ActionType.DELETED, e, strAssetId);
throw handleException(e);
}
}
@@ -102,13 +121,24 @@ public class AssetController extends BaseController {
checkParameter(ASSET_ID, strAssetId);
try {
CustomerId customerId = new CustomerId(toUUID(strCustomerId));
- checkCustomerId(customerId);
+ Customer customer = checkCustomerId(customerId);
AssetId assetId = new AssetId(toUUID(strAssetId));
checkAssetId(assetId);
- return checkNotNull(assetService.assignAssetToCustomer(assetId, customerId));
+ Asset savedAsset = checkNotNull(assetService.assignAssetToCustomer(assetId, customerId));
+
+ logEntityAction(assetId, savedAsset,
+ savedAsset.getCustomerId(),
+ ActionType.ASSIGNED_TO_CUSTOMER, null, strAssetId, strCustomerId, customer.getName());
+
+ return savedAsset;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.ASSET), null,
+ null,
+ ActionType.ASSIGNED_TO_CUSTOMER, e, strAssetId, strCustomerId);
+
throw handleException(e);
}
}
@@ -124,8 +154,22 @@ public class AssetController extends BaseController {
if (asset.getCustomerId() == null || asset.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) {
throw new IncorrectParameterException("Asset isn't assigned to any customer!");
}
- return checkNotNull(assetService.unassignAssetFromCustomer(assetId));
+
+ Customer customer = checkCustomerId(asset.getCustomerId());
+
+ Asset savedAsset = checkNotNull(assetService.unassignAssetFromCustomer(assetId));
+
+ logEntityAction(assetId, asset,
+ asset.getCustomerId(),
+ ActionType.UNASSIGNED_FROM_CUSTOMER, null, strAssetId, customer.getId().toString(), customer.getName());
+
+ return savedAsset;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.ASSET), null,
+ null,
+ ActionType.UNASSIGNED_FROM_CUSTOMER, e, strAssetId);
+
throw handleException(e);
}
}
@@ -139,8 +183,19 @@ public class AssetController extends BaseController {
AssetId assetId = new AssetId(toUUID(strAssetId));
Asset asset = checkAssetId(assetId);
Customer publicCustomer = customerService.findOrCreatePublicCustomer(asset.getTenantId());
- return checkNotNull(assetService.assignAssetToCustomer(assetId, publicCustomer.getId()));
+ Asset savedAsset = checkNotNull(assetService.assignAssetToCustomer(assetId, publicCustomer.getId()));
+
+ logEntityAction(assetId, savedAsset,
+ savedAsset.getCustomerId(),
+ ActionType.ASSIGNED_TO_CUSTOMER, null, strAssetId, publicCustomer.getId().toString(), publicCustomer.getName());
+
+ return savedAsset;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.ASSET), null,
+ null,
+ ActionType.ASSIGNED_TO_CUSTOMER, e, strAssetId);
+
throw handleException(e);
}
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/AuditLogController.java b/application/src/main/java/org/thingsboard/server/controller/AuditLogController.java
new file mode 100644
index 0000000..75bcf2a
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/controller/AuditLogController.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright © 2016-2018 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 org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.id.EntityIdFactory;
+import org.thingsboard.server.common.data.id.TenantId;
+import org.thingsboard.server.common.data.id.UserId;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.exception.ThingsboardException;
+
+import java.util.UUID;
+
+@RestController
+@RequestMapping("/api")
+public class AuditLogController extends BaseController {
+
+ @PreAuthorize("hasAuthority('TENANT_ADMIN')")
+ @RequestMapping(value = "/audit/logs/customer/{customerId}", params = {"limit"}, method = RequestMethod.GET)
+ @ResponseBody
+ public TimePageData<AuditLog> getAuditLogsByCustomerId(
+ @PathVariable("customerId") String strCustomerId,
+ @RequestParam int limit,
+ @RequestParam(required = false) Long startTime,
+ @RequestParam(required = false) Long endTime,
+ @RequestParam(required = false, defaultValue = "false") boolean ascOrder,
+ @RequestParam(required = false) String offset) throws ThingsboardException {
+ try {
+ checkParameter("CustomerId", strCustomerId);
+ TenantId tenantId = getCurrentUser().getTenantId();
+ TimePageLink pageLink = createPageLink(limit, startTime, endTime, ascOrder, offset);
+ return checkNotNull(auditLogService.findAuditLogsByTenantIdAndCustomerId(tenantId, new CustomerId(UUID.fromString(strCustomerId)), pageLink));
+ } catch (Exception e) {
+ throw handleException(e);
+ }
+ }
+
+ @PreAuthorize("hasAuthority('TENANT_ADMIN')")
+ @RequestMapping(value = "/audit/logs/user/{userId}", params = {"limit"}, method = RequestMethod.GET)
+ @ResponseBody
+ public TimePageData<AuditLog> getAuditLogsByUserId(
+ @PathVariable("userId") String strUserId,
+ @RequestParam int limit,
+ @RequestParam(required = false) Long startTime,
+ @RequestParam(required = false) Long endTime,
+ @RequestParam(required = false, defaultValue = "false") boolean ascOrder,
+ @RequestParam(required = false) String offset) throws ThingsboardException {
+ try {
+ checkParameter("UserId", strUserId);
+ TenantId tenantId = getCurrentUser().getTenantId();
+ TimePageLink pageLink = createPageLink(limit, startTime, endTime, ascOrder, offset);
+ return checkNotNull(auditLogService.findAuditLogsByTenantIdAndUserId(tenantId, new UserId(UUID.fromString(strUserId)), pageLink));
+ } catch (Exception e) {
+ throw handleException(e);
+ }
+ }
+
+ @PreAuthorize("hasAuthority('TENANT_ADMIN')")
+ @RequestMapping(value = "/audit/logs/entity/{entityType}/{entityId}", params = {"limit"}, method = RequestMethod.GET)
+ @ResponseBody
+ public TimePageData<AuditLog> getAuditLogsByEntityId(
+ @PathVariable("entityType") String strEntityType,
+ @PathVariable("entityId") String strEntityId,
+ @RequestParam int limit,
+ @RequestParam(required = false) Long startTime,
+ @RequestParam(required = false) Long endTime,
+ @RequestParam(required = false, defaultValue = "false") boolean ascOrder,
+ @RequestParam(required = false) String offset) throws ThingsboardException {
+ try {
+ checkParameter("EntityId", strEntityId);
+ checkParameter("EntityType", strEntityType);
+ TenantId tenantId = getCurrentUser().getTenantId();
+ TimePageLink pageLink = createPageLink(limit, startTime, endTime, ascOrder, offset);
+ return checkNotNull(auditLogService.findAuditLogsByTenantIdAndEntityId(tenantId, EntityIdFactory.getByTypeAndId(strEntityType, strEntityId), pageLink));
+ } catch (Exception e) {
+ throw handleException(e);
+ }
+ }
+
+ @PreAuthorize("hasAuthority('TENANT_ADMIN')")
+ @RequestMapping(value = "/audit/logs", params = {"limit"}, method = RequestMethod.GET)
+ @ResponseBody
+ public TimePageData<AuditLog> getAuditLogs(
+ @RequestParam int limit,
+ @RequestParam(required = false) Long startTime,
+ @RequestParam(required = false) Long endTime,
+ @RequestParam(required = false, defaultValue = "false") boolean ascOrder,
+ @RequestParam(required = false) String offset) throws ThingsboardException {
+ try {
+ TenantId tenantId = getCurrentUser().getTenantId();
+ TimePageLink pageLink = createPageLink(limit, startTime, endTime, ascOrder, offset);
+ return checkNotNull(auditLogService.findAuditLogsByTenantId(tenantId, pageLink));
+ } catch (Exception e) {
+ throw handleException(e);
+ }
+ }
+}
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 cb2f5b9..ef38d80 100644
--- a/application/src/main/java/org/thingsboard/server/controller/AuthController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/AuthController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/BaseController.java b/application/src/main/java/org/thingsboard/server/controller/BaseController.java
index 16ba93e..3264af4 100644
--- a/application/src/main/java/org/thingsboard/server/controller/BaseController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/BaseController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,9 +15,12 @@
*/
package org.thingsboard.server.controller;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.ExceptionHandler;
@@ -27,6 +30,8 @@ import org.thingsboard.server.common.data.alarm.Alarm;
import org.thingsboard.server.common.data.alarm.AlarmId;
import org.thingsboard.server.common.data.alarm.AlarmInfo;
import org.thingsboard.server.common.data.asset.Asset;
+import org.thingsboard.server.common.data.audit.ActionStatus;
+import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.id.*;
import org.thingsboard.server.common.data.page.TextPageLink;
import org.thingsboard.server.common.data.page.TimePageLink;
@@ -39,6 +44,7 @@ import org.thingsboard.server.common.data.widget.WidgetType;
import org.thingsboard.server.common.data.widget.WidgetsBundle;
import org.thingsboard.server.dao.alarm.AlarmService;
import org.thingsboard.server.dao.asset.AssetService;
+import org.thingsboard.server.dao.audit.AuditLogService;
import org.thingsboard.server.dao.customer.CustomerService;
import org.thingsboard.server.dao.dashboard.DashboardService;
import org.thingsboard.server.dao.device.DeviceCredentialsService;
@@ -72,6 +78,7 @@ public abstract class BaseController {
public static final String INCORRECT_TENANT_ID = "Incorrect tenantId ";
public static final String YOU_DON_T_HAVE_PERMISSION_TO_PERFORM_THIS_OPERATION = "You don't have permission to perform this operation!";
+
@Autowired
private ThingsboardErrorResponseHandler errorResponseHandler;
@@ -117,6 +124,8 @@ public abstract class BaseController {
@Autowired
protected RelationService relationService;
+ @Autowired
+ protected AuditLogService auditLogService;
@ExceptionHandler(ThingsboardException.class)
public void handleThingsboardException(ThingsboardException ex, HttpServletResponse response) {
@@ -129,7 +138,7 @@ public abstract class BaseController {
private ThingsboardException handleException(Exception exception, boolean logException) {
if (logException) {
- log.error("Error [{}]", exception.getMessage());
+ log.error("Error [{}]", exception.getMessage(), exception);
}
String cause = "";
@@ -414,7 +423,7 @@ public abstract class BaseController {
try {
validateId(dashboardId, "Incorrect dashboardId " + dashboardId);
Dashboard dashboard = dashboardService.findDashboardById(dashboardId);
- checkDashboard(dashboard, true);
+ checkDashboard(dashboard);
return dashboard;
} catch (Exception e) {
throw handleException(e, false);
@@ -425,28 +434,23 @@ public abstract class BaseController {
try {
validateId(dashboardId, "Incorrect dashboardId " + dashboardId);
DashboardInfo dashboardInfo = dashboardService.findDashboardInfoById(dashboardId);
- SecurityUser authUser = getCurrentUser();
- checkDashboard(dashboardInfo, authUser.getAuthority() != Authority.SYS_ADMIN);
+ checkDashboard(dashboardInfo);
return dashboardInfo;
} catch (Exception e) {
throw handleException(e, false);
}
}
- private void checkDashboard(DashboardInfo dashboard, boolean checkCustomerId) throws ThingsboardException {
+ private void checkDashboard(DashboardInfo dashboard) throws ThingsboardException {
checkNotNull(dashboard);
checkTenantId(dashboard.getTenantId());
SecurityUser authUser = getCurrentUser();
if (authUser.getAuthority() == Authority.CUSTOMER_USER) {
- if (dashboard.getCustomerId() == null || dashboard.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) {
+ if (!dashboard.isAssignedToCustomer(authUser.getCustomerId())) {
throw new ThingsboardException(YOU_DON_T_HAVE_PERMISSION_TO_PERFORM_THIS_OPERATION,
ThingsboardErrorCode.PERMISSION_DENIED);
}
}
- if (checkCustomerId &&
- dashboard.getCustomerId() != null && !dashboard.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) {
- checkCustomerId(dashboard.getCustomerId());
- }
}
ComponentDescriptor checkComponentDescriptorByClazz(String clazz) throws ThingsboardException {
@@ -541,4 +545,20 @@ public abstract class BaseController {
serverPort);
return baseUrl;
}
+
+ protected <I extends UUIDBased & EntityId> I emptyId(EntityType entityType) {
+ return (I)EntityIdFactory.getByTypeAndUuid(entityType, ModelConstants.NULL_UUID);
+ }
+
+ protected <E extends BaseData<I> & HasName,
+ I extends UUIDBased & EntityId> void logEntityAction(I entityId, E entity, CustomerId customerId,
+ ActionType actionType, Exception e, Object... additionalInfo) throws ThingsboardException {
+ User user = getCurrentUser();
+ if (customerId == null || customerId.isNullUid()) {
+ customerId = user.getCustomerId();
+ }
+ auditLogService.logEntityAction(user.getTenantId(), customerId, user.getId(), user.getName(), entityId, entity, actionType, e, additionalInfo);
+ }
+
+
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/ComponentDescriptorController.java b/application/src/main/java/org/thingsboard/server/controller/ComponentDescriptorController.java
index 913a00f..e63a443 100644
--- a/application/src/main/java/org/thingsboard/server/controller/ComponentDescriptorController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/ComponentDescriptorController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/CustomerController.java b/application/src/main/java/org/thingsboard/server/controller/CustomerController.java
index d87ea5c..b164702 100644
--- a/application/src/main/java/org/thingsboard/server/controller/CustomerController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/CustomerController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -22,6 +22,8 @@ import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.thingsboard.server.common.data.Customer;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.TextPageData;
@@ -86,8 +88,18 @@ public class CustomerController extends BaseController {
public Customer saveCustomer(@RequestBody Customer customer) throws ThingsboardException {
try {
customer.setTenantId(getCurrentUser().getTenantId());
- return checkNotNull(customerService.saveCustomer(customer));
+ Customer savedCustomer = checkNotNull(customerService.saveCustomer(customer));
+
+ logEntityAction(savedCustomer.getId(), savedCustomer,
+ savedCustomer.getId(),
+ customer.getId() == null ? ActionType.ADDED : ActionType.UPDATED, null);
+
+ return savedCustomer;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.CUSTOMER), customer,
+ null, customer.getId() == null ? ActionType.ADDED : ActionType.UPDATED, e);
+
throw handleException(e);
}
}
@@ -99,9 +111,20 @@ public class CustomerController extends BaseController {
checkParameter(CUSTOMER_ID, strCustomerId);
try {
CustomerId customerId = new CustomerId(toUUID(strCustomerId));
- checkCustomerId(customerId);
+ Customer customer = checkCustomerId(customerId);
customerService.deleteCustomer(customerId);
+
+ logEntityAction(customerId, customer,
+ customer.getId(),
+ ActionType.DELETED, null, strCustomerId);
+
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.CUSTOMER),
+ null,
+ null,
+ ActionType.DELETED, e, strCustomerId);
+
throw handleException(e);
}
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/DashboardController.java b/application/src/main/java/org/thingsboard/server/controller/DashboardController.java
index 7bc05d7..d2952a1 100644
--- a/application/src/main/java/org/thingsboard/server/controller/DashboardController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/DashboardController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -18,18 +18,22 @@ package org.thingsboard.server.controller;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
-import org.thingsboard.server.common.data.Customer;
-import org.thingsboard.server.common.data.Dashboard;
-import org.thingsboard.server.common.data.DashboardInfo;
+import org.thingsboard.server.common.data.*;
+import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.TextPageData;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
import org.thingsboard.server.dao.exception.IncorrectParameterException;
import org.thingsboard.server.dao.model.ModelConstants;
import org.thingsboard.server.exception.ThingsboardException;
+import java.util.HashSet;
+import java.util.Set;
+
@RestController
@RequestMapping("/api")
public class DashboardController extends BaseController {
@@ -75,8 +79,17 @@ public class DashboardController extends BaseController {
public Dashboard saveDashboard(@RequestBody Dashboard dashboard) throws ThingsboardException {
try {
dashboard.setTenantId(getCurrentUser().getTenantId());
- return checkNotNull(dashboardService.saveDashboard(dashboard));
+ Dashboard savedDashboard = checkNotNull(dashboardService.saveDashboard(dashboard));
+
+ logEntityAction(savedDashboard.getId(), savedDashboard,
+ null,
+ dashboard.getId() == null ? ActionType.ADDED : ActionType.UPDATED, null);
+
+ return savedDashboard;
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.DASHBOARD), dashboard,
+ null, dashboard.getId() == null ? ActionType.ADDED : ActionType.UPDATED, e);
+
throw handleException(e);
}
}
@@ -88,9 +101,20 @@ public class DashboardController extends BaseController {
checkParameter(DASHBOARD_ID, strDashboardId);
try {
DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
- checkDashboardId(dashboardId);
+ Dashboard dashboard = checkDashboardId(dashboardId);
dashboardService.deleteDashboard(dashboardId);
+
+ logEntityAction(dashboardId, dashboard,
+ null,
+ ActionType.DELETED, null, strDashboardId);
+
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.DASHBOARD),
+ null,
+ null,
+ ActionType.DELETED, e, strDashboardId);
+
throw handleException(e);
}
}
@@ -104,30 +128,207 @@ public class DashboardController extends BaseController {
checkParameter(DASHBOARD_ID, strDashboardId);
try {
CustomerId customerId = new CustomerId(toUUID(strCustomerId));
- checkCustomerId(customerId);
+ Customer customer = checkCustomerId(customerId);
DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
checkDashboardId(dashboardId);
- return checkNotNull(dashboardService.assignDashboardToCustomer(dashboardId, customerId));
+ Dashboard savedDashboard = checkNotNull(dashboardService.assignDashboardToCustomer(dashboardId, customerId));
+
+ logEntityAction(dashboardId, savedDashboard,
+ customerId,
+ ActionType.ASSIGNED_TO_CUSTOMER, null, strDashboardId, strCustomerId, customer.getName());
+
+
+ return savedDashboard;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.DASHBOARD), null,
+ null,
+ ActionType.ASSIGNED_TO_CUSTOMER, e, strDashboardId, strCustomerId);
+
throw handleException(e);
}
}
@PreAuthorize("hasAuthority('TENANT_ADMIN')")
- @RequestMapping(value = "/customer/dashboard/{dashboardId}", method = RequestMethod.DELETE)
+ @RequestMapping(value = "/customer/{customerId}/dashboard/{dashboardId}", method = RequestMethod.DELETE)
@ResponseBody
- public Dashboard unassignDashboardFromCustomer(@PathVariable(DASHBOARD_ID) String strDashboardId) throws ThingsboardException {
+ public Dashboard unassignDashboardFromCustomer(@PathVariable("customerId") String strCustomerId,
+ @PathVariable(DASHBOARD_ID) String strDashboardId) throws ThingsboardException {
+ checkParameter("customerId", strCustomerId);
+ checkParameter(DASHBOARD_ID, strDashboardId);
+ try {
+ CustomerId customerId = new CustomerId(toUUID(strCustomerId));
+ Customer customer = checkCustomerId(customerId);
+ DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
+ Dashboard dashboard = checkDashboardId(dashboardId);
+
+ Dashboard savedDashboard = checkNotNull(dashboardService.unassignDashboardFromCustomer(dashboardId, customerId));
+
+ logEntityAction(dashboardId, dashboard,
+ customerId,
+ ActionType.UNASSIGNED_FROM_CUSTOMER, null, strDashboardId, customer.getId().toString(), customer.getName());
+
+ return savedDashboard;
+ } catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.DASHBOARD), null,
+ null,
+ ActionType.UNASSIGNED_FROM_CUSTOMER, e, strDashboardId);
+
+ throw handleException(e);
+ }
+ }
+
+ @PreAuthorize("hasAuthority('TENANT_ADMIN')")
+ @RequestMapping(value = "/dashboard/{dashboardId}/customers", method = RequestMethod.POST)
+ @ResponseBody
+ public Dashboard updateDashboardCustomers(@PathVariable(DASHBOARD_ID) String strDashboardId,
+ @RequestBody String[] strCustomerIds) throws ThingsboardException {
+ checkParameter(DASHBOARD_ID, strDashboardId);
+ try {
+ DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
+ Dashboard dashboard = checkDashboardId(dashboardId);
+
+ Set<CustomerId> customerIds = new HashSet<>();
+ if (strCustomerIds != null) {
+ for (String strCustomerId : strCustomerIds) {
+ customerIds.add(new CustomerId(toUUID(strCustomerId)));
+ }
+ }
+
+ Set<CustomerId> addedCustomerIds = new HashSet<>();
+ Set<CustomerId> removedCustomerIds = new HashSet<>();
+ for (CustomerId customerId : customerIds) {
+ if (!dashboard.isAssignedToCustomer(customerId)) {
+ addedCustomerIds.add(customerId);
+ }
+ }
+
+ Set<ShortCustomerInfo> assignedCustomers = dashboard.getAssignedCustomers();
+ if (assignedCustomers != null) {
+ for (ShortCustomerInfo customerInfo : assignedCustomers) {
+ if (!customerIds.contains(customerInfo.getCustomerId())) {
+ removedCustomerIds.add(customerInfo.getCustomerId());
+ }
+ }
+ }
+
+ if (addedCustomerIds.isEmpty() && removedCustomerIds.isEmpty()) {
+ return dashboard;
+ } else {
+ Dashboard savedDashboard = null;
+ for (CustomerId customerId : addedCustomerIds) {
+ savedDashboard = checkNotNull(dashboardService.assignDashboardToCustomer(dashboardId, customerId));
+ ShortCustomerInfo customerInfo = savedDashboard.getAssignedCustomerInfo(customerId);
+ logEntityAction(dashboardId, savedDashboard,
+ customerId,
+ ActionType.ASSIGNED_TO_CUSTOMER, null, strDashboardId, customerId.toString(), customerInfo.getTitle());
+ }
+ for (CustomerId customerId : removedCustomerIds) {
+ ShortCustomerInfo customerInfo = dashboard.getAssignedCustomerInfo(customerId);
+ savedDashboard = checkNotNull(dashboardService.unassignDashboardFromCustomer(dashboardId, customerId));
+ logEntityAction(dashboardId, dashboard,
+ customerId,
+ ActionType.UNASSIGNED_FROM_CUSTOMER, null, strDashboardId, customerId.toString(), customerInfo.getTitle());
+
+ }
+ return savedDashboard;
+ }
+ } catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.DASHBOARD), null,
+ null,
+ ActionType.ASSIGNED_TO_CUSTOMER, e, strDashboardId);
+
+ throw handleException(e);
+ }
+ }
+
+ @PreAuthorize("hasAuthority('TENANT_ADMIN')")
+ @RequestMapping(value = "/dashboard/{dashboardId}/customers/add", method = RequestMethod.POST)
+ @ResponseBody
+ public Dashboard addDashboardCustomers(@PathVariable(DASHBOARD_ID) String strDashboardId,
+ @RequestBody String[] strCustomerIds) throws ThingsboardException {
+ checkParameter(DASHBOARD_ID, strDashboardId);
+ try {
+ DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
+ Dashboard dashboard = checkDashboardId(dashboardId);
+
+ Set<CustomerId> customerIds = new HashSet<>();
+ if (strCustomerIds != null) {
+ for (String strCustomerId : strCustomerIds) {
+ CustomerId customerId = new CustomerId(toUUID(strCustomerId));
+ if (!dashboard.isAssignedToCustomer(customerId)) {
+ customerIds.add(customerId);
+ }
+ }
+ }
+
+ if (customerIds.isEmpty()) {
+ return dashboard;
+ } else {
+ Dashboard savedDashboard = null;
+ for (CustomerId customerId : customerIds) {
+ savedDashboard = checkNotNull(dashboardService.assignDashboardToCustomer(dashboardId, customerId));
+ ShortCustomerInfo customerInfo = savedDashboard.getAssignedCustomerInfo(customerId);
+ logEntityAction(dashboardId, savedDashboard,
+ customerId,
+ ActionType.ASSIGNED_TO_CUSTOMER, null, strDashboardId, customerId.toString(), customerInfo.getTitle());
+ }
+ return savedDashboard;
+ }
+ } catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.DASHBOARD), null,
+ null,
+ ActionType.ASSIGNED_TO_CUSTOMER, e, strDashboardId);
+
+ throw handleException(e);
+ }
+ }
+
+ @PreAuthorize("hasAuthority('TENANT_ADMIN')")
+ @RequestMapping(value = "/dashboard/{dashboardId}/customers/remove", method = RequestMethod.POST)
+ @ResponseBody
+ public Dashboard removeDashboardCustomers(@PathVariable(DASHBOARD_ID) String strDashboardId,
+ @RequestBody String[] strCustomerIds) throws ThingsboardException {
checkParameter(DASHBOARD_ID, strDashboardId);
try {
DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
Dashboard dashboard = checkDashboardId(dashboardId);
- if (dashboard.getCustomerId() == null || dashboard.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) {
- throw new IncorrectParameterException("Dashboard isn't assigned to any customer!");
+
+ Set<CustomerId> customerIds = new HashSet<>();
+ if (strCustomerIds != null) {
+ for (String strCustomerId : strCustomerIds) {
+ CustomerId customerId = new CustomerId(toUUID(strCustomerId));
+ if (dashboard.isAssignedToCustomer(customerId)) {
+ customerIds.add(customerId);
+ }
+ }
+ }
+
+ if (customerIds.isEmpty()) {
+ return dashboard;
+ } else {
+ Dashboard savedDashboard = null;
+ for (CustomerId customerId : customerIds) {
+ ShortCustomerInfo customerInfo = dashboard.getAssignedCustomerInfo(customerId);
+ savedDashboard = checkNotNull(dashboardService.unassignDashboardFromCustomer(dashboardId, customerId));
+ logEntityAction(dashboardId, dashboard,
+ customerId,
+ ActionType.UNASSIGNED_FROM_CUSTOMER, null, strDashboardId, customerId.toString(), customerInfo.getTitle());
+
+ }
+ return savedDashboard;
}
- return checkNotNull(dashboardService.unassignDashboardFromCustomer(dashboardId));
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.DASHBOARD), null,
+ null,
+ ActionType.UNASSIGNED_FROM_CUSTOMER, e, strDashboardId);
+
throw handleException(e);
}
}
@@ -141,8 +342,46 @@ public class DashboardController extends BaseController {
DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
Dashboard dashboard = checkDashboardId(dashboardId);
Customer publicCustomer = customerService.findOrCreatePublicCustomer(dashboard.getTenantId());
- return checkNotNull(dashboardService.assignDashboardToCustomer(dashboardId, publicCustomer.getId()));
+ Dashboard savedDashboard = checkNotNull(dashboardService.assignDashboardToCustomer(dashboardId, publicCustomer.getId()));
+
+ logEntityAction(dashboardId, savedDashboard,
+ publicCustomer.getId(),
+ ActionType.ASSIGNED_TO_CUSTOMER, null, strDashboardId, publicCustomer.getId().toString(), publicCustomer.getName());
+
+ return savedDashboard;
+ } catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.DASHBOARD), null,
+ null,
+ ActionType.ASSIGNED_TO_CUSTOMER, e, strDashboardId);
+
+ throw handleException(e);
+ }
+ }
+
+ @PreAuthorize("hasAuthority('TENANT_ADMIN')")
+ @RequestMapping(value = "/customer/public/dashboard/{dashboardId}", method = RequestMethod.DELETE)
+ @ResponseBody
+ public Dashboard unassignDashboardFromPublicCustomer(@PathVariable(DASHBOARD_ID) String strDashboardId) throws ThingsboardException {
+ checkParameter(DASHBOARD_ID, strDashboardId);
+ try {
+ DashboardId dashboardId = new DashboardId(toUUID(strDashboardId));
+ Dashboard dashboard = checkDashboardId(dashboardId);
+ Customer publicCustomer = customerService.findOrCreatePublicCustomer(dashboard.getTenantId());
+
+ Dashboard savedDashboard = checkNotNull(dashboardService.unassignDashboardFromCustomer(dashboardId, publicCustomer.getId()));
+
+ logEntityAction(dashboardId, dashboard,
+ publicCustomer.getId(),
+ ActionType.UNASSIGNED_FROM_CUSTOMER, null, strDashboardId, publicCustomer.getId().toString(), publicCustomer.getName());
+
+ return savedDashboard;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.DASHBOARD), null,
+ null,
+ ActionType.UNASSIGNED_FROM_CUSTOMER, e, strDashboardId);
+
throw handleException(e);
}
}
@@ -186,19 +425,20 @@ public class DashboardController extends BaseController {
@PreAuthorize("hasAnyAuthority('TENANT_ADMIN', 'CUSTOMER_USER')")
@RequestMapping(value = "/customer/{customerId}/dashboards", params = { "limit" }, method = RequestMethod.GET)
@ResponseBody
- public TextPageData<DashboardInfo> getCustomerDashboards(
+ public TimePageData<DashboardInfo> getCustomerDashboards(
@PathVariable("customerId") String strCustomerId,
@RequestParam int limit,
- @RequestParam(required = false) String textSearch,
- @RequestParam(required = false) String idOffset,
- @RequestParam(required = false) String textOffset) throws ThingsboardException {
+ @RequestParam(required = false) Long startTime,
+ @RequestParam(required = false) Long endTime,
+ @RequestParam(required = false, defaultValue = "false") boolean ascOrder,
+ @RequestParam(required = false) String offset) throws ThingsboardException {
checkParameter("customerId", strCustomerId);
try {
TenantId tenantId = getCurrentUser().getTenantId();
CustomerId customerId = new CustomerId(toUUID(strCustomerId));
checkCustomerId(customerId);
- TextPageLink pageLink = createPageLink(limit, textSearch, idOffset, textOffset);
- return checkNotNull(dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink));
+ TimePageLink pageLink = createPageLink(limit, startTime, endTime, ascOrder, offset);
+ return checkNotNull(dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink).get());
} catch (Exception e) {
throw handleException(e);
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/DeviceController.java b/application/src/main/java/org/thingsboard/server/controller/DeviceController.java
index eeb10c8..bceea54 100644
--- a/application/src/main/java/org/thingsboard/server/controller/DeviceController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/DeviceController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -22,6 +22,10 @@ import org.springframework.web.bind.annotation.*;
import org.thingsboard.server.common.data.Customer;
import org.thingsboard.server.common.data.Device;
import org.thingsboard.server.common.data.EntitySubtype;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.audit.ActionStatus;
+import org.thingsboard.server.common.data.audit.ActionType;
+import org.thingsboard.server.common.data.device.DeviceSearchQuery;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.TenantId;
@@ -29,7 +33,6 @@ import org.thingsboard.server.common.data.page.TextPageData;
import org.thingsboard.server.common.data.page.TextPageLink;
import org.thingsboard.server.common.data.security.Authority;
import org.thingsboard.server.common.data.security.DeviceCredentials;
-import org.thingsboard.server.common.data.device.DeviceSearchQuery;
import org.thingsboard.server.dao.exception.IncorrectParameterException;
import org.thingsboard.server.dao.model.ModelConstants;
import org.thingsboard.server.exception.ThingsboardErrorCode;
@@ -75,14 +78,22 @@ public class DeviceController extends BaseController {
}
}
Device savedDevice = checkNotNull(deviceService.saveDevice(device));
+
actorService
.onDeviceNameOrTypeUpdate(
savedDevice.getTenantId(),
savedDevice.getId(),
savedDevice.getName(),
savedDevice.getType());
+
+ logEntityAction(savedDevice.getId(), savedDevice,
+ savedDevice.getCustomerId(),
+ device.getId() == null ? ActionType.ADDED : ActionType.UPDATED, null);
+
return savedDevice;
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.DEVICE), device,
+ null, device.getId() == null ? ActionType.ADDED : ActionType.UPDATED, e);
throw handleException(e);
}
}
@@ -94,9 +105,18 @@ public class DeviceController extends BaseController {
checkParameter(DEVICE_ID, strDeviceId);
try {
DeviceId deviceId = new DeviceId(toUUID(strDeviceId));
- checkDeviceId(deviceId);
+ Device device = checkDeviceId(deviceId);
deviceService.deleteDevice(deviceId);
+
+ logEntityAction(deviceId, device,
+ device.getCustomerId(),
+ ActionType.DELETED, null, strDeviceId);
+
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.DEVICE),
+ null,
+ null,
+ ActionType.DELETED, e, strDeviceId);
throw handleException(e);
}
}
@@ -110,13 +130,22 @@ public class DeviceController extends BaseController {
checkParameter(DEVICE_ID, strDeviceId);
try {
CustomerId customerId = new CustomerId(toUUID(strCustomerId));
- checkCustomerId(customerId);
+ Customer customer = checkCustomerId(customerId);
DeviceId deviceId = new DeviceId(toUUID(strDeviceId));
checkDeviceId(deviceId);
- return checkNotNull(deviceService.assignDeviceToCustomer(deviceId, customerId));
+ Device savedDevice = checkNotNull(deviceService.assignDeviceToCustomer(deviceId, customerId));
+
+ logEntityAction(deviceId, savedDevice,
+ savedDevice.getCustomerId(),
+ ActionType.ASSIGNED_TO_CUSTOMER, null, strDeviceId, strCustomerId, customer.getName());
+
+ return savedDevice;
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.DEVICE), null,
+ null,
+ ActionType.ASSIGNED_TO_CUSTOMER, e, strDeviceId, strCustomerId);
throw handleException(e);
}
}
@@ -132,8 +161,19 @@ public class DeviceController extends BaseController {
if (device.getCustomerId() == null || device.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) {
throw new IncorrectParameterException("Device isn't assigned to any customer!");
}
- return checkNotNull(deviceService.unassignDeviceFromCustomer(deviceId));
+ Customer customer = checkCustomerId(device.getCustomerId());
+
+ Device savedDevice = checkNotNull(deviceService.unassignDeviceFromCustomer(deviceId));
+
+ logEntityAction(deviceId, device,
+ device.getCustomerId(),
+ ActionType.UNASSIGNED_FROM_CUSTOMER, null, strDeviceId, customer.getId().toString(), customer.getName());
+
+ return savedDevice;
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.DEVICE), null,
+ null,
+ ActionType.UNASSIGNED_FROM_CUSTOMER, e, strDeviceId);
throw handleException(e);
}
}
@@ -147,8 +187,17 @@ public class DeviceController extends BaseController {
DeviceId deviceId = new DeviceId(toUUID(strDeviceId));
Device device = checkDeviceId(deviceId);
Customer publicCustomer = customerService.findOrCreatePublicCustomer(device.getTenantId());
- return checkNotNull(deviceService.assignDeviceToCustomer(deviceId, publicCustomer.getId()));
+ Device savedDevice = checkNotNull(deviceService.assignDeviceToCustomer(deviceId, publicCustomer.getId()));
+
+ logEntityAction(deviceId, savedDevice,
+ savedDevice.getCustomerId(),
+ ActionType.ASSIGNED_TO_CUSTOMER, null, strDeviceId, publicCustomer.getId().toString(), publicCustomer.getName());
+
+ return savedDevice;
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.DEVICE), null,
+ null,
+ ActionType.ASSIGNED_TO_CUSTOMER, e, strDeviceId);
throw handleException(e);
}
}
@@ -160,9 +209,16 @@ public class DeviceController extends BaseController {
checkParameter(DEVICE_ID, strDeviceId);
try {
DeviceId deviceId = new DeviceId(toUUID(strDeviceId));
- checkDeviceId(deviceId);
- return checkNotNull(deviceCredentialsService.findDeviceCredentialsByDeviceId(deviceId));
+ Device device = checkDeviceId(deviceId);
+ DeviceCredentials deviceCredentials = checkNotNull(deviceCredentialsService.findDeviceCredentialsByDeviceId(deviceId));
+ logEntityAction(deviceId, device,
+ device.getCustomerId(),
+ ActionType.CREDENTIALS_READ, null, strDeviceId);
+ return deviceCredentials;
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.DEVICE), null,
+ null,
+ ActionType.CREDENTIALS_READ, e, strDeviceId);
throw handleException(e);
}
}
@@ -173,11 +229,17 @@ public class DeviceController extends BaseController {
public DeviceCredentials saveDeviceCredentials(@RequestBody DeviceCredentials deviceCredentials) throws ThingsboardException {
checkNotNull(deviceCredentials);
try {
- checkDeviceId(deviceCredentials.getDeviceId());
+ Device device = checkDeviceId(deviceCredentials.getDeviceId());
DeviceCredentials result = checkNotNull(deviceCredentialsService.updateDeviceCredentials(deviceCredentials));
actorService.onCredentialsUpdate(getCurrentUser().getTenantId(), deviceCredentials.getDeviceId());
+ logEntityAction(device.getId(), device,
+ device.getCustomerId(),
+ ActionType.CREDENTIALS_UPDATED, null, deviceCredentials);
return result;
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.DEVICE), null,
+ null,
+ ActionType.CREDENTIALS_UPDATED, e, deviceCredentials);
throw handleException(e);
}
}
@@ -306,5 +368,4 @@ public class DeviceController extends BaseController {
throw handleException(e);
}
}
-
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/EntityRelationController.java b/application/src/main/java/org/thingsboard/server/controller/EntityRelationController.java
index ec7be12..03054df 100644
--- a/application/src/main/java/org/thingsboard/server/controller/EntityRelationController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/EntityRelationController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -120,7 +120,7 @@ public class EntityRelationController extends BaseController {
checkEntityId(fromId);
checkEntityId(toId);
RelationTypeGroup typeGroup = parseRelationTypeGroup(strRelationTypeGroup, RelationTypeGroup.COMMON);
- return checkNotNull(relationService.getRelation(fromId, toId, strRelationType, typeGroup).get());
+ return checkNotNull(relationService.getRelation(fromId, toId, strRelationType, typeGroup));
} catch (Exception e) {
throw handleException(e);
}
@@ -138,7 +138,7 @@ public class EntityRelationController extends BaseController {
checkEntityId(entityId);
RelationTypeGroup typeGroup = parseRelationTypeGroup(strRelationTypeGroup, RelationTypeGroup.COMMON);
try {
- return checkNotNull(relationService.findByFrom(entityId, typeGroup).get());
+ return checkNotNull(relationService.findByFrom(entityId, typeGroup));
} catch (Exception e) {
throw handleException(e);
}
@@ -176,7 +176,7 @@ public class EntityRelationController extends BaseController {
checkEntityId(entityId);
RelationTypeGroup typeGroup = parseRelationTypeGroup(strRelationTypeGroup, RelationTypeGroup.COMMON);
try {
- return checkNotNull(relationService.findByFromAndType(entityId, strRelationType, typeGroup).get());
+ return checkNotNull(relationService.findByFromAndType(entityId, strRelationType, typeGroup));
} catch (Exception e) {
throw handleException(e);
}
@@ -194,7 +194,7 @@ public class EntityRelationController extends BaseController {
checkEntityId(entityId);
RelationTypeGroup typeGroup = parseRelationTypeGroup(strRelationTypeGroup, RelationTypeGroup.COMMON);
try {
- return checkNotNull(relationService.findByTo(entityId, typeGroup).get());
+ return checkNotNull(relationService.findByTo(entityId, typeGroup));
} catch (Exception e) {
throw handleException(e);
}
@@ -232,7 +232,7 @@ public class EntityRelationController extends BaseController {
checkEntityId(entityId);
RelationTypeGroup typeGroup = parseRelationTypeGroup(strRelationTypeGroup, RelationTypeGroup.COMMON);
try {
- return checkNotNull(relationService.findByToAndType(entityId, strRelationType, typeGroup).get());
+ return checkNotNull(relationService.findByToAndType(entityId, strRelationType, typeGroup));
} catch (Exception e) {
throw handleException(e);
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/EventController.java b/application/src/main/java/org/thingsboard/server/controller/EventController.java
index dc35324..331b15e 100644
--- a/application/src/main/java/org/thingsboard/server/controller/EventController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/EventController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/plugin/PluginApiController.java b/application/src/main/java/org/thingsboard/server/controller/plugin/PluginApiController.java
index 1789da6..8e3cee4 100644
--- a/application/src/main/java/org/thingsboard/server/controller/plugin/PluginApiController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/plugin/PluginApiController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -30,6 +30,7 @@ import org.springframework.web.context.request.async.DeferredResult;
import org.thingsboard.server.actors.service.ActorService;
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.plugin.PluginMetaData;
import org.thingsboard.server.controller.BaseController;
import org.thingsboard.server.dao.model.ModelConstants;
@@ -68,7 +69,10 @@ public class PluginApiController extends BaseController {
if(tenantId != null && ModelConstants.NULL_UUID.equals(tenantId.getId())){
tenantId = null;
}
- PluginApiCallSecurityContext securityCtx = new PluginApiCallSecurityContext(pluginMd.getTenantId(), pluginMd.getId(), tenantId, customerId);
+ UserId userId = getCurrentUser().getId();
+ String userName = getCurrentUser().getName();
+ PluginApiCallSecurityContext securityCtx = new PluginApiCallSecurityContext(pluginMd.getTenantId(), pluginMd.getId(),
+ tenantId, customerId, userId, userName);
actorService.process(new BasicPluginRestMsg(securityCtx, new RestRequest(requestEntity, request), result));
} else {
result.setResult(new ResponseEntity<>(HttpStatus.FORBIDDEN));
diff --git a/application/src/main/java/org/thingsboard/server/controller/plugin/PluginNotFoundException.java b/application/src/main/java/org/thingsboard/server/controller/plugin/PluginNotFoundException.java
index 319c249..7fc12cb 100644
--- a/application/src/main/java/org/thingsboard/server/controller/plugin/PluginNotFoundException.java
+++ b/application/src/main/java/org/thingsboard/server/controller/plugin/PluginNotFoundException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketHandler.java b/application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketHandler.java
index 727fd30..7f835ed 100644
--- a/application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketHandler.java
+++ b/application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -28,6 +28,7 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.thingsboard.server.actors.service.ActorService;
+import org.thingsboard.server.common.data.id.UserId;
import org.thingsboard.server.config.WebSocketConfiguration;
import org.thingsboard.server.extensions.api.plugins.PluginConstants;
import org.thingsboard.server.service.security.model.SecurityUser;
@@ -151,8 +152,10 @@ public class PluginWebSocketHandler extends TextWebSocketHandler implements Plug
TenantId tenantId = currentUser.getTenantId();
CustomerId customerId = currentUser.getCustomerId();
if (PluginApiController.validatePluginAccess(pluginMd, tenantId, customerId)) {
+ UserId userId = currentUser.getId();
+ String userName = currentUser.getName();
PluginApiCallSecurityContext securityCtx = new PluginApiCallSecurityContext(pluginMd.getTenantId(), pluginMd.getId(), tenantId,
- currentUser.getCustomerId());
+ currentUser.getCustomerId(), userId, userName);
return new BasicPluginWebsocketSessionRef(UUID.randomUUID().toString(), securityCtx, session.getUri(), session.getAttributes(),
session.getLocalAddress(), session.getRemoteAddress());
} else {
diff --git a/application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketMsgEndpoint.java b/application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketMsgEndpoint.java
index ceb85b9..5e04ac2 100644
--- a/application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketMsgEndpoint.java
+++ b/application/src/main/java/org/thingsboard/server/controller/plugin/PluginWebSocketMsgEndpoint.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/PluginController.java b/application/src/main/java/org/thingsboard/server/controller/PluginController.java
index 191fc6b..2c69248 100644
--- a/application/src/main/java/org/thingsboard/server/controller/PluginController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/PluginController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -18,6 +18,8 @@ package org.thingsboard.server.controller;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.id.PluginId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.TextPageData;
@@ -71,8 +73,17 @@ public class PluginController extends BaseController {
PluginMetaData plugin = checkNotNull(pluginService.savePlugin(source));
actorService.onPluginStateChange(plugin.getTenantId(), plugin.getId(),
created ? ComponentLifecycleEvent.CREATED : ComponentLifecycleEvent.UPDATED);
+
+ logEntityAction(plugin.getId(), plugin,
+ null,
+ created ? ActionType.ADDED : ActionType.UPDATED, null);
+
return plugin;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.PLUGIN), source,
+ null, source.getId() == null ? ActionType.ADDED : ActionType.UPDATED, e);
+
throw handleException(e);
}
}
@@ -87,7 +98,18 @@ public class PluginController extends BaseController {
PluginMetaData plugin = checkPlugin(pluginService.findPluginById(pluginId));
pluginService.activatePluginById(pluginId);
actorService.onPluginStateChange(plugin.getTenantId(), plugin.getId(), ComponentLifecycleEvent.ACTIVATED);
+
+ logEntityAction(plugin.getId(), plugin,
+ null,
+ ActionType.ACTIVATED, null, strPluginId);
+
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.PLUGIN),
+ null,
+ null,
+ ActionType.ACTIVATED, e, strPluginId);
+
throw handleException(e);
}
}
@@ -102,7 +124,18 @@ public class PluginController extends BaseController {
PluginMetaData plugin = checkPlugin(pluginService.findPluginById(pluginId));
pluginService.suspendPluginById(pluginId);
actorService.onPluginStateChange(plugin.getTenantId(), plugin.getId(), ComponentLifecycleEvent.SUSPENDED);
+
+ logEntityAction(plugin.getId(), plugin,
+ null,
+ ActionType.SUSPENDED, null, strPluginId);
+
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.PLUGIN),
+ null,
+ null,
+ ActionType.SUSPENDED, e, strPluginId);
+
throw handleException(e);
}
}
@@ -189,7 +222,16 @@ public class PluginController extends BaseController {
PluginMetaData plugin = checkPlugin(pluginService.findPluginById(pluginId));
pluginService.deletePluginById(pluginId);
actorService.onPluginStateChange(plugin.getTenantId(), plugin.getId(), ComponentLifecycleEvent.DELETED);
+
+ logEntityAction(pluginId, plugin,
+ null,
+ ActionType.DELETED, null, strPluginId);
+
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.PLUGIN),
+ null,
+ null,
+ ActionType.DELETED, e, strPluginId);
throw handleException(e);
}
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/RuleController.java b/application/src/main/java/org/thingsboard/server/controller/RuleController.java
index 84d1c8f..e498c8f 100644
--- a/application/src/main/java/org/thingsboard/server/controller/RuleController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/RuleController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -18,6 +18,8 @@ package org.thingsboard.server.controller;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.id.RuleId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.TextPageData;
@@ -73,8 +75,17 @@ public class RuleController extends BaseController {
RuleMetaData rule = checkNotNull(ruleService.saveRule(source));
actorService.onRuleStateChange(rule.getTenantId(), rule.getId(),
created ? ComponentLifecycleEvent.CREATED : ComponentLifecycleEvent.UPDATED);
+
+ logEntityAction(rule.getId(), rule,
+ null,
+ created ? ActionType.ADDED : ActionType.UPDATED, null);
+
return rule;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.RULE), source,
+ null, source.getId() == null ? ActionType.ADDED : ActionType.UPDATED, e);
+
throw handleException(e);
}
}
@@ -89,7 +100,18 @@ public class RuleController extends BaseController {
RuleMetaData rule = checkRule(ruleService.findRuleById(ruleId));
ruleService.activateRuleById(ruleId);
actorService.onRuleStateChange(rule.getTenantId(), rule.getId(), ComponentLifecycleEvent.ACTIVATED);
+
+ logEntityAction(rule.getId(), rule,
+ null,
+ ActionType.ACTIVATED, null, strRuleId);
+
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.RULE),
+ null,
+ null,
+ ActionType.ACTIVATED, e, strRuleId);
+
throw handleException(e);
}
}
@@ -104,7 +126,18 @@ public class RuleController extends BaseController {
RuleMetaData rule = checkRule(ruleService.findRuleById(ruleId));
ruleService.suspendRuleById(ruleId);
actorService.onRuleStateChange(rule.getTenantId(), rule.getId(), ComponentLifecycleEvent.SUSPENDED);
+
+ logEntityAction(rule.getId(), rule,
+ null,
+ ActionType.SUSPENDED, null, strRuleId);
+
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.RULE),
+ null,
+ null,
+ ActionType.SUSPENDED, e, strRuleId);
+
throw handleException(e);
}
}
@@ -187,7 +220,18 @@ public class RuleController extends BaseController {
RuleMetaData rule = checkRule(ruleService.findRuleById(ruleId));
ruleService.deleteRuleById(ruleId);
actorService.onRuleStateChange(rule.getTenantId(), rule.getId(), ComponentLifecycleEvent.DELETED);
+
+ logEntityAction(ruleId, rule,
+ null,
+ ActionType.DELETED, null, strRuleId);
+
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.RULE),
+ null,
+ null,
+ ActionType.DELETED, e, strRuleId);
+
throw handleException(e);
}
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/TenantController.java b/application/src/main/java/org/thingsboard/server/controller/TenantController.java
index bbe5f3b..5acb4eb 100644
--- a/application/src/main/java/org/thingsboard/server/controller/TenantController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/TenantController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 05fca0b..2a1531a 100644
--- a/application/src/main/java/org/thingsboard/server/controller/UserController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/UserController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -19,7 +19,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
+import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.User;
+import org.thingsboard.server.common.data.audit.ActionType;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.id.UserId;
@@ -92,8 +94,17 @@ public class UserController extends BaseController {
throw e;
}
}
+
+ logEntityAction(savedUser.getId(), savedUser,
+ savedUser.getCustomerId(),
+ user.getId() == null ? ActionType.ADDED : ActionType.UPDATED, null);
+
return savedUser;
} catch (Exception e) {
+
+ logEntityAction(emptyId(EntityType.USER), user,
+ null, user.getId() == null ? ActionType.ADDED : ActionType.UPDATED, e);
+
throw handleException(e);
}
}
@@ -156,9 +167,18 @@ public class UserController extends BaseController {
checkParameter(USER_ID, strUserId);
try {
UserId userId = new UserId(toUUID(strUserId));
- checkUserId(userId);
+ User user = checkUserId(userId);
userService.deleteUser(userId);
+
+ logEntityAction(userId, user,
+ user.getCustomerId(),
+ ActionType.DELETED, null, strUserId);
+
} catch (Exception e) {
+ logEntityAction(emptyId(EntityType.USER),
+ null,
+ null,
+ ActionType.DELETED, e, strUserId);
throw handleException(e);
}
}
diff --git a/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java b/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java
index 1028f35..757f765 100644
--- a/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/WidgetsBundleController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java b/application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java
index a8b2b1e..44c7d94 100644
--- a/application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java
+++ b/application/src/main/java/org/thingsboard/server/controller/WidgetTypeController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorCode.java b/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorCode.java
index 59e7442..e78d4f2 100644
--- a/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorCode.java
+++ b/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorCode.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponse.java b/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponse.java
index 76e730c..3b897d6 100644
--- a/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponse.java
+++ b/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponse.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponseHandler.java b/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponseHandler.java
index c167044..c70c561 100644
--- a/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponseHandler.java
+++ b/application/src/main/java/org/thingsboard/server/exception/ThingsboardErrorResponseHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/exception/ThingsboardException.java b/application/src/main/java/org/thingsboard/server/exception/ThingsboardException.java
index bcf7701..fcbd65e 100644
--- a/application/src/main/java/org/thingsboard/server/exception/ThingsboardException.java
+++ b/application/src/main/java/org/thingsboard/server/exception/ThingsboardException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallConfiguration.java b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallConfiguration.java
new file mode 100644
index 0000000..14b1263
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallConfiguration.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright © 2016-2018 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.install;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Profile;
+import org.thingsboard.server.dao.audit.AuditLogLevelFilter;
+
+import java.util.HashMap;
+
+@Configuration
+@Profile("install")
+public class ThingsboardInstallConfiguration {
+
+ @Bean
+ public AuditLogLevelFilter emptyAuditLogLevelFilter() {
+ return new AuditLogLevelFilter(new HashMap<>());
+ }
+}
diff --git a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallException.java b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallException.java
index a5c5a5b..14ff7de 100644
--- a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallException.java
+++ b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.install;
import org.springframework.boot.ExitCodeGenerator;
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 bec7809..e765c40 100644
--- a/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java
+++ b/application/src/main/java/org/thingsboard/server/install/ThingsboardInstallService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.install;
import lombok.extern.slf4j.Slf4j;
@@ -81,6 +80,8 @@ public class ThingsboardInstallService {
case "1.3.1":
log.info("Upgrading ThingsBoard from version 1.3.1 to 1.4.0 ...");
+ databaseUpgradeService.upgradeDatabase("1.3.1");
+
log.info("Updating system data...");
systemDataLoaderService.deleteSystemWidgetBundle("charts");
@@ -92,6 +93,7 @@ public class ThingsboardInstallService {
systemDataLoaderService.deleteSystemWidgetBundle("alarm_widgets");
systemDataLoaderService.deleteSystemWidgetBundle("control_widgets");
systemDataLoaderService.deleteSystemWidgetBundle("maps_v2");
+ systemDataLoaderService.deleteSystemWidgetBundle("gateway_widgets");
systemDataLoaderService.loadSystemWidgets();
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/CurrentServerInstanceService.java b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/CurrentServerInstanceService.java
index f4bcca8..2232ef8 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/CurrentServerInstanceService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/CurrentServerInstanceService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryService.java b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryService.java
index 515b7c8..516fca9 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryServiceListener.java b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryServiceListener.java
index 31303c5..61cea6b 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryServiceListener.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DiscoveryServiceListener.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DummyDiscoveryService.java b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DummyDiscoveryService.java
index af35af6..865325f 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DummyDiscoveryService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/DummyDiscoveryService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstance.java b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstance.java
index 81dd97c..03c9694 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstance.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstance.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstanceService.java b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstanceService.java
index 136e7ad..adf80e7 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstanceService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ServerInstanceService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ZkDiscoveryService.java b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ZkDiscoveryService.java
index a08fb77..818d2b1 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ZkDiscoveryService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/discovery/ZkDiscoveryService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/routing/ClusterRoutingService.java b/application/src/main/java/org/thingsboard/server/service/cluster/routing/ClusterRoutingService.java
index c0efbfc..b29668c 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/routing/ClusterRoutingService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/routing/ClusterRoutingService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/routing/ConsistentClusterRoutingService.java b/application/src/main/java/org/thingsboard/server/service/cluster/routing/ConsistentClusterRoutingService.java
index c29833b..4067797 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/routing/ConsistentClusterRoutingService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/routing/ConsistentClusterRoutingService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterGrpcService.java b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterGrpcService.java
index b22fd7e..5a6b307 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterGrpcService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterGrpcService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterRpcService.java b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterRpcService.java
index 51da5fa..8c50bb7 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterRpcService.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/ClusterRpcService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSession.java b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSession.java
index ded34ce..c403895 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSession.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSession.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSessionListener.java b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSessionListener.java
index e1f222d..44e0693 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSessionListener.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/GrpcSessionListener.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcMsgListener.java b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcMsgListener.java
index 5a5a76e..a5c3151 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcMsgListener.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcMsgListener.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcSessionCreationFuture.java b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcSessionCreationFuture.java
index c6913a9..f98a456 100644
--- a/application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcSessionCreationFuture.java
+++ b/application/src/main/java/org/thingsboard/server/service/cluster/rpc/RpcSessionCreationFuture.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/component/AnnotationComponentDiscoveryService.java b/application/src/main/java/org/thingsboard/server/service/component/AnnotationComponentDiscoveryService.java
index a8f9fc3..0a6081d 100644
--- a/application/src/main/java/org/thingsboard/server/service/component/AnnotationComponentDiscoveryService.java
+++ b/application/src/main/java/org/thingsboard/server/service/component/AnnotationComponentDiscoveryService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/component/ComponentDiscoveryService.java b/application/src/main/java/org/thingsboard/server/service/component/ComponentDiscoveryService.java
index 4d48275..ea27e60 100644
--- a/application/src/main/java/org/thingsboard/server/service/component/ComponentDiscoveryService.java
+++ b/application/src/main/java/org/thingsboard/server/service/component/ComponentDiscoveryService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/environment/EnvironmentLogService.java b/application/src/main/java/org/thingsboard/server/service/environment/EnvironmentLogService.java
index 1655018..7656890 100644
--- a/application/src/main/java/org/thingsboard/server/service/environment/EnvironmentLogService.java
+++ b/application/src/main/java/org/thingsboard/server/service/environment/EnvironmentLogService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseSchemaService.java b/application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseSchemaService.java
index eaef0e4..5bdc0a7 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseSchemaService.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseSchemaService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.install;
import lombok.extern.slf4j.Slf4j;
diff --git a/application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseUpgradeService.java b/application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseUpgradeService.java
index 7f009f4..e6826ec 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseUpgradeService.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/CassandraDatabaseUpgradeService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.install;
import com.datastax.driver.core.KeyspaceMetadata;
@@ -24,6 +23,7 @@ import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
import org.thingsboard.server.dao.cassandra.CassandraCluster;
import org.thingsboard.server.dao.cassandra.CassandraInstallCluster;
+import org.thingsboard.server.dao.dashboard.DashboardService;
import org.thingsboard.server.dao.util.NoSqlDao;
import org.thingsboard.server.service.install.cql.CQLStatementsParser;
import org.thingsboard.server.service.install.cql.CassandraDbHelper;
@@ -33,6 +33,8 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
+import static org.thingsboard.server.service.install.DatabaseHelper.*;
+
@Service
@NoSqlDao
@Profile("install")
@@ -40,12 +42,6 @@ import java.util.List;
public class CassandraDatabaseUpgradeService implements DatabaseUpgradeService {
private static final String SCHEMA_UPDATE_CQL = "schema_update.cql";
- public static final String DEVICE = "device";
- public static final String TENANT_ID = "tenant_id";
- public static final String CUSTOMER_ID = "customer_id";
- public static final String SEARCH_TEXT = "search_text";
- public static final String ADDITIONAL_INFO = "additional_info";
- public static final String ASSET = "asset";
@Value("${install.data_dir}")
private String dataDir;
@@ -56,6 +52,9 @@ public class CassandraDatabaseUpgradeService implements DatabaseUpgradeService {
@Autowired
private CassandraInstallCluster installCluster;
+ @Autowired
+ private DashboardService dashboardService;
+
@Override
public void upgradeDatabase(String fromVersion) throws Exception {
@@ -66,6 +65,8 @@ public class CassandraDatabaseUpgradeService implements DatabaseUpgradeService {
//Dump devices, assets and relations
+ cluster.getSession();
+
KeyspaceMetadata ks = cluster.getCluster().getMetadata().getKeyspace(cluster.getKeyspaceName());
log.info("Dumping devices ...");
@@ -157,6 +158,34 @@ public class CassandraDatabaseUpgradeService implements DatabaseUpgradeService {
break;
case "1.3.0":
break;
+ case "1.3.1":
+
+ cluster.getSession();
+
+ ks = cluster.getCluster().getMetadata().getKeyspace(cluster.getKeyspaceName());
+
+ log.info("Dumping dashboards ...");
+ Path dashboardsDump = CassandraDbHelper.dumpCfIfExists(ks, cluster.getSession(), DASHBOARD,
+ new String[]{ID, TENANT_ID, CUSTOMER_ID, TITLE, SEARCH_TEXT, ASSIGNED_CUSTOMERS, CONFIGURATION},
+ new String[]{"", "", "", "", "", "", ""},
+ "tb-dashboards", true);
+ log.info("Dashboards dumped.");
+
+
+ log.info("Updating schema ...");
+ schemaUpdateFile = Paths.get(this.dataDir, "upgrade", "1.4.0", SCHEMA_UPDATE_CQL);
+ loadCql(schemaUpdateFile);
+ log.info("Schema updated.");
+
+ log.info("Restoring dashboards ...");
+ if (dashboardsDump != null) {
+ CassandraDbHelper.loadCf(ks, cluster.getSession(), DASHBOARD,
+ new String[]{ID, TENANT_ID, TITLE, SEARCH_TEXT, CONFIGURATION}, dashboardsDump, true);
+ DatabaseHelper.upgradeTo40_assignDashboards(dashboardsDump, dashboardService, false);
+ Files.deleteIfExists(dashboardsDump);
+ }
+ log.info("Dashboards restored.");
+ break;
default:
throw new RuntimeException("Unable to upgrade Cassandra database, unsupported fromVersion: " + fromVersion);
}
diff --git a/application/src/main/java/org/thingsboard/server/service/install/cql/CassandraDbHelper.java b/application/src/main/java/org/thingsboard/server/service/install/cql/CassandraDbHelper.java
index 0a411f6..c13d70e 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/cql/CassandraDbHelper.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/cql/CassandraDbHelper.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.install.cql;
import com.datastax.driver.core.*;
@@ -28,16 +27,25 @@ import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.*;
-public class CassandraDbHelper {
+import static org.thingsboard.server.service.install.DatabaseHelper.CSV_DUMP_FORMAT;
- private static final CSVFormat CSV_DUMP_FORMAT = CSVFormat.DEFAULT.withNullString("\\N");
+public class CassandraDbHelper {
public static Path dumpCfIfExists(KeyspaceMetadata ks, Session session, String cfName,
String[] columns, String[] defaultValues, String dumpPrefix) throws Exception {
+ return dumpCfIfExists(ks, session, cfName, columns, defaultValues, dumpPrefix, false);
+ }
+
+ public static Path dumpCfIfExists(KeyspaceMetadata ks, Session session, String cfName,
+ String[] columns, String[] defaultValues, String dumpPrefix, boolean printHeader) throws Exception {
if (ks.getTable(cfName) != null) {
Path dumpFile = Files.createTempFile(dumpPrefix, null);
Files.deleteIfExists(dumpFile);
- try (CSVPrinter csvPrinter = new CSVPrinter(Files.newBufferedWriter(dumpFile), CSV_DUMP_FORMAT)) {
+ CSVFormat csvFormat = CSV_DUMP_FORMAT;
+ if (printHeader) {
+ csvFormat = csvFormat.withHeader(columns);
+ }
+ try (CSVPrinter csvPrinter = new CSVPrinter(Files.newBufferedWriter(dumpFile), csvFormat)) {
Statement stmt = new SimpleStatement("SELECT * FROM " + cfName);
stmt.setFetchSize(1000);
ResultSet rs = session.execute(stmt);
@@ -75,9 +83,19 @@ public class CassandraDbHelper {
}
public static void loadCf(KeyspaceMetadata ks, Session session, String cfName, String[] columns, Path sourceFile) throws Exception {
+ loadCf(ks, session, cfName, columns, sourceFile, false);
+ }
+
+ public static void loadCf(KeyspaceMetadata ks, Session session, String cfName, String[] columns, Path sourceFile, boolean parseHeader) throws Exception {
TableMetadata tableMetadata = ks.getTable(cfName);
PreparedStatement prepared = session.prepare(createInsertStatement(cfName, columns));
- try (CSVParser csvParser = new CSVParser(Files.newBufferedReader(sourceFile), CSV_DUMP_FORMAT.withHeader(columns))) {
+ CSVFormat csvFormat = CSV_DUMP_FORMAT;
+ if (parseHeader) {
+ csvFormat = csvFormat.withFirstRecordAsHeader();
+ } else {
+ csvFormat = CSV_DUMP_FORMAT.withHeader(columns);
+ }
+ try (CSVParser csvParser = new CSVParser(Files.newBufferedReader(sourceFile), csvFormat)) {
csvParser.forEach(record -> {
BoundStatement boundStatement = prepared.bind();
for (String column : columns) {
diff --git a/application/src/main/java/org/thingsboard/server/service/install/cql/CQLStatementsParser.java b/application/src/main/java/org/thingsboard/server/service/install/cql/CQLStatementsParser.java
index c68ebf3..78ce34d 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/cql/CQLStatementsParser.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/cql/CQLStatementsParser.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.install.cql;
import lombok.extern.slf4j.Slf4j;
diff --git a/application/src/main/java/org/thingsboard/server/service/install/DatabaseHelper.java b/application/src/main/java/org/thingsboard/server/service/install/DatabaseHelper.java
new file mode 100644
index 0000000..4a21412
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/install/DatabaseHelper.java
@@ -0,0 +1,100 @@
+/**
+ * Copyright © 2016-2018 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.install;
+
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.lang3.StringUtils;
+import org.thingsboard.server.common.data.ShortCustomerInfo;
+import org.thingsboard.server.common.data.UUIDConverter;
+import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.id.DashboardId;
+import org.thingsboard.server.dao.dashboard.DashboardService;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.*;
+
+/**
+ * Created by igor on 2/27/18.
+ */
+@Slf4j
+public class DatabaseHelper {
+
+ public static final CSVFormat CSV_DUMP_FORMAT = CSVFormat.DEFAULT.withNullString("\\N");
+
+ public static final String DEVICE = "device";
+ public static final String TENANT_ID = "tenant_id";
+ public static final String CUSTOMER_ID = "customer_id";
+ public static final String SEARCH_TEXT = "search_text";
+ public static final String ADDITIONAL_INFO = "additional_info";
+ public static final String ASSET = "asset";
+ public static final String DASHBOARD = "dashboard";
+ public static final String ID = "id";
+ public static final String TITLE = "title";
+ public static final String ASSIGNED_CUSTOMERS = "assigned_customers";
+ public static final String CONFIGURATION = "configuration";
+
+ public static final ObjectMapper objectMapper = new ObjectMapper();
+
+ public static void upgradeTo40_assignDashboards(Path dashboardsDump, DashboardService dashboardService, boolean sql) throws Exception {
+ JavaType assignedCustomersType =
+ objectMapper.getTypeFactory().constructCollectionType(HashSet.class, ShortCustomerInfo.class);
+ try (CSVParser csvParser = new CSVParser(Files.newBufferedReader(dashboardsDump), CSV_DUMP_FORMAT.withFirstRecordAsHeader())) {
+ csvParser.forEach(record -> {
+ String customerIdString = record.get(CUSTOMER_ID);
+ String assignedCustomersString = record.get(ASSIGNED_CUSTOMERS);
+ DashboardId dashboardId = new DashboardId(toUUID(record.get(ID), sql));
+ List<CustomerId> customerIds = new ArrayList<>();
+ if (!StringUtils.isEmpty(assignedCustomersString)) {
+ try {
+ Set<ShortCustomerInfo> assignedCustomers = objectMapper.readValue(assignedCustomersString, assignedCustomersType);
+ assignedCustomers.forEach((customerInfo) -> {
+ CustomerId customerId = customerInfo.getCustomerId();
+ if (!customerId.isNullUid()) {
+ customerIds.add(customerId);
+ }
+ });
+ } catch (IOException e) {
+ log.error("Unable to parse assigned customers field", e);
+ }
+ }
+ if (!StringUtils.isEmpty(customerIdString)) {
+ CustomerId customerId = new CustomerId(toUUID(customerIdString, sql));
+ if (!customerId.isNullUid()) {
+ customerIds.add(customerId);
+ }
+ }
+ for (CustomerId customerId : customerIds) {
+ dashboardService.assignDashboardToCustomer(dashboardId, customerId);
+ }
+ });
+ }
+ }
+
+ private static UUID toUUID(String src, boolean sql) {
+ if (sql) {
+ return UUIDConverter.fromString(src);
+ } else {
+ return UUID.fromString(src);
+ }
+ }
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/install/DatabaseSchemaService.java b/application/src/main/java/org/thingsboard/server/service/install/DatabaseSchemaService.java
index c852ffd..bc1a76f 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/DatabaseSchemaService.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/DatabaseSchemaService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/install/DatabaseUpgradeService.java b/application/src/main/java/org/thingsboard/server/service/install/DatabaseUpgradeService.java
index 215e7bb..d923651 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/DatabaseUpgradeService.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/DatabaseUpgradeService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.install;
public interface DatabaseUpgradeService {
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 4e81f94..1ef805f 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.install;
import com.fasterxml.jackson.databind.JsonNode;
@@ -339,8 +338,10 @@ public class DefaultSystemDataLoaderService implements SystemDataLoaderService {
JsonNode dashboardJson = objectMapper.readTree(path.toFile());
Dashboard dashboard = objectMapper.treeToValue(dashboardJson, Dashboard.class);
dashboard.setTenantId(tenantId);
- dashboard.setCustomerId(customerId);
- dashboardService.saveDashboard(dashboard);
+ Dashboard savedDashboard = dashboardService.saveDashboard(dashboard);
+ if (customerId != null && !customerId.isNullUid()) {
+ dashboardService.assignDashboardToCustomer(savedDashboard.getId(), customerId);
+ }
} catch (Exception e) {
log.error("Unable to load dashboard from json: [{}]", path.toString());
throw new RuntimeException("Unable to load dashboard from json", e);
diff --git a/application/src/main/java/org/thingsboard/server/service/install/sql/SqlDbHelper.java b/application/src/main/java/org/thingsboard/server/service/install/sql/SqlDbHelper.java
new file mode 100644
index 0000000..f6c4749
--- /dev/null
+++ b/application/src/main/java/org/thingsboard/server/service/install/sql/SqlDbHelper.java
@@ -0,0 +1,171 @@
+/**
+ * Copyright © 2016-2018 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.service.install.sql;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVParser;
+import org.apache.commons.csv.CSVPrinter;
+import org.apache.commons.csv.CSVRecord;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.thingsboard.server.service.install.DatabaseHelper.CSV_DUMP_FORMAT;
+
+/**
+ * Created by igor on 2/27/18.
+ */
+@Slf4j
+public class SqlDbHelper {
+
+ public static Path dumpTableIfExists(Connection conn, String tableName,
+ String[] columns, String[] defaultValues, String dumpPrefix) throws Exception {
+ return dumpTableIfExists(conn, tableName, columns, defaultValues, dumpPrefix, false);
+ }
+
+ public static Path dumpTableIfExists(Connection conn, String tableName,
+ String[] columns, String[] defaultValues, String dumpPrefix, boolean printHeader) throws Exception {
+
+ if (tableExists(conn, tableName)) {
+ Path dumpFile = Files.createTempFile(dumpPrefix, null);
+ Files.deleteIfExists(dumpFile);
+ CSVFormat csvFormat = CSV_DUMP_FORMAT;
+ if (printHeader) {
+ csvFormat = csvFormat.withHeader(columns);
+ }
+ try (CSVPrinter csvPrinter = new CSVPrinter(Files.newBufferedWriter(dumpFile), csvFormat)) {
+ try (PreparedStatement stmt = conn.prepareStatement("SELECT * FROM " + tableName)) {
+ try (ResultSet tableRes = stmt.executeQuery()) {
+ ResultSetMetaData resMetaData = tableRes.getMetaData();
+ Map<String, Integer> columnIndexMap = new HashMap<>();
+ for (int i = 1; i <= resMetaData.getColumnCount(); i++) {
+ String columnName = resMetaData.getColumnName(i);
+ columnIndexMap.put(columnName.toUpperCase(), i);
+ }
+ while(tableRes.next()) {
+ dumpRow(tableRes, columnIndexMap, columns, defaultValues, csvPrinter);
+ }
+ }
+ }
+ }
+ return dumpFile;
+ } else {
+ return null;
+ }
+ }
+
+ private static boolean tableExists(Connection conn, String tableName) {
+ try (Statement stmt = conn.createStatement()) {
+ stmt.executeQuery("select * from " + tableName + " where 1=0");
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ public static void loadTable(Connection conn, String tableName, String[] columns, Path sourceFile) throws Exception {
+ loadTable(conn, tableName, columns, sourceFile, false);
+ }
+
+ public static void loadTable(Connection conn, String tableName, String[] columns, Path sourceFile, boolean parseHeader) throws Exception {
+ CSVFormat csvFormat = CSV_DUMP_FORMAT;
+ if (parseHeader) {
+ csvFormat = csvFormat.withFirstRecordAsHeader();
+ } else {
+ csvFormat = CSV_DUMP_FORMAT.withHeader(columns);
+ }
+ try (PreparedStatement prepared = conn.prepareStatement(createInsertStatement(tableName, columns))) {
+ try (CSVParser csvParser = new CSVParser(Files.newBufferedReader(sourceFile), csvFormat)) {
+ csvParser.forEach(record -> {
+ try {
+ for (int i = 0; i < columns.length; i++) {
+ setColumnValue(i, columns[i], record, prepared);
+ }
+ prepared.execute();
+ } catch (SQLException e) {
+ log.error("Unable to load table record!", e);
+ }
+ });
+ }
+ }
+ }
+
+ private static void dumpRow(ResultSet res, Map<String, Integer> columnIndexMap, String[] columns,
+ String[] defaultValues, CSVPrinter csvPrinter) throws Exception {
+ List<String> record = new ArrayList<>();
+ for (int i=0;i<columns.length;i++) {
+ String column = columns[i];
+ String defaultValue;
+ if (defaultValues != null && i < defaultValues.length) {
+ defaultValue = defaultValues[i];
+ } else {
+ defaultValue = "";
+ }
+ record.add(getColumnValue(column, defaultValue, columnIndexMap, res));
+ }
+ csvPrinter.printRecord(record);
+ }
+
+ private static String getColumnValue(String column, String defaultValue, Map<String, Integer> columnIndexMap, ResultSet res) {
+ int index = columnIndexMap.containsKey(column.toUpperCase()) ? columnIndexMap.get(column.toUpperCase()) : -1;
+ if (index > -1) {
+ String str;
+ try {
+ Object obj = res.getObject(index);
+ if (obj == null) {
+ return null;
+ } else {
+ str = obj.toString();
+ }
+ } catch (Exception e) {
+ str = "";
+ }
+ return str;
+ } else {
+ return defaultValue;
+ }
+ }
+
+ private static void setColumnValue(int index, String column,
+ CSVRecord record, PreparedStatement preparedStatement) throws SQLException {
+ String value = record.get(column);
+ int type = preparedStatement.getParameterMetaData().getParameterType(index + 1);
+ preparedStatement.setObject(index + 1, value, type);
+ }
+
+ private static String createInsertStatement(String tableName, String[] columns) {
+ StringBuilder insertStatementBuilder = new StringBuilder();
+ insertStatementBuilder.append("INSERT INTO ").append(tableName).append(" (");
+ for (String column : columns) {
+ insertStatementBuilder.append(column).append(",");
+ }
+ insertStatementBuilder.deleteCharAt(insertStatementBuilder.length() - 1);
+ insertStatementBuilder.append(") VALUES (");
+ for (String column : columns) {
+ insertStatementBuilder.append("?").append(",");
+ }
+ insertStatementBuilder.deleteCharAt(insertStatementBuilder.length() - 1);
+ insertStatementBuilder.append(")");
+ return insertStatementBuilder.toString();
+ }
+
+}
diff --git a/application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseSchemaService.java b/application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseSchemaService.java
index acd3868..443ec0c 100644
--- a/application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseSchemaService.java
+++ b/application/src/main/java/org/thingsboard/server/service/install/SqlDatabaseSchemaService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.install;
import lombok.extern.slf4j.Slf4j;
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 a8ffa99..cdd3103 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,22 +13,29 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.install;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
+import org.thingsboard.server.dao.dashboard.DashboardService;
import org.thingsboard.server.dao.util.SqlDao;
+import org.thingsboard.server.service.install.cql.CassandraDbHelper;
+import org.thingsboard.server.service.install.sql.SqlDbHelper;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.sql.Connection;
+import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
+import static org.thingsboard.server.service.install.DatabaseHelper.*;
+import static org.thingsboard.server.service.install.DatabaseHelper.CONFIGURATION;
+
@Service
@Profile("install")
@Slf4j
@@ -49,6 +56,9 @@ public class SqlDatabaseUpgradeService implements DatabaseUpgradeService {
@Value("${spring.datasource.password}")
private String dbPassword;
+ @Autowired
+ private DashboardService dashboardService;
+
@Override
public void upgradeDatabase(String fromVersion) throws Exception {
switch (fromVersion) {
@@ -61,6 +71,32 @@ public class SqlDatabaseUpgradeService implements DatabaseUpgradeService {
}
log.info("Schema updated.");
break;
+ case "1.3.1":
+ try (Connection conn = DriverManager.getConnection(dbUrl, dbUserName, dbPassword)) {
+
+ log.info("Dumping dashboards ...");
+ Path dashboardsDump = SqlDbHelper.dumpTableIfExists(conn, DASHBOARD,
+ new String[]{ID, TENANT_ID, CUSTOMER_ID, TITLE, SEARCH_TEXT, ASSIGNED_CUSTOMERS, CONFIGURATION},
+ new String[]{"", "", "", "", "", "", ""},
+ "tb-dashboards", true);
+ log.info("Dashboards dumped.");
+
+ log.info("Updating schema ...");
+ schemaUpdateFile = Paths.get(this.dataDir, "upgrade", "1.4.0", SCHEMA_UPDATE_SQL);
+ String sql = new String(Files.readAllBytes(schemaUpdateFile), Charset.forName("UTF-8"));
+ conn.createStatement().execute(sql); //NOSONAR, ignoring because method used to execute thingsboard database upgrade script
+ log.info("Schema updated.");
+
+ log.info("Restoring dashboards ...");
+ if (dashboardsDump != null) {
+ SqlDbHelper.loadTable(conn, DASHBOARD,
+ new String[]{ID, TENANT_ID, TITLE, SEARCH_TEXT, CONFIGURATION}, dashboardsDump, true);
+ DatabaseHelper.upgradeTo40_assignDashboards(dashboardsDump, dashboardService, true);
+ Files.deleteIfExists(dashboardsDump);
+ }
+ log.info("Dashboards restored.");
+ }
+ break;
default:
throw new RuntimeException("Unable to upgrade SQL database, unsupported fromVersion: " + fromVersion);
}
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 8ca6f14..a3dcb68 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/mail/DefaultMailService.java b/application/src/main/java/org/thingsboard/server/service/mail/DefaultMailService.java
index a6c4f43..25b911c 100644
--- a/application/src/main/java/org/thingsboard/server/service/mail/DefaultMailService.java
+++ b/application/src/main/java/org/thingsboard/server/service/mail/DefaultMailService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/mail/MailService.java b/application/src/main/java/org/thingsboard/server/service/mail/MailService.java
index a64f7d6..b87da4c 100644
--- a/application/src/main/java/org/thingsboard/server/service/mail/MailService.java
+++ b/application/src/main/java/org/thingsboard/server/service/mail/MailService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/AbstractJwtAuthenticationToken.java b/application/src/main/java/org/thingsboard/server/service/security/auth/AbstractJwtAuthenticationToken.java
index 39d9a82..62a3893 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/AbstractJwtAuthenticationToken.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/AbstractJwtAuthenticationToken.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtHeaderTokenExtractor.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtHeaderTokenExtractor.java
index d16bd35..2b55d1b 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtHeaderTokenExtractor.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtHeaderTokenExtractor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtQueryTokenExtractor.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtQueryTokenExtractor.java
index 2d85dbd..c44779d 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtQueryTokenExtractor.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/JwtQueryTokenExtractor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/TokenExtractor.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/TokenExtractor.java
index b1163ec..176297f 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/TokenExtractor.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/extractor/TokenExtractor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 4c178c6..a46fb48 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtTokenAuthenticationProcessingFilter.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtTokenAuthenticationProcessingFilter.java
index ef4d51a..f4da3a5 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtTokenAuthenticationProcessingFilter.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/JwtTokenAuthenticationProcessingFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 be5e546..08de9ef 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -25,6 +25,7 @@ import org.springframework.util.Assert;
import org.thingsboard.server.common.data.Customer;
import org.thingsboard.server.common.data.User;
import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.UUIDBased;
import org.thingsboard.server.common.data.id.UserId;
import org.thingsboard.server.common.data.security.Authority;
@@ -108,7 +109,7 @@ public class RefreshTokenAuthenticationProvider implements AuthenticationProvide
throw new BadCredentialsException("Refresh token is not valid");
}
- User user = new User(new UserId(UUIDBased.EMPTY));
+ User user = new User(new UserId(EntityId.NULL_UUID));
user.setTenantId(publicCustomer.getTenantId());
user.setCustomerId(publicCustomer.getId());
user.setEmail(publicId);
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenProcessingFilter.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenProcessingFilter.java
index a023712..a016f3a 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenProcessingFilter.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenProcessingFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 02955ed..975487f 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRequest.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRequest.java
index d8350ed..a9dd17a 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRequest.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/RefreshTokenRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/SkipPathRequestMatcher.java b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/SkipPathRequestMatcher.java
index aebe893..97706c7 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/SkipPathRequestMatcher.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/jwt/SkipPathRequestMatcher.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/JwtAuthenticationToken.java b/application/src/main/java/org/thingsboard/server/service/security/auth/JwtAuthenticationToken.java
index 1b89f77..6a348cc 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/JwtAuthenticationToken.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/JwtAuthenticationToken.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/RefreshAuthenticationToken.java b/application/src/main/java/org/thingsboard/server/service/security/auth/RefreshAuthenticationToken.java
index e656754..39f9d81 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/RefreshAuthenticationToken.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/RefreshAuthenticationToken.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginRequest.java b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginRequest.java
index 49de4d9..617305c 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginRequest.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/LoginRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/PublicLoginRequest.java b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/PublicLoginRequest.java
index 54ef093..3c04a2f 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/PublicLoginRequest.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/PublicLoginRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAuthenticationProvider.java b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAuthenticationProvider.java
index 6615023..36f2199 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAuthenticationProvider.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAuthenticationProvider.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -26,6 +26,7 @@ import org.springframework.util.Assert;
import org.thingsboard.server.common.data.Customer;
import org.thingsboard.server.common.data.User;
import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.UUIDBased;
import org.thingsboard.server.common.data.id.UserId;
import org.thingsboard.server.common.data.security.Authority;
@@ -111,7 +112,7 @@ public class RestAuthenticationProvider implements AuthenticationProvider {
if (!publicCustomer.isPublic()) {
throw new BadCredentialsException("Authentication Failed. Public Id is not valid.");
}
- User user = new User(new UserId(UUIDBased.EMPTY));
+ User user = new User(new UserId(EntityId.NULL_UUID));
user.setTenantId(publicCustomer.getTenantId());
user.setCustomerId(publicCustomer.getId());
user.setEmail(publicId);
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationFailureHandler.java b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationFailureHandler.java
index eb0fb2c..73e15a1 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationFailureHandler.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestAwareAuthenticationFailureHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 799fc4d..9c8c90d 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestLoginProcessingFilter.java b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestLoginProcessingFilter.java
index c3c5f11..4f6a87c 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestLoginProcessingFilter.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestLoginProcessingFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestPublicLoginProcessingFilter.java b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestPublicLoginProcessingFilter.java
index 707653f..5f8488e 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestPublicLoginProcessingFilter.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/auth/rest/RestPublicLoginProcessingFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/device/DefaultDeviceAuthService.java b/application/src/main/java/org/thingsboard/server/service/security/device/DefaultDeviceAuthService.java
index 18cdb58..6178f88 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/device/DefaultDeviceAuthService.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/device/DefaultDeviceAuthService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/exception/AuthMethodNotSupportedException.java b/application/src/main/java/org/thingsboard/server/service/security/exception/AuthMethodNotSupportedException.java
index 1bd03be..62741f6 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/exception/AuthMethodNotSupportedException.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/exception/AuthMethodNotSupportedException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 69ed883..8e8a9af 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/model/SecurityUser.java b/application/src/main/java/org/thingsboard/server/service/security/model/SecurityUser.java
index 7980ff0..f4a28a0 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/model/SecurityUser.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/model/SecurityUser.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 7484af8..4248f4c 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtToken.java b/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtToken.java
index e52a93d..3234414 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtToken.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/model/token/JwtToken.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 7e5fba5..2d0d4f9 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 61aff2e..db6a336 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/security/model/UserPrincipal.java b/application/src/main/java/org/thingsboard/server/service/security/model/UserPrincipal.java
index 76e3185..3baf14c 100644
--- a/application/src/main/java/org/thingsboard/server/service/security/model/UserPrincipal.java
+++ b/application/src/main/java/org/thingsboard/server/service/security/model/UserPrincipal.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.security.model;
import java.io.Serializable;
diff --git a/application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java b/application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java
index 273b775..fb2a936 100644
--- a/application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java
+++ b/application/src/main/java/org/thingsboard/server/service/update/DefaultUpdateService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.update;
import com.fasterxml.jackson.databind.JsonNode;
diff --git a/application/src/main/java/org/thingsboard/server/service/update/model/UpdateMessage.java b/application/src/main/java/org/thingsboard/server/service/update/model/UpdateMessage.java
index bbb8511..6d7e037 100644
--- a/application/src/main/java/org/thingsboard/server/service/update/model/UpdateMessage.java
+++ b/application/src/main/java/org/thingsboard/server/service/update/model/UpdateMessage.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/service/update/UpdateService.java b/application/src/main/java/org/thingsboard/server/service/update/UpdateService.java
index 18bfb2f..bc881b4 100644
--- a/application/src/main/java/org/thingsboard/server/service/update/UpdateService.java
+++ b/application/src/main/java/org/thingsboard/server/service/update/UpdateService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.service.update;
import org.thingsboard.server.service.update.model.UpdateMessage;
diff --git a/application/src/main/java/org/thingsboard/server/ThingsboardInstallApplication.java b/application/src/main/java/org/thingsboard/server/ThingsboardInstallApplication.java
index 8d54d25..a0f0ae3 100644
--- a/application/src/main/java/org/thingsboard/server/ThingsboardInstallApplication.java
+++ b/application/src/main/java/org/thingsboard/server/ThingsboardInstallApplication.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server;
import lombok.extern.slf4j.Slf4j;
diff --git a/application/src/main/java/org/thingsboard/server/ThingsboardServerApplication.java b/application/src/main/java/org/thingsboard/server/ThingsboardServerApplication.java
index 9463b08..c3444d4 100644
--- a/application/src/main/java/org/thingsboard/server/ThingsboardServerApplication.java
+++ b/application/src/main/java/org/thingsboard/server/ThingsboardServerApplication.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/java/org/thingsboard/server/utils/MiscUtils.java b/application/src/main/java/org/thingsboard/server/utils/MiscUtils.java
index c709820..88be306 100644
--- a/application/src/main/java/org/thingsboard/server/utils/MiscUtils.java
+++ b/application/src/main/java/org/thingsboard/server/utils/MiscUtils.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/proto/cluster.proto b/application/src/main/proto/cluster.proto
index 496ccff..e106d1b 100644
--- a/application/src/main/proto/cluster.proto
+++ b/application/src/main/proto/cluster.proto
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/proto/discovery.proto b/application/src/main/proto/discovery.proto
index 3efda93..be4ec92 100644
--- a/application/src/main/proto/discovery.proto
+++ b/application/src/main/proto/discovery.proto
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/resources/actor-system.conf b/application/src/main/resources/actor-system.conf
index 3cd319f..3c68775 100644
--- a/application/src/main/resources/actor-system.conf
+++ b/application/src/main/resources/actor-system.conf
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/application/src/main/resources/logback.xml b/application/src/main/resources/logback.xml
index 7169894..1779912 100644
--- a/application/src/main/resources/logback.xml
+++ b/application/src/main/resources/logback.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/application/src/main/resources/templates/account.activated.vm b/application/src/main/resources/templates/account.activated.vm
index 1131042..a13c6b0 100644
--- a/application/src/main/resources/templates/account.activated.vm
+++ b/application/src/main/resources/templates/account.activated.vm
@@ -1,5 +1,5 @@
#*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/resources/templates/activation.vm b/application/src/main/resources/templates/activation.vm
index c5b5252..23df15f 100644
--- a/application/src/main/resources/templates/activation.vm
+++ b/application/src/main/resources/templates/activation.vm
@@ -1,5 +1,5 @@
#*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/resources/templates/password.was.reset.vm b/application/src/main/resources/templates/password.was.reset.vm
index eace7d7..1389c50 100644
--- a/application/src/main/resources/templates/password.was.reset.vm
+++ b/application/src/main/resources/templates/password.was.reset.vm
@@ -1,5 +1,5 @@
#*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/resources/templates/reset.password.vm b/application/src/main/resources/templates/reset.password.vm
index 45bcc60..267bdbb 100644
--- a/application/src/main/resources/templates/reset.password.vm
+++ b/application/src/main/resources/templates/reset.password.vm
@@ -1,5 +1,5 @@
#*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/main/resources/templates/test.vm b/application/src/main/resources/templates/test.vm
index e05f24b..de3f6d3 100644
--- a/application/src/main/resources/templates/test.vm
+++ b/application/src/main/resources/templates/test.vm
@@ -1,5 +1,5 @@
#*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
application/src/main/resources/thingsboard.yml 103(+85 -18)
diff --git a/application/src/main/resources/thingsboard.yml b/application/src/main/resources/thingsboard.yml
index 7eef95a..8f862da 100644
--- a/application/src/main/resources/thingsboard.yml
+++ b/application/src/main/resources/thingsboard.yml
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
@@ -77,6 +77,8 @@ http:
# MQTT server parameters
mqtt:
+ # Enable/disable mqtt transport protocol.
+ enabled: "${MQTT_ENABLED:true}"
bind_address: "${MQTT_BIND_ADDRESS:0.0.0.0}"
bind_port: "${MQTT_BIND_PORT:1883}"
adaptor: "${MQTT_ADAPTOR_NAME:JsonMqttAdaptor}"
@@ -102,11 +104,34 @@ mqtt:
# CoAP server parameters
coap:
+ # Enable/disable coap transport protocol.
+ enabled: "${COAP_ENABLED:true}"
bind_address: "${COAP_BIND_ADDRESS:0.0.0.0}"
bind_port: "${COAP_BIND_PORT:5683}"
adaptor: "${COAP_ADAPTOR_NAME:JsonCoapAdaptor}"
timeout: "${COAP_TIMEOUT:10000}"
+#Quota parameters
+quota:
+ host:
+ # Max allowed number of API requests in interval for single host
+ limit: "${QUOTA_HOST_LIMIT:10000}"
+ # Interval duration
+ intervalMs: "${QUOTA_HOST_INTERVAL_MS:60000}"
+ # Maximum silence duration for host after which Host removed from QuotaService. Must be bigger than intervalMs
+ ttlMs: "${QUOTA_HOST_TTL_MS:60000}"
+ # Interval for scheduled task that cleans expired records. TTL is used for expiring
+ cleanPeriodMs: "${QUOTA_HOST_CLEAN_PERIOD_MS:300000}"
+ # Enable Host API Limits
+ enabled: "${QUOTA_HOST_ENABLED:false}"
+ # Array of whitelist hosts
+ whitelist: "${QUOTA_HOST_WHITELIST:localhost,127.0.0.1}"
+ # Array of blacklist hosts
+ blacklist: "${QUOTA_HOST_BLACKLIST:}"
+ log:
+ topSize: 10
+ intervalMin: 2
+
database:
type: "${DATABASE_TYPE:sql}" # cassandra OR sql
@@ -189,24 +214,30 @@ actors:
enabled: "${ACTORS_STATISTICS_ENABLED:true}"
persist_frequency: "${ACTORS_STATISTICS_PERSIST_FREQUENCY:3600000}"
-# Cache parameters
cache:
- # Enable/disable cache functionality.
- enabled: "${CACHE_ENABLED:false}"
- device_credentials:
- # Default time to store device credentials in cache, in seconds
- time_to_live: "${CACHE_DEVICE_CREDENTIAL_TTL:3600}"
- # Maximum size of the map. When maximum size is reached, the map is evicted based on the policy defined.
- max_size:
- # Max size policy options:
- # PER_NODE: Maximum number of map entries in each JVM.
- # PER_PARTITION: Maximum number of map entries within each partition.
- # USED_HEAP_SIZE: Maximum used heap size in megabytes for each JVM.
- # USED_HEAP_PERCENTAGE: Maximum used heap size percentage for each JVM.
- # FREE_HEAP_SIZE: Minimum free heap size in megabytes for each JVM.
- # FREE_HEAP_PERCENTAGE: Minimum free heap size percentage for each JVM.
- policy: "${CACHE_DEVICE_CREDENTIAL_MAX_SIZE_POLICY:PER_NODE}"
- size: "${CACHE_DEVICE_CREDENTIAL_MAX_SIZE_SIZE:1000000}"
+ # caffeine or redis
+ type: "${CACHE_TYPE:caffeine}"
+
+caffeine:
+ specs:
+ relations:
+ timeToLiveInMinutes: 1440
+ maxSize: 100000
+ deviceCredentials:
+ timeToLiveInMinutes: 1440
+ maxSize: 100000
+ devices:
+ timeToLiveInMinutes: 1440
+ maxSize: 100000
+
+redis:
+ # standalone or cluster
+ connection:
+ type: standalone
+ host: "${REDIS_HOST:localhost}"
+ port: "${REDIS_PORT:6379}"
+ db: "${REDIS_DB:0}"
+ password: "${REDIS_PASSWORD:}"
# Check new version updates parameters
updates:
@@ -270,3 +301,39 @@ rule:
# url: "${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/thingsboard}"
# username: "${SPRING_DATASOURCE_USERNAME:postgres}"
# password: "${SPRING_DATASOURCE_PASSWORD:postgres}"
+
+# Audit log parameters
+audit_log:
+ # Enable/disable audit log functionality.
+ enabled: "${AUDIT_LOG_ENABLED:true}"
+ # Specify partitioning size for audit log by tenant id storage. Example MINUTES, HOURS, DAYS, MONTHS
+ by_tenant_partitioning: "${AUDIT_LOG_BY_TENANT_PARTITIONING:MONTHS}"
+ # Number of days as history period if startTime and endTime are not specified
+ default_query_period: "${AUDIT_LOG_DEFAULT_QUERY_PERIOD:30}"
+ # Logging levels per each entity type.
+ # Allowed values: OFF (disable), W (log write operations), RW (log read and write operations)
+ logging_level:
+ mask:
+ "device": "${AUDIT_LOG_MASK_DEVICE:W}"
+ "asset": "${AUDIT_LOG_MASK_ASSET:W}"
+ "dashboard": "${AUDIT_LOG_MASK_DASHBOARD:W}"
+ "customer": "${AUDIT_LOG_MASK_CUSTOMER:W}"
+ "user": "${AUDIT_LOG_MASK_USER:W}"
+ "rule": "${AUDIT_LOG_MASK_RULE:W}"
+ "plugin": "${AUDIT_LOG_MASK_PLUGIN:W}"
+ sink:
+ # Type of external sink. possible options: none, elasticsearch
+ type: "${AUDIT_LOG_SINK_TYPE:none}"
+ # Name of the index where audit logs stored
+ # Index name could contain next placeholders (not mandatory):
+ # @{TENANT} - substituted by tenant ID
+ # @{DATE} - substituted by current date in format provided in audit_log.sink.date_format
+ index_pattern: "${AUDIT_LOG_SINK_INDEX_PATTERN:@{TENANT}_AUDIT_LOG_@{DATE}}"
+ # Date format. Details of the pattern could be found here:
+ # https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
+ date_format: "${AUDIT_LOG_SINK_DATE_FORMAT:YYYY.MM.DD}"
+ scheme_name: "${AUDIT_LOG_SINK_SCHEME_NAME:http}" # http or https
+ host: "${AUDIT_LOG_SINK_HOST:localhost}"
+ port: "${AUDIT_LOG_SINK_POST:9200}"
+ user_name: "${AUDIT_LOG_SINK_USER_NAME:}"
+ password: "${AUDIT_LOG_SINK_PASSWORD:}"
\ No newline at end of file
diff --git a/application/src/main/scripts/install/install.sh b/application/src/main/scripts/install/install.sh
index be96363..5d1a1be 100755
--- a/application/src/main/scripts/install/install.sh
+++ b/application/src/main/scripts/install/install.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/application/src/main/scripts/install/install_dev_db.sh b/application/src/main/scripts/install/install_dev_db.sh
index 8f64ad0..ba93479 100644
--- a/application/src/main/scripts/install/install_dev_db.sh
+++ b/application/src/main/scripts/install/install_dev_db.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/application/src/main/scripts/install/logback.xml b/application/src/main/scripts/install/logback.xml
index b2535cc..b9dd4ad 100644
--- a/application/src/main/scripts/install/logback.xml
+++ b/application/src/main/scripts/install/logback.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/application/src/main/scripts/install/upgrade.sh b/application/src/main/scripts/install/upgrade.sh
index b40c3bb..6a32ccf 100755
--- a/application/src/main/scripts/install/upgrade.sh
+++ b/application/src/main/scripts/install/upgrade.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/actors/ActorsTestSuite.java b/application/src/test/java/org/thingsboard/server/actors/ActorsTestSuite.java
index 4c1b185..c2b5de9 100644
--- a/application/src/test/java/org/thingsboard/server/actors/ActorsTestSuite.java
+++ b/application/src/test/java/org/thingsboard/server/actors/ActorsTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/actors/DefaultActorServiceTest.java b/application/src/test/java/org/thingsboard/server/actors/DefaultActorServiceTest.java
index 5e12cda..d77341a 100644
--- a/application/src/test/java/org/thingsboard/server/actors/DefaultActorServiceTest.java
+++ b/application/src/test/java/org/thingsboard/server/actors/DefaultActorServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/actors/DummySessionID.java b/application/src/test/java/org/thingsboard/server/actors/DummySessionID.java
index 80ec950..9324e26 100644
--- a/application/src/test/java/org/thingsboard/server/actors/DummySessionID.java
+++ b/application/src/test/java/org/thingsboard/server/actors/DummySessionID.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/AbstractControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/AbstractControllerTest.java
index 8d68bf8..b92e464 100644
--- a/application/src/test/java/org/thingsboard/server/controller/AbstractControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/AbstractControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -66,6 +66,7 @@ import org.thingsboard.server.common.data.User;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.id.UUIDBased;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageLink;
import org.thingsboard.server.common.data.security.Authority;
import org.thingsboard.server.config.ThingsboardSecurityConfiguration;
import org.thingsboard.server.service.mail.TestMailService;
@@ -336,6 +337,35 @@ public abstract class AbstractControllerTest {
return readResponse(doGet(urlTemplate, vars).andExpect(status().isOk()), responseType);
}
+ protected <T> T doGetTypedWithTimePageLink(String urlTemplate, TypeReference<T> responseType,
+ TimePageLink pageLink,
+ Object... urlVariables) throws Exception {
+ List<Object> pageLinkVariables = new ArrayList<>();
+ urlTemplate += "limit={limit}";
+ pageLinkVariables.add(pageLink.getLimit());
+ if (pageLink.getStartTime() != null) {
+ urlTemplate += "&startTime={startTime}";
+ pageLinkVariables.add(pageLink.getStartTime());
+ }
+ if (pageLink.getEndTime() != null) {
+ urlTemplate += "&endTime={endTime}";
+ pageLinkVariables.add(pageLink.getEndTime());
+ }
+ if (pageLink.getIdOffset() != null) {
+ urlTemplate += "&offset={offset}";
+ pageLinkVariables.add(pageLink.getIdOffset().toString());
+ }
+ if (pageLink.isAscOrder()) {
+ urlTemplate += "&ascOrder={ascOrder}";
+ pageLinkVariables.add(pageLink.isAscOrder());
+ }
+ Object[] vars = new Object[urlVariables.length + pageLinkVariables.size()];
+ System.arraycopy(urlVariables, 0, vars, 0, urlVariables.length);
+ System.arraycopy(pageLinkVariables.toArray(), 0, vars, urlVariables.length, pageLinkVariables.size());
+
+ return readResponse(doGet(urlTemplate, vars).andExpect(status().isOk()), responseType);
+ }
+
protected <T> T doPost(String urlTemplate, Class<T> responseClass, String... params) throws Exception {
return readResponse(doPost(urlTemplate, params).andExpect(status().isOk()), responseClass);
}
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAdminControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseAdminControllerTest.java
index f7153d5..43c9f82 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseAdminControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseAdminControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAssetControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseAssetControllerTest.java
index fb2e720..390b01c 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseAssetControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseAssetControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAuditLogControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseAuditLogControllerTest.java
new file mode 100644
index 0000000..8fb097b
--- /dev/null
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseAuditLogControllerTest.java
@@ -0,0 +1,148 @@
+/**
+ * Copyright © 2016-2018 The Thingsboard Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.thingsboard.server.controller;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.thingsboard.server.common.data.Device;
+import org.thingsboard.server.common.data.Tenant;
+import org.thingsboard.server.common.data.User;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.common.data.security.Authority;
+import org.thingsboard.server.dao.model.ModelConstants;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+public abstract class BaseAuditLogControllerTest extends AbstractControllerTest {
+
+ private Tenant savedTenant;
+ private User tenantAdmin;
+
+ @Before
+ public void beforeTest() throws Exception {
+ loginSysAdmin();
+
+ Tenant tenant = new Tenant();
+ tenant.setTitle("My tenant");
+ savedTenant = doPost("/api/tenant", tenant, Tenant.class);
+ Assert.assertNotNull(savedTenant);
+
+ tenantAdmin = new User();
+ tenantAdmin.setAuthority(Authority.TENANT_ADMIN);
+ tenantAdmin.setTenantId(savedTenant.getId());
+ tenantAdmin.setEmail("tenant2@thingsboard.org");
+ tenantAdmin.setFirstName("Joe");
+ tenantAdmin.setLastName("Downs");
+
+ tenantAdmin = createUserAndLogin(tenantAdmin, "testPassword1");
+ }
+
+ @After
+ public void afterTest() throws Exception {
+ loginSysAdmin();
+
+ doDelete("/api/tenant/" + savedTenant.getId().getId().toString())
+ .andExpect(status().isOk());
+ }
+
+ @Test
+ public void testAuditLogs() throws Exception {
+ for (int i = 0; i < 178; i++) {
+ Device device = new Device();
+ device.setName("Device" + i);
+ device.setType("default");
+ doPost("/api/device", device, Device.class);
+ }
+
+ List<AuditLog> loadedAuditLogs = new ArrayList<>();
+ TimePageLink pageLink = new TimePageLink(23);
+ TimePageData<AuditLog> pageData;
+ do {
+ pageData = doGetTypedWithTimePageLink("/api/audit/logs?",
+ new TypeReference<TimePageData<AuditLog>>() {
+ }, pageLink);
+ loadedAuditLogs.addAll(pageData.getData());
+ if (pageData.hasNext()) {
+ pageLink = pageData.getNextPageLink();
+ }
+ } while (pageData.hasNext());
+
+ Assert.assertEquals(178, loadedAuditLogs.size());
+
+ loadedAuditLogs = new ArrayList<>();
+ pageLink = new TimePageLink(23);
+ do {
+ pageData = doGetTypedWithTimePageLink("/api/audit/logs/customer/" + ModelConstants.NULL_UUID + "?",
+ new TypeReference<TimePageData<AuditLog>>() {
+ }, pageLink);
+ loadedAuditLogs.addAll(pageData.getData());
+ if (pageData.hasNext()) {
+ pageLink = pageData.getNextPageLink();
+ }
+ } while (pageData.hasNext());
+
+ Assert.assertEquals(178, loadedAuditLogs.size());
+
+ loadedAuditLogs = new ArrayList<>();
+ pageLink = new TimePageLink(23);
+ do {
+ pageData = doGetTypedWithTimePageLink("/api/audit/logs/user/" + tenantAdmin.getId().getId().toString() + "?",
+ new TypeReference<TimePageData<AuditLog>>() {
+ }, pageLink);
+ loadedAuditLogs.addAll(pageData.getData());
+ if (pageData.hasNext()) {
+ pageLink = pageData.getNextPageLink();
+ }
+ } while (pageData.hasNext());
+
+ Assert.assertEquals(178, loadedAuditLogs.size());
+ }
+
+ @Test
+ public void testAuditLogs_byTenantIdAndEntityId() throws Exception {
+ Device device = new Device();
+ device.setName("Device name");
+ device.setType("default");
+ Device savedDevice = doPost("/api/device", device, Device.class);
+ for (int i = 0; i < 178; i++) {
+ savedDevice.setName("Device name" + i);
+ doPost("/api/device", savedDevice, Device.class);
+ }
+
+ List<AuditLog> loadedAuditLogs = new ArrayList<>();
+ TimePageLink pageLink = new TimePageLink(23);
+ TimePageData<AuditLog> pageData;
+ do {
+ pageData = doGetTypedWithTimePageLink("/api/audit/logs/entity/DEVICE/" + savedDevice.getId().getId() + "?",
+ new TypeReference<TimePageData<AuditLog>>() {
+ }, pageLink);
+ loadedAuditLogs.addAll(pageData.getData());
+ if (pageData.hasNext()) {
+ pageLink = pageData.getNextPageLink();
+ }
+ } while (pageData.hasNext());
+
+ Assert.assertEquals(179, loadedAuditLogs.size());
+ }
+}
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseAuthControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseAuthControllerTest.java
index ba7f90d..f6a0f21 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseAuthControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseAuthControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseComponentDescriptorControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseComponentDescriptorControllerTest.java
index 175c138..4346538 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseComponentDescriptorControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseComponentDescriptorControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseCustomerControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseCustomerControllerTest.java
index f4ed228..7fec539 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseCustomerControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseCustomerControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseDashboardControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseDashboardControllerTest.java
index bb06411..b2f2919 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseDashboardControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseDashboardControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -19,6 +19,7 @@ import static org.hamcrest.Matchers.containsString;
import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+import java.sql.Time;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -29,6 +30,8 @@ import org.thingsboard.server.common.data.*;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.page.TextPageData;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
import org.thingsboard.server.common.data.security.Authority;
import org.thingsboard.server.dao.model.ModelConstants;
import org.junit.After;
@@ -82,8 +85,6 @@ public abstract class BaseDashboardControllerTest extends AbstractControllerTest
Assert.assertNotNull(savedDashboard.getId());
Assert.assertTrue(savedDashboard.getCreatedTime() > 0);
Assert.assertEquals(savedTenant.getId(), savedDashboard.getTenantId());
- Assert.assertNotNull(savedDashboard.getCustomerId());
- Assert.assertEquals(NULL_UUID, savedDashboard.getCustomerId().getId());
Assert.assertEquals(dashboard.getTitle(), savedDashboard.getTitle());
savedDashboard.setTitle("My new dashboard");
@@ -136,17 +137,20 @@ public abstract class BaseDashboardControllerTest extends AbstractControllerTest
Dashboard assignedDashboard = doPost("/api/customer/" + savedCustomer.getId().getId().toString()
+ "/dashboard/" + savedDashboard.getId().getId().toString(), Dashboard.class);
- Assert.assertEquals(savedCustomer.getId(), assignedDashboard.getCustomerId());
-
+
+ Assert.assertTrue(assignedDashboard.getAssignedCustomers().contains(savedCustomer.toShortCustomerInfo()));
+
Dashboard foundDashboard = doGet("/api/dashboard/" + savedDashboard.getId().getId().toString(), Dashboard.class);
- Assert.assertEquals(savedCustomer.getId(), foundDashboard.getCustomerId());
+ Assert.assertTrue(foundDashboard.getAssignedCustomers().contains(savedCustomer.toShortCustomerInfo()));
Dashboard unassignedDashboard =
- doDelete("/api/customer/dashboard/" + savedDashboard.getId().getId().toString(), Dashboard.class);
- Assert.assertEquals(ModelConstants.NULL_UUID, unassignedDashboard.getCustomerId().getId());
-
+ doDelete("/api/customer/"+savedCustomer.getId().getId().toString()+"/dashboard/" + savedDashboard.getId().getId().toString(), Dashboard.class);
+
+ Assert.assertTrue(unassignedDashboard.getAssignedCustomers() == null || unassignedDashboard.getAssignedCustomers().isEmpty());
+
foundDashboard = doGet("/api/dashboard/" + savedDashboard.getId().getId().toString(), Dashboard.class);
- Assert.assertEquals(ModelConstants.NULL_UUID, foundDashboard.getCustomerId().getId());
+
+ Assert.assertTrue(foundDashboard.getAssignedCustomers() == null || foundDashboard.getAssignedCustomers().isEmpty());
}
@Test
@@ -320,11 +324,11 @@ public abstract class BaseDashboardControllerTest extends AbstractControllerTest
}
List<DashboardInfo> loadedDashboards = new ArrayList<>();
- TextPageLink pageLink = new TextPageLink(21);
- TextPageData<DashboardInfo> pageData = null;
+ TimePageLink pageLink = new TimePageLink(21);
+ TimePageData<DashboardInfo> pageData = null;
do {
- pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/dashboards?",
- new TypeReference<TextPageData<DashboardInfo>>(){}, pageLink);
+ pageData = doGetTypedWithTimePageLink("/api/customer/" + customerId.getId().toString() + "/dashboards?",
+ new TypeReference<TimePageData<DashboardInfo>>(){}, pageLink);
loadedDashboards.addAll(pageData.getData());
if (pageData.hasNext()) {
pageLink = pageData.getNextPageLink();
@@ -336,93 +340,5 @@ public abstract class BaseDashboardControllerTest extends AbstractControllerTest
Assert.assertEquals(dashboards, loadedDashboards);
}
-
- @Test
- public void testFindCustomerDashboardsByTitle() throws Exception {
- Customer customer = new Customer();
- customer.setTitle("Test customer");
- customer = doPost("/api/customer", customer, Customer.class);
- CustomerId customerId = customer.getId();
-
- String title1 = "Dashboard title 1";
- List<DashboardInfo> dashboardsTitle1 = new ArrayList<>();
- for (int i=0;i<125;i++) {
- Dashboard dashboard = new Dashboard();
- String suffix = RandomStringUtils.randomAlphanumeric((int)(Math.random()*15));
- String title = title1+suffix;
- title = i % 2 == 0 ? title.toLowerCase() : title.toUpperCase();
- dashboard.setTitle(title);
- dashboard = doPost("/api/dashboard", dashboard, Dashboard.class);
- dashboardsTitle1.add(new DashboardInfo(doPost("/api/customer/" + customerId.getId().toString()
- + "/dashboard/" + dashboard.getId().getId().toString(), Dashboard.class)));
- }
- String title2 = "Dashboard title 2";
- List<DashboardInfo> dashboardsTitle2 = new ArrayList<>();
- for (int i=0;i<143;i++) {
- Dashboard dashboard = new Dashboard();
- String suffix = RandomStringUtils.randomAlphanumeric((int)(Math.random()*15));
- String title = title2+suffix;
- title = i % 2 == 0 ? title.toLowerCase() : title.toUpperCase();
- dashboard.setTitle(title);
- dashboard = doPost("/api/dashboard", dashboard, Dashboard.class);
- dashboardsTitle2.add(new DashboardInfo(doPost("/api/customer/" + customerId.getId().toString()
- + "/dashboard/" + dashboard.getId().getId().toString(), Dashboard.class)));
- }
-
- List<DashboardInfo> loadedDashboardsTitle1 = new ArrayList<>();
- TextPageLink pageLink = new TextPageLink(18, title1);
- TextPageData<DashboardInfo> pageData = null;
- do {
- pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/dashboards?",
- new TypeReference<TextPageData<DashboardInfo>>(){}, pageLink);
- loadedDashboardsTitle1.addAll(pageData.getData());
- if (pageData.hasNext()) {
- pageLink = pageData.getNextPageLink();
- }
- } while (pageData.hasNext());
-
- Collections.sort(dashboardsTitle1, idComparator);
- Collections.sort(loadedDashboardsTitle1, idComparator);
-
- Assert.assertEquals(dashboardsTitle1, loadedDashboardsTitle1);
-
- List<DashboardInfo> loadedDashboardsTitle2 = new ArrayList<>();
- pageLink = new TextPageLink(7, title2);
- do {
- pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/dashboards?",
- new TypeReference<TextPageData<DashboardInfo>>(){}, pageLink);
- loadedDashboardsTitle2.addAll(pageData.getData());
- if (pageData.hasNext()) {
- pageLink = pageData.getNextPageLink();
- }
- } while (pageData.hasNext());
-
- Collections.sort(dashboardsTitle2, idComparator);
- Collections.sort(loadedDashboardsTitle2, idComparator);
-
- Assert.assertEquals(dashboardsTitle2, loadedDashboardsTitle2);
-
- for (DashboardInfo dashboard : loadedDashboardsTitle1) {
- doDelete("/api/customer/dashboard/" + dashboard.getId().getId().toString())
- .andExpect(status().isOk());
- }
-
- pageLink = new TextPageLink(5, title1);
- pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/dashboards?",
- new TypeReference<TextPageData<DashboardInfo>>(){}, pageLink);
- Assert.assertFalse(pageData.hasNext());
- Assert.assertEquals(0, pageData.getData().size());
-
- for (DashboardInfo dashboard : loadedDashboardsTitle2) {
- doDelete("/api/customer/dashboard/" + dashboard.getId().getId().toString())
- .andExpect(status().isOk());
- }
-
- pageLink = new TextPageLink(9, title2);
- pageData = doGetTypedWithPageLink("/api/customer/" + customerId.getId().toString() + "/dashboards?",
- new TypeReference<TextPageData<DashboardInfo>>(){}, pageLink);
- Assert.assertFalse(pageData.hasNext());
- Assert.assertEquals(0, pageData.getData().size());
- }
}
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java
index f8da8fc..2b86934 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseDeviceControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BasePluginControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BasePluginControllerTest.java
index 6933c5e..915015f 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BasePluginControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BasePluginControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseRuleControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseRuleControllerTest.java
index bb4cc49..9236dfe 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseRuleControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseRuleControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseTenantControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseTenantControllerTest.java
index 770e02f..c5c5c3c 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseTenantControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseTenantControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java
index e3c87f6..e7a6373 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseUserControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseWidgetsBundleControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseWidgetsBundleControllerTest.java
index 5a9a2bf..edf00f7 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseWidgetsBundleControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseWidgetsBundleControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/BaseWidgetTypeControllerTest.java b/application/src/test/java/org/thingsboard/server/controller/BaseWidgetTypeControllerTest.java
index 08720e2..59b6844 100644
--- a/application/src/test/java/org/thingsboard/server/controller/BaseWidgetTypeControllerTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/BaseWidgetTypeControllerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/ControllerNoSqlTestSuite.java b/application/src/test/java/org/thingsboard/server/controller/ControllerNoSqlTestSuite.java
index b773eab..2e88483 100644
--- a/application/src/test/java/org/thingsboard/server/controller/ControllerNoSqlTestSuite.java
+++ b/application/src/test/java/org/thingsboard/server/controller/ControllerNoSqlTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 b969227..f316051 100644
--- a/application/src/test/java/org/thingsboard/server/controller/ControllerSqlTestSuite.java
+++ b/application/src/test/java/org/thingsboard/server/controller/ControllerSqlTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/AdminControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/AdminControllerNoSqlTest.java
index 6ec28e7..64fdfb8 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/AdminControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/AdminControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/AssetControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/AssetControllerNoSqlTest.java
index a4bd152..6d1ccda 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/AssetControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/AssetControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/AuditLogControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/AuditLogControllerNoSqlTest.java
new file mode 100644
index 0000000..60f5535
--- /dev/null
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/AuditLogControllerNoSqlTest.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright © 2016-2018 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.nosql;
+
+import org.thingsboard.server.controller.BaseAuditLogControllerTest;
+import org.thingsboard.server.dao.service.DaoNoSqlTest;
+
+@DaoNoSqlTest
+public class AuditLogControllerNoSqlTest extends BaseAuditLogControllerTest {
+}
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/AuthControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/AuthControllerNoSqlTest.java
index 4896d22..07dc154 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/AuthControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/AuthControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/ComponentDescriptorControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/ComponentDescriptorControllerNoSqlTest.java
index f3aa3e8..d659624 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/ComponentDescriptorControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/ComponentDescriptorControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/CustomerControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/CustomerControllerNoSqlTest.java
index 2fa3067..f94a5b2 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/CustomerControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/CustomerControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/DashboardControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/DashboardControllerNoSqlTest.java
index 2a7af40..edff44f 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/DashboardControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/DashboardControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/DeviceControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/DeviceControllerNoSqlTest.java
index 47f1c9e..3bdbff9 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/DeviceControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/DeviceControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/PluginControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/PluginControllerNoSqlTest.java
index c25eca1..48815e6 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/PluginControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/PluginControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/RuleControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/RuleControllerNoSqlTest.java
index 3bf64fb..0557d5d 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/RuleControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/RuleControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/TenantControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/TenantControllerNoSqlTest.java
index 7cb34d3..9f42331 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/TenantControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/TenantControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/UserControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/UserControllerNoSqlTest.java
index 6540347..3f092ce 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/UserControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/UserControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/WidgetsBundleControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/WidgetsBundleControllerNoSqlTest.java
index 02b4c07..b163ba1 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/WidgetsBundleControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/WidgetsBundleControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/nosql/WidgetTypeControllerNoSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/nosql/WidgetTypeControllerNoSqlTest.java
index 852f453..7542cd7 100644
--- a/application/src/test/java/org/thingsboard/server/controller/nosql/WidgetTypeControllerNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/nosql/WidgetTypeControllerNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AdminControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AdminControllerSqlTest.java
index 2491c32..8c166ff 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/AdminControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/AdminControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AssetControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AssetControllerSqlTest.java
index 519cc38..f2ce3e0 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/AssetControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/AssetControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AuditLogControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AuditLogControllerSqlTest.java
new file mode 100644
index 0000000..dd57b43
--- /dev/null
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/AuditLogControllerSqlTest.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright © 2016-2018 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.sql;
+
+import org.thingsboard.server.controller.BaseAuditLogControllerTest;
+import org.thingsboard.server.dao.service.DaoSqlTest;
+
+@DaoSqlTest
+public class AuditLogControllerSqlTest extends BaseAuditLogControllerTest {
+}
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/AuthControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/AuthControllerSqlTest.java
index cb2b1f0..8a381da 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/AuthControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/AuthControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/ComponentDescriptorControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/ComponentDescriptorControllerSqlTest.java
index d96b3dd..34752e5 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/ComponentDescriptorControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/ComponentDescriptorControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/CustomerControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/CustomerControllerSqlTest.java
index 8d3ba49..125bdbb 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/CustomerControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/CustomerControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/DashboardControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/DashboardControllerSqlTest.java
index 7ce48c7..b46ef7c 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/DashboardControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/DashboardControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/DeviceControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/DeviceControllerSqlTest.java
index 8505e64..32ac99c 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/DeviceControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/DeviceControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/PluginControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/PluginControllerSqlTest.java
index 3d750c5..fbb6338 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/PluginControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/PluginControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/RuleControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/RuleControllerSqlTest.java
index d70d550..cf651da 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/RuleControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/RuleControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/TenantControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/TenantControllerSqlTest.java
index 582dc61..67a65ab 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/TenantControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/TenantControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/UserControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/UserControllerSqlTest.java
index 9b7fc3b..bda368a 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/UserControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/UserControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/WidgetsBundleControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/WidgetsBundleControllerSqlTest.java
index 7e2e481..e6a2b2a 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/WidgetsBundleControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/WidgetsBundleControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/controller/sql/WidgetTypeControllerSqlTest.java b/application/src/test/java/org/thingsboard/server/controller/sql/WidgetTypeControllerSqlTest.java
index db0cd3a..47ce11d 100644
--- a/application/src/test/java/org/thingsboard/server/controller/sql/WidgetTypeControllerSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/controller/sql/WidgetTypeControllerSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/mqtt/MqttNoSqlTestSuite.java b/application/src/test/java/org/thingsboard/server/mqtt/MqttNoSqlTestSuite.java
index cbde335..c4a969b 100644
--- a/application/src/test/java/org/thingsboard/server/mqtt/MqttNoSqlTestSuite.java
+++ b/application/src/test/java/org/thingsboard/server/mqtt/MqttNoSqlTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/mqtt/MqttSqlTestSuite.java b/application/src/test/java/org/thingsboard/server/mqtt/MqttSqlTestSuite.java
index e92cbe7..5ddbb67 100644
--- a/application/src/test/java/org/thingsboard/server/mqtt/MqttSqlTestSuite.java
+++ b/application/src/test/java/org/thingsboard/server/mqtt/MqttSqlTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/mqtt/rpc/AbstractMqttServerSideRpcIntegrationTest.java b/application/src/test/java/org/thingsboard/server/mqtt/rpc/AbstractMqttServerSideRpcIntegrationTest.java
index 8b4332c..b732e66 100644
--- a/application/src/test/java/org/thingsboard/server/mqtt/rpc/AbstractMqttServerSideRpcIntegrationTest.java
+++ b/application/src/test/java/org/thingsboard/server/mqtt/rpc/AbstractMqttServerSideRpcIntegrationTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/mqtt/rpc/nosql/MqttServerSideRpcNoSqlIntegrationTest.java b/application/src/test/java/org/thingsboard/server/mqtt/rpc/nosql/MqttServerSideRpcNoSqlIntegrationTest.java
index 7cd9efb..af76045 100644
--- a/application/src/test/java/org/thingsboard/server/mqtt/rpc/nosql/MqttServerSideRpcNoSqlIntegrationTest.java
+++ b/application/src/test/java/org/thingsboard/server/mqtt/rpc/nosql/MqttServerSideRpcNoSqlIntegrationTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/mqtt/rpc/sql/MqttServerSideRpcSqlIntegrationTest.java b/application/src/test/java/org/thingsboard/server/mqtt/rpc/sql/MqttServerSideRpcSqlIntegrationTest.java
index b520798..7c9c058 100644
--- a/application/src/test/java/org/thingsboard/server/mqtt/rpc/sql/MqttServerSideRpcSqlIntegrationTest.java
+++ b/application/src/test/java/org/thingsboard/server/mqtt/rpc/sql/MqttServerSideRpcSqlIntegrationTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/mqtt/telemetry/AbstractMqttTelemetryIntegrationTest.java b/application/src/test/java/org/thingsboard/server/mqtt/telemetry/AbstractMqttTelemetryIntegrationTest.java
index c42eae8..d02d07d 100644
--- a/application/src/test/java/org/thingsboard/server/mqtt/telemetry/AbstractMqttTelemetryIntegrationTest.java
+++ b/application/src/test/java/org/thingsboard/server/mqtt/telemetry/AbstractMqttTelemetryIntegrationTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/mqtt/telemetry/nosql/MqttTelemetryNoSqlIntegrationTest.java b/application/src/test/java/org/thingsboard/server/mqtt/telemetry/nosql/MqttTelemetryNoSqlIntegrationTest.java
index 069397e..1bcf0e0 100644
--- a/application/src/test/java/org/thingsboard/server/mqtt/telemetry/nosql/MqttTelemetryNoSqlIntegrationTest.java
+++ b/application/src/test/java/org/thingsboard/server/mqtt/telemetry/nosql/MqttTelemetryNoSqlIntegrationTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/mqtt/telemetry/sql/MqttTelemetrySqlIntegrationTest.java b/application/src/test/java/org/thingsboard/server/mqtt/telemetry/sql/MqttTelemetrySqlIntegrationTest.java
index bd42827..83680d3 100644
--- a/application/src/test/java/org/thingsboard/server/mqtt/telemetry/sql/MqttTelemetrySqlIntegrationTest.java
+++ b/application/src/test/java/org/thingsboard/server/mqtt/telemetry/sql/MqttTelemetrySqlIntegrationTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/service/mail/TestMailService.java b/application/src/test/java/org/thingsboard/server/service/mail/TestMailService.java
index ed646db..ed3750d 100644
--- a/application/src/test/java/org/thingsboard/server/service/mail/TestMailService.java
+++ b/application/src/test/java/org/thingsboard/server/service/mail/TestMailService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/system/BaseHttpDeviceApiTest.java b/application/src/test/java/org/thingsboard/server/system/BaseHttpDeviceApiTest.java
index 680fa94..4fa6162 100644
--- a/application/src/test/java/org/thingsboard/server/system/BaseHttpDeviceApiTest.java
+++ b/application/src/test/java/org/thingsboard/server/system/BaseHttpDeviceApiTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/system/nosql/DeviceApiNoSqlTest.java b/application/src/test/java/org/thingsboard/server/system/nosql/DeviceApiNoSqlTest.java
index 7ee185c..c24d774 100644
--- a/application/src/test/java/org/thingsboard/server/system/nosql/DeviceApiNoSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/system/nosql/DeviceApiNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/system/sql/DeviceApiSqlTest.java b/application/src/test/java/org/thingsboard/server/system/sql/DeviceApiSqlTest.java
index 2343087..66ad1d3 100644
--- a/application/src/test/java/org/thingsboard/server/system/sql/DeviceApiSqlTest.java
+++ b/application/src/test/java/org/thingsboard/server/system/sql/DeviceApiSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/system/SystemNoSqlTestSuite.java b/application/src/test/java/org/thingsboard/server/system/SystemNoSqlTestSuite.java
index 54c3bc7..70e3fe2 100644
--- a/application/src/test/java/org/thingsboard/server/system/SystemNoSqlTestSuite.java
+++ b/application/src/test/java/org/thingsboard/server/system/SystemNoSqlTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/application/src/test/java/org/thingsboard/server/system/SystemSqlTestSuite.java b/application/src/test/java/org/thingsboard/server/system/SystemSqlTestSuite.java
index 21667a7..cfa0c58 100644
--- a/application/src/test/java/org/thingsboard/server/system/SystemSqlTestSuite.java
+++ b/application/src/test/java/org/thingsboard/server/system/SystemSqlTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
common/data/pom.xml 4(+2 -2)
diff --git a/common/data/pom.xml b/common/data/pom.xml
index 11e62e8..577fcff 100644
--- a/common/data/pom.xml
+++ b/common/data/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/AdminSettings.java b/common/data/src/main/java/org/thingsboard/server/common/data/AdminSettings.java
index 167c6f7..59ddacd 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/AdminSettings.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/AdminSettings.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/Alarm.java b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/Alarm.java
index 3fa6f62..70f5042 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/Alarm.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/Alarm.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmId.java b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmId.java
index ad0fd5b..268bdcb 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmInfo.java b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmInfo.java
index ef24f1c..4742dd6 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmInfo.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmInfo.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmQuery.java
index 55019c8..4a6e41b 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmQuery.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmQuery.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmSearchStatus.java b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmSearchStatus.java
index c09b1fd..9dd830e 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmSearchStatus.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmSearchStatus.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.common.data.alarm;
public enum AlarmSearchStatus {
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmSeverity.java b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmSeverity.java
index ed73027..ddf148c 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmSeverity.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmSeverity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmStatus.java b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmStatus.java
index a8704b2..541a61d 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmStatus.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/alarm/AlarmStatus.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/asset/Asset.java b/common/data/src/main/java/org/thingsboard/server/common/data/asset/Asset.java
index 382a2d7..cc3c111 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/asset/Asset.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/asset/Asset.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -17,14 +17,16 @@ package org.thingsboard.server.common.data.asset;
import com.fasterxml.jackson.databind.JsonNode;
import lombok.EqualsAndHashCode;
+import org.thingsboard.server.common.data.HasAdditionalInfo;
import org.thingsboard.server.common.data.HasName;
import org.thingsboard.server.common.data.SearchTextBased;
+import org.thingsboard.server.common.data.SearchTextBasedWithAdditionalInfo;
import org.thingsboard.server.common.data.id.AssetId;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.TenantId;
@EqualsAndHashCode(callSuper = true)
-public class Asset extends SearchTextBased<AssetId> implements HasName {
+public class Asset extends SearchTextBasedWithAdditionalInfo<AssetId> implements HasName {
private static final long serialVersionUID = 2807343040519543363L;
@@ -32,7 +34,6 @@ public class Asset extends SearchTextBased<AssetId> implements HasName {
private CustomerId customerId;
private String name;
private String type;
- private transient JsonNode additionalInfo;
public Asset() {
super();
@@ -48,7 +49,6 @@ public class Asset extends SearchTextBased<AssetId> implements HasName {
this.customerId = asset.getCustomerId();
this.name = asset.getName();
this.type = asset.getType();
- this.additionalInfo = asset.getAdditionalInfo();
}
public TenantId getTenantId() {
@@ -84,14 +84,6 @@ public class Asset extends SearchTextBased<AssetId> implements HasName {
this.type = type;
}
- public JsonNode getAdditionalInfo() {
- return additionalInfo;
- }
-
- public void setAdditionalInfo(JsonNode additionalInfo) {
- this.additionalInfo = additionalInfo;
- }
-
@Override
public String getSearchText() {
return getName();
@@ -109,7 +101,7 @@ public class Asset extends SearchTextBased<AssetId> implements HasName {
builder.append(", type=");
builder.append(type);
builder.append(", additionalInfo=");
- builder.append(additionalInfo);
+ builder.append(getAdditionalInfo());
builder.append(", createdTime=");
builder.append(createdTime);
builder.append(", id=");
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 b955fdb..4c1739f 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/audit/ActionStatus.java b/common/data/src/main/java/org/thingsboard/server/common/data/audit/ActionStatus.java
new file mode 100644
index 0000000..8638834
--- /dev/null
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/audit/ActionStatus.java
@@ -0,0 +1,20 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+public enum ActionStatus {
+ SUCCESS, FAILURE
+}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/audit/ActionType.java b/common/data/src/main/java/org/thingsboard/server/common/data/audit/ActionType.java
new file mode 100644
index 0000000..ea442f0
--- /dev/null
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/audit/ActionType.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import lombok.Getter;
+
+@Getter
+public enum ActionType {
+ ADDED(false), // log entity
+ DELETED(false), // log string id
+ UPDATED(false), // log entity
+ ATTRIBUTES_UPDATED(false), // log attributes/values
+ ATTRIBUTES_DELETED(false), // log attributes
+ RPC_CALL(false), // log method and params
+ CREDENTIALS_UPDATED(false), // log new credentials
+ ASSIGNED_TO_CUSTOMER(false), // log customer name
+ UNASSIGNED_FROM_CUSTOMER(false), // log customer name
+ ACTIVATED(false), // log string id
+ SUSPENDED(false), // log string id
+ CREDENTIALS_READ(true), // log device id
+ ATTRIBUTES_READ(true); // log attributes
+
+ private final boolean isRead;
+
+ ActionType(boolean isRead) {
+ this.isRead = isRead;
+ }
+}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/audit/AuditLog.java b/common/data/src/main/java/org/thingsboard/server/common/data/audit/AuditLog.java
new file mode 100644
index 0000000..0fb27b2
--- /dev/null
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/audit/AuditLog.java
@@ -0,0 +1,60 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.thingsboard.server.common.data.BaseData;
+import org.thingsboard.server.common.data.id.*;
+
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class AuditLog extends BaseData<AuditLogId> {
+
+ private TenantId tenantId;
+ private CustomerId customerId;
+ private EntityId entityId;
+ private String entityName;
+ private UserId userId;
+ private String userName;
+ private ActionType actionType;
+ private JsonNode actionData;
+ private ActionStatus actionStatus;
+ private String actionFailureDetails;
+
+ public AuditLog() {
+ super();
+ }
+
+ public AuditLog(AuditLogId id) {
+ super(id);
+ }
+
+ public AuditLog(AuditLog auditLog) {
+ super(auditLog);
+ this.tenantId = auditLog.getTenantId();
+ this.customerId = auditLog.getCustomerId();
+ this.entityId = auditLog.getEntityId();
+ this.entityName = auditLog.getEntityName();
+ this.userId = auditLog.getUserId();
+ this.userName = auditLog.getUserName();
+ this.actionType = auditLog.getActionType();
+ this.actionData = auditLog.getActionData();
+ this.actionStatus = auditLog.getActionStatus();
+ this.actionFailureDetails = auditLog.getActionFailureDetails();
+ }
+}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/BaseData.java b/common/data/src/main/java/org/thingsboard/server/common/data/BaseData.java
index d30081f..06579e8 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/BaseData.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/BaseData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 dfcc63f..88f7631 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -17,4 +17,6 @@ package org.thingsboard.server.common.data;
public class CacheConstants {
public static final String DEVICE_CREDENTIALS_CACHE = "deviceCredentials";
+ public static final String RELATIONS_CACHE = "relations";
+ public static final String DEVICE_CACHE = "devices";
}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/ContactBased.java b/common/data/src/main/java/org/thingsboard/server/common/data/ContactBased.java
index d5252a0..9d24d06 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/ContactBased.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/ContactBased.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -19,7 +19,7 @@ import lombok.EqualsAndHashCode;
import org.thingsboard.server.common.data.id.UUIDBased;
@EqualsAndHashCode(callSuper = true)
-public abstract class ContactBased<I extends UUIDBased> extends SearchTextBased<I> {
+public abstract class ContactBased<I extends UUIDBased> extends SearchTextBasedWithAdditionalInfo<I> {
private static final long serialVersionUID = 5047448057830660988L;
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/Customer.java b/common/data/src/main/java/org/thingsboard/server/common/data/Customer.java
index 7754e88..03115a9 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/Customer.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/Customer.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -29,8 +29,7 @@ public class Customer extends ContactBased<CustomerId> implements HasName {
private String title;
private TenantId tenantId;
- private transient JsonNode additionalInfo;
-
+
public Customer() {
super();
}
@@ -43,7 +42,6 @@ public class Customer extends ContactBased<CustomerId> implements HasName {
super(customer);
this.tenantId = customer.getTenantId();
this.title = customer.getTitle();
- this.additionalInfo = customer.getAdditionalInfo();
}
public TenantId getTenantId() {
@@ -65,26 +63,23 @@ public class Customer extends ContactBased<CustomerId> implements HasName {
@JsonIgnore
public boolean isPublic() {
if (getAdditionalInfo() != null && getAdditionalInfo().has("isPublic")) {
- return additionalInfo.get("isPublic").asBoolean();
+ return getAdditionalInfo().get("isPublic").asBoolean();
}
return false;
}
+ @JsonIgnore
+ public ShortCustomerInfo toShortCustomerInfo() {
+ return new ShortCustomerInfo(id, title, isPublic());
+ }
+
@Override
@JsonProperty(access = Access.READ_ONLY)
public String getName() {
return title;
}
- public JsonNode getAdditionalInfo() {
- return additionalInfo;
- }
-
- public void setAdditionalInfo(JsonNode additionalInfo) {
- this.additionalInfo = additionalInfo;
- }
-
@Override
public String getSearchText() {
return getTitle();
@@ -94,7 +89,6 @@ public class Customer extends ContactBased<CustomerId> implements HasName {
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
- result = prime * result + ((additionalInfo == null) ? 0 : additionalInfo.hashCode());
result = prime * result + ((tenantId == null) ? 0 : tenantId.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
@@ -109,11 +103,6 @@ public class Customer extends ContactBased<CustomerId> implements HasName {
if (getClass() != obj.getClass())
return false;
Customer other = (Customer) obj;
- if (additionalInfo == null) {
- if (other.additionalInfo != null)
- return false;
- } else if (!additionalInfo.equals(other.additionalInfo))
- return false;
if (tenantId == null) {
if (other.tenantId != null)
return false;
@@ -135,7 +124,7 @@ public class Customer extends ContactBased<CustomerId> implements HasName {
builder.append(", tenantId=");
builder.append(tenantId);
builder.append(", additionalInfo=");
- builder.append(additionalInfo);
+ builder.append(getAdditionalInfo());
builder.append(", country=");
builder.append(country);
builder.append(", state=");
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/Dashboard.java b/common/data/src/main/java/org/thingsboard/server/common/data/Dashboard.java
index 71f2b13..644d865 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/Dashboard.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/Dashboard.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -79,8 +79,6 @@ public class Dashboard extends DashboardInfo {
StringBuilder builder = new StringBuilder();
builder.append("Dashboard [tenantId=");
builder.append(getTenantId());
- builder.append(", customerId=");
- builder.append(getCustomerId());
builder.append(", title=");
builder.append(getTitle());
builder.append(", configuration=");
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/DashboardInfo.java b/common/data/src/main/java/org/thingsboard/server/common/data/DashboardInfo.java
index 15898c6..ff908fc 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/DashboardInfo.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/DashboardInfo.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -20,11 +20,13 @@ import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
+import java.util.*;
+
public class DashboardInfo extends SearchTextBased<DashboardId> implements HasName {
private TenantId tenantId;
- private CustomerId customerId;
private String title;
+ private Set<ShortCustomerInfo> assignedCustomers;
public DashboardInfo() {
super();
@@ -37,8 +39,8 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa
public DashboardInfo(DashboardInfo dashboardInfo) {
super(dashboardInfo);
this.tenantId = dashboardInfo.getTenantId();
- this.customerId = dashboardInfo.getCustomerId();
this.title = dashboardInfo.getTitle();
+ this.assignedCustomers = dashboardInfo.getAssignedCustomers();
}
public TenantId getTenantId() {
@@ -49,14 +51,6 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa
this.tenantId = tenantId;
}
- public CustomerId getCustomerId() {
- return customerId;
- }
-
- public void setCustomerId(CustomerId customerId) {
- this.customerId = customerId;
- }
-
public String getTitle() {
return title;
}
@@ -65,6 +59,62 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa
this.title = title;
}
+ public Set<ShortCustomerInfo> getAssignedCustomers() {
+ return assignedCustomers;
+ }
+
+ public void setAssignedCustomers(Set<ShortCustomerInfo> assignedCustomers) {
+ this.assignedCustomers = assignedCustomers;
+ }
+
+ public boolean isAssignedToCustomer(CustomerId customerId) {
+ return this.assignedCustomers != null && this.assignedCustomers.contains(new ShortCustomerInfo(customerId, null, false));
+ }
+
+ public ShortCustomerInfo getAssignedCustomerInfo(CustomerId customerId) {
+ if (this.assignedCustomers != null) {
+ for (ShortCustomerInfo customerInfo : this.assignedCustomers) {
+ if (customerInfo.getCustomerId().equals(customerId)) {
+ return customerInfo;
+ }
+ }
+ }
+ return null;
+ }
+
+ public boolean addAssignedCustomer(Customer customer) {
+ ShortCustomerInfo customerInfo = customer.toShortCustomerInfo();
+ if (this.assignedCustomers != null && this.assignedCustomers.contains(customerInfo)) {
+ return false;
+ } else {
+ if (this.assignedCustomers == null) {
+ this.assignedCustomers = new HashSet<>();
+ }
+ this.assignedCustomers.add(customerInfo);
+ return true;
+ }
+ }
+
+ public boolean updateAssignedCustomer(Customer customer) {
+ ShortCustomerInfo customerInfo = customer.toShortCustomerInfo();
+ if (this.assignedCustomers != null && this.assignedCustomers.contains(customerInfo)) {
+ this.assignedCustomers.add(customerInfo);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public boolean removeAssignedCustomer(Customer customer) {
+ ShortCustomerInfo customerInfo = customer.toShortCustomerInfo();
+ if (this.assignedCustomers != null && this.assignedCustomers.contains(customerInfo)) {
+ this.assignedCustomers.remove(customerInfo);
+ return true;
+ } else {
+ return false;
+ }
+ }
+
@Override
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
public String getName() {
@@ -80,7 +130,6 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
- result = prime * result + ((customerId == null) ? 0 : customerId.hashCode());
result = prime * result + ((tenantId == null) ? 0 : tenantId.hashCode());
result = prime * result + ((title == null) ? 0 : title.hashCode());
return result;
@@ -95,11 +144,6 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa
if (getClass() != obj.getClass())
return false;
DashboardInfo other = (DashboardInfo) obj;
- if (customerId == null) {
- if (other.customerId != null)
- return false;
- } else if (!customerId.equals(other.customerId))
- return false;
if (tenantId == null) {
if (other.tenantId != null)
return false;
@@ -118,8 +162,6 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa
StringBuilder builder = new StringBuilder();
builder.append("DashboardInfo [tenantId=");
builder.append(tenantId);
- builder.append(", customerId=");
- builder.append(customerId);
builder.append(", title=");
builder.append(title);
builder.append("]");
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 47e992f..a776d7b 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/Device.java b/common/data/src/main/java/org/thingsboard/server/common/data/Device.java
index 131a310..13fa011 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/Device.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/Device.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -23,7 +23,7 @@ import org.thingsboard.server.common.data.id.TenantId;
import com.fasterxml.jackson.databind.JsonNode;
@EqualsAndHashCode(callSuper = true)
-public class Device extends SearchTextBased<DeviceId> implements HasName {
+public class Device extends SearchTextBasedWithAdditionalInfo<DeviceId> implements HasName {
private static final long serialVersionUID = 2807343040519543363L;
@@ -31,7 +31,6 @@ public class Device extends SearchTextBased<DeviceId> implements HasName {
private CustomerId customerId;
private String name;
private String type;
- private transient JsonNode additionalInfo;
public Device() {
super();
@@ -47,7 +46,6 @@ public class Device extends SearchTextBased<DeviceId> implements HasName {
this.customerId = device.getCustomerId();
this.name = device.getName();
this.type = device.getType();
- this.additionalInfo = device.getAdditionalInfo();
}
public TenantId getTenantId() {
@@ -83,14 +81,6 @@ public class Device extends SearchTextBased<DeviceId> implements HasName {
this.type = type;
}
- public JsonNode getAdditionalInfo() {
- return additionalInfo;
- }
-
- public void setAdditionalInfo(JsonNode additionalInfo) {
- this.additionalInfo = additionalInfo;
- }
-
@Override
public String getSearchText() {
return getName();
@@ -108,7 +98,7 @@ public class Device extends SearchTextBased<DeviceId> implements HasName {
builder.append(", type=");
builder.append(type);
builder.append(", additionalInfo=");
- builder.append(additionalInfo);
+ builder.append(getAdditionalInfo());
builder.append(", createdTime=");
builder.append(createdTime);
builder.append(", id=");
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 243eeb7..04c809a 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/EntitySubtype.java b/common/data/src/main/java/org/thingsboard/server/common/data/EntitySubtype.java
index 21bdf1e..944aa55 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/EntitySubtype.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/EntitySubtype.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/EntityType.java b/common/data/src/main/java/org/thingsboard/server/common/data/EntityType.java
index ebf42f2..05b558e 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/EntityType.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/EntityType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/Event.java b/common/data/src/main/java/org/thingsboard/server/common/data/Event.java
index af760e4..9ac17bf 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/Event.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/Event.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/HasAdditionalInfo.java b/common/data/src/main/java/org/thingsboard/server/common/data/HasAdditionalInfo.java
new file mode 100644
index 0000000..751321e
--- /dev/null
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/HasAdditionalInfo.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright © 2016-2018 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 com.fasterxml.jackson.databind.JsonNode;
+
+public interface HasAdditionalInfo {
+
+ JsonNode getAdditionalInfo();
+
+}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/HasName.java b/common/data/src/main/java/org/thingsboard/server/common/data/HasName.java
index f431989..763300c 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/HasName.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/HasName.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/AdminSettingsId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/AdminSettingsId.java
index b1930f7..2011d65 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/AdminSettingsId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/AdminSettingsId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/AssetId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/AssetId.java
index 049116e..a3e63a3 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/AssetId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/AssetId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/AuditLogId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/AuditLogId.java
new file mode 100644
index 0000000..ce3110a
--- /dev/null
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/AuditLogId.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright © 2016-2018 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.id;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.UUID;
+
+public class AuditLogId extends UUIDBased {
+
+ private static final long serialVersionUID = 1L;
+
+ @JsonCreator
+ public AuditLogId(@JsonProperty("id") UUID id) {
+ super(id);
+ }
+
+ public static AuditLogId fromString(String auditLogId) {
+ return new AuditLogId(UUID.fromString(auditLogId));
+ }
+}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/ComponentDescriptorId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/ComponentDescriptorId.java
index de75030..d165969 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/ComponentDescriptorId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/ComponentDescriptorId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/CustomerId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/CustomerId.java
index 4d0e762..860ab27 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/CustomerId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/CustomerId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/DashboardId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/DashboardId.java
index a9a3441..1bd1e61 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/DashboardId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/DashboardId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceCredentialsId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceCredentialsId.java
index 31e5769..8506915 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceCredentialsId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceCredentialsId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java
index ac2cbf1..5c41e79 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/DeviceId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityId.java
index 197762b..de4da7f 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdDeserializer.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdDeserializer.java
index f9f34c4..db53c3a 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdDeserializer.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdDeserializer.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdFactory.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdFactory.java
index 1f77904..e45cb91 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdFactory.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdFactory.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdSerializer.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdSerializer.java
index 18ffaea..4b1afa9 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdSerializer.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/EntityIdSerializer.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/EventId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/EventId.java
index 979bdd6..c7a44f8 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/EventId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/EventId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/IdBased.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/IdBased.java
index 4417f83..6ac5136 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/IdBased.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/IdBased.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/NodeId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/NodeId.java
index 12b5f4a..28d5cb8 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/NodeId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/NodeId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/PluginId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/PluginId.java
index 1d0dfa0..d3ce466 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/PluginId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/PluginId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/RuleId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/RuleId.java
index fe4a77a..6f14042 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/RuleId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/RuleId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/SessionId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/SessionId.java
index 60f1f44..1b47727 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/SessionId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/SessionId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/TenantId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/TenantId.java
index e28d64f..8ba0a72 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/TenantId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/TenantId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/UserCredentialsId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/UserCredentialsId.java
index afbf96f..4e4a9f9 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/UserCredentialsId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/UserCredentialsId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/UserId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/UserId.java
index 31b6642..d9a0ef5 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/UserId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/UserId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/UUIDBased.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/UUIDBased.java
index e39fd7a..4670064 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/UUIDBased.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/UUIDBased.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -20,8 +20,6 @@ import java.util.UUID;
public abstract class UUIDBased implements Serializable {
- public static final UUID EMPTY = new UUID(0L, 0L);
-
private static final long serialVersionUID = 1L;
private final UUID id;
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetsBundleId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetsBundleId.java
index 1b4937e..7d8e853 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetsBundleId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetsBundleId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetTypeId.java b/common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetTypeId.java
index 715b9cb..df04222 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetTypeId.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/id/WidgetTypeId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/Aggregation.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/Aggregation.java
index 479a49a..24c91f5 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/Aggregation.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/Aggregation.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/AttributeKey.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/AttributeKey.java
index 5a3cbfb..e35b665 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/AttributeKey.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/AttributeKey.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/AttributeKvEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/AttributeKvEntry.java
index bbfd58e..fe77434 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/AttributeKvEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/AttributeKvEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BaseAttributeKvEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BaseAttributeKvEntry.java
index cca3727..b131322 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BaseAttributeKvEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BaseAttributeKvEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BaseTsKvQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BaseTsKvQuery.java
index e95496b..0afe00b 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BaseTsKvQuery.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BaseTsKvQuery.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BasicKvEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BasicKvEntry.java
index d6b2a91..809e8c4 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BasicKvEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BasicKvEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BasicTsKvEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BasicTsKvEntry.java
index a80335b..9aae1a3 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BasicTsKvEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BasicTsKvEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BooleanDataEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BooleanDataEntry.java
index 5a5bae5..30c3b5d 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/BooleanDataEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/BooleanDataEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/DataType.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/DataType.java
index 4df811b..093d267 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/DataType.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/DataType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/DoubleDataEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/DoubleDataEntry.java
index 2aeeb3e..dda906b 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/DoubleDataEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/DoubleDataEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/KvEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/KvEntry.java
index d5dd7b2..c1579ca 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/KvEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/KvEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/LongDataEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/LongDataEntry.java
index a040e7a..eb34389 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/LongDataEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/LongDataEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/StringDataEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/StringDataEntry.java
index f0b7842..9131e20 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/StringDataEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/StringDataEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/TsKvEntry.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/TsKvEntry.java
index 9594bbc..1d4b3c9 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/TsKvEntry.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/TsKvEntry.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/kv/TsKvQuery.java b/common/data/src/main/java/org/thingsboard/server/common/data/kv/TsKvQuery.java
index 8ede698..ca9f90c 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/kv/TsKvQuery.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/kv/TsKvQuery.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/page/BasePageLink.java b/common/data/src/main/java/org/thingsboard/server/common/data/page/BasePageLink.java
index 55abd09..0b1802c 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/page/BasePageLink.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/page/BasePageLink.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/page/PageDataIterable.java b/common/data/src/main/java/org/thingsboard/server/common/data/page/PageDataIterable.java
index e8a3eb1..34f8c3a 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/page/PageDataIterable.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/page/PageDataIterable.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/page/TextPageData.java b/common/data/src/main/java/org/thingsboard/server/common/data/page/TextPageData.java
index 2005d9e..73f2e63 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/page/TextPageData.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/page/TextPageData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/page/TextPageLink.java b/common/data/src/main/java/org/thingsboard/server/common/data/page/TextPageLink.java
index 015e3cb..e40f8df 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/page/TextPageLink.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/page/TextPageLink.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/page/TimePageData.java b/common/data/src/main/java/org/thingsboard/server/common/data/page/TimePageData.java
index 10250a6..34b94ce 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/page/TimePageData.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/page/TimePageData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/page/TimePageLink.java b/common/data/src/main/java/org/thingsboard/server/common/data/page/TimePageLink.java
index 521a813..7dd346f 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/page/TimePageLink.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/page/TimePageLink.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentDescriptor.java b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentDescriptor.java
index 2db1a38..02cc9ae 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentDescriptor.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentDescriptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleEvent.java b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleEvent.java
index 9257648..b74f5cd 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleEvent.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleEvent.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleState.java b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleState.java
index 025a819..d3f9e1a 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleState.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentLifecycleState.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentScope.java b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentScope.java
index 1e3fb0c..063dc6b 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentScope.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentScope.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentType.java b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentType.java
index 386f717..45fb590 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentType.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/ComponentType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/PluginMetaData.java b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/PluginMetaData.java
index 755cf71..8576264 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/plugin/PluginMetaData.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/plugin/PluginMetaData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,16 +15,24 @@
*/
package org.thingsboard.server.common.data.plugin;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.EqualsAndHashCode;
+import lombok.extern.slf4j.Slf4j;
import org.thingsboard.server.common.data.HasName;
-import org.thingsboard.server.common.data.SearchTextBased;
+import org.thingsboard.server.common.data.SearchTextBasedWithAdditionalInfo;
import org.thingsboard.server.common.data.id.PluginId;
import org.thingsboard.server.common.data.id.TenantId;
import com.fasterxml.jackson.databind.JsonNode;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
@EqualsAndHashCode(callSuper = true)
-public class PluginMetaData extends SearchTextBased<PluginId> implements HasName {
+@Slf4j
+public class PluginMetaData extends SearchTextBasedWithAdditionalInfo<PluginId> implements HasName {
private static final long serialVersionUID = 1L;
@@ -35,7 +43,9 @@ public class PluginMetaData extends SearchTextBased<PluginId> implements HasName
private boolean publicAccess;
private ComponentLifecycleState state;
private transient JsonNode configuration;
- private transient JsonNode additionalInfo;
+ @JsonIgnore
+ private byte[] configurationBytes;
+
public PluginMetaData() {
super();
@@ -54,7 +64,6 @@ public class PluginMetaData extends SearchTextBased<PluginId> implements HasName
this.publicAccess = plugin.isPublicAccess();
this.state = plugin.getState();
this.configuration = plugin.getConfiguration();
- this.additionalInfo = plugin.getAdditionalInfo();
}
@Override
@@ -96,11 +105,11 @@ public class PluginMetaData extends SearchTextBased<PluginId> implements HasName
}
public JsonNode getConfiguration() {
- return configuration;
+ return getJson(() -> configuration, () -> configurationBytes);
}
- public void setConfiguration(JsonNode configuration) {
- this.configuration = configuration;
+ public void setConfiguration(JsonNode data) {
+ setJson(data, json -> this.configuration = json, bytes -> this.configurationBytes = bytes);
}
public boolean isPublicAccess() {
@@ -119,14 +128,6 @@ public class PluginMetaData extends SearchTextBased<PluginId> implements HasName
return state;
}
- public JsonNode getAdditionalInfo() {
- return additionalInfo;
- }
-
- public void setAdditionalInfo(JsonNode additionalInfo) {
- this.additionalInfo = additionalInfo;
- }
-
@Override
public String toString() {
return "PluginMetaData [apiToken=" + apiToken + ", tenantId=" + tenantId + ", name=" + name + ", clazz=" + clazz + ", publicAccess=" + publicAccess
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelation.java b/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelation.java
index f9d70fa..aa55b43 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelation.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelation.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,10 +15,20 @@
*/
package org.thingsboard.server.common.data.relation;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.thingsboard.server.common.data.SearchTextBasedWithAdditionalInfo;
import org.thingsboard.server.common.data.id.EntityId;
-public class EntityRelation {
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.Serializable;
+
+@Slf4j
+public class EntityRelation implements Serializable {
private static final long serialVersionUID = 2807343040519543363L;
@@ -29,7 +39,9 @@ public class EntityRelation {
private EntityId to;
private String type;
private RelationTypeGroup typeGroup;
- private JsonNode additionalInfo;
+ private transient JsonNode additionalInfo;
+ @JsonIgnore
+ private byte[] additionalInfoBytes;
public EntityRelation() {
super();
@@ -92,11 +104,11 @@ public class EntityRelation {
}
public JsonNode getAdditionalInfo() {
- return additionalInfo;
+ return SearchTextBasedWithAdditionalInfo.getJson(() -> additionalInfo, () -> additionalInfoBytes);
}
- public void setAdditionalInfo(JsonNode additionalInfo) {
- this.additionalInfo = additionalInfo;
+ public void setAdditionalInfo(JsonNode addInfo) {
+ SearchTextBasedWithAdditionalInfo.setJson(addInfo, json -> this.additionalInfo = json, bytes -> this.additionalInfoBytes = bytes);
}
@Override
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationInfo.java b/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationInfo.java
index 5012691..38293f9 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationInfo.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntityRelationInfo.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.common.data.relation;
public class EntityRelationInfo extends EntityRelation {
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 20bc141..2ccfe2f 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntitySearchDirection.java b/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntitySearchDirection.java
index 98cf9c8..6b46e4c 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntitySearchDirection.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/relation/EntitySearchDirection.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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/EntityTypeFilter.java
index 7415158..39f1d47 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/EntityTypeFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationsSearchParameters.java b/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationsSearchParameters.java
index 8fa2ca2..2e976f2 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationsSearchParameters.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationsSearchParameters.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java b/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java
index 82798ab..90e0253 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/relation/RelationTypeGroup.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -18,6 +18,7 @@ package org.thingsboard.server.common.data.relation;
public enum RelationTypeGroup {
COMMON,
- ALARM
+ ALARM,
+ DASHBOARD
}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleMetaData.java b/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleMetaData.java
index 1fd72c2..98adeb7 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleMetaData.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleMetaData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,18 +15,23 @@
*/
package org.thingsboard.server.common.data.rule;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.extern.slf4j.Slf4j;
import org.thingsboard.server.common.data.HasName;
-import org.thingsboard.server.common.data.SearchTextBased;
+import org.thingsboard.server.common.data.SearchTextBasedWithAdditionalInfo;
import org.thingsboard.server.common.data.id.RuleId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.plugin.ComponentLifecycleState;
@Data
@EqualsAndHashCode(callSuper = true)
-public class RuleMetaData extends SearchTextBased<RuleId> implements HasName {
+@Slf4j
+public class RuleMetaData extends SearchTextBasedWithAdditionalInfo<RuleId> implements HasName {
private static final long serialVersionUID = -5656679015122935465L;
@@ -38,7 +43,13 @@ public class RuleMetaData extends SearchTextBased<RuleId> implements HasName {
private transient JsonNode filters;
private transient JsonNode processor;
private transient JsonNode action;
- private transient JsonNode additionalInfo;
+ @JsonIgnore
+ private byte[] filtersBytes;
+ @JsonIgnore
+ private byte[] processorBytes;
+ @JsonIgnore
+ private byte[] actionBytes;
+
public RuleMetaData() {
super();
@@ -55,10 +66,9 @@ public class RuleMetaData extends SearchTextBased<RuleId> implements HasName {
this.state = rule.getState();
this.weight = rule.getWeight();
this.pluginToken = rule.getPluginToken();
- this.filters = rule.getFilters();
- this.processor = rule.getProcessor();
- this.action = rule.getAction();
- this.additionalInfo = rule.getAdditionalInfo();
+ this.setFilters(rule.getFilters());
+ this.setProcessor(rule.getProcessor());
+ this.setAction(rule.getAction());
}
@Override
@@ -71,4 +81,29 @@ public class RuleMetaData extends SearchTextBased<RuleId> implements HasName {
return name;
}
+ public JsonNode getFilters() {
+ return SearchTextBasedWithAdditionalInfo.getJson(() -> filters, () -> filtersBytes);
+ }
+
+ public JsonNode getProcessor() {
+ return SearchTextBasedWithAdditionalInfo.getJson(() -> processor, () -> processorBytes);
+ }
+
+ public JsonNode getAction() {
+ return SearchTextBasedWithAdditionalInfo.getJson(() -> action, () -> actionBytes);
+ }
+
+ public void setFilters(JsonNode data) {
+ setJson(data, json -> this.filters = json, bytes -> this.filtersBytes = bytes);
+ }
+
+ public void setProcessor(JsonNode data) {
+ setJson(data, json -> this.processor = json, bytes -> this.processorBytes = bytes);
+ }
+
+ public void setAction(JsonNode data) {
+ setJson(data, json -> this.action = json, bytes -> this.actionBytes = bytes);
+ }
+
+
}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleType.java b/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleType.java
index 7459399..41e75fd 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleType.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/rule/RuleType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/rule/Scope.java b/common/data/src/main/java/org/thingsboard/server/common/data/rule/Scope.java
index 238ecaa..64cb3f1 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/rule/Scope.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/rule/Scope.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/SearchTextBased.java b/common/data/src/main/java/org/thingsboard/server/common/data/SearchTextBased.java
index cff689c..0952ea1 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/SearchTextBased.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/SearchTextBased.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/SearchTextBasedWithAdditionalInfo.java b/common/data/src/main/java/org/thingsboard/server/common/data/SearchTextBasedWithAdditionalInfo.java
new file mode 100644
index 0000000..1552028
--- /dev/null
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/SearchTextBasedWithAdditionalInfo.java
@@ -0,0 +1,105 @@
+/**
+ * Copyright © 2016-2018 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 com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.extern.slf4j.Slf4j;
+import org.thingsboard.server.common.data.id.UUIDBased;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.function.Supplier;
+import java.util.function.Consumer;
+
+/**
+ * Created by ashvayka on 19.02.18.
+ */
+@Slf4j
+public abstract class SearchTextBasedWithAdditionalInfo<I extends UUIDBased> extends SearchTextBased<I> implements HasAdditionalInfo {
+
+ private transient JsonNode additionalInfo;
+ @JsonIgnore
+ private byte[] additionalInfoBytes;
+
+ public SearchTextBasedWithAdditionalInfo() {
+ super();
+ }
+
+ public SearchTextBasedWithAdditionalInfo(I id) {
+ super(id);
+ }
+
+ public SearchTextBasedWithAdditionalInfo(SearchTextBasedWithAdditionalInfo<I> searchTextBased) {
+ super(searchTextBased);
+ setAdditionalInfo(searchTextBased.getAdditionalInfo());
+ }
+
+ @Override
+ public JsonNode getAdditionalInfo() {
+ return getJson(() -> additionalInfo, () -> additionalInfoBytes);
+ }
+
+ public void setAdditionalInfo(JsonNode addInfo) {
+ setJson(addInfo, json -> this.additionalInfo = json, bytes -> this.additionalInfoBytes = bytes);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ if (!super.equals(o)) return false;
+ SearchTextBasedWithAdditionalInfo<?> that = (SearchTextBasedWithAdditionalInfo<?>) o;
+ return Arrays.equals(additionalInfoBytes, that.additionalInfoBytes);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), additionalInfoBytes);
+ }
+
+ public static JsonNode getJson(Supplier<JsonNode> jsonData, Supplier<byte[]> binaryData) {
+ JsonNode json = jsonData.get();
+ if (json != null) {
+ return json;
+ } else {
+ byte[] data = binaryData.get();
+ if (data != null) {
+ try {
+ return new ObjectMapper().readTree(new ByteArrayInputStream(data));
+ } catch (IOException e) {
+ log.warn("Can't deserialize json data: ", e);
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+ }
+
+ public static void setJson(JsonNode json, Consumer<JsonNode> jsonConsumer, Consumer<byte[]> bytesConsumer) {
+ jsonConsumer.accept(json);
+ try {
+ bytesConsumer.accept(new ObjectMapper().writeValueAsBytes(json));
+ } catch (JsonProcessingException e) {
+ log.warn("Can't serialize json data: ", e);
+ }
+ }
+}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/Authority.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/Authority.java
index b308161..15dd93f 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/security/Authority.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/Authority.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentials.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentials.java
index a835d61..8e3955c 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentials.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentials.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsFilter.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsFilter.java
index 5e63f83..a59cc63 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsFilter.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsType.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsType.java
index e37bc0d..665eda0 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsType.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceCredentialsType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceTokenCredentials.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceTokenCredentials.java
index 78805ff..6dcafb1 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceTokenCredentials.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceTokenCredentials.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceX509Credentials.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceX509Credentials.java
index a7f23a8..4639452 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceX509Credentials.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/DeviceX509Credentials.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/security/UserCredentials.java b/common/data/src/main/java/org/thingsboard/server/common/data/security/UserCredentials.java
index 7069016..a0a9e1e 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/security/UserCredentials.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/security/UserCredentials.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/ShortCustomerInfo.java b/common/data/src/main/java/org/thingsboard/server/common/data/ShortCustomerInfo.java
new file mode 100644
index 0000000..974f2bf
--- /dev/null
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/ShortCustomerInfo.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright © 2016-2018 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.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+import org.thingsboard.server.common.data.id.CustomerId;
+
+/**
+ * Created by igor on 2/27/18.
+ */
+
+@AllArgsConstructor
+public class ShortCustomerInfo {
+
+ @Getter @Setter
+ private CustomerId customerId;
+
+ @Getter @Setter
+ private String title;
+
+ @Getter @Setter
+ private boolean isPublic;
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ShortCustomerInfo that = (ShortCustomerInfo) o;
+
+ return customerId.equals(that.customerId);
+
+ }
+
+ @Override
+ public int hashCode() {
+ return customerId.hashCode();
+ }
+}
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/Tenant.java b/common/data/src/main/java/org/thingsboard/server/common/data/Tenant.java
index bb209f1..7f41741 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/Tenant.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/Tenant.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -28,8 +28,7 @@ public class Tenant extends ContactBased<TenantId> implements HasName {
private String title;
private String region;
- private transient JsonNode additionalInfo;
-
+
public Tenant() {
super();
}
@@ -42,7 +41,6 @@ public class Tenant extends ContactBased<TenantId> implements HasName {
super(tenant);
this.title = tenant.getTitle();
this.region = tenant.getRegion();
- this.additionalInfo = tenant.getAdditionalInfo();
}
public String getTitle() {
@@ -67,14 +65,6 @@ public class Tenant extends ContactBased<TenantId> implements HasName {
this.region = region;
}
- public JsonNode getAdditionalInfo() {
- return additionalInfo;
- }
-
- public void setAdditionalInfo(JsonNode additionalInfo) {
- this.additionalInfo = additionalInfo;
- }
-
@Override
public String getSearchText() {
return getTitle();
@@ -88,7 +78,7 @@ public class Tenant extends ContactBased<TenantId> implements HasName {
builder.append(", region=");
builder.append(region);
builder.append(", additionalInfo=");
- builder.append(additionalInfo);
+ builder.append(getAdditionalInfo());
builder.append(", country=");
builder.append(country);
builder.append(", state=");
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/User.java b/common/data/src/main/java/org/thingsboard/server/common/data/User.java
index a648899..c893d64 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/User.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/User.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -25,7 +25,7 @@ import org.thingsboard.server.common.data.security.Authority;
import com.fasterxml.jackson.databind.JsonNode;
@EqualsAndHashCode(callSuper = true)
-public class User extends SearchTextBased<UserId> implements HasName {
+public class User extends SearchTextBasedWithAdditionalInfo<UserId> implements HasName {
private static final long serialVersionUID = 8250339805336035966L;
@@ -35,7 +35,6 @@ public class User extends SearchTextBased<UserId> implements HasName {
private Authority authority;
private String firstName;
private String lastName;
- private transient JsonNode additionalInfo;
public User() {
super();
@@ -53,7 +52,6 @@ public class User extends SearchTextBased<UserId> implements HasName {
this.authority = user.getAuthority();
this.firstName = user.getFirstName();
this.lastName = user.getLastName();
- this.additionalInfo = user.getAdditionalInfo();
}
public TenantId getTenantId() {
@@ -110,14 +108,6 @@ public class User extends SearchTextBased<UserId> implements HasName {
this.lastName = lastName;
}
- public JsonNode getAdditionalInfo() {
- return additionalInfo;
- }
-
- public void setAdditionalInfo(JsonNode additionalInfo) {
- this.additionalInfo = additionalInfo;
- }
-
@Override
public String getSearchText() {
return getEmail();
@@ -139,7 +129,7 @@ public class User extends SearchTextBased<UserId> implements HasName {
builder.append(", lastName=");
builder.append(lastName);
builder.append(", additionalInfo=");
- builder.append(additionalInfo);
+ builder.append(getAdditionalInfo());
builder.append(", createdTime=");
builder.append(createdTime);
builder.append(", id=");
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/UUIDConverter.java b/common/data/src/main/java/org/thingsboard/server/common/data/UUIDConverter.java
index 6bb0391..c18e1e4 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/UUIDConverter.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/UUIDConverter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetsBundle.java b/common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetsBundle.java
index 025cf84..01112b3 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetsBundle.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetsBundle.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetType.java b/common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetType.java
index caffe2d..fc21bdc 100644
--- a/common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetType.java
+++ b/common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java b/common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java
index c7b1a08..b9e3611 100644
--- a/common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java
+++ b/common/data/src/test/java/org/thingsboard/server/common/data/UUIDConverterTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
common/message/pom.xml 4(+2 -2)
diff --git a/common/message/pom.xml b/common/message/pom.xml
index 33466a6..9e97d34 100644
--- a/common/message/pom.xml
+++ b/common/message/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/CustomerAwareMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/CustomerAwareMsg.java
index 01954d4..a7f00c0 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/CustomerAwareMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/CustomerAwareMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/DeviceAwareMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/DeviceAwareMsg.java
index fbc6438..74c0ab6 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/DeviceAwareMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/DeviceAwareMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/NodeAwareMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/NodeAwareMsg.java
index dff1b53..349a095 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/NodeAwareMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/NodeAwareMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/PluginAwareMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/PluginAwareMsg.java
index 16cc778..78859b4 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/PluginAwareMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/PluginAwareMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/RuleAwareMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/RuleAwareMsg.java
index dc23839..b14e882 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/RuleAwareMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/RuleAwareMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/SessionAwareMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/SessionAwareMsg.java
index 0a62a4c..db6ff6f 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/SessionAwareMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/SessionAwareMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/TenantAwareMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/TenantAwareMsg.java
index a670580..cb383bf 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/aware/TenantAwareMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/aware/TenantAwareMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ClusterEventMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ClusterEventMsg.java
index f5ce685..67f4de7 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ClusterEventMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ClusterEventMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ServerAddress.java b/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ServerAddress.java
index a275ef9..4b65d6f 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ServerAddress.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ServerAddress.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ToAllNodesMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ToAllNodesMsg.java
index 338a5e6..1dc33c0 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ToAllNodesMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/cluster/ToAllNodesMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesSubscribeMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesSubscribeMsg.java
index c6d430c..6894ac5 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesSubscribeMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesSubscribeMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUnsubscribeMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUnsubscribeMsg.java
index 073c622..e3fcd6f 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUnsubscribeMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUnsubscribeMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUpdateNotification.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUpdateNotification.java
index 8ba28dd..1329489 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUpdateNotification.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/AttributesUpdateNotification.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicCommandAckResponse.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicCommandAckResponse.java
index 9a0cd7e..ef772c3 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicCommandAckResponse.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicCommandAckResponse.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesRequest.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesRequest.java
index 3db4138..b431c14 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesRequest.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesResponse.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesResponse.java
index 39cc80d..5072de2 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesResponse.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicGetAttributesResponse.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicRequest.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicRequest.java
index af228df..4fcde44 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicRequest.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicResponseMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicResponseMsg.java
index df1dcaa..caaa15c 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicResponseMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicResponseMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicStatusCodeResponse.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicStatusCodeResponse.java
index 5fc4808..22b525b 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicStatusCodeResponse.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicStatusCodeResponse.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicTelemetryUploadRequest.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicTelemetryUploadRequest.java
index 497e845..1d96a65 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicTelemetryUploadRequest.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicTelemetryUploadRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicToDeviceSessionActorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicToDeviceSessionActorMsg.java
index aebe198..6a70891 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicToDeviceSessionActorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicToDeviceSessionActorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicUpdateAttributesRequest.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicUpdateAttributesRequest.java
index 5e75fce..994fe5e 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicUpdateAttributesRequest.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/BasicUpdateAttributesRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesRequest.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesRequest.java
index 8dde754..241bb6b 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesRequest.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesResponse.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesResponse.java
index 35df401..6242d46 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesResponse.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/GetAttributesResponse.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ResponseMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ResponseMsg.java
index 63e6fc2..2eb0959 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ResponseMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ResponseMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/RpcSubscribeMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/RpcSubscribeMsg.java
index 5ebd8dd..d4fc1d7 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/RpcSubscribeMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/RpcSubscribeMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/RpcUnsubscribeMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/RpcUnsubscribeMsg.java
index a0fa895..b1532d7 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/RpcUnsubscribeMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/RpcUnsubscribeMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineError.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineError.java
index 5edef2c..bc8ceb4 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineError.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineError.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineErrorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineErrorMsg.java
index 4f4c778..5cb3314 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineErrorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/RuleEngineErrorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseMsg.java
index 6c52c89..738bc6e 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseNotification.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseNotification.java
index ae3ea77..bf3c982 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseNotification.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionCloseNotification.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionOpenMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionOpenMsg.java
index 215d846..f3a7bc7 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionOpenMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/SessionOpenMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/StatusCodeResponse.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/StatusCodeResponse.java
index fda3dca..b2d8611 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/StatusCodeResponse.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/StatusCodeResponse.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/TelemetryUploadRequest.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/TelemetryUploadRequest.java
index c5f51bf..52c2f9e 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/TelemetryUploadRequest.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/TelemetryUploadRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcRequestMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcRequestMsg.java
index 4c7a117..c9eeb4e 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcRequestMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcRequestMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcResponseMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcResponseMsg.java
index da9b597..ec739b3 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcResponseMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceRpcResponseMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceSessionActorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceSessionActorMsg.java
index 9371d5a..f3e0c0f 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceSessionActorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToDeviceSessionActorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcRequestMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcRequestMsg.java
index f0d2f85..ace51c0 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcRequestMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcRequestMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcResponseMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcResponseMsg.java
index e120f16..b9a43d1 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcResponseMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/ToServerRpcResponseMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/core/UpdateAttributesRequest.java b/common/message/src/main/java/org/thingsboard/server/common/msg/core/UpdateAttributesRequest.java
index 94dc8aa..a298962 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/core/UpdateAttributesRequest.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/core/UpdateAttributesRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/device/BasicToDeviceActorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/device/BasicToDeviceActorMsg.java
index 2d1a2a4..959da7c 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/device/BasicToDeviceActorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/device/BasicToDeviceActorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/device/ToDeviceActorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/device/ToDeviceActorMsg.java
index fdeb14f..72e552d 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/device/ToDeviceActorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/device/ToDeviceActorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/kv/AttributesKVMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/kv/AttributesKVMsg.java
index e3555d8..fa6fe92 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/kv/AttributesKVMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/kv/AttributesKVMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/kv/BasicAttributeKVMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/kv/BasicAttributeKVMsg.java
index 5d0467c..d191cc8 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/kv/BasicAttributeKVMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/kv/BasicAttributeKVMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/plugin/ComponentLifecycleMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/plugin/ComponentLifecycleMsg.java
index 9935d01..d48c3fe 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/plugin/ComponentLifecycleMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/plugin/ComponentLifecycleMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/RuleMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/RuleMsg.java
index 23ded23..ee352ad 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/RuleMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/RuleMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/AdaptorToSessionActorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/AdaptorToSessionActorMsg.java
index 6174199..5383a52 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/AdaptorToSessionActorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/AdaptorToSessionActorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicAdaptorToSessionActorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicAdaptorToSessionActorMsg.java
index d2e3b45..21c28d2 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicAdaptorToSessionActorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicAdaptorToSessionActorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionActorToAdaptorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionActorToAdaptorMsg.java
index 85b22f1..7b23419 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionActorToAdaptorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionActorToAdaptorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionMsg.java
index d4b4c4b..855cce5 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicSessionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicToDeviceActorSessionMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicToDeviceActorSessionMsg.java
index 31ad23c..a318538 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicToDeviceActorSessionMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/BasicToDeviceActorSessionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ctrl/SessionCloseMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ctrl/SessionCloseMsg.java
index c7baaaf..a24bdcd 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ctrl/SessionCloseMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ctrl/SessionCloseMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/ProcessingTimeoutException.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/ProcessingTimeoutException.java
index 4f95cb4..6371f7f 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/ProcessingTimeoutException.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/ProcessingTimeoutException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionAuthException.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionAuthException.java
index f48d04e..5383dff 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionAuthException.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionAuthException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionException.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionException.java
index 4a6adbb..576f759 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionException.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ex/SessionException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/FeatureType.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/FeatureType.java
index 4f65d2f..7644eb8 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/FeatureType.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/FeatureType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceMsg.java
index f3fe1cf..19d45a7 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceRequestMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceRequestMsg.java
index 59a34fa..1ebeb67 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceRequestMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/FromDeviceRequestMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/MsgType.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/MsgType.java
index e7c6537..ddc5149 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/MsgType.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/MsgType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionActorToAdaptorMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionActorToAdaptorMsg.java
index d70f0a8..fa1f6d5 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionActorToAdaptorMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionActorToAdaptorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionContext.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionContext.java
index 0b138df..73aaab4 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionContext.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionCtrlMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionCtrlMsg.java
index 06e8a61..19ca219 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionCtrlMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionCtrlMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionMsg.java
index 54c00eb..6b0b0af 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionType.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionType.java
index f4f7b5b..831682d 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionType.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/SessionType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceActorSessionMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceActorSessionMsg.java
index a905ddb..9ecfe19 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceActorSessionMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceActorSessionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceMsg.java b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceMsg.java
index b722d0e..31ec1fa 100644
--- a/common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceMsg.java
+++ b/common/message/src/main/java/org/thingsboard/server/common/msg/session/ToDeviceMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
common/pom.xml 4(+2 -2)
diff --git a/common/pom.xml b/common/pom.xml
index dfba528..0f92175 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
common/transport/pom.xml 16(+14 -2)
diff --git a/common/transport/pom.xml b/common/transport/pom.xml
index 884f455..18f2de6 100644
--- a/common/transport/pom.xml
+++ b/common/transport/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>common</artifactId>
</parent>
<groupId>org.thingsboard.common</groupId>
@@ -74,6 +74,18 @@
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
</dependencies>
</project>
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/AdaptorException.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/AdaptorException.java
index 35fad08..3ab4eaa 100644
--- a/common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/AdaptorException.java
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/AdaptorException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverter.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverter.java
index ad1ed0b..390266a 100644
--- a/common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverter.java
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/adaptor/JsonConverter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthResult.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthResult.java
index c757474..7584845 100644
--- a/common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthResult.java
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthResult.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthService.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthService.java
index 16d0c8b..8153a63 100644
--- a/common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthService.java
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/auth/DeviceAuthService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/Clock.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/Clock.java
new file mode 100644
index 0000000..dcc2d23
--- /dev/null
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/Clock.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright © 2016-2018 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.quota;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public final class Clock {
+
+ private static long time = 0L;
+
+ private Clock() {
+ }
+
+
+ public static long millis() {
+ return time == 0 ? System.currentTimeMillis() : time;
+ }
+
+ public static void setMillis(long millis) {
+ time = millis;
+ }
+
+ public static void shift(long delta) {
+ time += delta;
+ }
+
+ public static void reset() {
+ time = 0;
+ }
+}
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/HostRequestLimitPolicy.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/HostRequestLimitPolicy.java
new file mode 100644
index 0000000..cf1c4e8
--- /dev/null
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/HostRequestLimitPolicy.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright © 2016-2018 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.quota;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+@Component
+public class HostRequestLimitPolicy {
+
+ private final long limit;
+
+ public HostRequestLimitPolicy(@Value("${quota.host.limit}") long limit) {
+ this.limit = limit;
+ }
+
+ public boolean isValid(long currentValue) {
+ return currentValue <= limit;
+ }
+
+}
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/HostRequestsQuotaService.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/HostRequestsQuotaService.java
new file mode 100644
index 0000000..c1f045d
--- /dev/null
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/HostRequestsQuotaService.java
@@ -0,0 +1,76 @@
+/**
+ * Copyright © 2016-2018 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.quota;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.thingsboard.server.common.transport.quota.inmemory.HostRequestIntervalRegistry;
+import org.thingsboard.server.common.transport.quota.inmemory.IntervalRegistryCleaner;
+import org.thingsboard.server.common.transport.quota.inmemory.IntervalRegistryLogger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+@Service
+@Slf4j
+public class HostRequestsQuotaService implements QuotaService {
+
+ private final HostRequestIntervalRegistry requestRegistry;
+ private final HostRequestLimitPolicy requestsPolicy;
+ private final IntervalRegistryCleaner registryCleaner;
+ private final IntervalRegistryLogger registryLogger;
+ private final boolean enabled;
+
+ public HostRequestsQuotaService(HostRequestIntervalRegistry requestRegistry, HostRequestLimitPolicy requestsPolicy,
+ IntervalRegistryCleaner registryCleaner, IntervalRegistryLogger registryLogger,
+ @Value("${quota.host.enabled}") boolean enabled) {
+ this.requestRegistry = requestRegistry;
+ this.requestsPolicy = requestsPolicy;
+ this.registryCleaner = registryCleaner;
+ this.registryLogger = registryLogger;
+ this.enabled = enabled;
+ }
+
+ @PostConstruct
+ public void init() {
+ if (enabled) {
+ registryCleaner.schedule();
+ registryLogger.schedule();
+ }
+ }
+
+ @PreDestroy
+ public void close() {
+ if (enabled) {
+ registryCleaner.stop();
+ registryLogger.stop();
+ }
+ }
+
+ @Override
+ public boolean isQuotaExceeded(String key) {
+ if (enabled) {
+ long count = requestRegistry.tick(key);
+ return !requestsPolicy.isValid(count);
+ }
+ return false;
+ }
+}
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/HostRequestIntervalRegistry.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/HostRequestIntervalRegistry.java
new file mode 100644
index 0000000..8d254a0
--- /dev/null
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/HostRequestIntervalRegistry.java
@@ -0,0 +1,83 @@
+/**
+ * Copyright © 2016-2018 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.quota.inmemory;
+
+import com.google.common.collect.Sets;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.stream.Collectors;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+@Component
+@Slf4j
+public class HostRequestIntervalRegistry {
+
+ private final Map<String, IntervalCount> hostCounts = new ConcurrentHashMap<>();
+ private final long intervalDurationMs;
+ private final long ttlMs;
+ private final Set<String> whiteList;
+ private final Set<String> blackList;
+
+ public HostRequestIntervalRegistry(@Value("${quota.host.intervalMs}") long intervalDurationMs,
+ @Value("${quota.host.ttlMs}") long ttlMs,
+ @Value("${quota.host.whitelist}") String whiteList,
+ @Value("${quota.host.blacklist}") String blackList) {
+ this.intervalDurationMs = intervalDurationMs;
+ this.ttlMs = ttlMs;
+ this.whiteList = Sets.newHashSet(StringUtils.split(whiteList, ','));
+ this.blackList = Sets.newHashSet(StringUtils.split(blackList, ','));
+ }
+
+ @PostConstruct
+ public void init() {
+ if (ttlMs < intervalDurationMs) {
+ log.warn("TTL for IntervalRegistry [{}] smaller than interval duration [{}]", ttlMs, intervalDurationMs);
+ }
+ log.info("Start Host Quota Service with whitelist {}", whiteList);
+ log.info("Start Host Quota Service with blacklist {}", blackList);
+ }
+
+ public long tick(String clientHostId) {
+ if (whiteList.contains(clientHostId)) {
+ return 0;
+ } else if (blackList.contains(clientHostId)) {
+ return Long.MAX_VALUE;
+ }
+ IntervalCount intervalCount = hostCounts.computeIfAbsent(clientHostId, s -> new IntervalCount(intervalDurationMs));
+ return intervalCount.resetIfExpiredAndTick();
+ }
+
+ public void clean() {
+ hostCounts.entrySet().removeIf(entry -> entry.getValue().silenceDuration() > ttlMs);
+ }
+
+ public Map<String, Long> getContent() {
+ return hostCounts.entrySet().stream()
+ .collect(Collectors.toMap(
+ Map.Entry::getKey,
+ interval -> interval.getValue().getCount()));
+ }
+}
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalCount.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalCount.java
new file mode 100644
index 0000000..0ac6c9b
--- /dev/null
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalCount.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright © 2016-2018 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.quota.inmemory;
+
+
+import org.thingsboard.server.common.transport.quota.Clock;
+
+import java.util.concurrent.atomic.LongAdder;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public class IntervalCount {
+
+ private final LongAdder adder = new LongAdder();
+ private final long intervalDurationMs;
+ private volatile long startTime;
+ private volatile long lastTickTime;
+
+ public IntervalCount(long intervalDurationMs) {
+ this.intervalDurationMs = intervalDurationMs;
+ startTime = Clock.millis();
+ }
+
+ public long resetIfExpiredAndTick() {
+ if (isExpired()) {
+ reset();
+ }
+ tick();
+ return adder.sum();
+ }
+
+ public long silenceDuration() {
+ return Clock.millis() - lastTickTime;
+ }
+
+ public long getCount() {
+ return adder.sum();
+ }
+
+ private void tick() {
+ adder.add(1);
+ lastTickTime = Clock.millis();
+ }
+
+ private void reset() {
+ adder.reset();
+ startTime = Clock.millis();
+ }
+
+ private boolean isExpired() {
+ return (Clock.millis() - startTime) > intervalDurationMs;
+ }
+}
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryCleaner.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryCleaner.java
new file mode 100644
index 0000000..a227d2a
--- /dev/null
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryCleaner.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright © 2016-2018 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.quota.inmemory;
+
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PreDestroy;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+@Component
+@Slf4j
+public class IntervalRegistryCleaner {
+
+ private final HostRequestIntervalRegistry intervalRegistry;
+ private final long cleanPeriodMs;
+ private ScheduledExecutorService executor;
+
+ public IntervalRegistryCleaner(HostRequestIntervalRegistry intervalRegistry, @Value("${quota.host.cleanPeriodMs}") long cleanPeriodMs) {
+ this.intervalRegistry = intervalRegistry;
+ this.cleanPeriodMs = cleanPeriodMs;
+ }
+
+ public void schedule() {
+ if (executor != null) {
+ throw new IllegalStateException("Registry Cleaner already scheduled");
+ }
+ executor = Executors.newSingleThreadScheduledExecutor();
+ executor.scheduleAtFixedRate(this::clean, cleanPeriodMs, cleanPeriodMs, TimeUnit.MILLISECONDS);
+ }
+
+ public void stop() {
+ if (executor != null) {
+ executor.shutdown();
+ }
+ }
+
+ public void clean() {
+ try {
+ intervalRegistry.clean();
+ } catch (RuntimeException ex) {
+ log.error("Could not clear Interval Registry", ex);
+ }
+ }
+
+}
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryLogger.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryLogger.java
new file mode 100644
index 0000000..8b34a6b
--- /dev/null
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryLogger.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright © 2016-2018 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.quota.inmemory;
+
+import com.google.common.collect.MinMaxPriorityQueue;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.Comparator;
+import java.util.Map;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+@Component
+@Slf4j
+public class IntervalRegistryLogger {
+
+ private final int topSize;
+ private final HostRequestIntervalRegistry intervalRegistry;
+ private final long logIntervalMin;
+ private ScheduledExecutorService executor;
+
+ public IntervalRegistryLogger(@Value("${quota.log.topSize}") int topSize, @Value("${quota.log.intervalMin}") long logIntervalMin,
+ HostRequestIntervalRegistry intervalRegistry) {
+ this.topSize = topSize;
+ this.logIntervalMin = logIntervalMin;
+ this.intervalRegistry = intervalRegistry;
+ }
+
+ public void schedule() {
+ if (executor != null) {
+ throw new IllegalStateException("Registry Cleaner already scheduled");
+ }
+ executor = Executors.newSingleThreadScheduledExecutor();
+ executor.scheduleAtFixedRate(this::logStatistic, logIntervalMin, logIntervalMin, TimeUnit.MINUTES);
+ }
+
+ public void stop() {
+ if (executor != null) {
+ executor.shutdown();
+ }
+ }
+
+ public void logStatistic() {
+ Map<String, Long> registryContent = intervalRegistry.getContent();
+ int uniqHosts = registryContent.size();
+ long requestsCount = registryContent.values().stream().mapToLong(i -> i).sum();
+ Map<String, Long> top = getTopElements(registryContent);
+ log(top, uniqHosts, requestsCount);
+ }
+
+ protected Map<String, Long> getTopElements(Map<String, Long> countMap) {
+ MinMaxPriorityQueue<Map.Entry<String, Long>> topQueue = MinMaxPriorityQueue
+ .orderedBy(Comparator.comparing((Function<Map.Entry<String, Long>, Long>) Map.Entry::getValue).reversed())
+ .maximumSize(topSize)
+ .create(countMap.entrySet());
+
+ return topQueue.stream().collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
+ }
+
+ private void log(Map<String, Long> top, int uniqHosts, long requestsCount) {
+ long rps = requestsCount / TimeUnit.MINUTES.toSeconds(logIntervalMin);
+ StringBuilder builder = new StringBuilder("Quota Statistic : ");
+ builder.append("uniqHosts : ").append(uniqHosts).append("; ");
+ builder.append("requestsCount : ").append(requestsCount).append("; ");
+ builder.append("RPS : ").append(rps).append(" ");
+ builder.append("top -> ");
+ for (Map.Entry<String, Long> host : top.entrySet()) {
+ builder.append(host.getKey()).append(" : ").append(host.getValue()).append("; ");
+ }
+
+ log.info(builder.toString());
+ }
+}
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/QuotaService.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/QuotaService.java
new file mode 100644
index 0000000..f841749
--- /dev/null
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/quota/QuotaService.java
@@ -0,0 +1,25 @@
+/**
+ * Copyright © 2016-2018 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.quota;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public interface QuotaService {
+
+ boolean isQuotaExceeded(String key);
+}
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/session/DeviceAwareSessionContext.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/session/DeviceAwareSessionContext.java
index 89debed..f0fb51e 100644
--- a/common/transport/src/main/java/org/thingsboard/server/common/transport/session/DeviceAwareSessionContext.java
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/session/DeviceAwareSessionContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/SessionMsgProcessor.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/SessionMsgProcessor.java
index 9250d94..ea77366 100644
--- a/common/transport/src/main/java/org/thingsboard/server/common/transport/SessionMsgProcessor.java
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/SessionMsgProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/transport/src/main/java/org/thingsboard/server/common/transport/TransportAdaptor.java b/common/transport/src/main/java/org/thingsboard/server/common/transport/TransportAdaptor.java
index 9bf8f96..93a6e99 100644
--- a/common/transport/src/main/java/org/thingsboard/server/common/transport/TransportAdaptor.java
+++ b/common/transport/src/main/java/org/thingsboard/server/common/transport/TransportAdaptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/ClockTest.java b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/ClockTest.java
new file mode 100644
index 0000000..403bdc6
--- /dev/null
+++ b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/ClockTest.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright © 2016-2018 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.quota;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public class ClockTest {
+
+ @Before
+ public void init() {
+ Clock.reset();
+ }
+
+ @After
+ public void clear() {
+ Clock.reset();
+ }
+
+ @Test
+ public void defaultClockUseSystemTime() {
+ assertFalse(Clock.millis() > System.currentTimeMillis());
+ }
+
+ @Test
+ public void timeCanBeSet() {
+ Clock.setMillis(100L);
+ assertEquals(100L, Clock.millis());
+ }
+
+ @Test
+ public void clockCanBeReseted() {
+ Clock.setMillis(100L);
+ assertEquals(100L, Clock.millis());
+ Clock.reset();
+ assertFalse(Clock.millis() > System.currentTimeMillis());
+ }
+
+ @Test
+ public void timeIsShifted() {
+ Clock.setMillis(100L);
+ Clock.shift(50L);
+ assertEquals(150L, Clock.millis());
+ }
+
+}
\ No newline at end of file
diff --git a/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/HostRequestLimitPolicyTest.java b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/HostRequestLimitPolicyTest.java
new file mode 100644
index 0000000..174d182
--- /dev/null
+++ b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/HostRequestLimitPolicyTest.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright © 2016-2018 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.quota;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public class HostRequestLimitPolicyTest {
+
+ private HostRequestLimitPolicy limitPolicy = new HostRequestLimitPolicy(10L);
+
+ @Test
+ public void ifCurrentValueLessThenLimitItIsValid() {
+ assertTrue(limitPolicy.isValid(9));
+ }
+
+ @Test
+ public void ifCurrentValueEqualsToLimitItIsValid() {
+ assertTrue(limitPolicy.isValid(10));
+ }
+
+ @Test
+ public void ifCurrentValueGreaterThenLimitItIsValid() {
+ assertFalse(limitPolicy.isValid(11));
+ }
+
+}
\ No newline at end of file
diff --git a/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/HostRequestsQuotaServiceTest.java b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/HostRequestsQuotaServiceTest.java
new file mode 100644
index 0000000..547f0cf
--- /dev/null
+++ b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/HostRequestsQuotaServiceTest.java
@@ -0,0 +1,76 @@
+/**
+ * Copyright © 2016-2018 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.quota;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.thingsboard.server.common.transport.quota.inmemory.HostRequestIntervalRegistry;
+import org.thingsboard.server.common.transport.quota.inmemory.IntervalRegistryCleaner;
+import org.thingsboard.server.common.transport.quota.inmemory.IntervalRegistryLogger;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.*;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public class HostRequestsQuotaServiceTest {
+
+ private HostRequestsQuotaService quotaService;
+
+ private HostRequestIntervalRegistry requestRegistry = mock(HostRequestIntervalRegistry.class);
+ private HostRequestLimitPolicy requestsPolicy = mock(HostRequestLimitPolicy.class);
+ private IntervalRegistryCleaner registryCleaner = mock(IntervalRegistryCleaner.class);
+ private IntervalRegistryLogger registryLogger = mock(IntervalRegistryLogger.class);
+
+ @Before
+ public void init() {
+ quotaService = new HostRequestsQuotaService(requestRegistry, requestsPolicy, registryCleaner, registryLogger, true);
+ }
+
+ @Test
+ public void quotaExceededIfRequestCountBiggerThanAllowed() {
+ when(requestRegistry.tick("key")).thenReturn(10L);
+ when(requestsPolicy.isValid(10L)).thenReturn(false);
+
+ assertTrue(quotaService.isQuotaExceeded("key"));
+
+ verify(requestRegistry).tick("key");
+ verify(requestsPolicy).isValid(10L);
+ verifyNoMoreInteractions(requestRegistry, requestsPolicy);
+ }
+
+ @Test
+ public void quotaNotExceededIfRequestCountLessThanAllowed() {
+ when(requestRegistry.tick("key")).thenReturn(10L);
+ when(requestsPolicy.isValid(10L)).thenReturn(true);
+
+ assertFalse(quotaService.isQuotaExceeded("key"));
+
+ verify(requestRegistry).tick("key");
+ verify(requestsPolicy).isValid(10L);
+ verifyNoMoreInteractions(requestRegistry, requestsPolicy);
+ }
+
+ @Test
+ public void serviceCanBeDisabled() {
+ quotaService = new HostRequestsQuotaService(requestRegistry, requestsPolicy, registryCleaner, registryLogger, false);
+ assertFalse(quotaService.isQuotaExceeded("key"));
+ verifyNoMoreInteractions(requestRegistry, requestsPolicy);
+ }
+}
\ No newline at end of file
diff --git a/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/HostRequestIntervalRegistryTest.java b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/HostRequestIntervalRegistryTest.java
new file mode 100644
index 0000000..78b82ee
--- /dev/null
+++ b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/HostRequestIntervalRegistryTest.java
@@ -0,0 +1,85 @@
+/**
+ * Copyright © 2016-2018 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.quota.inmemory;
+
+import com.google.common.collect.Sets;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Collections;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public class HostRequestIntervalRegistryTest {
+
+ private HostRequestIntervalRegistry registry;
+
+ @Before
+ public void init() {
+ registry = new HostRequestIntervalRegistry(10000L, 100L,"g1,g2", "b1");
+ }
+
+ @Test
+ public void newHostCreateNewInterval() {
+ assertEquals(1L, registry.tick("host1"));
+ }
+
+ @Test
+ public void existingHostUpdated() {
+ registry.tick("aaa");
+ assertEquals(1L, registry.tick("bbb"));
+ assertEquals(2L, registry.tick("aaa"));
+ }
+
+ @Test
+ public void expiredIntervalsCleaned() throws InterruptedException {
+ registry.tick("aaa");
+ Thread.sleep(150L);
+ registry.tick("bbb");
+ registry.clean();
+ assertEquals(1L, registry.tick("aaa"));
+ assertEquals(2L, registry.tick("bbb"));
+ }
+
+ @Test
+ public void domainFromWhitelistNotCounted(){
+ assertEquals(0L, registry.tick("g1"));
+ assertEquals(0L, registry.tick("g1"));
+ assertEquals(0L, registry.tick("g2"));
+ }
+
+ @Test
+ public void domainFromBlackListReturnMaxValue(){
+ assertEquals(Long.MAX_VALUE, registry.tick("b1"));
+ assertEquals(Long.MAX_VALUE, registry.tick("b1"));
+ }
+
+ @Test
+ public void emptyWhitelistParsedOk(){
+ registry = new HostRequestIntervalRegistry(10000L, 100L,"", "b1");
+ assertEquals(1L, registry.tick("aaa"));
+ }
+
+ @Test
+ public void emptyBlacklistParsedOk(){
+ registry = new HostRequestIntervalRegistry(10000L, 100L,"", "");
+ assertEquals(1L, registry.tick("aaa"));
+ }
+}
\ No newline at end of file
diff --git a/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalCountTest.java b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalCountTest.java
new file mode 100644
index 0000000..4fdce61
--- /dev/null
+++ b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalCountTest.java
@@ -0,0 +1,65 @@
+/**
+ * Copyright © 2016-2018 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.quota.inmemory;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.thingsboard.server.common.transport.quota.Clock;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public class IntervalCountTest {
+
+ @Before
+ public void init() {
+ Clock.setMillis(1000L);
+ }
+
+ @After
+ public void clear() {
+ Clock.reset();
+ }
+
+ @Test
+ public void ticksInSameIntervalAreSummed() {
+ IntervalCount intervalCount = new IntervalCount(100L);
+ assertEquals(1L, intervalCount.resetIfExpiredAndTick());
+ Clock.shift(100);
+ assertEquals(2L, intervalCount.resetIfExpiredAndTick());
+ }
+
+ @Test
+ public void oldDataCleanedWhenIntervalExpired() {
+ IntervalCount intervalCount = new IntervalCount(100L);
+ assertEquals(1L, intervalCount.resetIfExpiredAndTick());
+ Clock.shift(101);
+ assertEquals(1L, intervalCount.resetIfExpiredAndTick());
+ }
+
+ @Test
+ public void silenceDurationCalculatedFromLastTick() {
+ IntervalCount intervalCount = new IntervalCount(100L);
+ assertEquals(1L, intervalCount.resetIfExpiredAndTick());
+ Clock.shift(10L);
+ assertEquals(10L, intervalCount.silenceDuration());
+ }
+
+}
\ No newline at end of file
diff --git a/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryLoggerTest.java b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryLoggerTest.java
new file mode 100644
index 0000000..c9139ae
--- /dev/null
+++ b/common/transport/src/test/java/org/thingsboard/server/common/transport/quota/inmemory/IntervalRegistryLoggerTest.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright © 2016-2018 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.quota.inmemory;
+
+import com.google.common.collect.ImmutableMap;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Collections;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
+/**
+ * @author Vitaliy Paromskiy
+ * @version 1.0
+ */
+public class IntervalRegistryLoggerTest {
+
+ private IntervalRegistryLogger logger;
+
+ private HostRequestIntervalRegistry requestRegistry = mock(HostRequestIntervalRegistry.class);
+
+ @Before
+ public void init() {
+ logger = new IntervalRegistryLogger(3, 10, requestRegistry);
+ }
+
+ @Test
+ public void onlyMaxHostsCollected() {
+ Map<String, Long> map = ImmutableMap.of("a", 8L, "b", 3L, "c", 1L, "d", 3L);
+ Map<String, Long> actual = logger.getTopElements(map);
+ Map<String, Long> expected = ImmutableMap.of("a", 8L, "b", 3L, "d", 3L);
+
+ assertEquals(expected, actual);
+ }
+
+ @Test
+ public void emptyMapProcessedCorrectly() {
+ Map<String, Long> map = Collections.emptyMap();
+ Map<String, Long> actual = logger.getTopElements(map);
+ Map<String, Long> expected = Collections.emptyMap();
+
+ assertEquals(expected, actual);
+ }
+
+}
\ No newline at end of file
dao/pom.xml 31(+28 -3)
diff --git a/dao/pom.xml b/dao/pom.xml
index 8d43822..1df74c0 100644
--- a/dao/pom.xml
+++ b/dao/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<artifactId>dao</artifactId>
@@ -102,7 +102,12 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
@@ -148,6 +153,10 @@
<artifactId>hazelcast</artifactId>
</dependency>
<dependency>
+ <groupId>com.github.ben-manes.caffeine</groupId>
+ <artifactId>caffeine</artifactId>
+ </dependency>
+ <dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast-spring</artifactId>
</dependency>
@@ -173,6 +182,22 @@
<artifactId>hsqldb</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.data</groupId>
+ <artifactId>spring-data-redis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>redis.clients</groupId>
+ <artifactId>jedis</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.elasticsearch.client</groupId>
+ <artifactId>rest</artifactId>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmDao.java b/dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmDao.java
index 0ab7620..fd625ea 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmService.java b/dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmService.java
index 0c54f71..4da7df2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/alarm/AlarmService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/alarm/BaseAlarmService.java b/dao/src/main/java/org/thingsboard/server/dao/alarm/BaseAlarmService.java
index be7e44f..e669ae2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/alarm/BaseAlarmService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/alarm/BaseAlarmService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -337,7 +337,7 @@ public class BaseAlarmService extends AbstractEntityService implements AlarmServ
private void updateRelations(Alarm alarm, AlarmStatus oldStatus, AlarmStatus newStatus) {
try {
- List<EntityRelation> relations = relationService.findByTo(alarm.getId(), RelationTypeGroup.ALARM).get();
+ List<EntityRelation> relations = relationService.findByToAsync(alarm.getId(), RelationTypeGroup.ALARM).get();
Set<EntityId> parents = relations.stream().map(EntityRelation::getFrom).collect(Collectors.toSet());
for (EntityId parentId : parents) {
updateAlarmRelation(parentId, alarm.getId(), oldStatus, newStatus);
diff --git a/dao/src/main/java/org/thingsboard/server/dao/alarm/CassandraAlarmDao.java b/dao/src/main/java/org/thingsboard/server/dao/alarm/CassandraAlarmDao.java
index 746f18d..1233c7f 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/alarm/CassandraAlarmDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/alarm/CassandraAlarmDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/asset/AssetDao.java b/dao/src/main/java/org/thingsboard/server/dao/asset/AssetDao.java
index f953335..3aa23d1 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/asset/AssetDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/asset/AssetDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/asset/AssetService.java b/dao/src/main/java/org/thingsboard/server/dao/asset/AssetService.java
index 7b64b20..6dc15c0 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/asset/AssetService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/asset/AssetService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/asset/AssetTypeFilter.java b/dao/src/main/java/org/thingsboard/server/dao/asset/AssetTypeFilter.java
index 221e4df..4e2619b 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/asset/AssetTypeFilter.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/asset/AssetTypeFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/asset/BaseAssetService.java b/dao/src/main/java/org/thingsboard/server/dao/asset/BaseAssetService.java
index 1ee4789..dcd9523 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/asset/BaseAssetService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/asset/BaseAssetService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/asset/CassandraAssetDao.java b/dao/src/main/java/org/thingsboard/server/dao/asset/CassandraAssetDao.java
index d6c6ca4..4f923fe 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/asset/CassandraAssetDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/asset/CassandraAssetDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesDao.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesDao.java
index 704210e..c9510d2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesService.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesService.java
index 6090fa9..fa3a2b1 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/AttributesService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 0086e52..079772b 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/attributes/CassandraBaseAttributesDao.java b/dao/src/main/java/org/thingsboard/server/dao/attributes/CassandraBaseAttributesDao.java
index 6911cdb..932d6b9 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/attributes/CassandraBaseAttributesDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/attributes/CassandraBaseAttributesDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogDao.java b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogDao.java
new file mode 100644
index 0000000..45885a3
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogDao.java
@@ -0,0 +1,47 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.id.EntityId;
+import org.thingsboard.server.common.data.id.UserId;
+import org.thingsboard.server.common.data.page.TimePageLink;
+
+import java.util.List;
+import java.util.UUID;
+
+public interface AuditLogDao {
+
+ ListenableFuture<Void> saveByTenantId(AuditLog auditLog);
+
+ ListenableFuture<Void> saveByTenantIdAndEntityId(AuditLog auditLog);
+
+ ListenableFuture<Void> saveByTenantIdAndCustomerId(AuditLog auditLog);
+
+ ListenableFuture<Void> saveByTenantIdAndUserId(AuditLog auditLog);
+
+ ListenableFuture<Void> savePartitionsByTenantId(AuditLog auditLog);
+
+ List<AuditLog> findAuditLogsByTenantIdAndEntityId(UUID tenantId, EntityId entityId, TimePageLink pageLink);
+
+ List<AuditLog> findAuditLogsByTenantIdAndCustomerId(UUID tenantId, CustomerId customerId, TimePageLink pageLink);
+
+ List<AuditLog> findAuditLogsByTenantIdAndUserId(UUID tenantId, UserId userId, TimePageLink pageLink);
+
+ List<AuditLog> findAuditLogsByTenantId(UUID tenantId, TimePageLink pageLink);
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogLevelFilter.java b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogLevelFilter.java
new file mode 100644
index 0000000..6970f54
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogLevelFilter.java
@@ -0,0 +1,46 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.audit.ActionType;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class AuditLogLevelFilter {
+
+ private Map<EntityType, AuditLogLevelMask> entityTypeMask = new HashMap<>();
+
+ public AuditLogLevelFilter(Map<String, String> mask) {
+ entityTypeMask.clear();
+ mask.forEach((entityTypeStr, logLevelMaskStr) -> {
+ EntityType entityType = EntityType.valueOf(entityTypeStr.toUpperCase());
+ AuditLogLevelMask logLevelMask = AuditLogLevelMask.valueOf(logLevelMaskStr.toUpperCase());
+ entityTypeMask.put(entityType, logLevelMask);
+ });
+ }
+
+ public boolean logEnabled(EntityType entityType, ActionType actionType) {
+ AuditLogLevelMask logLevelMask = entityTypeMask.get(entityType);
+ if (logLevelMask != null) {
+ return actionType.isRead() ? logLevelMask.isRead() : logLevelMask.isWrite();
+ } else {
+ return false;
+ }
+ }
+
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogLevelMask.java b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogLevelMask.java
new file mode 100644
index 0000000..5220093
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogLevelMask.java
@@ -0,0 +1,34 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import lombok.Getter;
+
+@Getter
+public enum AuditLogLevelMask {
+
+ OFF(false, false),
+ W(true, false),
+ RW(true, true);
+
+ private final boolean write;
+ private final boolean read;
+
+ AuditLogLevelMask(boolean write, boolean read) {
+ this.write = write;
+ this.read = read;
+ }
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogQueryCursor.java b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogQueryCursor.java
new file mode 100644
index 0000000..56fcb33
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogQueryCursor.java
@@ -0,0 +1,70 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import lombok.Getter;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.dao.model.nosql.AuditLogEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+public class AuditLogQueryCursor {
+ @Getter
+ private final UUID tenantId;
+ @Getter
+ private final List<AuditLogEntity> data;
+ @Getter
+ private final TimePageLink pageLink;
+
+ private final List<Long> partitions;
+
+ private int partitionIndex;
+ private int currentLimit;
+
+ public AuditLogQueryCursor(UUID tenantId, TimePageLink pageLink, List<Long> partitions) {
+ this.tenantId = tenantId;
+ this.partitions = partitions;
+ this.partitionIndex = partitions.size() - 1;
+ this.data = new ArrayList<>();
+ this.currentLimit = pageLink.getLimit();
+ this.pageLink = pageLink;
+ }
+
+ public boolean hasNextPartition() {
+ return partitionIndex >= 0;
+ }
+
+ public boolean isFull() {
+ return currentLimit <= 0;
+ }
+
+ public long getNextPartition() {
+ long partition = partitions.get(partitionIndex);
+ partitionIndex--;
+ return partition;
+ }
+
+ public int getCurrentLimit() {
+ return currentLimit;
+ }
+
+ public void addData(List<AuditLogEntity> newData) {
+ currentLimit -= newData.size();
+ data.addAll(newData);
+ }
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogService.java b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogService.java
new file mode 100644
index 0000000..19651a0
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogService.java
@@ -0,0 +1,53 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.util.concurrent.ListenableFuture;
+import org.thingsboard.server.common.data.BaseData;
+import org.thingsboard.server.common.data.HasName;
+import org.thingsboard.server.common.data.User;
+import org.thingsboard.server.common.data.audit.ActionStatus;
+import org.thingsboard.server.common.data.audit.ActionType;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.*;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
+
+import java.util.List;
+
+public interface AuditLogService {
+
+ TimePageData<AuditLog> findAuditLogsByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, TimePageLink pageLink);
+
+ TimePageData<AuditLog> findAuditLogsByTenantIdAndUserId(TenantId tenantId, UserId userId, TimePageLink pageLink);
+
+ TimePageData<AuditLog> findAuditLogsByTenantIdAndEntityId(TenantId tenantId, EntityId entityId, TimePageLink pageLink);
+
+ TimePageData<AuditLog> findAuditLogsByTenantId(TenantId tenantId, TimePageLink pageLink);
+
+ <E extends BaseData<I> & HasName,
+ I extends UUIDBased & EntityId> ListenableFuture<List<Void>> logEntityAction(
+ TenantId tenantId,
+ CustomerId customerId,
+ UserId userId,
+ String userName,
+ I entityId,
+ E entity,
+ ActionType actionType,
+ Exception e, Object... additionalInfo);
+
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogServiceImpl.java
new file mode 100644
index 0000000..23fadeb
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/AuditLogServiceImpl.java
@@ -0,0 +1,323 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import com.datastax.driver.core.utils.UUIDs;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import com.google.common.collect.Lists;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+import org.thingsboard.server.common.data.BaseData;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.HasName;
+import org.thingsboard.server.common.data.audit.ActionStatus;
+import org.thingsboard.server.common.data.audit.ActionType;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.*;
+import org.thingsboard.server.common.data.kv.AttributeKvEntry;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.common.data.security.DeviceCredentials;
+import org.thingsboard.server.dao.audit.sink.AuditLogSink;
+import org.thingsboard.server.dao.entity.EntityService;
+import org.thingsboard.server.dao.exception.DataValidationException;
+import org.thingsboard.server.dao.service.DataValidator;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.List;
+
+import static org.thingsboard.server.dao.service.Validator.validateEntityId;
+import static org.thingsboard.server.dao.service.Validator.validateId;
+
+@Slf4j
+@Service
+@ConditionalOnProperty(prefix = "audit_log", value = "enabled", havingValue = "true")
+public class AuditLogServiceImpl implements AuditLogService {
+
+ private static final ObjectMapper objectMapper = new ObjectMapper();
+
+ private static final String INCORRECT_TENANT_ID = "Incorrect tenantId ";
+ private static final int INSERTS_PER_ENTRY = 3;
+
+ @Autowired
+ private AuditLogLevelFilter auditLogLevelFilter;
+
+ @Autowired
+ private AuditLogDao auditLogDao;
+
+ @Autowired
+ private EntityService entityService;
+
+ @Autowired
+ private AuditLogSink auditLogSink;
+
+ @Override
+ public TimePageData<AuditLog> findAuditLogsByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, TimePageLink pageLink) {
+ log.trace("Executing findAuditLogsByTenantIdAndCustomerId [{}], [{}], [{}]", tenantId, customerId, pageLink);
+ validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
+ validateId(customerId, "Incorrect customerId " + customerId);
+ List<AuditLog> auditLogs = auditLogDao.findAuditLogsByTenantIdAndCustomerId(tenantId.getId(), customerId, pageLink);
+ return new TimePageData<>(auditLogs, pageLink);
+ }
+
+ @Override
+ public TimePageData<AuditLog> findAuditLogsByTenantIdAndUserId(TenantId tenantId, UserId userId, TimePageLink pageLink) {
+ log.trace("Executing findAuditLogsByTenantIdAndUserId [{}], [{}], [{}]", tenantId, userId, pageLink);
+ validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
+ validateId(userId, "Incorrect userId" + userId);
+ List<AuditLog> auditLogs = auditLogDao.findAuditLogsByTenantIdAndUserId(tenantId.getId(), userId, pageLink);
+ return new TimePageData<>(auditLogs, pageLink);
+ }
+
+ @Override
+ public TimePageData<AuditLog> findAuditLogsByTenantIdAndEntityId(TenantId tenantId, EntityId entityId, TimePageLink pageLink) {
+ log.trace("Executing findAuditLogsByTenantIdAndEntityId [{}], [{}], [{}]", tenantId, entityId, pageLink);
+ validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
+ validateEntityId(entityId, INCORRECT_TENANT_ID + entityId);
+ List<AuditLog> auditLogs = auditLogDao.findAuditLogsByTenantIdAndEntityId(tenantId.getId(), entityId, pageLink);
+ return new TimePageData<>(auditLogs, pageLink);
+ }
+
+ @Override
+ public TimePageData<AuditLog> findAuditLogsByTenantId(TenantId tenantId, TimePageLink pageLink) {
+ log.trace("Executing findAuditLogs [{}]", pageLink);
+ validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
+ List<AuditLog> auditLogs = auditLogDao.findAuditLogsByTenantId(tenantId.getId(), pageLink);
+ return new TimePageData<>(auditLogs, pageLink);
+ }
+
+ @Override
+ public <E extends BaseData<I> & HasName, I extends UUIDBased & EntityId> ListenableFuture<List<Void>>
+ logEntityAction(TenantId tenantId, CustomerId customerId, UserId userId, String userName, I entityId, E entity,
+ ActionType actionType, Exception e, Object... additionalInfo) {
+ if (canLog(entityId.getEntityType(), actionType)) {
+ JsonNode actionData = constructActionData(entityId, entity, actionType, additionalInfo);
+ ActionStatus actionStatus = ActionStatus.SUCCESS;
+ String failureDetails = "";
+ String entityName = "";
+ if (entity != null) {
+ entityName = entity.getName();
+ } else {
+ try {
+ entityName = entityService.fetchEntityNameAsync(entityId).get();
+ } catch (Exception ex) {}
+ }
+ if (e != null) {
+ actionStatus = ActionStatus.FAILURE;
+ failureDetails = getFailureStack(e);
+ }
+ if (actionType == ActionType.RPC_CALL) {
+ String rpcErrorString = extractParameter(String.class, additionalInfo);
+ if (!StringUtils.isEmpty(rpcErrorString)) {
+ actionStatus = ActionStatus.FAILURE;
+ failureDetails = rpcErrorString;
+ }
+ }
+ return logAction(tenantId,
+ entityId,
+ entityName,
+ customerId,
+ userId,
+ userName,
+ actionType,
+ actionData,
+ actionStatus,
+ failureDetails);
+ } else {
+ return null;
+ }
+ }
+
+ private <E extends BaseData<I> & HasName, I extends UUIDBased & EntityId> JsonNode constructActionData(I entityId,
+ E entity,
+ ActionType actionType,
+ Object... additionalInfo) {
+ ObjectNode actionData = objectMapper.createObjectNode();
+ switch(actionType) {
+ case ADDED:
+ case UPDATED:
+ ObjectNode entityNode = objectMapper.valueToTree(entity);
+ if (entityId.getEntityType() == EntityType.DASHBOARD) {
+ entityNode.put("configuration", "");
+ }
+ actionData.set("entity", entityNode);
+ break;
+ case DELETED:
+ case ACTIVATED:
+ case SUSPENDED:
+ case CREDENTIALS_READ:
+ String strEntityId = extractParameter(String.class, additionalInfo);
+ actionData.put("entityId", strEntityId);
+ break;
+ case ATTRIBUTES_UPDATED:
+ actionData.put("entityId", entityId.toString());
+ String scope = extractParameter(String.class, 0, additionalInfo);
+ List<AttributeKvEntry> attributes = extractParameter(List.class, 1, additionalInfo);
+ actionData.put("scope", scope);
+ ObjectNode attrsNode = objectMapper.createObjectNode();
+ if (attributes != null) {
+ for (AttributeKvEntry attr : attributes) {
+ attrsNode.put(attr.getKey(), attr.getValueAsString());
+ }
+ }
+ actionData.set("attributes", attrsNode);
+ break;
+ case ATTRIBUTES_DELETED:
+ case ATTRIBUTES_READ:
+ actionData.put("entityId", entityId.toString());
+ scope = extractParameter(String.class, 0, additionalInfo);
+ actionData.put("scope", scope);
+ List<String> keys = extractParameter(List.class, 1, additionalInfo);
+ ArrayNode attrsArrayNode = actionData.putArray("attributes");
+ if (keys != null) {
+ keys.forEach(attrsArrayNode::add);
+ }
+ break;
+ case RPC_CALL:
+ actionData.put("entityId", entityId.toString());
+ Boolean oneWay = extractParameter(Boolean.class, 1, additionalInfo);
+ String method = extractParameter(String.class, 2, additionalInfo);
+ String params = extractParameter(String.class, 3, additionalInfo);
+ actionData.put("oneWay", oneWay);
+ actionData.put("method", method);
+ actionData.put("params", params);
+ break;
+ case CREDENTIALS_UPDATED:
+ actionData.put("entityId", entityId.toString());
+ DeviceCredentials deviceCredentials = extractParameter(DeviceCredentials.class, additionalInfo);
+ actionData.set("credentials", objectMapper.valueToTree(deviceCredentials));
+ break;
+ case ASSIGNED_TO_CUSTOMER:
+ strEntityId = extractParameter(String.class, 0, additionalInfo);
+ String strCustomerId = extractParameter(String.class, 1, additionalInfo);
+ String strCustomerName = extractParameter(String.class, 2, additionalInfo);
+ actionData.put("entityId", strEntityId);
+ actionData.put("assignedCustomerId", strCustomerId);
+ actionData.put("assignedCustomerName", strCustomerName);
+ break;
+ case UNASSIGNED_FROM_CUSTOMER:
+ strEntityId = extractParameter(String.class, 0, additionalInfo);
+ strCustomerId = extractParameter(String.class, 1, additionalInfo);
+ strCustomerName = extractParameter(String.class, 2, additionalInfo);
+ actionData.put("entityId", strEntityId);
+ actionData.put("unassignedCustomerId", strCustomerId);
+ actionData.put("unassignedCustomerName", strCustomerName);
+ break;
+ }
+ return actionData;
+ }
+
+ private <T> T extractParameter(Class<T> clazz, Object... additionalInfo) {
+ return extractParameter(clazz, 0, additionalInfo);
+ }
+
+ private <T> T extractParameter(Class<T> clazz, int index, Object... additionalInfo) {
+ T result = null;
+ if (additionalInfo != null && additionalInfo.length > index) {
+ Object paramObject = additionalInfo[index];
+ if (clazz.isInstance(paramObject)) {
+ result = clazz.cast(paramObject);
+ }
+ }
+ return result;
+ }
+
+ private String getFailureStack(Exception e) {
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw));
+ return sw.toString();
+ }
+
+ private boolean canLog(EntityType entityType, ActionType actionType) {
+ return auditLogLevelFilter.logEnabled(entityType, actionType);
+ }
+
+ private AuditLog createAuditLogEntry(TenantId tenantId,
+ EntityId entityId,
+ String entityName,
+ CustomerId customerId,
+ UserId userId,
+ String userName,
+ ActionType actionType,
+ JsonNode actionData,
+ ActionStatus actionStatus,
+ String actionFailureDetails) {
+ AuditLog result = new AuditLog();
+ result.setId(new AuditLogId(UUIDs.timeBased()));
+ result.setTenantId(tenantId);
+ result.setEntityId(entityId);
+ result.setEntityName(entityName);
+ result.setCustomerId(customerId);
+ result.setUserId(userId);
+ result.setUserName(userName);
+ result.setActionType(actionType);
+ result.setActionData(actionData);
+ result.setActionStatus(actionStatus);
+ result.setActionFailureDetails(actionFailureDetails);
+ return result;
+ }
+
+ private ListenableFuture<List<Void>> logAction(TenantId tenantId,
+ EntityId entityId,
+ String entityName,
+ CustomerId customerId,
+ UserId userId,
+ String userName,
+ ActionType actionType,
+ JsonNode actionData,
+ ActionStatus actionStatus,
+ String actionFailureDetails) {
+ AuditLog auditLogEntry = createAuditLogEntry(tenantId, entityId, entityName, customerId, userId, userName,
+ actionType, actionData, actionStatus, actionFailureDetails);
+ log.trace("Executing logAction [{}]", auditLogEntry);
+ auditLogValidator.validate(auditLogEntry);
+ List<ListenableFuture<Void>> futures = Lists.newArrayListWithExpectedSize(INSERTS_PER_ENTRY);
+ futures.add(auditLogDao.savePartitionsByTenantId(auditLogEntry));
+ futures.add(auditLogDao.saveByTenantId(auditLogEntry));
+ futures.add(auditLogDao.saveByTenantIdAndEntityId(auditLogEntry));
+ futures.add(auditLogDao.saveByTenantIdAndCustomerId(auditLogEntry));
+ futures.add(auditLogDao.saveByTenantIdAndUserId(auditLogEntry));
+
+ auditLogSink.logAction(auditLogEntry);
+
+ return Futures.allAsList(futures);
+ }
+
+ private DataValidator<AuditLog> auditLogValidator =
+ new DataValidator<AuditLog>() {
+ @Override
+ protected void validateDataImpl(AuditLog auditLog) {
+ if (auditLog.getEntityId() == null) {
+ throw new DataValidationException("Entity Id should be specified!");
+ }
+ if (auditLog.getTenantId() == null) {
+ throw new DataValidationException("Tenant Id should be specified!");
+ }
+ if (auditLog.getUserId() == null) {
+ throw new DataValidationException("User Id should be specified!");
+ }
+ }
+ };
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/CassandraAuditLogDao.java b/dao/src/main/java/org/thingsboard/server/dao/audit/CassandraAuditLogDao.java
new file mode 100644
index 0000000..27f7adc
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/CassandraAuditLogDao.java
@@ -0,0 +1,349 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import com.datastax.driver.core.BoundStatement;
+import com.datastax.driver.core.PreparedStatement;
+import com.datastax.driver.core.ResultSet;
+import com.datastax.driver.core.ResultSetFuture;
+import com.datastax.driver.core.querybuilder.QueryBuilder;
+import com.datastax.driver.core.querybuilder.Select;
+import com.google.common.base.Function;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.id.EntityId;
+import org.thingsboard.server.common.data.id.UserId;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.dao.DaoUtil;
+import org.thingsboard.server.dao.model.ModelConstants;
+import org.thingsboard.server.dao.model.nosql.AuditLogEntity;
+import org.thingsboard.server.dao.nosql.CassandraAbstractSearchTimeDao;
+import org.thingsboard.server.dao.timeseries.TsPartitionDate;
+import org.thingsboard.server.dao.util.NoSqlDao;
+
+import javax.annotation.Nullable;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
+import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.stream.Collectors;
+
+import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
+import static org.thingsboard.server.dao.model.ModelConstants.*;
+
+@Component
+@Slf4j
+@NoSqlDao
+public class CassandraAuditLogDao extends CassandraAbstractSearchTimeDao<AuditLogEntity, AuditLog> implements AuditLogDao {
+
+ private static final String INSERT_INTO = "INSERT INTO ";
+
+ @Autowired
+ private Environment environment;
+
+ @Override
+ protected Class<AuditLogEntity> getColumnFamilyClass() {
+ return AuditLogEntity.class;
+ }
+
+ @Override
+ protected String getColumnFamilyName() {
+ return AUDIT_LOG_COLUMN_FAMILY_NAME;
+ }
+
+ protected ExecutorService readResultsProcessingExecutor;
+
+ @Value("${audit_log.by_tenant_partitioning}")
+ private String partitioning;
+ private TsPartitionDate tsFormat;
+
+ @Value("${audit_log.default_query_period}")
+ private Integer defaultQueryPeriodInDays;
+
+ private PreparedStatement partitionInsertStmt;
+ private PreparedStatement saveByTenantStmt;
+ private PreparedStatement saveByTenantIdAndUserIdStmt;
+ private PreparedStatement saveByTenantIdAndEntityIdStmt;
+ private PreparedStatement saveByTenantIdAndCustomerIdStmt;
+
+ private boolean isInstall() {
+ return environment.acceptsProfiles("install");
+ }
+
+ @PostConstruct
+ public void init() {
+ if (!isInstall()) {
+ Optional<TsPartitionDate> partition = TsPartitionDate.parse(partitioning);
+ if (partition.isPresent()) {
+ tsFormat = partition.get();
+ } else {
+ log.warn("Incorrect configuration of partitioning {}", partitioning);
+ throw new RuntimeException("Failed to parse partitioning property: " + partitioning + "!");
+ }
+ }
+ readResultsProcessingExecutor = Executors.newCachedThreadPool();
+ }
+
+ @PreDestroy
+ public void stopExecutor() {
+ if (readResultsProcessingExecutor != null) {
+ readResultsProcessingExecutor.shutdownNow();
+ }
+ }
+
+ private <T> ListenableFuture<T> getFuture(ResultSetFuture future, java.util.function.Function<ResultSet, T> transformer) {
+ return Futures.transform(future, new Function<ResultSet, T>() {
+ @Nullable
+ @Override
+ public T apply(@Nullable ResultSet input) {
+ return transformer.apply(input);
+ }
+ }, readResultsProcessingExecutor);
+ }
+
+ @Override
+ public ListenableFuture<Void> saveByTenantId(AuditLog auditLog) {
+ log.debug("Save saveByTenantId [{}] ", auditLog);
+
+ long partition = toPartitionTs(LocalDate.now().atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli());
+ BoundStatement stmt = getSaveByTenantStmt().bind();
+ stmt = setSaveStmtVariables(stmt, auditLog, partition);
+ return getFuture(executeAsyncWrite(stmt), rs -> null);
+ }
+
+ @Override
+ public ListenableFuture<Void> saveByTenantIdAndEntityId(AuditLog auditLog) {
+ log.debug("Save saveByTenantIdAndEntityId [{}] ", auditLog);
+
+ BoundStatement stmt = getSaveByTenantIdAndEntityIdStmt().bind();
+ stmt = setSaveStmtVariables(stmt, auditLog, -1);
+ return getFuture(executeAsyncWrite(stmt), rs -> null);
+ }
+
+ @Override
+ public ListenableFuture<Void> saveByTenantIdAndCustomerId(AuditLog auditLog) {
+ log.debug("Save saveByTenantIdAndCustomerId [{}] ", auditLog);
+
+ BoundStatement stmt = getSaveByTenantIdAndCustomerIdStmt().bind();
+ stmt = setSaveStmtVariables(stmt, auditLog, -1);
+ return getFuture(executeAsyncWrite(stmt), rs -> null);
+ }
+
+ @Override
+ public ListenableFuture<Void> saveByTenantIdAndUserId(AuditLog auditLog) {
+ log.debug("Save saveByTenantIdAndUserId [{}] ", auditLog);
+
+ BoundStatement stmt = getSaveByTenantIdAndUserIdStmt().bind();
+ stmt = setSaveStmtVariables(stmt, auditLog, -1);
+ return getFuture(executeAsyncWrite(stmt), rs -> null);
+ }
+
+ private BoundStatement setSaveStmtVariables(BoundStatement stmt, AuditLog auditLog, long partition) {
+ stmt.setUUID(0, auditLog.getId().getId())
+ .setUUID(1, auditLog.getTenantId().getId())
+ .setUUID(2, auditLog.getCustomerId().getId())
+ .setUUID(3, auditLog.getEntityId().getId())
+ .setString(4, auditLog.getEntityId().getEntityType().name())
+ .setString(5, auditLog.getEntityName())
+ .setUUID(6, auditLog.getUserId().getId())
+ .setString(7, auditLog.getUserName())
+ .setString(8, auditLog.getActionType().name())
+ .setString(9, auditLog.getActionData() != null ? auditLog.getActionData().toString() : null)
+ .setString(10, auditLog.getActionStatus().name())
+ .setString(11, auditLog.getActionFailureDetails());
+ if (partition > -1) {
+ stmt.setLong(12, partition);
+ }
+ return stmt;
+ }
+
+ @Override
+ public ListenableFuture<Void> savePartitionsByTenantId(AuditLog auditLog) {
+ log.debug("Save savePartitionsByTenantId [{}] ", auditLog);
+
+ long partition = toPartitionTs(LocalDate.now().atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli());
+
+ BoundStatement stmt = getPartitionInsertStmt().bind();
+ stmt = stmt.setUUID(0, auditLog.getTenantId().getId())
+ .setLong(1, partition);
+ return getFuture(executeAsyncWrite(stmt), rs -> null);
+ }
+
+ private PreparedStatement getSaveByTenantStmt() {
+ if (saveByTenantStmt == null) {
+ saveByTenantStmt = getSaveByTenantIdAndCFName(ModelConstants.AUDIT_LOG_BY_TENANT_ID_CF, true);
+ }
+ return saveByTenantStmt;
+ }
+
+ private PreparedStatement getSaveByTenantIdAndEntityIdStmt() {
+ if (saveByTenantIdAndEntityIdStmt == null) {
+ saveByTenantIdAndEntityIdStmt = getSaveByTenantIdAndCFName(ModelConstants.AUDIT_LOG_BY_ENTITY_ID_CF, false);
+ }
+ return saveByTenantIdAndEntityIdStmt;
+ }
+
+ private PreparedStatement getSaveByTenantIdAndCustomerIdStmt() {
+ if (saveByTenantIdAndCustomerIdStmt == null) {
+ saveByTenantIdAndCustomerIdStmt = getSaveByTenantIdAndCFName(ModelConstants.AUDIT_LOG_BY_CUSTOMER_ID_CF, false);
+ }
+ return saveByTenantIdAndCustomerIdStmt;
+ }
+
+ private PreparedStatement getSaveByTenantIdAndUserIdStmt() {
+ if (saveByTenantIdAndUserIdStmt == null) {
+ saveByTenantIdAndUserIdStmt = getSaveByTenantIdAndCFName(ModelConstants.AUDIT_LOG_BY_USER_ID_CF, false);
+ }
+ return saveByTenantIdAndUserIdStmt;
+ }
+
+ private PreparedStatement getSaveByTenantIdAndCFName(String cfName, boolean hasPartition) {
+ List columnsList = new ArrayList();
+ columnsList.add(ModelConstants.AUDIT_LOG_ID_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_TENANT_ID_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_CUSTOMER_ID_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_ENTITY_ID_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_ENTITY_TYPE_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_ENTITY_NAME_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_USER_ID_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_USER_NAME_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_ACTION_TYPE_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_ACTION_DATA_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_ACTION_STATUS_PROPERTY);
+ columnsList.add(ModelConstants.AUDIT_LOG_ACTION_FAILURE_DETAILS_PROPERTY);
+ if (hasPartition) {
+ columnsList.add(ModelConstants.AUDIT_LOG_PARTITION_PROPERTY);
+ }
+ StringJoiner values = new StringJoiner(",");
+ for (int i=0;i<columnsList.size();i++) {
+ values.add("?");
+ }
+ String statementString = INSERT_INTO + cfName + " (" + String.join(",", columnsList) + ") VALUES (" + values.toString() + ")";
+ return getSession().prepare(statementString);
+ }
+
+ private PreparedStatement getPartitionInsertStmt() {
+ if (partitionInsertStmt == null) {
+ partitionInsertStmt = getSession().prepare(INSERT_INTO + ModelConstants.AUDIT_LOG_BY_TENANT_ID_PARTITIONS_CF +
+ "(" + ModelConstants.AUDIT_LOG_TENANT_ID_PROPERTY +
+ "," + ModelConstants.AUDIT_LOG_PARTITION_PROPERTY + ")" +
+ " VALUES(?, ?)");
+ }
+ return partitionInsertStmt;
+ }
+
+ private long toPartitionTs(long ts) {
+ LocalDateTime time = LocalDateTime.ofInstant(Instant.ofEpochMilli(ts), ZoneOffset.UTC);
+ return tsFormat.truncatedTo(time).toInstant(ZoneOffset.UTC).toEpochMilli();
+ }
+
+ @Override
+ public List<AuditLog> findAuditLogsByTenantIdAndEntityId(UUID tenantId, EntityId entityId, TimePageLink pageLink) {
+ log.trace("Try to find audit logs by tenant [{}], entity [{}] and pageLink [{}]", tenantId, entityId, pageLink);
+ List<AuditLogEntity> entities = findPageWithTimeSearch(AUDIT_LOG_BY_ENTITY_ID_CF,
+ Arrays.asList(eq(ModelConstants.AUDIT_LOG_TENANT_ID_PROPERTY, tenantId),
+ eq(ModelConstants.AUDIT_LOG_ENTITY_TYPE_PROPERTY, entityId.getEntityType()),
+ eq(ModelConstants.AUDIT_LOG_ENTITY_ID_PROPERTY, entityId.getId())),
+ pageLink);
+ log.trace("Found audit logs by tenant [{}], entity [{}] and pageLink [{}]", tenantId, entityId, pageLink);
+ return DaoUtil.convertDataList(entities);
+ }
+
+ @Override
+ public List<AuditLog> findAuditLogsByTenantIdAndCustomerId(UUID tenantId, CustomerId customerId, TimePageLink pageLink) {
+ log.trace("Try to find audit logs by tenant [{}], customer [{}] and pageLink [{}]", tenantId, customerId, pageLink);
+ List<AuditLogEntity> entities = findPageWithTimeSearch(AUDIT_LOG_BY_CUSTOMER_ID_CF,
+ Arrays.asList(eq(ModelConstants.AUDIT_LOG_TENANT_ID_PROPERTY, tenantId),
+ eq(ModelConstants.AUDIT_LOG_CUSTOMER_ID_PROPERTY, customerId.getId())),
+ pageLink);
+ log.trace("Found audit logs by tenant [{}], customer [{}] and pageLink [{}]", tenantId, customerId, pageLink);
+ return DaoUtil.convertDataList(entities);
+ }
+
+ @Override
+ public List<AuditLog> findAuditLogsByTenantIdAndUserId(UUID tenantId, UserId userId, TimePageLink pageLink) {
+ log.trace("Try to find audit logs by tenant [{}], user [{}] and pageLink [{}]", tenantId, userId, pageLink);
+ List<AuditLogEntity> entities = findPageWithTimeSearch(AUDIT_LOG_BY_USER_ID_CF,
+ Arrays.asList(eq(ModelConstants.AUDIT_LOG_TENANT_ID_PROPERTY, tenantId),
+ eq(ModelConstants.AUDIT_LOG_USER_ID_PROPERTY, userId.getId())),
+ pageLink);
+ log.trace("Found audit logs by tenant [{}], user [{}] and pageLink [{}]", tenantId, userId, pageLink);
+ return DaoUtil.convertDataList(entities);
+ }
+
+ @Override
+ public List<AuditLog> findAuditLogsByTenantId(UUID tenantId, TimePageLink pageLink) {
+ log.trace("Try to find audit logs by tenant [{}] and pageLink [{}]", tenantId, pageLink);
+
+ long minPartition;
+ if (pageLink.getStartTime() != null && pageLink.getStartTime() != 0) {
+ minPartition = toPartitionTs(pageLink.getStartTime());
+ } else {
+ minPartition = toPartitionTs(LocalDate.now().minusDays(defaultQueryPeriodInDays).atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli());
+ }
+
+ long maxPartition;
+ if (pageLink.getEndTime() != null && pageLink.getEndTime() != 0) {
+ maxPartition = toPartitionTs(pageLink.getEndTime());
+ } else {
+ maxPartition = toPartitionTs(LocalDate.now().atStartOfDay().toInstant(ZoneOffset.UTC).toEpochMilli());
+ }
+
+ List<Long> partitions = fetchPartitions(tenantId, minPartition, maxPartition)
+ .all()
+ .stream()
+ .map(row -> row.getLong(ModelConstants.PARTITION_COLUMN))
+ .collect(Collectors.toList());
+
+ AuditLogQueryCursor cursor = new AuditLogQueryCursor(tenantId, pageLink, partitions);
+ List<AuditLogEntity> entities = fetchSequentiallyWithLimit(cursor);
+ log.trace("Found audit logs by tenant [{}] and pageLink [{}]", tenantId, pageLink);
+ return DaoUtil.convertDataList(entities);
+ }
+
+ private List<AuditLogEntity> fetchSequentiallyWithLimit(AuditLogQueryCursor cursor) {
+ if (cursor.isFull() || !cursor.hasNextPartition()) {
+ return cursor.getData();
+ } else {
+ cursor.addData(findPageWithTimeSearch(AUDIT_LOG_BY_TENANT_ID_CF,
+ Arrays.asList(eq(ModelConstants.AUDIT_LOG_TENANT_ID_PROPERTY, cursor.getTenantId()),
+ eq(ModelConstants.AUDIT_LOG_PARTITION_PROPERTY, cursor.getNextPartition())),
+ cursor.getPageLink()));
+ return fetchSequentiallyWithLimit(cursor);
+ }
+ }
+
+ private ResultSet fetchPartitions(UUID tenantId, long minPartition, long maxPartition) {
+ Select.Where select = QueryBuilder.select(ModelConstants.AUDIT_LOG_PARTITION_PROPERTY).from(ModelConstants.AUDIT_LOG_BY_TENANT_ID_PARTITIONS_CF)
+ .where(eq(ModelConstants.AUDIT_LOG_TENANT_ID_PROPERTY, tenantId));
+ select.and(QueryBuilder.gte(ModelConstants.PARTITION_COLUMN, minPartition));
+ select.and(QueryBuilder.lte(ModelConstants.PARTITION_COLUMN, maxPartition));
+ return getSession().execute(select);
+ }
+
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/DummyAuditLogServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/audit/DummyAuditLogServiceImpl.java
new file mode 100644
index 0000000..3706e50
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/DummyAuditLogServiceImpl.java
@@ -0,0 +1,60 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Service;
+import org.thingsboard.server.common.data.BaseData;
+import org.thingsboard.server.common.data.HasName;
+import org.thingsboard.server.common.data.audit.ActionType;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.*;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
+
+import java.util.List;
+
+@Service
+@ConditionalOnProperty(prefix = "audit_log", value = "enabled", havingValue = "false")
+public class DummyAuditLogServiceImpl implements AuditLogService {
+
+ @Override
+ public TimePageData<AuditLog> findAuditLogsByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, TimePageLink pageLink) {
+ return new TimePageData<>(null, pageLink);
+ }
+
+ @Override
+ public TimePageData<AuditLog> findAuditLogsByTenantIdAndUserId(TenantId tenantId, UserId userId, TimePageLink pageLink) {
+ return new TimePageData<>(null, pageLink);
+ }
+
+ @Override
+ public TimePageData<AuditLog> findAuditLogsByTenantIdAndEntityId(TenantId tenantId, EntityId entityId, TimePageLink pageLink) {
+ return new TimePageData<>(null, pageLink);
+ }
+
+ @Override
+ public TimePageData<AuditLog> findAuditLogsByTenantId(TenantId tenantId, TimePageLink pageLink) {
+ return new TimePageData<>(null, pageLink);
+ }
+
+ @Override
+ public <E extends BaseData<I> & HasName, I extends UUIDBased & EntityId> ListenableFuture<List<Void>> logEntityAction(TenantId tenantId, CustomerId customerId, UserId userId, String userName, I entityId, E entity, ActionType actionType, Exception e, Object... additionalInfo) {
+ return null;
+ }
+
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/sink/AuditLogSink.java b/dao/src/main/java/org/thingsboard/server/dao/audit/sink/AuditLogSink.java
new file mode 100644
index 0000000..d7b9032
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/sink/AuditLogSink.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright © 2016-2018 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.audit.sink;
+
+import org.thingsboard.server.common.data.audit.AuditLog;
+
+public interface AuditLogSink {
+
+ void logAction(AuditLog auditLogEntry);
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/sink/DummyAuditLogSink.java b/dao/src/main/java/org/thingsboard/server/dao/audit/sink/DummyAuditLogSink.java
new file mode 100644
index 0000000..2c07f62
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/sink/DummyAuditLogSink.java
@@ -0,0 +1,29 @@
+/**
+ * Copyright © 2016-2018 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.audit.sink;
+
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.common.data.audit.AuditLog;
+
+@Component
+@ConditionalOnProperty(prefix = "audit_log.sink", value = "type", havingValue = "none")
+public class DummyAuditLogSink implements AuditLogSink {
+
+ @Override
+ public void logAction(AuditLog auditLogEntry) {
+ }
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/audit/sink/ElasticsearchAuditLogSink.java b/dao/src/main/java/org/thingsboard/server/dao/audit/sink/ElasticsearchAuditLogSink.java
new file mode 100644
index 0000000..8359a7f
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/audit/sink/ElasticsearchAuditLogSink.java
@@ -0,0 +1,160 @@
+/**
+ * Copyright © 2016-2018 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.audit.sink;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpHost;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.entity.ContentType;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.nio.entity.NStringEntity;
+import org.elasticsearch.client.Response;
+import org.elasticsearch.client.ResponseListener;
+import org.elasticsearch.client.RestClient;
+import org.elasticsearch.client.RestClientBuilder;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.http.HttpMethod;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.TenantId;
+
+import javax.annotation.PostConstruct;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Collections;
+
+@Component
+@ConditionalOnProperty(prefix = "audit_log.sink", value = "type", havingValue = "elasticsearch")
+@Slf4j
+public class ElasticsearchAuditLogSink implements AuditLogSink {
+
+ private static final String TENANT_PLACEHOLDER = "@{TENANT}";
+ private static final String DATE_PLACEHOLDER = "@{DATE}";
+ private static final String INDEX_TYPE = "audit_log";
+
+ private final ObjectMapper mapper = new ObjectMapper();
+
+ @Value("${audit_log.sink.index_pattern}")
+ private String indexPattern;
+ @Value("${audit_log.sink.scheme_name}")
+ private String schemeName;
+ @Value("${audit_log.sink.host}")
+ private String host;
+ @Value("${audit_log.sink.port}")
+ private int port;
+ @Value("${audit_log.sink.user_name}")
+ private String userName;
+ @Value("${audit_log.sink.password}")
+ private String password;
+ @Value("${audit_log.sink.date_format}")
+ private String dateFormat;
+
+ private RestClient restClient;
+
+ @PostConstruct
+ public void init() {
+ try {
+ log.trace("Adding elastic rest endpoint... host [{}], port [{}], scheme name [{}]",
+ host, port, schemeName);
+ RestClientBuilder builder = RestClient.builder(
+ new HttpHost(host, port, schemeName));
+
+ if (StringUtils.isNotEmpty(userName) &&
+ StringUtils.isNotEmpty(password)) {
+ log.trace("...using username [{}] and password ***", userName);
+ final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+ credentialsProvider.setCredentials(AuthScope.ANY,
+ new UsernamePasswordCredentials(userName, password));
+ builder.setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider));
+ }
+
+ this.restClient = builder.build();
+ } catch (Exception e) {
+ log.error("Sink init failed!", e);
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public void logAction(AuditLog auditLogEntry) {
+ String jsonContent = createElasticJsonRecord(auditLogEntry);
+
+ HttpEntity entity = new NStringEntity(
+ jsonContent,
+ ContentType.APPLICATION_JSON);
+
+ restClient.performRequestAsync(
+ HttpMethod.POST.name(),
+ String.format("/%s/%s", getIndexName(auditLogEntry.getTenantId()), INDEX_TYPE),
+ Collections.emptyMap(),
+ entity,
+ responseListener);
+ }
+
+ private String createElasticJsonRecord(AuditLog auditLog) {
+ ObjectNode auditLogNode = mapper.createObjectNode();
+ auditLogNode.put("postDate", LocalDateTime.now().toString());
+ auditLogNode.put("id", auditLog.getId().getId().toString());
+ auditLogNode.put("entityName", auditLog.getEntityName());
+ auditLogNode.put("tenantId", auditLog.getTenantId().getId().toString());
+ if (auditLog.getCustomerId() != null) {
+ auditLogNode.put("customerId", auditLog.getCustomerId().getId().toString());
+ }
+ auditLogNode.put("entityId", auditLog.getEntityId().getId().toString());
+ auditLogNode.put("entityType", auditLog.getEntityId().getEntityType().name());
+ auditLogNode.put("userId", auditLog.getUserId().getId().toString());
+ auditLogNode.put("userName", auditLog.getUserName());
+ auditLogNode.put("actionType", auditLog.getActionType().name());
+ if (auditLog.getActionData() != null) {
+ auditLogNode.put("actionData", auditLog.getActionData().toString());
+ }
+ auditLogNode.put("actionStatus", auditLog.getActionStatus().name());
+ auditLogNode.put("actionFailureDetails", auditLog.getActionFailureDetails());
+ return auditLogNode.toString();
+ }
+
+ private ResponseListener responseListener = new ResponseListener() {
+ @Override
+ public void onSuccess(Response response) {
+ log.trace("Elasticsearch sink log action method succeeded. Response result [{}]!", response);
+ }
+
+ @Override
+ public void onFailure(Exception exception) {
+ log.warn("Elasticsearch sink log action method failed!", exception);
+ }
+ };
+
+ private String getIndexName(TenantId tenantId) {
+ String indexName = indexPattern;
+ if (indexName.contains(TENANT_PLACEHOLDER) && tenantId != null) {
+ indexName = indexName.replace(TENANT_PLACEHOLDER, tenantId.getId().toString());
+ }
+ if (indexName.contains(DATE_PLACEHOLDER)) {
+ LocalDateTime now = LocalDateTime.now();
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern(dateFormat);
+ indexName = indexName.replace(DATE_PLACEHOLDER, now.format(formatter));
+ }
+ return indexName.toLowerCase();
+ }
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cache/CacheSpecs.java b/dao/src/main/java/org/thingsboard/server/dao/cache/CacheSpecs.java
new file mode 100644
index 0000000..22e826a
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/cache/CacheSpecs.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright © 2016-2018 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.cache;
+
+import lombok.Data;
+
+@Data
+public class CacheSpecs {
+ private Integer timeToLiveInMinutes;
+ private Integer maxSize;
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cache/CaffeineCacheConfiguration.java b/dao/src/main/java/org/thingsboard/server/dao/cache/CaffeineCacheConfiguration.java
new file mode 100644
index 0000000..2dc624f
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/cache/CaffeineCacheConfiguration.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright © 2016-2018 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.cache;
+
+import com.github.benmanes.caffeine.cache.Caffeine;
+import com.github.benmanes.caffeine.cache.Ticker;
+import lombok.Data;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.caffeine.CaffeineCache;
+import org.springframework.cache.interceptor.KeyGenerator;
+import org.springframework.cache.support.SimpleCacheManager;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+@Configuration
+@ConditionalOnProperty(prefix = "cache", value = "type", havingValue = "caffeine", matchIfMissing = true)
+@ConfigurationProperties(prefix = "caffeine")
+@EnableCaching
+@Data
+public class CaffeineCacheConfiguration {
+
+ private Map<String, CacheSpecs> specs;
+
+ @Bean
+ public CacheManager cacheManager() {
+ SimpleCacheManager manager = new SimpleCacheManager();
+ if (specs != null) {
+ List<CaffeineCache> caches =
+ specs.entrySet().stream()
+ .map(entry -> buildCache(entry.getKey(),
+ entry.getValue()))
+ .collect(Collectors.toList());
+ manager.setCaches(caches);
+ }
+ return manager;
+ }
+
+ private CaffeineCache buildCache(String name, CacheSpecs cacheSpec) {
+ final Caffeine<Object, Object> caffeineBuilder
+ = Caffeine.newBuilder()
+ .expireAfterWrite(cacheSpec.getTimeToLiveInMinutes(), TimeUnit.MINUTES)
+ .maximumSize(cacheSpec.getMaxSize())
+ .ticker(ticker());
+ return new CaffeineCache(name, caffeineBuilder.build());
+ }
+
+ @Bean
+ public Ticker ticker() {
+ return Ticker.systemTicker();
+ }
+
+ @Bean
+ public KeyGenerator previousDeviceCredentialsId() {
+ return new PreviousDeviceCredentialsIdKeyGenerator();
+ }
+
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cache/PreviousDeviceCredentialsIdKeyGenerator.java b/dao/src/main/java/org/thingsboard/server/dao/cache/PreviousDeviceCredentialsIdKeyGenerator.java
index aa40043..cc8f496 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/cache/PreviousDeviceCredentialsIdKeyGenerator.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/cache/PreviousDeviceCredentialsIdKeyGenerator.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -23,6 +23,8 @@ import java.lang.reflect.Method;
public class PreviousDeviceCredentialsIdKeyGenerator implements KeyGenerator {
+ private static final String NOT_VALID_DEVICE = "notValidDeviceCredentialsId";
+
@Override
public Object generate(Object o, Method method, Object... objects) {
DeviceCredentialsService deviceCredentialsService = (DeviceCredentialsService) o;
@@ -33,6 +35,6 @@ public class PreviousDeviceCredentialsIdKeyGenerator implements KeyGenerator {
return oldDeviceCredentials.getCredentialsId();
}
}
- return null;
+ return NOT_VALID_DEVICE;
}
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cache/TBRedisCacheConfiguration.java b/dao/src/main/java/org/thingsboard/server/dao/cache/TBRedisCacheConfiguration.java
new file mode 100644
index 0000000..cfb69f3
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/cache/TBRedisCacheConfiguration.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright © 2016-2018 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.cache;
+
+import lombok.Data;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.interceptor.KeyGenerator;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.cache.RedisCacheManager;
+import org.springframework.data.redis.connection.RedisConnectionFactory;
+import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
+import org.springframework.data.redis.core.RedisTemplate;
+
+@Configuration
+@ConditionalOnProperty(prefix = "cache", value = "type", havingValue = "redis", matchIfMissing = false)
+@EnableCaching
+@Data
+public class TBRedisCacheConfiguration {
+
+ @Value("${redis.connection.host}")
+ private String host;
+
+ @Value("${redis.connection.port}")
+ private Integer port;
+
+ @Value("${redis.connection.db}")
+ private Integer db;
+
+ @Value("${redis.connection.password}")
+ private String password;
+
+ @Bean
+ public RedisConnectionFactory redisConnectionFactory() {
+ JedisConnectionFactory factory = new JedisConnectionFactory();
+ factory.setHostName(host);
+ factory.setPort(port);
+ factory.setDatabase(db);
+ factory.setPassword(password);
+ return factory;
+ }
+
+ @Bean
+ public RedisTemplate<String, String> redisTemplate(RedisConnectionFactory cf) {
+ RedisTemplate<String, String> redisTemplate = new RedisTemplate<>();
+ redisTemplate.setConnectionFactory(cf);
+ return redisTemplate;
+ }
+
+ @Bean
+ public CacheManager cacheManager(RedisTemplate redisTemplate) {
+ return new RedisCacheManager(redisTemplate);
+ }
+
+ @Bean
+ public KeyGenerator previousDeviceCredentialsId() {
+ return new PreviousDeviceCredentialsIdKeyGenerator();
+ }
+
+
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cassandra/AbstractCassandraCluster.java b/dao/src/main/java/org/thingsboard/server/dao/cassandra/AbstractCassandraCluster.java
index f37fa93..2e56416 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/cassandra/AbstractCassandraCluster.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/cassandra/AbstractCassandraCluster.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -20,9 +20,6 @@ import com.datastax.driver.core.*;
import com.datastax.driver.core.ProtocolOptions.Compression;
import com.datastax.driver.mapping.Mapper;
import com.datastax.driver.mapping.MappingManager;
-import lombok.AccessLevel;
-import lombok.Data;
-import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -36,7 +33,6 @@ import java.util.Collections;
import java.util.List;
@Slf4j
-@Data
public abstract class AbstractCassandraCluster {
private static final String COMMA = ",";
@@ -77,7 +73,7 @@ public abstract class AbstractCassandraCluster {
private Cluster cluster;
private Cluster.Builder clusterBuilder;
- @Getter(AccessLevel.NONE) private Session session;
+ private Session session;
private MappingManager mappingManager;
@@ -115,6 +111,10 @@ public abstract class AbstractCassandraCluster {
}
}
+ public Cluster getCluster() {
+ return cluster;
+ }
+
public Session getSession() {
if (!isInstall()) {
return session;
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraCluster.java b/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraCluster.java
index be4d9ad..5675232 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraCluster.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraCluster.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraInstallCluster.java b/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraInstallCluster.java
index 6674035..0296807 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraInstallCluster.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraInstallCluster.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.dao.cassandra;
import org.springframework.context.annotation.Profile;
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraQueryOptions.java b/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraQueryOptions.java
index 1d29910..474cad7 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraQueryOptions.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraQueryOptions.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraSocketOptions.java b/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraSocketOptions.java
index 5c8f196..8171ccc 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraSocketOptions.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/cassandra/CassandraSocketOptions.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/component/BaseComponentDescriptorService.java b/dao/src/main/java/org/thingsboard/server/dao/component/BaseComponentDescriptorService.java
index 3a89e55..556a713 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/component/BaseComponentDescriptorService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/component/BaseComponentDescriptorService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/component/CassandraBaseComponentDescriptorDao.java b/dao/src/main/java/org/thingsboard/server/dao/component/CassandraBaseComponentDescriptorDao.java
index ff3f727..5e03545 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/component/CassandraBaseComponentDescriptorDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/component/CassandraBaseComponentDescriptorDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/component/ComponentDescriptorDao.java b/dao/src/main/java/org/thingsboard/server/dao/component/ComponentDescriptorDao.java
index cfbcaae..7e87482 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/component/ComponentDescriptorDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/component/ComponentDescriptorDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/component/ComponentDescriptorService.java b/dao/src/main/java/org/thingsboard/server/dao/component/ComponentDescriptorService.java
index ec93a91..bd101de 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/component/ComponentDescriptorService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/component/ComponentDescriptorService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/customer/CassandraCustomerDao.java b/dao/src/main/java/org/thingsboard/server/dao/customer/CassandraCustomerDao.java
index 629bd98..9fea618 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/customer/CassandraCustomerDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/customer/CassandraCustomerDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerDao.java b/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerDao.java
index 53d764b..b9d2f37 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerService.java b/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerService.java
index 1d1abda..4b70291 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerServiceImpl.java
index f76d654..36b250d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerServiceImpl.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/customer/CustomerServiceImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -97,7 +97,9 @@ public class CustomerServiceImpl extends AbstractEntityService implements Custom
public Customer saveCustomer(Customer customer) {
log.trace("Executing saveCustomer [{}]", customer);
customerValidator.validate(customer);
- return customerDao.save(customer);
+ Customer savedCustomer = customerDao.save(customer);
+ dashboardService.updateCustomerDashboards(savedCustomer.getId());
+ return savedCustomer;
}
@Override
@@ -108,7 +110,7 @@ public class CustomerServiceImpl extends AbstractEntityService implements Custom
if (customer == null) {
throw new IncorrectParameterException("Unable to delete non-existent customer.");
}
- dashboardService.unassignCustomerDashboards(customer.getTenantId(), customerId);
+ dashboardService.unassignCustomerDashboards(customerId);
assetService.unassignCustomerAssets(customer.getTenantId(), customerId);
deviceService.unassignCustomerDevices(customer.getTenantId(), customerId);
userService.deleteCustomerUsers(customer.getTenantId(), customerId);
diff --git a/dao/src/main/java/org/thingsboard/server/dao/Dao.java b/dao/src/main/java/org/thingsboard/server/dao/Dao.java
index f0580eb..c823790 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/Dao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/Dao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/DaoUtil.java b/dao/src/main/java/org/thingsboard/server/dao/DaoUtil.java
index 3392ef7..fc434bf 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/DaoUtil.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/DaoUtil.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/dashboard/CassandraDashboardDao.java b/dao/src/main/java/org/thingsboard/server/dao/dashboard/CassandraDashboardDao.java
index b5cb0a8..f665bca 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/dashboard/CassandraDashboardDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/dashboard/CassandraDashboardDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/dashboard/CassandraDashboardInfoDao.java b/dao/src/main/java/org/thingsboard/server/dao/dashboard/CassandraDashboardInfoDao.java
index d0651a4..8091b2a 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/dashboard/CassandraDashboardInfoDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/dashboard/CassandraDashboardInfoDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,16 +15,26 @@
*/
package org.thingsboard.server.dao.dashboard;
+import com.google.common.util.concurrent.AsyncFunction;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.thingsboard.server.common.data.DashboardInfo;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.common.data.relation.EntityRelation;
+import org.thingsboard.server.common.data.relation.RelationTypeGroup;
import org.thingsboard.server.dao.DaoUtil;
import org.thingsboard.server.dao.model.nosql.DashboardInfoEntity;
import org.thingsboard.server.dao.nosql.CassandraAbstractSearchTextDao;
+import org.thingsboard.server.dao.relation.RelationDao;
import org.thingsboard.server.dao.util.NoSqlDao;
-import java.util.Arrays;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
@@ -37,6 +47,9 @@ import static org.thingsboard.server.dao.model.ModelConstants.*;
@NoSqlDao
public class CassandraDashboardInfoDao extends CassandraAbstractSearchTextDao<DashboardInfoEntity, DashboardInfo> implements DashboardInfoDao {
+ @Autowired
+ private RelationDao relationDao;
+
@Override
protected Class<DashboardInfoEntity> getColumnFamilyClass() {
return DashboardInfoEntity.class;
@@ -59,15 +72,18 @@ public class CassandraDashboardInfoDao extends CassandraAbstractSearchTextDao<Da
}
@Override
- public List<DashboardInfo> findDashboardsByTenantIdAndCustomerId(UUID tenantId, UUID customerId, TextPageLink pageLink) {
+ public ListenableFuture<List<DashboardInfo>> findDashboardsByTenantIdAndCustomerId(UUID tenantId, UUID customerId, TimePageLink pageLink) {
log.debug("Try to find dashboards by tenantId [{}], customerId[{}] and pageLink [{}]", tenantId, customerId, pageLink);
- List<DashboardInfoEntity> dashboardEntities = findPageWithTextSearch(DASHBOARD_BY_CUSTOMER_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME,
- Arrays.asList(eq(DASHBOARD_CUSTOMER_ID_PROPERTY, customerId),
- eq(DASHBOARD_TENANT_ID_PROPERTY, tenantId)),
- pageLink);
- log.trace("Found dashboards [{}] by tenantId [{}], customerId [{}] and pageLink [{}]", dashboardEntities, tenantId, customerId, pageLink);
- return DaoUtil.convertDataList(dashboardEntities);
+ ListenableFuture<List<EntityRelation>> relations = relationDao.findRelations(new CustomerId(customerId), EntityRelation.CONTAINS_TYPE, RelationTypeGroup.DASHBOARD, EntityType.DASHBOARD, pageLink);
+
+ return Futures.transform(relations, (AsyncFunction<List<EntityRelation>, List<DashboardInfo>>) input -> {
+ List<ListenableFuture<DashboardInfo>> dashboardFutures = new ArrayList<>(input.size());
+ for (EntityRelation relation : input) {
+ dashboardFutures.add(findByIdAsync(relation.getTo().getId()));
+ }
+ return Futures.successfulAsList(dashboardFutures);
+ });
}
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardDao.java b/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardDao.java
index f2563ca..c355eef 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardInfoDao.java b/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardInfoDao.java
index a26bd14..ec2b39a 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardInfoDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardInfoDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,8 +15,10 @@
*/
package org.thingsboard.server.dao.dashboard;
+import com.google.common.util.concurrent.ListenableFuture;
import org.thingsboard.server.common.data.DashboardInfo;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageLink;
import org.thingsboard.server.dao.Dao;
import java.util.List;
@@ -44,6 +46,6 @@ public interface DashboardInfoDao extends Dao<DashboardInfo> {
* @param pageLink the page link
* @return the list of dashboard objects
*/
- List<DashboardInfo> findDashboardsByTenantIdAndCustomerId(UUID tenantId, UUID customerId, TextPageLink pageLink);
+ ListenableFuture<List<DashboardInfo>> findDashboardsByTenantIdAndCustomerId(UUID tenantId, UUID customerId, TimePageLink pageLink);
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardService.java b/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardService.java
index 74d8544..44d18ac 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -23,6 +23,10 @@ import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.TextPageData;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
+
+import java.util.Set;
public interface DashboardService {
@@ -38,7 +42,7 @@ public interface DashboardService {
Dashboard assignDashboardToCustomer(DashboardId dashboardId, CustomerId customerId);
- Dashboard unassignDashboardFromCustomer(DashboardId dashboardId);
+ Dashboard unassignDashboardFromCustomer(DashboardId dashboardId, CustomerId customerId);
void deleteDashboard(DashboardId dashboardId);
@@ -46,8 +50,10 @@ public interface DashboardService {
void deleteDashboardsByTenantId(TenantId tenantId);
- TextPageData<DashboardInfo> findDashboardsByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, TextPageLink pageLink);
+ ListenableFuture<TimePageData<DashboardInfo>> findDashboardsByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, TimePageLink pageLink);
+
+ void unassignCustomerDashboards(CustomerId customerId);
- void unassignCustomerDashboards(TenantId tenantId, CustomerId customerId);
+ void updateCustomerDashboards(CustomerId customerId);
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardServiceImpl.java
index 53fdb73..6ce5286 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardServiceImpl.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/dashboard/DashboardServiceImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,30 +15,42 @@
*/
package org.thingsboard.server.dao.dashboard;
+import com.google.common.base.Function;
+import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-import org.thingsboard.server.common.data.Customer;
-import org.thingsboard.server.common.data.Dashboard;
-import org.thingsboard.server.common.data.DashboardInfo;
-import org.thingsboard.server.common.data.Tenant;
+import org.thingsboard.server.common.data.*;
+import org.thingsboard.server.common.data.alarm.AlarmInfo;
import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.TextPageData;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.common.data.relation.EntityRelation;
+import org.thingsboard.server.common.data.relation.RelationTypeGroup;
import org.thingsboard.server.dao.customer.CustomerDao;
import org.thingsboard.server.dao.entity.AbstractEntityService;
import org.thingsboard.server.dao.exception.DataValidationException;
import org.thingsboard.server.dao.model.ModelConstants;
+import org.thingsboard.server.dao.relation.RelationDao;
import org.thingsboard.server.dao.service.DataValidator;
import org.thingsboard.server.dao.service.PaginatedRemover;
+import org.thingsboard.server.dao.service.TimePaginatedRemover;
import org.thingsboard.server.dao.service.Validator;
import org.thingsboard.server.dao.tenant.TenantDao;
+import javax.annotation.Nullable;
+import java.sql.Time;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ExecutionException;
import static org.thingsboard.server.dao.service.Validator.validateId;
@@ -59,7 +71,7 @@ public class DashboardServiceImpl extends AbstractEntityService implements Dashb
@Autowired
private CustomerDao customerDao;
-
+
@Override
public Dashboard findDashboardById(DashboardId dashboardId) {
log.trace("Executing findDashboardById [{}]", dashboardId);
@@ -98,15 +110,63 @@ public class DashboardServiceImpl extends AbstractEntityService implements Dashb
@Override
public Dashboard assignDashboardToCustomer(DashboardId dashboardId, CustomerId customerId) {
Dashboard dashboard = findDashboardById(dashboardId);
- dashboard.setCustomerId(customerId);
- return saveDashboard(dashboard);
+ Customer customer = customerDao.findById(customerId.getId());
+ if (customer == null) {
+ throw new DataValidationException("Can't assign dashboard to non-existent customer!");
+ }
+ if (!customer.getTenantId().getId().equals(dashboard.getTenantId().getId())) {
+ throw new DataValidationException("Can't assign dashboard to customer from different tenant!");
+ }
+ if (dashboard.addAssignedCustomer(customer)) {
+ try {
+ createRelation(new EntityRelation(customerId, dashboardId, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.DASHBOARD));
+ } catch (ExecutionException | InterruptedException e) {
+ log.warn("[{}] Failed to create dashboard relation. Customer Id: [{}]", dashboardId, customerId);
+ throw new RuntimeException(e);
+ }
+ return saveDashboard(dashboard);
+ } else {
+ return dashboard;
+ }
}
@Override
- public Dashboard unassignDashboardFromCustomer(DashboardId dashboardId) {
+ public Dashboard unassignDashboardFromCustomer(DashboardId dashboardId, CustomerId customerId) {
Dashboard dashboard = findDashboardById(dashboardId);
- dashboard.setCustomerId(null);
- return saveDashboard(dashboard);
+ Customer customer = customerDao.findById(customerId.getId());
+ if (customer == null) {
+ throw new DataValidationException("Can't unassign dashboard from non-existent customer!");
+ }
+ if (dashboard.removeAssignedCustomer(customer)) {
+ try {
+ deleteRelation(new EntityRelation(customerId, dashboardId, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.DASHBOARD));
+ } catch (ExecutionException | InterruptedException e) {
+ log.warn("[{}] Failed to delete dashboard relation. Customer Id: [{}]", dashboardId, customerId);
+ throw new RuntimeException(e);
+ }
+ return saveDashboard(dashboard);
+ } else {
+ return dashboard;
+ }
+ }
+
+ private Dashboard updateAssignedCustomer(DashboardId dashboardId, Customer customer) {
+ Dashboard dashboard = findDashboardById(dashboardId);
+ if (dashboard.updateAssignedCustomer(customer)) {
+ return saveDashboard(dashboard);
+ } else {
+ return dashboard;
+ }
+ }
+
+ private void deleteRelation(EntityRelation dashboardRelation) throws ExecutionException, InterruptedException {
+ log.debug("Deleting Dashboard relation: {}", dashboardRelation);
+ relationService.deleteRelationAsync(dashboardRelation).get();
+ }
+
+ private void createRelation(EntityRelation dashboardRelation) throws ExecutionException, InterruptedException {
+ log.debug("Creating Dashboard relation: {}", dashboardRelation);
+ relationService.saveRelationAsync(dashboardRelation).get();
}
@Override
@@ -134,23 +194,44 @@ public class DashboardServiceImpl extends AbstractEntityService implements Dashb
}
@Override
- public TextPageData<DashboardInfo> findDashboardsByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, TextPageLink pageLink) {
+ public ListenableFuture<TimePageData<DashboardInfo>> findDashboardsByTenantIdAndCustomerId(TenantId tenantId, CustomerId customerId, TimePageLink pageLink) {
log.trace("Executing findDashboardsByTenantIdAndCustomerId, tenantId [{}], customerId [{}], pageLink [{}]", tenantId, customerId, pageLink);
Validator.validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
Validator.validateId(customerId, "Incorrect customerId " + customerId);
Validator.validatePageLink(pageLink, "Incorrect page link " + pageLink);
- List<DashboardInfo> dashboards = dashboardInfoDao.findDashboardsByTenantIdAndCustomerId(tenantId.getId(), customerId.getId(), pageLink);
- return new TextPageData<>(dashboards, pageLink);
+ ListenableFuture<List<DashboardInfo>> dashboards = dashboardInfoDao.findDashboardsByTenantIdAndCustomerId(tenantId.getId(), customerId.getId(), pageLink);
+
+ return Futures.transform(dashboards, new Function<List<DashboardInfo>, TimePageData<DashboardInfo>>() {
+ @Nullable
+ @Override
+ public TimePageData<DashboardInfo> apply(@Nullable List<DashboardInfo> dashboards) {
+ return new TimePageData<>(dashboards, pageLink);
+ }
+ });
}
@Override
- public void unassignCustomerDashboards(TenantId tenantId, CustomerId customerId) {
- log.trace("Executing unassignCustomerDashboards, tenantId [{}], customerId [{}]", tenantId, customerId);
- Validator.validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
+ public void unassignCustomerDashboards(CustomerId customerId) {
+ log.trace("Executing unassignCustomerDashboards, customerId [{}]", customerId);
Validator.validateId(customerId, "Incorrect customerId " + customerId);
- new CustomerDashboardsUnassigner(tenantId).removeEntities(customerId);
+ Customer customer = customerDao.findById(customerId.getId());
+ if (customer == null) {
+ throw new DataValidationException("Can't unassign dashboards from non-existent customer!");
+ }
+ new CustomerDashboardsUnassigner(customer).removeEntities(customer);
}
-
+
+ @Override
+ public void updateCustomerDashboards(CustomerId customerId) {
+ log.trace("Executing updateCustomerDashboards, customerId [{}]", customerId);
+ Validator.validateId(customerId, "Incorrect customerId " + customerId);
+ Customer customer = customerDao.findById(customerId.getId());
+ if (customer == null) {
+ throw new DataValidationException("Can't update dashboards for non-existent customer!");
+ }
+ new CustomerDashboardsUpdater(customer).removeEntities(customer);
+ }
+
private DataValidator<Dashboard> dashboardValidator =
new DataValidator<Dashboard>() {
@Override
@@ -166,17 +247,6 @@ public class DashboardServiceImpl extends AbstractEntityService implements Dashb
throw new DataValidationException("Dashboard is referencing to non-existent tenant!");
}
}
- if (dashboard.getCustomerId() == null) {
- dashboard.setCustomerId(new CustomerId(ModelConstants.NULL_UUID));
- } else if (!dashboard.getCustomerId().getId().equals(ModelConstants.NULL_UUID)) {
- Customer customer = customerDao.findById(dashboard.getCustomerId().getId());
- if (customer == null) {
- throw new DataValidationException("Can't assign dashboard to non-existent customer!");
- }
- if (!customer.getTenantId().getId().equals(dashboard.getTenantId().getId())) {
- throw new DataValidationException("Can't assign dashboard to customer from different tenant!");
- }
- }
}
};
@@ -194,24 +264,54 @@ public class DashboardServiceImpl extends AbstractEntityService implements Dashb
}
};
- private class CustomerDashboardsUnassigner extends PaginatedRemover<CustomerId, DashboardInfo> {
-
- private TenantId tenantId;
+ private class CustomerDashboardsUnassigner extends TimePaginatedRemover<Customer, DashboardInfo> {
- CustomerDashboardsUnassigner(TenantId tenantId) {
- this.tenantId = tenantId;
+ private Customer customer;
+
+ CustomerDashboardsUnassigner(Customer customer) {
+ this.customer = customer;
}
@Override
- protected List<DashboardInfo> findEntities(CustomerId id, TextPageLink pageLink) {
- return dashboardInfoDao.findDashboardsByTenantIdAndCustomerId(tenantId.getId(), id.getId(), pageLink);
+ protected List<DashboardInfo> findEntities(Customer customer, TimePageLink pageLink) {
+ try {
+ return dashboardInfoDao.findDashboardsByTenantIdAndCustomerId(customer.getTenantId().getId(), customer.getId().getId(), pageLink).get();
+ } catch (InterruptedException | ExecutionException e) {
+ log.warn("Failed to get dashboards by tenantId [{}] and customerId [{}].", customer.getTenantId().getId(), customer.getId().getId());
+ throw new RuntimeException(e);
+ }
}
@Override
protected void removeEntity(DashboardInfo entity) {
- unassignDashboardFromCustomer(new DashboardId(entity.getUuidId()));
+ unassignDashboardFromCustomer(new DashboardId(entity.getUuidId()), this.customer.getId());
}
}
+ private class CustomerDashboardsUpdater extends TimePaginatedRemover<Customer, DashboardInfo> {
+
+ private Customer customer;
+
+ CustomerDashboardsUpdater(Customer customer) {
+ this.customer = customer;
+ }
+
+ @Override
+ protected List<DashboardInfo> findEntities(Customer customer, TimePageLink pageLink) {
+ try {
+ return dashboardInfoDao.findDashboardsByTenantIdAndCustomerId(customer.getTenantId().getId(), customer.getId().getId(), pageLink).get();
+ } catch (InterruptedException | ExecutionException e) {
+ log.warn("Failed to get dashboards by tenantId [{}] and customerId [{}].", customer.getTenantId().getId(), customer.getId().getId());
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ protected void removeEntity(DashboardInfo entity) {
+ updateAssignedCustomer(new DashboardId(entity.getUuidId()), this.customer);
+ }
+
+ }
+
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/CassandraDeviceCredentialsDao.java b/dao/src/main/java/org/thingsboard/server/dao/device/CassandraDeviceCredentialsDao.java
index 5073516..68c2cae 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/device/CassandraDeviceCredentialsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/device/CassandraDeviceCredentialsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/CassandraDeviceDao.java b/dao/src/main/java/org/thingsboard/server/dao/device/CassandraDeviceDao.java
index 9c3a4bb..ac72ae8 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/device/CassandraDeviceDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/device/CassandraDeviceDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsDao.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsDao.java
index c13129a..bb36ee9 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsService.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsService.java
index 73e9dd3..89389a5 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java
index caeb3d1..4219b06 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceCredentialsServiceImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceDao.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceDao.java
index c0c1744..dbc098e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceService.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceService.java
index 3b0c5ec..3a7c5e3 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -34,7 +34,7 @@ public interface DeviceService {
ListenableFuture<Device> findDeviceByIdAsync(DeviceId deviceId);
- Optional<Device> findDeviceByTenantIdAndName(TenantId tenantId, String name);
+ Device findDeviceByTenantIdAndName(TenantId tenantId, String name);
Device saveDevice(Device device);
diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java
index e762a0c..9120619 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -22,6 +22,10 @@ import com.google.common.util.concurrent.ListenableFuture;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.Cache;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.thingsboard.server.common.data.*;
@@ -33,12 +37,12 @@ import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.TextPageData;
import org.thingsboard.server.common.data.page.TextPageLink;
import org.thingsboard.server.common.data.relation.EntityRelation;
+import org.thingsboard.server.common.data.relation.EntitySearchDirection;
import org.thingsboard.server.common.data.security.DeviceCredentials;
import org.thingsboard.server.common.data.security.DeviceCredentialsType;
import org.thingsboard.server.dao.customer.CustomerDao;
import org.thingsboard.server.dao.entity.AbstractEntityService;
import org.thingsboard.server.dao.exception.DataValidationException;
-import org.thingsboard.server.common.data.relation.EntitySearchDirection;
import org.thingsboard.server.dao.service.DataValidator;
import org.thingsboard.server.dao.service.PaginatedRemover;
import org.thingsboard.server.dao.tenant.TenantDao;
@@ -47,6 +51,7 @@ import javax.annotation.Nullable;
import java.util.*;
import java.util.stream.Collectors;
+import static org.thingsboard.server.common.data.CacheConstants.DEVICE_CACHE;
import static org.thingsboard.server.dao.DaoUtil.toUUIDs;
import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID;
import static org.thingsboard.server.dao.service.Validator.*;
@@ -71,6 +76,9 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe
@Autowired
private DeviceCredentialsService deviceCredentialsService;
+ @Autowired
+ private CacheManager cacheManager;
+
@Override
public Device findDeviceById(DeviceId deviceId) {
log.trace("Executing findDeviceById [{}]", deviceId);
@@ -85,18 +93,16 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe
return deviceDao.findByIdAsync(deviceId.getId());
}
+ @Cacheable(cacheNames = DEVICE_CACHE, key = "{#tenantId, #name}")
@Override
- public Optional<Device> findDeviceByTenantIdAndName(TenantId tenantId, String name) {
+ public Device findDeviceByTenantIdAndName(TenantId tenantId, String name) {
log.trace("Executing findDeviceByTenantIdAndName [{}][{}]", tenantId, name);
validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
Optional<Device> deviceOpt = deviceDao.findDeviceByTenantIdAndName(tenantId.getId(), name);
- if (deviceOpt.isPresent()) {
- return Optional.of(deviceOpt.get());
- } else {
- return Optional.empty();
- }
+ return deviceOpt.orElse(null);
}
+ @CacheEvict(cacheNames = DEVICE_CACHE, key = "{#device.tenantId, #device.name}")
@Override
public Device saveDevice(Device device) {
log.trace("Executing saveDevice [{}]", device);
@@ -129,12 +135,18 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe
@Override
public void deleteDevice(DeviceId deviceId) {
log.trace("Executing deleteDevice [{}]", deviceId);
+ Cache cache = cacheManager.getCache(DEVICE_CACHE);
validateId(deviceId, INCORRECT_DEVICE_ID + deviceId);
DeviceCredentials deviceCredentials = deviceCredentialsService.findDeviceCredentialsByDeviceId(deviceId);
if (deviceCredentials != null) {
deviceCredentialsService.deleteDeviceCredentials(deviceCredentials);
}
deleteEntityRelations(deviceId);
+ Device device = deviceDao.findById(deviceId.getId());
+ List<Object> list = new ArrayList<>();
+ list.add(device.getTenantId());
+ list.add(device.getName());
+ cache.evict(list);
deviceDao.removeById(deviceId.getId());
}
@@ -190,7 +202,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe
validateId(customerId, INCORRECT_CUSTOMER_ID + customerId);
validateString(type, "Incorrect type " + type);
validatePageLink(pageLink, INCORRECT_PAGE_LINK + pageLink);
- List<Device> devices = deviceDao.findDevicesByTenantIdAndCustomerIdAndType(tenantId.getId(), customerId.getId(), type, pageLink);
+ List<Device> devices = deviceDao.findDevicesByTenantIdAndCustomerIdAndType(tenantId.getId(), customerId.getId(), type, pageLink);
return new TextPageData<>(devices, pageLink);
}
@@ -244,10 +256,10 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe
validateId(tenantId, INCORRECT_TENANT_ID + tenantId);
ListenableFuture<List<EntitySubtype>> tenantDeviceTypes = deviceDao.findTenantDeviceTypesAsync(tenantId.getId());
return Futures.transform(tenantDeviceTypes,
- (Function<List<EntitySubtype>, List<EntitySubtype>>) deviceTypes -> {
- deviceTypes.sort(Comparator.comparing(EntitySubtype::getType));
- return deviceTypes;
- });
+ (Function<List<EntitySubtype>, List<EntitySubtype>>) deviceTypes -> {
+ deviceTypes.sort(Comparator.comparing(EntitySubtype::getType));
+ return deviceTypes;
+ });
}
private DataValidator<Device> deviceValidator =
diff --git a/dao/src/main/java/org/thingsboard/server/dao/EncryptionUtil.java b/dao/src/main/java/org/thingsboard/server/dao/EncryptionUtil.java
index 1d74d30..a44ad57 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/EncryptionUtil.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/EncryptionUtil.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/entity/AbstractEntityService.java b/dao/src/main/java/org/thingsboard/server/dao/entity/AbstractEntityService.java
index a7f1530..50723f3 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/entity/AbstractEntityService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/entity/AbstractEntityService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.dao.entity;
import lombok.extern.slf4j.Slf4j;
diff --git a/dao/src/main/java/org/thingsboard/server/dao/entity/BaseEntityService.java b/dao/src/main/java/org/thingsboard/server/dao/entity/BaseEntityService.java
index c4e2e42..acc88eb 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/entity/BaseEntityService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/entity/BaseEntityService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/entity/EntityService.java b/dao/src/main/java/org/thingsboard/server/dao/entity/EntityService.java
index 415f518..aa4acb1 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/entity/EntityService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/entity/EntityService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.dao.entity;
import com.google.common.util.concurrent.ListenableFuture;
diff --git a/dao/src/main/java/org/thingsboard/server/dao/event/BaseEventService.java b/dao/src/main/java/org/thingsboard/server/dao/event/BaseEventService.java
index 4e47f3a..b8ba4a7 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/event/BaseEventService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/event/BaseEventService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/event/CassandraBaseEventDao.java b/dao/src/main/java/org/thingsboard/server/dao/event/CassandraBaseEventDao.java
index 8b89e45..43d3fd5 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/event/CassandraBaseEventDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/event/CassandraBaseEventDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/event/EventDao.java b/dao/src/main/java/org/thingsboard/server/dao/event/EventDao.java
index 846c476..fb5c0fb 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/event/EventDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/event/EventDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/event/EventService.java b/dao/src/main/java/org/thingsboard/server/dao/event/EventService.java
index 1fb40f1..edee190 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/event/EventService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/event/EventService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/exception/DatabaseException.java b/dao/src/main/java/org/thingsboard/server/dao/exception/DatabaseException.java
index aa322f6..9a581a1 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/exception/DatabaseException.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/exception/DatabaseException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/exception/DataValidationException.java b/dao/src/main/java/org/thingsboard/server/dao/exception/DataValidationException.java
index 640bc0a..48fa0db 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/exception/DataValidationException.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/exception/DataValidationException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/exception/IncorrectParameterException.java b/dao/src/main/java/org/thingsboard/server/dao/exception/IncorrectParameterException.java
index 6600dc8..02c9b80 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/exception/IncorrectParameterException.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/exception/IncorrectParameterException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/JpaDaoConfig.java b/dao/src/main/java/org/thingsboard/server/dao/JpaDaoConfig.java
index 5e4d5c1..cf3ce52 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/JpaDaoConfig.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/JpaDaoConfig.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/BaseEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/BaseEntity.java
index effe911..0aaf9c2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/BaseEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/BaseEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/BaseSqlEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/BaseSqlEntity.java
index a6110f0..cba21e4 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/BaseSqlEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/BaseSqlEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/EntitySubtypeEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/EntitySubtypeEntity.java
index a653b4d..e4e4d61 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/EntitySubtypeEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/EntitySubtypeEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package org.thingsboard.server.dao.model;
import com.datastax.driver.mapping.annotations.Column;
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 9b596fc..c2b55c9 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -44,6 +44,13 @@ public class ModelConstants {
public static final String ADDITIONAL_INFO_PROPERTY = "additional_info";
public static final String ENTITY_TYPE_PROPERTY = "entity_type";
+ public static final String ENTITY_TYPE_COLUMN = ENTITY_TYPE_PROPERTY;
+ public static final String ENTITY_ID_COLUMN = "entity_id";
+ public static final String ATTRIBUTE_TYPE_COLUMN = "attribute_type";
+ public static final String ATTRIBUTE_KEY_COLUMN = "attribute_key";
+ public static final String LAST_UPDATE_TS_COLUMN = "last_update_ts";
+
+
/**
* Cassandra user constants.
*/
@@ -135,6 +142,31 @@ public class ModelConstants {
public static final String DEVICE_TYPES_BY_TENANT_VIEW_NAME = "device_types_by_tenant";
/**
+ * Cassandra audit log constants.
+ */
+ public static final String AUDIT_LOG_COLUMN_FAMILY_NAME = "audit_log";
+
+ public static final String AUDIT_LOG_BY_ENTITY_ID_CF = "audit_log_by_entity_id";
+ public static final String AUDIT_LOG_BY_CUSTOMER_ID_CF = "audit_log_by_customer_id";
+ public static final String AUDIT_LOG_BY_USER_ID_CF = "audit_log_by_user_id";
+ public static final String AUDIT_LOG_BY_TENANT_ID_CF = "audit_log_by_tenant_id";
+ public static final String AUDIT_LOG_BY_TENANT_ID_PARTITIONS_CF = "audit_log_by_tenant_id_partitions";
+
+ public static final String AUDIT_LOG_ID_PROPERTY = ID_PROPERTY;
+ public static final String AUDIT_LOG_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY;
+ public static final String AUDIT_LOG_CUSTOMER_ID_PROPERTY = CUSTOMER_ID_PROPERTY;
+ public static final String AUDIT_LOG_ENTITY_TYPE_PROPERTY = ENTITY_TYPE_PROPERTY;
+ public static final String AUDIT_LOG_ENTITY_ID_PROPERTY = ENTITY_ID_COLUMN;
+ public static final String AUDIT_LOG_ENTITY_NAME_PROPERTY = "entity_name";
+ public static final String AUDIT_LOG_USER_ID_PROPERTY = USER_ID_PROPERTY;
+ public static final String AUDIT_LOG_PARTITION_PROPERTY = "partition";
+ public static final String AUDIT_LOG_USER_NAME_PROPERTY = "user_name";
+ public static final String AUDIT_LOG_ACTION_TYPE_PROPERTY = "action_type";
+ public static final String AUDIT_LOG_ACTION_DATA_PROPERTY = "action_data";
+ public static final String AUDIT_LOG_ACTION_STATUS_PROPERTY = "action_status";
+ public static final String AUDIT_LOG_ACTION_FAILURE_DETAILS_PROPERTY = "action_failure_details";
+
+ /**
* Cassandra asset constants.
*/
public static final String ASSET_COLUMN_FAMILY_NAME = "asset";
@@ -234,13 +266,11 @@ public class ModelConstants {
*/
public static final String DASHBOARD_COLUMN_FAMILY_NAME = "dashboard";
public static final String DASHBOARD_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY;
- public static final String DASHBOARD_CUSTOMER_ID_PROPERTY = CUSTOMER_ID_PROPERTY;
public static final String DASHBOARD_TITLE_PROPERTY = TITLE_PROPERTY;
public static final String DASHBOARD_CONFIGURATION_PROPERTY = "configuration";
+ public static final String DASHBOARD_ASSIGNED_CUSTOMERS_PROPERTY = "assigned_customers";
public static final String DASHBOARD_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "dashboard_by_tenant_and_search_text";
- public static final String DASHBOARD_BY_CUSTOMER_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "dashboard_by_customer_and_search_text";
-
/**
* Cassandra plugin metadata constants.
@@ -310,13 +340,6 @@ public class ModelConstants {
public static final String TS_KV_PARTITIONS_CF = "ts_kv_partitions_cf";
public static final String TS_KV_LATEST_CF = "ts_kv_latest_cf";
-
- public static final String ENTITY_TYPE_COLUMN = ENTITY_TYPE_PROPERTY;
- public static final String ENTITY_ID_COLUMN = "entity_id";
- public static final String ATTRIBUTE_TYPE_COLUMN = "attribute_type";
- public static final String ATTRIBUTE_KEY_COLUMN = "attribute_key";
- public static final String LAST_UPDATE_TS_COLUMN = "last_update_ts";
-
public static final String PARTITION_COLUMN = "partition";
public static final String KEY_COLUMN = "key";
public static final String TS_COLUMN = "ts";
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AdminSettingsEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AdminSettingsEntity.java
index b5dc234..29c9859 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AdminSettingsEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AdminSettingsEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AlarmEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AlarmEntity.java
index 9610d13..72bf4df 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AlarmEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AlarmEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AssetEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AssetEntity.java
index 3a36ce5..11eb905 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AssetEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AssetEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AuditLogEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AuditLogEntity.java
new file mode 100644
index 0000000..ac90cb7
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/AuditLogEntity.java
@@ -0,0 +1,139 @@
+/**
+ * Copyright © 2016-2018 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.nosql;
+
+import com.datastax.driver.core.utils.UUIDs;
+import com.datastax.driver.mapping.annotations.Column;
+import com.datastax.driver.mapping.annotations.Table;
+import com.fasterxml.jackson.databind.JsonNode;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.audit.ActionStatus;
+import org.thingsboard.server.common.data.audit.ActionType;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.*;
+import org.thingsboard.server.dao.model.BaseEntity;
+import org.thingsboard.server.dao.model.type.ActionStatusCodec;
+import org.thingsboard.server.dao.model.type.ActionTypeCodec;
+import org.thingsboard.server.dao.model.type.EntityTypeCodec;
+import org.thingsboard.server.dao.model.type.JsonCodec;
+
+import java.util.UUID;
+
+import static org.thingsboard.server.dao.model.ModelConstants.*;
+
+@Table(name = AUDIT_LOG_COLUMN_FAMILY_NAME)
+@Data
+@NoArgsConstructor
+public class AuditLogEntity implements BaseEntity<AuditLog> {
+
+ @Column(name = ID_PROPERTY)
+ private UUID id;
+
+ @Column(name = AUDIT_LOG_TENANT_ID_PROPERTY)
+ private UUID tenantId;
+
+ @Column(name = AUDIT_LOG_CUSTOMER_ID_PROPERTY)
+ private UUID customerId;
+
+ @Column(name = AUDIT_LOG_ENTITY_TYPE_PROPERTY, codec = EntityTypeCodec.class)
+ private EntityType entityType;
+
+ @Column(name = AUDIT_LOG_ENTITY_ID_PROPERTY)
+ private UUID entityId;
+
+ @Column(name = AUDIT_LOG_ENTITY_NAME_PROPERTY)
+ private String entityName;
+
+ @Column(name = AUDIT_LOG_USER_ID_PROPERTY)
+ private UUID userId;
+
+ @Column(name = AUDIT_LOG_USER_NAME_PROPERTY)
+ private String userName;
+
+ @Column(name = AUDIT_LOG_ACTION_TYPE_PROPERTY, codec = ActionTypeCodec.class)
+ private ActionType actionType;
+
+ @Column(name = AUDIT_LOG_ACTION_DATA_PROPERTY, codec = JsonCodec.class)
+ private JsonNode actionData;
+
+ @Column(name = AUDIT_LOG_ACTION_STATUS_PROPERTY, codec = ActionStatusCodec.class)
+ private ActionStatus actionStatus;
+
+ @Column(name = AUDIT_LOG_ACTION_FAILURE_DETAILS_PROPERTY)
+ private String actionFailureDetails;
+
+ @Override
+ public UUID getId() {
+ return id;
+ }
+
+ @Override
+ public void setId(UUID id) {
+ this.id = id;
+ }
+
+ public AuditLogEntity(AuditLog auditLog) {
+ if (auditLog.getId() != null) {
+ this.id = auditLog.getId().getId();
+ }
+ if (auditLog.getTenantId() != null) {
+ this.tenantId = auditLog.getTenantId().getId();
+ }
+ if (auditLog.getEntityId() != null) {
+ this.entityType = auditLog.getEntityId().getEntityType();
+ this.entityId = auditLog.getEntityId().getId();
+ }
+ if (auditLog.getCustomerId() != null) {
+ this.customerId = auditLog.getCustomerId().getId();
+ }
+ if (auditLog.getUserId() != null) {
+ this.userId = auditLog.getUserId().getId();
+ }
+ this.entityName = auditLog.getEntityName();
+ this.userName = auditLog.getUserName();
+ this.actionType = auditLog.getActionType();
+ this.actionData = auditLog.getActionData();
+ this.actionStatus = auditLog.getActionStatus();
+ this.actionFailureDetails = auditLog.getActionFailureDetails();
+ }
+
+ @Override
+ public AuditLog toData() {
+ AuditLog auditLog = new AuditLog(new AuditLogId(id));
+ auditLog.setCreatedTime(UUIDs.unixTimestamp(id));
+ if (tenantId != null) {
+ auditLog.setTenantId(new TenantId(tenantId));
+ }
+ if (entityId != null && entityType != null) {
+ auditLog.setEntityId(EntityIdFactory.getByTypeAndUuid(entityType, entityId));
+ }
+ if (customerId != null) {
+ auditLog.setCustomerId(new CustomerId(customerId));
+ }
+ if (userId != null) {
+ auditLog.setUserId(new UserId(userId));
+ }
+ auditLog.setEntityName(this.entityName);
+ auditLog.setUserName(this.userName);
+ auditLog.setActionType(this.actionType);
+ auditLog.setActionData(this.actionData);
+ auditLog.setActionStatus(this.actionStatus);
+ auditLog.setActionFailureDetails(this.actionFailureDetails);
+ return auditLog;
+ }
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/ComponentDescriptorEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/ComponentDescriptorEntity.java
index a07b660..4998ae5 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/ComponentDescriptorEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/ComponentDescriptorEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/CustomerEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/CustomerEntity.java
index 2bd5b9a..0952037 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/CustomerEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/CustomerEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DashboardEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DashboardEntity.java
index 047a8f2..622d6df 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DashboardEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DashboardEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -19,16 +19,23 @@ import com.datastax.driver.core.utils.UUIDs;
import com.datastax.driver.mapping.annotations.Column;
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.EqualsAndHashCode;
import lombok.ToString;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.StringUtils;
import org.thingsboard.server.common.data.Dashboard;
-import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.ShortCustomerInfo;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.dao.model.SearchTextEntity;
import org.thingsboard.server.dao.model.type.JsonCodec;
+import java.io.IOException;
+import java.util.HashSet;
import java.util.UUID;
import static org.thingsboard.server.dao.model.ModelConstants.*;
@@ -36,8 +43,13 @@ import static org.thingsboard.server.dao.model.ModelConstants.*;
@Table(name = DASHBOARD_COLUMN_FAMILY_NAME)
@EqualsAndHashCode
@ToString
+@Slf4j
public final class DashboardEntity implements SearchTextEntity<Dashboard> {
-
+
+ private static final ObjectMapper objectMapper = new ObjectMapper();
+ private static final JavaType assignedCustomersType =
+ objectMapper.getTypeFactory().constructCollectionType(HashSet.class, ShortCustomerInfo.class);
+
@PartitionKey(value = 0)
@Column(name = ID_PROPERTY)
private UUID id;
@@ -46,16 +58,15 @@ public final class DashboardEntity implements SearchTextEntity<Dashboard> {
@Column(name = DASHBOARD_TENANT_ID_PROPERTY)
private UUID tenantId;
- @PartitionKey(value = 2)
- @Column(name = DASHBOARD_CUSTOMER_ID_PROPERTY)
- private UUID customerId;
-
@Column(name = DASHBOARD_TITLE_PROPERTY)
private String title;
@Column(name = SEARCH_TEXT_PROPERTY)
private String searchText;
-
+
+ @Column(name = DASHBOARD_ASSIGNED_CUSTOMERS_PROPERTY)
+ private String assignedCustomers;
+
@Column(name = DASHBOARD_CONFIGURATION_PROPERTY, codec = JsonCodec.class)
private JsonNode configuration;
@@ -70,10 +81,14 @@ public final class DashboardEntity implements SearchTextEntity<Dashboard> {
if (dashboard.getTenantId() != null) {
this.tenantId = dashboard.getTenantId().getId();
}
- if (dashboard.getCustomerId() != null) {
- this.customerId = dashboard.getCustomerId().getId();
- }
this.title = dashboard.getTitle();
+ if (dashboard.getAssignedCustomers() != null) {
+ try {
+ this.assignedCustomers = objectMapper.writeValueAsString(dashboard.getAssignedCustomers());
+ } catch (JsonProcessingException e) {
+ log.error("Unable to serialize assigned customers to string!", e);
+ }
+ }
this.configuration = dashboard.getConfiguration();
}
@@ -93,14 +108,6 @@ public final class DashboardEntity implements SearchTextEntity<Dashboard> {
this.tenantId = tenantId;
}
- public UUID getCustomerId() {
- return customerId;
- }
-
- public void setCustomerId(UUID customerId) {
- this.customerId = customerId;
- }
-
public String getTitle() {
return title;
}
@@ -109,6 +116,14 @@ public final class DashboardEntity implements SearchTextEntity<Dashboard> {
this.title = title;
}
+ public String getAssignedCustomers() {
+ return assignedCustomers;
+ }
+
+ public void setAssignedCustomers(String assignedCustomers) {
+ this.assignedCustomers = assignedCustomers;
+ }
+
public JsonNode getConfiguration() {
return configuration;
}
@@ -138,10 +153,14 @@ public final class DashboardEntity implements SearchTextEntity<Dashboard> {
if (tenantId != null) {
dashboard.setTenantId(new TenantId(tenantId));
}
- if (customerId != null) {
- dashboard.setCustomerId(new CustomerId(customerId));
- }
dashboard.setTitle(title);
+ if (!StringUtils.isEmpty(assignedCustomers)) {
+ try {
+ dashboard.setAssignedCustomers(objectMapper.readValue(assignedCustomers, assignedCustomersType));
+ } catch (IOException e) {
+ log.warn("Unable to parse assigned customers!", e);
+ }
+ }
dashboard.setConfiguration(configuration);
return dashboard;
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DashboardInfoEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DashboardInfoEntity.java
index a2a5280..ab0ec1c 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DashboardInfoEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DashboardInfoEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -19,14 +19,21 @@ import com.datastax.driver.core.utils.UUIDs;
import com.datastax.driver.mapping.annotations.Column;
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.EqualsAndHashCode;
import lombok.ToString;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.StringUtils;
import org.thingsboard.server.common.data.DashboardInfo;
-import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.ShortCustomerInfo;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.dao.model.SearchTextEntity;
+import java.io.IOException;
+import java.util.HashSet;
import java.util.UUID;
import static org.thingsboard.server.dao.model.ModelConstants.*;
@@ -34,8 +41,13 @@ import static org.thingsboard.server.dao.model.ModelConstants.*;
@Table(name = DASHBOARD_COLUMN_FAMILY_NAME)
@EqualsAndHashCode
@ToString
+@Slf4j
public class DashboardInfoEntity implements SearchTextEntity<DashboardInfo> {
+ private static final ObjectMapper objectMapper = new ObjectMapper();
+ private static final JavaType assignedCustomersType =
+ objectMapper.getTypeFactory().constructCollectionType(HashSet.class, ShortCustomerInfo.class);
+
@PartitionKey(value = 0)
@Column(name = ID_PROPERTY)
private UUID id;
@@ -44,16 +56,15 @@ public class DashboardInfoEntity implements SearchTextEntity<DashboardInfo> {
@Column(name = DASHBOARD_TENANT_ID_PROPERTY)
private UUID tenantId;
- @PartitionKey(value = 2)
- @Column(name = DASHBOARD_CUSTOMER_ID_PROPERTY)
- private UUID customerId;
-
@Column(name = DASHBOARD_TITLE_PROPERTY)
private String title;
@Column(name = SEARCH_TEXT_PROPERTY)
private String searchText;
+ @Column(name = DASHBOARD_ASSIGNED_CUSTOMERS_PROPERTY)
+ private String assignedCustomers;
+
public DashboardInfoEntity() {
super();
}
@@ -65,10 +76,14 @@ public class DashboardInfoEntity implements SearchTextEntity<DashboardInfo> {
if (dashboardInfo.getTenantId() != null) {
this.tenantId = dashboardInfo.getTenantId().getId();
}
- if (dashboardInfo.getCustomerId() != null) {
- this.customerId = dashboardInfo.getCustomerId().getId();
- }
this.title = dashboardInfo.getTitle();
+ if (dashboardInfo.getAssignedCustomers() != null) {
+ try {
+ this.assignedCustomers = objectMapper.writeValueAsString(dashboardInfo.getAssignedCustomers());
+ } catch (JsonProcessingException e) {
+ log.error("Unable to serialize assigned customers to string!", e);
+ }
+ }
}
public UUID getId() {
@@ -87,14 +102,6 @@ public class DashboardInfoEntity implements SearchTextEntity<DashboardInfo> {
this.tenantId = tenantId;
}
- public UUID getCustomerId() {
- return customerId;
- }
-
- public void setCustomerId(UUID customerId) {
- this.customerId = customerId;
- }
-
public String getTitle() {
return title;
}
@@ -103,6 +110,14 @@ public class DashboardInfoEntity implements SearchTextEntity<DashboardInfo> {
this.title = title;
}
+ public String getAssignedCustomers() {
+ return assignedCustomers;
+ }
+
+ public void setAssignedCustomers(String assignedCustomers) {
+ this.assignedCustomers = assignedCustomers;
+ }
+
@Override
public String getSearchTextSource() {
return getTitle();
@@ -124,10 +139,14 @@ public class DashboardInfoEntity implements SearchTextEntity<DashboardInfo> {
if (tenantId != null) {
dashboardInfo.setTenantId(new TenantId(tenantId));
}
- if (customerId != null) {
- dashboardInfo.setCustomerId(new CustomerId(customerId));
- }
dashboardInfo.setTitle(title);
+ if (!StringUtils.isEmpty(assignedCustomers)) {
+ try {
+ dashboardInfo.setAssignedCustomers(objectMapper.readValue(assignedCustomers, assignedCustomersType));
+ } catch (IOException e) {
+ log.warn("Unable to parse assigned customers!", e);
+ }
+ }
return dashboardInfo;
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DeviceCredentialsEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DeviceCredentialsEntity.java
index f51942e..8483865 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DeviceCredentialsEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DeviceCredentialsEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DeviceEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DeviceEntity.java
index a400760..ef0c5fe 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DeviceEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/DeviceEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/EventEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/EventEntity.java
index 380c620..3b55d38 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/EventEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/EventEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/PluginMetaDataEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/PluginMetaDataEntity.java
index 8e50cce..eaf833f 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/PluginMetaDataEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/PluginMetaDataEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/RuleMetaDataEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/RuleMetaDataEntity.java
index 1b1402a..5e09581 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/RuleMetaDataEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/RuleMetaDataEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/TenantEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/TenantEntity.java
index a143f0a..9140f9e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/TenantEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/TenantEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/UserCredentialsEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/UserCredentialsEntity.java
index 6cb1c9f..ef441de 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/UserCredentialsEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/UserCredentialsEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/UserEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/UserEntity.java
index bbdebe9..69b5a63 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/UserEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/UserEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/WidgetsBundleEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/WidgetsBundleEntity.java
index 8b9ca81..26cd88d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/WidgetsBundleEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/WidgetsBundleEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/WidgetTypeEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/WidgetTypeEntity.java
index 3806f59..1d37aaf 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/nosql/WidgetTypeEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/nosql/WidgetTypeEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/SearchTextEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/SearchTextEntity.java
index 61c26c9..9bb7c7d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/SearchTextEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/SearchTextEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AdminSettingsEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AdminSettingsEntity.java
index 0a3f9cd..7891bfc 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AdminSettingsEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AdminSettingsEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AlarmEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AlarmEntity.java
index e3f6b69..65ca386 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AlarmEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AlarmEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AssetEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AssetEntity.java
index 5ed51c5..a32f2d6 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AssetEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AssetEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AttributeKvCompositeKey.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AttributeKvCompositeKey.java
index e6d5ca7..3001e12 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AttributeKvCompositeKey.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AttributeKvCompositeKey.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AttributeKvEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AttributeKvEntity.java
index 09f1bfc..81722a1 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AttributeKvEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AttributeKvEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/AuditLogEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AuditLogEntity.java
new file mode 100644
index 0000000..6d13561
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/AuditLogEntity.java
@@ -0,0 +1,135 @@
+/**
+ * Copyright © 2016-2018 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 com.datastax.driver.core.utils.UUIDs;
+import com.fasterxml.jackson.databind.JsonNode;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.hibernate.annotations.Type;
+import org.hibernate.annotations.TypeDef;
+import org.thingsboard.server.common.data.EntityType;
+import org.thingsboard.server.common.data.audit.ActionStatus;
+import org.thingsboard.server.common.data.audit.ActionType;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.*;
+import org.thingsboard.server.dao.model.BaseEntity;
+import org.thingsboard.server.dao.model.BaseSqlEntity;
+import org.thingsboard.server.dao.model.ModelConstants;
+import org.thingsboard.server.dao.util.mapping.JsonStringType;
+
+import javax.persistence.*;
+
+import static org.thingsboard.server.dao.model.ModelConstants.*;
+
+@Data
+@EqualsAndHashCode(callSuper = true)
+@Entity
+@TypeDef(name = "json", typeClass = JsonStringType.class)
+@Table(name = ModelConstants.AUDIT_LOG_COLUMN_FAMILY_NAME)
+public class AuditLogEntity extends BaseSqlEntity<AuditLog> implements BaseEntity<AuditLog> {
+
+ @Column(name = AUDIT_LOG_TENANT_ID_PROPERTY)
+ private String tenantId;
+
+ @Column(name = AUDIT_LOG_CUSTOMER_ID_PROPERTY)
+ private String customerId;
+
+ @Enumerated(EnumType.STRING)
+ @Column(name = AUDIT_LOG_ENTITY_TYPE_PROPERTY)
+ private EntityType entityType;
+
+ @Column(name = AUDIT_LOG_ENTITY_ID_PROPERTY)
+ private String entityId;
+
+ @Column(name = AUDIT_LOG_ENTITY_NAME_PROPERTY)
+ private String entityName;
+
+ @Column(name = AUDIT_LOG_USER_ID_PROPERTY)
+ private String userId;
+
+ @Column(name = AUDIT_LOG_USER_NAME_PROPERTY)
+ private String userName;
+
+ @Enumerated(EnumType.STRING)
+ @Column(name = AUDIT_LOG_ACTION_TYPE_PROPERTY)
+ private ActionType actionType;
+
+ @Type(type = "json")
+ @Column(name = AUDIT_LOG_ACTION_DATA_PROPERTY)
+ private JsonNode actionData;
+
+ @Enumerated(EnumType.STRING)
+ @Column(name = AUDIT_LOG_ACTION_STATUS_PROPERTY)
+ private ActionStatus actionStatus;
+
+ @Column(name = AUDIT_LOG_ACTION_FAILURE_DETAILS_PROPERTY)
+ private String actionFailureDetails;
+
+ public AuditLogEntity() {
+ super();
+ }
+
+ public AuditLogEntity(AuditLog auditLog) {
+ if (auditLog.getId() != null) {
+ this.setId(auditLog.getId().getId());
+ }
+ if (auditLog.getTenantId() != null) {
+ this.tenantId = toString(auditLog.getTenantId().getId());
+ }
+ if (auditLog.getCustomerId() != null) {
+ this.customerId = toString(auditLog.getCustomerId().getId());
+ }
+ if (auditLog.getEntityId() != null) {
+ this.entityId = toString(auditLog.getEntityId().getId());
+ this.entityType = auditLog.getEntityId().getEntityType();
+ }
+ if (auditLog.getUserId() != null) {
+ this.userId = toString(auditLog.getUserId().getId());
+ }
+ this.entityName = auditLog.getEntityName();
+ this.userName = auditLog.getUserName();
+ this.actionType = auditLog.getActionType();
+ this.actionData = auditLog.getActionData();
+ this.actionStatus = auditLog.getActionStatus();
+ this.actionFailureDetails = auditLog.getActionFailureDetails();
+ }
+
+ @Override
+ public AuditLog toData() {
+ AuditLog auditLog = new AuditLog(new AuditLogId(getId()));
+ auditLog.setCreatedTime(UUIDs.unixTimestamp(getId()));
+ if (tenantId != null) {
+ auditLog.setTenantId(new TenantId(toUUID(tenantId)));
+ }
+ if (customerId != null) {
+ auditLog.setCustomerId(new CustomerId(toUUID(customerId)));
+ }
+ if (entityId != null) {
+ auditLog.setEntityId(EntityIdFactory.getByTypeAndId(entityType.name(), toUUID(entityId).toString()));
+ }
+ if (userId != null) {
+ auditLog.setUserId(new UserId(toUUID(entityId)));
+ }
+ auditLog.setEntityName(this.entityName);
+ auditLog.setUserName(this.userName);
+ auditLog.setActionType(this.actionType);
+ auditLog.setActionData(this.actionData);
+ auditLog.setActionStatus(this.actionStatus);
+ auditLog.setActionFailureDetails(this.actionFailureDetails);
+ return auditLog;
+ }
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/ComponentDescriptorEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/ComponentDescriptorEntity.java
index 37e309d..9739889 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/ComponentDescriptorEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/ComponentDescriptorEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/CustomerEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/CustomerEntity.java
index 2e62c2b..5d20b37 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/CustomerEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/CustomerEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/DashboardEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/DashboardEntity.java
index bd0e0dc..696276d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/DashboardEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/DashboardEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -16,13 +16,18 @@
package org.thingsboard.server.dao.model.sql;
import com.datastax.driver.core.utils.UUIDs;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
+import org.springframework.util.StringUtils;
import org.thingsboard.server.common.data.Dashboard;
-import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.ShortCustomerInfo;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.dao.model.BaseSqlEntity;
@@ -33,26 +38,33 @@ import org.thingsboard.server.dao.util.mapping.JsonStringType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
+import java.io.IOException;
+import java.util.HashSet;
@Data
+@Slf4j
@EqualsAndHashCode(callSuper = true)
@Entity
@TypeDef(name = "json", typeClass = JsonStringType.class)
@Table(name = ModelConstants.DASHBOARD_COLUMN_FAMILY_NAME)
public final class DashboardEntity extends BaseSqlEntity<Dashboard> implements SearchTextEntity<Dashboard> {
+ private static final ObjectMapper objectMapper = new ObjectMapper();
+ private static final JavaType assignedCustomersType =
+ objectMapper.getTypeFactory().constructCollectionType(HashSet.class, ShortCustomerInfo.class);
+
@Column(name = ModelConstants.DASHBOARD_TENANT_ID_PROPERTY)
private String tenantId;
- @Column(name = ModelConstants.DASHBOARD_CUSTOMER_ID_PROPERTY)
- private String customerId;
-
@Column(name = ModelConstants.DASHBOARD_TITLE_PROPERTY)
private String title;
@Column(name = ModelConstants.SEARCH_TEXT_PROPERTY)
private String searchText;
+ @Column(name = ModelConstants.DASHBOARD_ASSIGNED_CUSTOMERS_PROPERTY)
+ private String assignedCustomers;
+
@Type(type = "json")
@Column(name = ModelConstants.DASHBOARD_CONFIGURATION_PROPERTY)
private JsonNode configuration;
@@ -68,10 +80,14 @@ public final class DashboardEntity extends BaseSqlEntity<Dashboard> implements S
if (dashboard.getTenantId() != null) {
this.tenantId = toString(dashboard.getTenantId().getId());
}
- if (dashboard.getCustomerId() != null) {
- this.customerId = toString(dashboard.getCustomerId().getId());
- }
this.title = dashboard.getTitle();
+ if (dashboard.getAssignedCustomers() != null) {
+ try {
+ this.assignedCustomers = objectMapper.writeValueAsString(dashboard.getAssignedCustomers());
+ } catch (JsonProcessingException e) {
+ log.error("Unable to serialize assigned customers to string!", e);
+ }
+ }
this.configuration = dashboard.getConfiguration();
}
@@ -92,10 +108,14 @@ public final class DashboardEntity extends BaseSqlEntity<Dashboard> implements S
if (tenantId != null) {
dashboard.setTenantId(new TenantId(toUUID(tenantId)));
}
- if (customerId != null) {
- dashboard.setCustomerId(new CustomerId(toUUID(customerId)));
- }
dashboard.setTitle(title);
+ if (!StringUtils.isEmpty(assignedCustomers)) {
+ try {
+ dashboard.setAssignedCustomers(objectMapper.readValue(assignedCustomers, assignedCustomersType));
+ } catch (IOException e) {
+ log.warn("Unable to parse assigned customers!", e);
+ }
+ }
dashboard.setConfiguration(configuration);
return dashboard;
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/DashboardInfoEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/DashboardInfoEntity.java
index c87e97d..f49ae70 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/DashboardInfoEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/DashboardInfoEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -16,10 +16,15 @@
package org.thingsboard.server.dao.model.sql;
import com.datastax.driver.core.utils.UUIDs;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.StringUtils;
import org.thingsboard.server.common.data.DashboardInfo;
-import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.ShortCustomerInfo;
import org.thingsboard.server.common.data.id.DashboardId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.dao.model.BaseSqlEntity;
@@ -29,25 +34,32 @@ import org.thingsboard.server.dao.model.SearchTextEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
+import java.io.IOException;
+import java.util.HashSet;
@Data
+@Slf4j
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = ModelConstants.DASHBOARD_COLUMN_FAMILY_NAME)
public class DashboardInfoEntity extends BaseSqlEntity<DashboardInfo> implements SearchTextEntity<DashboardInfo> {
+ private static final ObjectMapper objectMapper = new ObjectMapper();
+ private static final JavaType assignedCustomersType =
+ objectMapper.getTypeFactory().constructCollectionType(HashSet.class, ShortCustomerInfo.class);
+
@Column(name = ModelConstants.DASHBOARD_TENANT_ID_PROPERTY)
private String tenantId;
- @Column(name = ModelConstants.DASHBOARD_CUSTOMER_ID_PROPERTY)
- private String customerId;
-
@Column(name = ModelConstants.DASHBOARD_TITLE_PROPERTY)
private String title;
@Column(name = ModelConstants.SEARCH_TEXT_PROPERTY)
private String searchText;
+ @Column(name = ModelConstants.DASHBOARD_ASSIGNED_CUSTOMERS_PROPERTY)
+ private String assignedCustomers;
+
public DashboardInfoEntity() {
super();
}
@@ -59,10 +71,14 @@ public class DashboardInfoEntity extends BaseSqlEntity<DashboardInfo> implements
if (dashboardInfo.getTenantId() != null) {
this.tenantId = toString(dashboardInfo.getTenantId().getId());
}
- if (dashboardInfo.getCustomerId() != null) {
- this.customerId = toString(dashboardInfo.getCustomerId().getId());
- }
this.title = dashboardInfo.getTitle();
+ if (dashboardInfo.getAssignedCustomers() != null) {
+ try {
+ this.assignedCustomers = objectMapper.writeValueAsString(dashboardInfo.getAssignedCustomers());
+ } catch (JsonProcessingException e) {
+ log.error("Unable to serialize assigned customers to string!", e);
+ }
+ }
}
@Override
@@ -86,10 +102,14 @@ public class DashboardInfoEntity extends BaseSqlEntity<DashboardInfo> implements
if (tenantId != null) {
dashboardInfo.setTenantId(new TenantId(toUUID(tenantId)));
}
- if (customerId != null) {
- dashboardInfo.setCustomerId(new CustomerId(toUUID(customerId)));
- }
dashboardInfo.setTitle(title);
+ if (!StringUtils.isEmpty(assignedCustomers)) {
+ try {
+ dashboardInfo.setAssignedCustomers(objectMapper.readValue(assignedCustomers, assignedCustomersType));
+ } catch (IOException e) {
+ log.warn("Unable to parse assigned customers!", e);
+ }
+ }
return dashboardInfo;
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/DeviceCredentialsEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/DeviceCredentialsEntity.java
index f7be9a9..676ae2d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/DeviceCredentialsEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/DeviceCredentialsEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/DeviceEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/DeviceEntity.java
index a0f5c7b..7aaf0ae 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/DeviceEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/DeviceEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/EventEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/EventEntity.java
index 45a9c35..6f6b942 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/EventEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/EventEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/PluginMetaDataEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/PluginMetaDataEntity.java
index 32d8261..eec1dfc 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/PluginMetaDataEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/PluginMetaDataEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/RelationCompositeKey.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/RelationCompositeKey.java
index 2e8699a..8321462 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/RelationCompositeKey.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/RelationCompositeKey.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/RelationEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/RelationEntity.java
index 498f6fb..2f94669 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/RelationEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/RelationEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/RuleMetaDataEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/RuleMetaDataEntity.java
index e4eb30c..26d790e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/RuleMetaDataEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/RuleMetaDataEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TenantEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TenantEntity.java
index 44e2812..07e0486 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TenantEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TenantEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvCompositeKey.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvCompositeKey.java
index 795998a..f8ead0b 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvCompositeKey.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvCompositeKey.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvEntity.java
index 74356ad..3afe007 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvLatestCompositeKey.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvLatestCompositeKey.java
index c2001d8..2c92527 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvLatestCompositeKey.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvLatestCompositeKey.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvLatestEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvLatestEntity.java
index 943e061..67267c9 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvLatestEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/TsKvLatestEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/UserCredentialsEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/UserCredentialsEntity.java
index d7fc15d..e9c81b6 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/UserCredentialsEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/UserCredentialsEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/UserEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/UserEntity.java
index ff75343..3df2aa2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/UserEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/UserEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/WidgetsBundleEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/WidgetsBundleEntity.java
index d6f6d77..655a9d6 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/WidgetsBundleEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/WidgetsBundleEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/sql/WidgetTypeEntity.java b/dao/src/main/java/org/thingsboard/server/dao/model/sql/WidgetTypeEntity.java
index 4224655..3ec90cb 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/sql/WidgetTypeEntity.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/sql/WidgetTypeEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/ToData.java b/dao/src/main/java/org/thingsboard/server/dao/model/ToData.java
index 0c8259b..98e6a9b 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/ToData.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/ToData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/ActionStatusCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/ActionStatusCodec.java
new file mode 100644
index 0000000..051003c
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/ActionStatusCodec.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2018 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.type;
+
+import com.datastax.driver.extras.codecs.enums.EnumNameCodec;
+import org.thingsboard.server.common.data.audit.ActionStatus;
+
+public class ActionStatusCodec extends EnumNameCodec<ActionStatus> {
+
+ public ActionStatusCodec() {
+ super(ActionStatus.class);
+ }
+}
\ No newline at end of file
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/ActionTypeCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/ActionTypeCodec.java
new file mode 100644
index 0000000..aec4169
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/ActionTypeCodec.java
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2018 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.type;
+
+import com.datastax.driver.extras.codecs.enums.EnumNameCodec;
+import org.thingsboard.server.common.data.audit.ActionType;
+
+public class ActionTypeCodec extends EnumNameCodec<ActionType> {
+
+ public ActionTypeCodec() {
+ super(ActionType.class);
+ }
+}
\ No newline at end of file
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/AlarmSeverityCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/AlarmSeverityCodec.java
index dcce468..1f82efa 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/AlarmSeverityCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/AlarmSeverityCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/AlarmStatusCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/AlarmStatusCodec.java
index 7ba7d7b..186715c 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/AlarmStatusCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/AlarmStatusCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/AuthorityCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/AuthorityCodec.java
index 97cfca3..313f123 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/AuthorityCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/AuthorityCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentLifecycleStateCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentLifecycleStateCodec.java
index 34d8157..5a93416 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentLifecycleStateCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentLifecycleStateCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentScopeCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentScopeCodec.java
index 343d9b8..9bae823 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentScopeCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentScopeCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentTypeCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentTypeCodec.java
index e52111f..762455d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentTypeCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/ComponentTypeCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/DeviceCredentialsTypeCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/DeviceCredentialsTypeCodec.java
index e5ece8a..78ff3f4 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/DeviceCredentialsTypeCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/DeviceCredentialsTypeCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/EntityTypeCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/EntityTypeCodec.java
index f9559e9..fde1b3b 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/EntityTypeCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/EntityTypeCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/JsonCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/JsonCodec.java
index 7395bb3..45b423d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/JsonCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/JsonCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/type/RelationTypeGroupCodec.java b/dao/src/main/java/org/thingsboard/server/dao/model/type/RelationTypeGroupCodec.java
index a618da5..b989f33 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/type/RelationTypeGroupCodec.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/type/RelationTypeGroupCodec.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/model/wrapper/EntityResultSet.java b/dao/src/main/java/org/thingsboard/server/dao/model/wrapper/EntityResultSet.java
index 33d468f..0e4a95d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/model/wrapper/EntityResultSet.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/model/wrapper/EntityResultSet.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractAsyncDao.java b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractAsyncDao.java
index 0d64bad..63165e2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractAsyncDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractAsyncDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractDao.java b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractDao.java
index 4e4d9ca..94299ca 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractModelDao.java b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractModelDao.java
index b7335d7..bad7b9e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractModelDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractModelDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractSearchTextDao.java b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractSearchTextDao.java
index 7b7f99d..5130f31 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractSearchTextDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractSearchTextDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractSearchTimeDao.java b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractSearchTimeDao.java
index 86bbe94..c79381b 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractSearchTimeDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/nosql/CassandraAbstractSearchTimeDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/NoSqlDaoConfig.java b/dao/src/main/java/org/thingsboard/server/dao/NoSqlDaoConfig.java
index 904d390..70c0725 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/NoSqlDaoConfig.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/NoSqlDaoConfig.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/plugin/BasePluginService.java b/dao/src/main/java/org/thingsboard/server/dao/plugin/BasePluginService.java
index fe9a558..67b8c60 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/plugin/BasePluginService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/plugin/BasePluginService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/plugin/CassandraBasePluginDao.java b/dao/src/main/java/org/thingsboard/server/dao/plugin/CassandraBasePluginDao.java
index fc39c06..7b948a2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/plugin/CassandraBasePluginDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/plugin/CassandraBasePluginDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/plugin/PluginDao.java b/dao/src/main/java/org/thingsboard/server/dao/plugin/PluginDao.java
index 1a48b20..b86b983 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/plugin/PluginDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/plugin/PluginDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/plugin/PluginService.java b/dao/src/main/java/org/thingsboard/server/dao/plugin/PluginService.java
index 371a46e..106ad8e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/plugin/PluginService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/plugin/PluginService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationDao.java b/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationDao.java
index c313f0b..9e25241 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/relation/BaseRelationDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 86afdb4..01f60f8 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -21,6 +21,11 @@ import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.Cache;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.CacheEvict;
+import org.springframework.cache.annotation.Cacheable;
+import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.thingsboard.server.common.data.id.EntityId;
@@ -34,6 +39,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.function.BiConsumer;
+import static org.thingsboard.server.common.data.CacheConstants.RELATIONS_CACHE;
+
/**
* Created by ashvayka on 28.04.17.
*/
@@ -47,6 +54,9 @@ public class BaseRelationService implements RelationService {
@Autowired
private EntityService entityService;
+ @Autowired
+ private CacheManager cacheManager;
+
@Override
public ListenableFuture<Boolean> checkRelation(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup) {
log.trace("Executing checkRelation [{}][{}][{}][{}]", from, to, relationType, typeGroup);
@@ -54,13 +64,29 @@ public class BaseRelationService implements RelationService {
return relationDao.checkRelation(from, to, relationType, typeGroup);
}
+ @Cacheable(cacheNames = RELATIONS_CACHE, key = "{#from, #to, #relationType, #typeGroup}")
@Override
- public ListenableFuture<EntityRelation> getRelation(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup) {
+ public EntityRelation getRelation(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup) {
+ try {
+ return getRelationAsync(from, to, relationType, typeGroup).get();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public ListenableFuture<EntityRelation> getRelationAsync(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup) {
log.trace("Executing EntityRelation [{}][{}][{}][{}]", from, to, relationType, typeGroup);
validate(from, to, relationType, typeGroup);
return relationDao.getRelation(from, to, relationType, typeGroup);
}
+ @Caching(evict = {
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.type, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.to, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.to, #relation.type, #relation.typeGroup}")
+ })
@Override
public boolean saveRelation(EntityRelation relation) {
log.trace("Executing saveRelation [{}]", relation);
@@ -68,6 +94,12 @@ public class BaseRelationService implements RelationService {
return relationDao.saveRelation(relation);
}
+ @Caching(evict = {
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.type, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.to, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.to, #relation.type, #relation.typeGroup}")
+ })
@Override
public ListenableFuture<Boolean> saveRelationAsync(EntityRelation relation) {
log.trace("Executing saveRelationAsync [{}]", relation);
@@ -75,6 +107,13 @@ public class BaseRelationService implements RelationService {
return relationDao.saveRelationAsync(relation);
}
+ @Caching(evict = {
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.type, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.to, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.to, #relation.type, #relation.typeGroup}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.to, #relation.type, #relation.typeGroup}")
+ })
@Override
public boolean deleteRelation(EntityRelation relation) {
log.trace("Executing deleteRelation [{}]", relation);
@@ -82,6 +121,13 @@ public class BaseRelationService implements RelationService {
return relationDao.deleteRelation(relation);
}
+ @Caching(evict = {
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "#relation.from"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.type}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "#relation.to"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.to, #relation.type}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#relation.from, #relation.to, #relation.type, #relation.typeGroup}")
+ })
@Override
public ListenableFuture<Boolean> deleteRelationAsync(EntityRelation relation) {
log.trace("Executing deleteRelationAsync [{}]", relation);
@@ -89,6 +135,13 @@ public class BaseRelationService implements RelationService {
return relationDao.deleteRelationAsync(relation);
}
+ @Caching(evict = {
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "#from"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#from, #relationType}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "#to"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#to, #relationType}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#from, #to, #relationType}")
+ })
@Override
public boolean deleteRelation(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup) {
log.trace("Executing deleteRelation [{}][{}][{}][{}]", from, to, relationType, typeGroup);
@@ -96,6 +149,13 @@ public class BaseRelationService implements RelationService {
return relationDao.deleteRelation(from, to, relationType, typeGroup);
}
+ @Caching(evict = {
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "#from"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#from, #relationType}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "#to"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#to, #relationType}"),
+ @CacheEvict(cacheNames = RELATIONS_CACHE, key = "{#from, #to, #relationType}")
+ })
@Override
public ListenableFuture<Boolean> deleteRelationAsync(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup) {
log.trace("Executing deleteRelationAsync [{}][{}][{}][{}]", from, to, relationType, typeGroup);
@@ -105,23 +165,17 @@ public class BaseRelationService implements RelationService {
@Override
public boolean deleteEntityRelations(EntityId entity) {
+ Cache cache = cacheManager.getCache(RELATIONS_CACHE);
log.trace("Executing deleteEntityRelations [{}]", entity);
validate(entity);
- List<ListenableFuture<List<EntityRelation>>> inboundRelationsList = new ArrayList<>();
+ List<ListenableFuture<List<EntityRelation>>> inboundRelationsListTo = new ArrayList<>();
for (RelationTypeGroup typeGroup : RelationTypeGroup.values()) {
- inboundRelationsList.add(relationDao.findAllByTo(entity, typeGroup));
+ inboundRelationsListTo.add(relationDao.findAllByTo(entity, typeGroup));
}
- ListenableFuture<List<List<EntityRelation>>> inboundRelations = Futures.allAsList(inboundRelationsList);
- ListenableFuture<List<Boolean>> inboundDeletions = Futures.transform(inboundRelations, new Function<List<List<EntityRelation>>, List<Boolean>>() {
- @Override
- public List<Boolean> apply(List<List<EntityRelation>> relations) {
- List<Boolean> results = new ArrayList<>();
- for (List<EntityRelation> relationList : relations) {
- relationList.stream().forEach(relation -> results.add(relationDao.deleteRelation(relation)));
- }
- return results;
- }
- });
+ ListenableFuture<List<List<EntityRelation>>> inboundRelationsTo = Futures.allAsList(inboundRelationsListTo);
+ ListenableFuture<List<Boolean>> inboundDeletions = Futures.transform(inboundRelationsTo, (List<List<EntityRelation>> relations) ->
+ getBooleans(relations, cache, true));
+
ListenableFuture<Boolean> inboundFuture = Futures.transform(inboundDeletions, getListToBooleanFunction());
boolean inboundDeleteResult = false;
try {
@@ -129,39 +183,116 @@ public class BaseRelationService implements RelationService {
} catch (InterruptedException | ExecutionException e) {
log.error("Error deleting entity inbound relations", e);
}
+
+ List<ListenableFuture<List<EntityRelation>>> inboundRelationsListFrom = new ArrayList<>();
+ for (RelationTypeGroup typeGroup : RelationTypeGroup.values()) {
+ inboundRelationsListFrom.add(relationDao.findAllByFrom(entity, typeGroup));
+ }
+ ListenableFuture<List<List<EntityRelation>>> inboundRelationsFrom = Futures.allAsList(inboundRelationsListFrom);
+ Futures.transform(inboundRelationsFrom, (Function<List<List<EntityRelation>>, List<Boolean>>) relations ->
+ getBooleans(relations, cache, false));
+
boolean outboundDeleteResult = relationDao.deleteOutboundRelations(entity);
return inboundDeleteResult && outboundDeleteResult;
}
+ private List<Boolean> getBooleans(List<List<EntityRelation>> relations, Cache cache, boolean isRemove) {
+ List<Boolean> results = new ArrayList<>();
+ for (List<EntityRelation> relationList : relations) {
+ relationList.stream().forEach(relation -> {
+ checkFromDeleteSync(cache, results, relation, isRemove);
+ });
+ }
+ return results;
+ }
+
+ private void checkFromDeleteSync(Cache cache, List<Boolean> results, EntityRelation relation, boolean isRemove) {
+ if (isRemove) {
+ results.add(relationDao.deleteRelation(relation));
+ cacheEviction(relation, relation.getTo(), cache);
+ } else {
+ cacheEviction(relation, relation.getFrom(), cache);
+ }
+ }
+
@Override
public ListenableFuture<Boolean> deleteEntityRelationsAsync(EntityId entity) {
+ Cache cache = cacheManager.getCache(RELATIONS_CACHE);
log.trace("Executing deleteEntityRelationsAsync [{}]", entity);
validate(entity);
- List<ListenableFuture<List<EntityRelation>>> inboundRelationsList = new ArrayList<>();
+ List<ListenableFuture<List<EntityRelation>>> inboundRelationsListTo = new ArrayList<>();
for (RelationTypeGroup typeGroup : RelationTypeGroup.values()) {
- inboundRelationsList.add(relationDao.findAllByTo(entity, typeGroup));
+ inboundRelationsListTo.add(relationDao.findAllByTo(entity, typeGroup));
}
- ListenableFuture<List<List<EntityRelation>>> inboundRelations = Futures.allAsList(inboundRelationsList);
- ListenableFuture<List<Boolean>> inboundDeletions = Futures.transform(inboundRelations, new AsyncFunction<List<List<EntityRelation>>, List<Boolean>>() {
- @Override
- public ListenableFuture<List<Boolean>> apply(List<List<EntityRelation>> relations) throws Exception {
- List<ListenableFuture<Boolean>> results = new ArrayList<>();
- for (List<EntityRelation> relationList : relations) {
- relationList.stream().forEach(relation -> results.add(relationDao.deleteRelationAsync(relation)));
- }
- return Futures.allAsList(results);
- }
- });
+ ListenableFuture<List<List<EntityRelation>>> inboundRelationsTo = Futures.allAsList(inboundRelationsListTo);
+ ListenableFuture<List<Boolean>> inboundDeletions = Futures.transform(inboundRelationsTo,
+ (AsyncFunction<List<List<EntityRelation>>, List<Boolean>>) relations -> {
+ List<ListenableFuture<Boolean>> results = getListenableFutures(relations, cache, true);
+ return Futures.allAsList(results);
+ });
ListenableFuture<Boolean> inboundFuture = Futures.transform(inboundDeletions, getListToBooleanFunction());
- ListenableFuture<Boolean> outboundFuture = relationDao.deleteOutboundRelationsAsync(entity);
+ List<ListenableFuture<List<EntityRelation>>> inboundRelationsListFrom = new ArrayList<>();
+ for (RelationTypeGroup typeGroup : RelationTypeGroup.values()) {
+ inboundRelationsListFrom.add(relationDao.findAllByTo(entity, typeGroup));
+ }
+ ListenableFuture<List<List<EntityRelation>>> inboundRelationsFrom = Futures.allAsList(inboundRelationsListFrom);
+ Futures.transform(inboundRelationsFrom, (AsyncFunction<List<List<EntityRelation>>, List<Boolean>>) relations -> {
+ List<ListenableFuture<Boolean>> results = getListenableFutures(relations, cache, false);
+ return Futures.allAsList(results);
+ });
+ ListenableFuture<Boolean> outboundFuture = relationDao.deleteOutboundRelationsAsync(entity);
return Futures.transform(Futures.allAsList(Arrays.asList(inboundFuture, outboundFuture)), getListToBooleanFunction());
}
+ private List<ListenableFuture<Boolean>> getListenableFutures(List<List<EntityRelation>> relations, Cache cache, boolean isRemove) {
+ List<ListenableFuture<Boolean>> results = new ArrayList<>();
+ for (List<EntityRelation> relationList : relations) {
+ relationList.stream().forEach(relation -> {
+ checkFromDeleteAsync(cache, results, relation, isRemove);
+ });
+ }
+ return results;
+ }
+
+ private void checkFromDeleteAsync(Cache cache, List<ListenableFuture<Boolean>> results, EntityRelation relation, boolean isRemove) {
+ if (isRemove) {
+ results.add(relationDao.deleteRelationAsync(relation));
+ cacheEviction(relation, relation.getTo(), cache);
+ } else {
+ cacheEviction(relation, relation.getFrom(), cache);
+ }
+ }
+
+ private void cacheEviction(EntityRelation relation, EntityId entityId, Cache cache) {
+ cache.evict(entityId);
+
+ List<Object> toAndType = new ArrayList<>();
+ toAndType.add(entityId);
+ toAndType.add(relation.getType());
+ cache.evict(toAndType);
+
+ List<Object> fromToAndType = new ArrayList<>();
+ fromToAndType.add(relation.getFrom());
+ fromToAndType.add(relation.getTo());
+ fromToAndType.add(relation.getType());
+ cache.evict(fromToAndType);
+ }
+
+ @Cacheable(cacheNames = RELATIONS_CACHE, key = "{#from, #typeGroup}")
@Override
- public ListenableFuture<List<EntityRelation>> findByFrom(EntityId from, RelationTypeGroup typeGroup) {
+ public List<EntityRelation> findByFrom(EntityId from, RelationTypeGroup typeGroup) {
+ try {
+ return findByFromAsync(from, typeGroup).get();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public ListenableFuture<List<EntityRelation>> findByFromAsync(EntityId from, RelationTypeGroup typeGroup) {
log.trace("Executing findByFrom [{}][{}]", from, typeGroup);
validate(from);
validateTypeGroup(typeGroup);
@@ -176,19 +307,29 @@ public class BaseRelationService implements RelationService {
ListenableFuture<List<EntityRelation>> relations = relationDao.findAllByFrom(from, typeGroup);
ListenableFuture<List<EntityRelationInfo>> relationsInfo = Futures.transform(relations,
(AsyncFunction<List<EntityRelation>, List<EntityRelationInfo>>) relations1 -> {
- List<ListenableFuture<EntityRelationInfo>> futures = new ArrayList<>();
+ List<ListenableFuture<EntityRelationInfo>> futures = new ArrayList<>();
relations1.stream().forEach(relation ->
futures.add(fetchRelationInfoAsync(relation,
relation2 -> relation2.getTo(),
(EntityRelationInfo relationInfo, String entityName) -> relationInfo.setToName(entityName)))
);
return Futures.successfulAsList(futures);
- });
+ });
return relationsInfo;
}
+ @Cacheable(cacheNames = RELATIONS_CACHE, key = "{#from, #relationType, #typeGroup}")
@Override
- public ListenableFuture<List<EntityRelation>> findByFromAndType(EntityId from, String relationType, RelationTypeGroup typeGroup) {
+ public List<EntityRelation> findByFromAndType(EntityId from, String relationType, RelationTypeGroup typeGroup) {
+ try {
+ return findByFromAndTypeAsync(from, relationType, typeGroup).get();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public ListenableFuture<List<EntityRelation>> findByFromAndTypeAsync(EntityId from, String relationType, RelationTypeGroup typeGroup) {
log.trace("Executing findByFromAndType [{}][{}][{}]", from, relationType, typeGroup);
validate(from);
validateType(relationType);
@@ -196,8 +337,18 @@ public class BaseRelationService implements RelationService {
return relationDao.findAllByFromAndType(from, relationType, typeGroup);
}
+ @Cacheable(cacheNames = RELATIONS_CACHE, key = "{#to, #typeGroup}")
+ @Override
+ public List<EntityRelation> findByTo(EntityId to, RelationTypeGroup typeGroup) {
+ try {
+ return findByToAsync(to, typeGroup).get();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
@Override
- public ListenableFuture<List<EntityRelation>> findByTo(EntityId to, RelationTypeGroup typeGroup) {
+ public ListenableFuture<List<EntityRelation>> findByToAsync(EntityId to, RelationTypeGroup typeGroup) {
log.trace("Executing findByTo [{}][{}]", to, typeGroup);
validate(to);
validateTypeGroup(typeGroup);
@@ -214,9 +365,9 @@ public class BaseRelationService implements RelationService {
(AsyncFunction<List<EntityRelation>, List<EntityRelationInfo>>) relations1 -> {
List<ListenableFuture<EntityRelationInfo>> futures = new ArrayList<>();
relations1.stream().forEach(relation ->
- futures.add(fetchRelationInfoAsync(relation,
- relation2 -> relation2.getFrom(),
- (EntityRelationInfo relationInfo, String entityName) -> relationInfo.setFromName(entityName)))
+ futures.add(fetchRelationInfoAsync(relation,
+ relation2 -> relation2.getFrom(),
+ (EntityRelationInfo relationInfo, String entityName) -> relationInfo.setFromName(entityName)))
);
return Futures.successfulAsList(futures);
});
@@ -236,8 +387,18 @@ public class BaseRelationService implements RelationService {
return entityRelationInfo;
}
+ @Cacheable(cacheNames = RELATIONS_CACHE, key = "{#to, #relationType, #typeGroup}")
+ @Override
+ public List<EntityRelation> findByToAndType(EntityId to, String relationType, RelationTypeGroup typeGroup) {
+ try {
+ return findByToAndTypeAsync(to, relationType, typeGroup).get();
+ } catch (InterruptedException | ExecutionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
@Override
- public ListenableFuture<List<EntityRelation>> findByToAndType(EntityId to, String relationType, RelationTypeGroup typeGroup) {
+ public ListenableFuture<List<EntityRelation>> findByToAndTypeAsync(EntityId to, String relationType, RelationTypeGroup typeGroup) {
log.trace("Executing findByToAndType [{}][{}][{}]", to, relationType, typeGroup);
validate(to);
validateType(relationType);
@@ -411,11 +572,10 @@ public class BaseRelationService implements RelationService {
private ListenableFuture<List<EntityRelation>> findRelations(final EntityId rootId, final EntitySearchDirection direction) {
ListenableFuture<List<EntityRelation>> relations;
if (direction == EntitySearchDirection.FROM) {
- relations = findByFrom(rootId, RelationTypeGroup.COMMON);
+ relations = findByFromAsync(rootId, RelationTypeGroup.COMMON);
} else {
- relations = findByTo(rootId, RelationTypeGroup.COMMON);
+ relations = findByToAsync(rootId, RelationTypeGroup.COMMON);
}
return relations;
}
-
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/relation/RelationDao.java b/dao/src/main/java/org/thingsboard/server/dao/relation/RelationDao.java
index edd6d87..8f49e89 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/relation/RelationDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/relation/RelationDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/relation/RelationService.java b/dao/src/main/java/org/thingsboard/server/dao/relation/RelationService.java
index cef9393..ca1b959 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/relation/RelationService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/relation/RelationService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -31,7 +31,9 @@ public interface RelationService {
ListenableFuture<Boolean> checkRelation(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup);
- ListenableFuture<EntityRelation> getRelation(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup);
+ EntityRelation getRelation(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup);
+
+ ListenableFuture<EntityRelation> getRelationAsync(EntityId from, EntityId to, String relationType, RelationTypeGroup typeGroup);
boolean saveRelation(EntityRelation relation);
@@ -49,17 +51,25 @@ public interface RelationService {
ListenableFuture<Boolean> deleteEntityRelationsAsync(EntityId entity);
- ListenableFuture<List<EntityRelation>> findByFrom(EntityId from, RelationTypeGroup typeGroup);
+ List<EntityRelation> findByFrom(EntityId from, RelationTypeGroup typeGroup);
+
+ ListenableFuture<List<EntityRelation>> findByFromAsync(EntityId from, RelationTypeGroup typeGroup);
ListenableFuture<List<EntityRelationInfo>> findInfoByFrom(EntityId from, RelationTypeGroup typeGroup);
- ListenableFuture<List<EntityRelation>> findByFromAndType(EntityId from, String relationType, RelationTypeGroup typeGroup);
+ List<EntityRelation> findByFromAndType(EntityId from, String relationType, RelationTypeGroup typeGroup);
+
+ ListenableFuture<List<EntityRelation>> findByFromAndTypeAsync(EntityId from, String relationType, RelationTypeGroup typeGroup);
- ListenableFuture<List<EntityRelation>> findByTo(EntityId to, RelationTypeGroup typeGroup);
+ List<EntityRelation> findByTo(EntityId to, RelationTypeGroup typeGroup);
+
+ ListenableFuture<List<EntityRelation>> findByToAsync(EntityId to, RelationTypeGroup typeGroup);
ListenableFuture<List<EntityRelationInfo>> findInfoByTo(EntityId to, RelationTypeGroup typeGroup);
- ListenableFuture<List<EntityRelation>> findByToAndType(EntityId to, String relationType, RelationTypeGroup typeGroup);
+ List<EntityRelation> findByToAndType(EntityId to, String relationType, RelationTypeGroup typeGroup);
+
+ ListenableFuture<List<EntityRelation>> findByToAndTypeAsync(EntityId to, String relationType, RelationTypeGroup typeGroup);
ListenableFuture<List<EntityRelation>> findByQuery(EntityRelationsQuery query);
diff --git a/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleService.java b/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleService.java
index 77d38b9..f1df09e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/rule/BaseRuleService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/rule/CassandraBaseRuleDao.java b/dao/src/main/java/org/thingsboard/server/dao/rule/CassandraBaseRuleDao.java
index 4993d46..2c5b1f7 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/rule/CassandraBaseRuleDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/rule/CassandraBaseRuleDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/rule/RuleDao.java b/dao/src/main/java/org/thingsboard/server/dao/rule/RuleDao.java
index ea12b74..8d5a7c0 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/rule/RuleDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/rule/RuleDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/rule/RuleService.java b/dao/src/main/java/org/thingsboard/server/dao/rule/RuleService.java
index 23f4a01..ce2f2dc 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/rule/RuleService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/rule/RuleService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/service/DataValidator.java b/dao/src/main/java/org/thingsboard/server/dao/service/DataValidator.java
index a85c25c..fd74e8e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/service/DataValidator.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/service/DataValidator.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/service/PaginatedRemover.java b/dao/src/main/java/org/thingsboard/server/dao/service/PaginatedRemover.java
index c1c89c2..d9f3a05 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/service/PaginatedRemover.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/service/PaginatedRemover.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/service/TimePaginatedRemover.java b/dao/src/main/java/org/thingsboard/server/dao/service/TimePaginatedRemover.java
new file mode 100644
index 0000000..c8bb38d
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/service/TimePaginatedRemover.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright © 2016-2018 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.service;
+
+import org.thingsboard.server.common.data.id.IdBased;
+import org.thingsboard.server.common.data.page.TimePageLink;
+
+import java.sql.Time;
+import java.util.List;
+import java.util.UUID;
+
+public abstract class TimePaginatedRemover<I, D extends IdBased<?>> {
+
+ private static final int DEFAULT_LIMIT = 100;
+
+ public void removeEntities(I id) {
+ TimePageLink pageLink = new TimePageLink(DEFAULT_LIMIT);
+ boolean hasNext = true;
+ while (hasNext) {
+ List<D> entities = findEntities(id, pageLink);
+ for (D entity : entities) {
+ removeEntity(entity);
+ }
+ hasNext = entities.size() == pageLink.getLimit();
+ if (hasNext) {
+ int index = entities.size() - 1;
+ UUID idOffset = entities.get(index).getUuidId();
+ pageLink.setIdOffset(idOffset);
+ }
+ }
+ }
+
+ protected abstract List<D> findEntities(I id, TimePageLink pageLink);
+
+ protected abstract void removeEntity(D entity);
+
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/service/Validator.java b/dao/src/main/java/org/thingsboard/server/dao/service/Validator.java
index d8a511d..c8af7cb 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/service/Validator.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/service/Validator.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -17,6 +17,7 @@ package org.thingsboard.server.dao.service;
import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.UUIDBased;
+import org.thingsboard.server.common.data.page.BasePageLink;
import org.thingsboard.server.common.data.page.TextPageLink;
import org.thingsboard.server.dao.exception.IncorrectParameterException;
@@ -116,7 +117,7 @@ public class Validator {
* @param pageLink the page link
* @param errorMessage the error message for exception
*/
- public static void validatePageLink(TextPageLink pageLink, String errorMessage) {
+ public static void validatePageLink(BasePageLink pageLink, String errorMessage) {
if (pageLink == null || pageLink.getLimit() < 1 || (pageLink.getIdOffset() != null && pageLink.getIdOffset().version() != 1)) {
throw new IncorrectParameterException(errorMessage);
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsDao.java b/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsDao.java
index b0ed852..871d194 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsService.java b/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsService.java
index 49576b1..29559ff 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsServiceImpl.java
index 2138703..7e7dfa2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsServiceImpl.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/settings/AdminSettingsServiceImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/settings/CassandraAdminSettingsDao.java b/dao/src/main/java/org/thingsboard/server/dao/settings/CassandraAdminSettingsDao.java
index e6a7ed5..6cd3719 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/settings/CassandraAdminSettingsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/settings/CassandraAdminSettingsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/AlarmRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/AlarmRepository.java
index 2906e0a..cbd0409 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/AlarmRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/AlarmRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/JpaAlarmDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/JpaAlarmDao.java
index 37de354..0d64d5c 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/JpaAlarmDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/alarm/JpaAlarmDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/asset/AssetRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/asset/AssetRepository.java
index b0636f1..bf1e289 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/asset/AssetRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/asset/AssetRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/asset/JpaAssetDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/asset/JpaAssetDao.java
index ea256e6..9f8f673 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/asset/JpaAssetDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/asset/JpaAssetDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/attributes/AttributeKvRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/attributes/AttributeKvRepository.java
index 3816f22..c76cefe 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/attributes/AttributeKvRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/attributes/AttributeKvRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/attributes/JpaAttributeDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/attributes/JpaAttributeDao.java
index 2026134..0dabf4c 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/attributes/JpaAttributeDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/attributes/JpaAttributeDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/audit/AuditLogRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/audit/AuditLogRepository.java
new file mode 100644
index 0000000..de3f8b3
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/audit/AuditLogRepository.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.repository.CrudRepository;
+import org.thingsboard.server.dao.model.sql.AuditLogEntity;
+
+public interface AuditLogRepository extends CrudRepository<AuditLogEntity, String>, JpaSpecificationExecutor<AuditLogEntity> {
+
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/audit/JpaAuditLogDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/audit/JpaAuditLogDao.java
new file mode 100644
index 0000000..e94f3b3
--- /dev/null
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/audit/JpaAuditLogDao.java
@@ -0,0 +1,155 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.data.repository.CrudRepository;
+import org.springframework.stereotype.Component;
+import org.thingsboard.server.common.data.UUIDConverter;
+import org.thingsboard.server.common.data.audit.AuditLog;
+import org.thingsboard.server.common.data.id.CustomerId;
+import org.thingsboard.server.common.data.id.EntityId;
+import org.thingsboard.server.common.data.id.UserId;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.dao.DaoUtil;
+import org.thingsboard.server.dao.audit.AuditLogDao;
+import org.thingsboard.server.dao.model.sql.AuditLogEntity;
+import org.thingsboard.server.dao.sql.JpaAbstractDao;
+import org.thingsboard.server.dao.sql.JpaAbstractSearchTimeDao;
+import org.thingsboard.server.dao.util.SqlDao;
+
+import javax.annotation.PreDestroy;
+import javax.persistence.criteria.Predicate;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+import java.util.concurrent.Executors;
+
+import static org.springframework.data.jpa.domain.Specifications.where;
+import static org.thingsboard.server.dao.model.ModelConstants.ID_PROPERTY;
+
+@Component
+@SqlDao
+public class JpaAuditLogDao extends JpaAbstractDao<AuditLogEntity, AuditLog> implements AuditLogDao {
+
+ private ListeningExecutorService insertService = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
+
+ @Autowired
+ private AuditLogRepository auditLogRepository;
+
+ @Override
+ protected Class<AuditLogEntity> getEntityClass() {
+ return AuditLogEntity.class;
+ }
+
+ @Override
+ protected CrudRepository<AuditLogEntity, String> getCrudRepository() {
+ return auditLogRepository;
+ }
+
+ @PreDestroy
+ void onDestroy() {
+ insertService.shutdown();
+ }
+
+ @Override
+ public ListenableFuture<Void> saveByTenantId(AuditLog auditLog) {
+ return insertService.submit(() -> {
+ save(auditLog);
+ return null;
+ });
+ }
+
+ @Override
+ public ListenableFuture<Void> saveByTenantIdAndEntityId(AuditLog auditLog) {
+ return insertService.submit(() -> null);
+ }
+
+ @Override
+ public ListenableFuture<Void> saveByTenantIdAndCustomerId(AuditLog auditLog) {
+ return insertService.submit(() -> null);
+ }
+
+ @Override
+ public ListenableFuture<Void> saveByTenantIdAndUserId(AuditLog auditLog) {
+ return insertService.submit(() -> null);
+ }
+
+ @Override
+ public ListenableFuture<Void> savePartitionsByTenantId(AuditLog auditLog) {
+ return insertService.submit(() -> null);
+ }
+
+ @Override
+ public List<AuditLog> findAuditLogsByTenantIdAndEntityId(UUID tenantId, EntityId entityId, TimePageLink pageLink) {
+ return findAuditLogs(tenantId, entityId, null, null, pageLink);
+ }
+
+ @Override
+ public List<AuditLog> findAuditLogsByTenantIdAndCustomerId(UUID tenantId, CustomerId customerId, TimePageLink pageLink) {
+ return findAuditLogs(tenantId, null, customerId, null, pageLink);
+ }
+
+ @Override
+ public List<AuditLog> findAuditLogsByTenantIdAndUserId(UUID tenantId, UserId userId, TimePageLink pageLink) {
+ return findAuditLogs(tenantId, null, null, userId, pageLink);
+ }
+
+ @Override
+ public List<AuditLog> findAuditLogsByTenantId(UUID tenantId, TimePageLink pageLink) {
+ return findAuditLogs(tenantId, null, null, null, pageLink);
+ }
+
+ private List<AuditLog> findAuditLogs(UUID tenantId, EntityId entityId, CustomerId customerId, UserId userId, TimePageLink pageLink) {
+ Specification<AuditLogEntity> timeSearchSpec = JpaAbstractSearchTimeDao.getTimeSearchPageSpec(pageLink, "id");
+ Specification<AuditLogEntity> fieldsSpec = getEntityFieldsSpec(tenantId, entityId, customerId, userId);
+ Sort.Direction sortDirection = pageLink.isAscOrder() ? Sort.Direction.ASC : Sort.Direction.DESC;
+ Pageable pageable = new PageRequest(0, pageLink.getLimit(), sortDirection, ID_PROPERTY);
+ return DaoUtil.convertDataList(auditLogRepository.findAll(where(timeSearchSpec).and(fieldsSpec), pageable).getContent());
+ }
+
+ private Specification<AuditLogEntity> getEntityFieldsSpec(UUID tenantId, EntityId entityId, CustomerId customerId, UserId userId) {
+ return (root, criteriaQuery, criteriaBuilder) -> {
+ List<Predicate> predicates = new ArrayList<>();
+ if (tenantId != null) {
+ Predicate tenantIdPredicate = criteriaBuilder.equal(root.get("tenantId"), UUIDConverter.fromTimeUUID(tenantId));
+ predicates.add(tenantIdPredicate);
+ }
+ if (entityId != null) {
+ Predicate entityTypePredicate = criteriaBuilder.equal(root.get("entityType"), entityId.getEntityType());
+ predicates.add(entityTypePredicate);
+ Predicate entityIdPredicate = criteriaBuilder.equal(root.get("entityId"), UUIDConverter.fromTimeUUID(entityId.getId()));
+ predicates.add(entityIdPredicate);
+ }
+ if (customerId != null) {
+ Predicate tenantIdPredicate = criteriaBuilder.equal(root.get("customerId"), UUIDConverter.fromTimeUUID(customerId.getId()));
+ predicates.add(tenantIdPredicate);
+ }
+ if (userId != null) {
+ Predicate tenantIdPredicate = criteriaBuilder.equal(root.get("userId"), UUIDConverter.fromTimeUUID(userId.getId()));
+ predicates.add(tenantIdPredicate);
+ }
+ return criteriaBuilder.and(predicates.toArray(new Predicate[]{}));
+ };
+ }
+}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/component/ComponentDescriptorRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/component/ComponentDescriptorRepository.java
index e9d231d..6a7d119 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/component/ComponentDescriptorRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/component/ComponentDescriptorRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDao.java
index ee32444..1728818 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/customer/CustomerRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/customer/CustomerRepository.java
index 4d9af55..b713284 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/customer/CustomerRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/customer/CustomerRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/customer/JpaCustomerDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/customer/JpaCustomerDao.java
index 6fabca2..396a6cb 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/customer/JpaCustomerDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/customer/JpaCustomerDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/DashboardInfoRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/DashboardInfoRepository.java
index 7f0ec7a..f481387 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/DashboardInfoRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/DashboardInfoRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -39,12 +39,4 @@ public interface DashboardInfoRepository extends CrudRepository<DashboardInfoEnt
@Param("idOffset") String idOffset,
Pageable pageable);
- @Query("SELECT di FROM DashboardInfoEntity di WHERE di.tenantId = :tenantId " +
- "AND di.customerId = :customerId AND LOWER(di.searchText) LIKE LOWER(CONCAT(:searchText, '%')) " +
- "AND di.id > :idOffset ORDER BY di.id")
- List<DashboardInfoEntity> findByTenantIdAndCustomerId(@Param("tenantId") String tenantId,
- @Param("customerId") String customerId,
- @Param("searchText") String searchText,
- @Param("idOffset") String idOffset,
- Pageable pageable);
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/DashboardRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/DashboardRepository.java
index 2c4d18a..d30fc0e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/DashboardRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/DashboardRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardDao.java
index c2650f9..e552be9 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardInfoDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardInfoDao.java
index 204189a..4d8d0b2 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardInfoDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardInfoDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,19 +15,31 @@
*/
package org.thingsboard.server.dao.sql.dashboard;
+import com.google.common.util.concurrent.AsyncFunction;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.ListenableFuture;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;
import org.thingsboard.server.common.data.DashboardInfo;
+import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.UUIDConverter;
+import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageLink;
+import org.thingsboard.server.common.data.relation.EntityRelation;
+import org.thingsboard.server.common.data.relation.RelationTypeGroup;
import org.thingsboard.server.dao.DaoUtil;
import org.thingsboard.server.dao.dashboard.DashboardInfoDao;
import org.thingsboard.server.dao.model.sql.DashboardInfoEntity;
+import org.thingsboard.server.dao.relation.RelationDao;
import org.thingsboard.server.dao.sql.JpaAbstractSearchTextDao;
import org.thingsboard.server.dao.util.SqlDao;
+import java.sql.Time;
+import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
@@ -37,11 +49,15 @@ import static org.thingsboard.server.dao.model.ModelConstants.NULL_UUID_STR;
/**
* Created by Valerii Sosliuk on 5/6/2017.
*/
+@Slf4j
@Component
@SqlDao
public class JpaDashboardInfoDao extends JpaAbstractSearchTextDao<DashboardInfoEntity, DashboardInfo> implements DashboardInfoDao {
@Autowired
+ private RelationDao relationDao;
+
+ @Autowired
private DashboardInfoRepository dashboardInfoRepository;
@Override
@@ -65,13 +81,17 @@ public class JpaDashboardInfoDao extends JpaAbstractSearchTextDao<DashboardInfoE
}
@Override
- public List<DashboardInfo> findDashboardsByTenantIdAndCustomerId(UUID tenantId, UUID customerId, TextPageLink pageLink) {
- return DaoUtil.convertDataList(dashboardInfoRepository
- .findByTenantIdAndCustomerId(
- UUIDConverter.fromTimeUUID(tenantId),
- UUIDConverter.fromTimeUUID(customerId),
- Objects.toString(pageLink.getTextSearch(), ""),
- pageLink.getIdOffset() == null ? NULL_UUID_STR : UUIDConverter.fromTimeUUID(pageLink.getIdOffset()),
- new PageRequest(0, pageLink.getLimit())));
+ public ListenableFuture<List<DashboardInfo>> findDashboardsByTenantIdAndCustomerId(UUID tenantId, UUID customerId, TimePageLink pageLink) {
+ log.debug("Try to find dashboards by tenantId [{}], customerId[{}] and pageLink [{}]", tenantId, customerId, pageLink);
+
+ ListenableFuture<List<EntityRelation>> relations = relationDao.findRelations(new CustomerId(customerId), EntityRelation.CONTAINS_TYPE, RelationTypeGroup.DASHBOARD, EntityType.DASHBOARD, pageLink);
+
+ return Futures.transform(relations, (AsyncFunction<List<EntityRelation>, List<DashboardInfo>>) input -> {
+ List<ListenableFuture<DashboardInfo>> dashboardFutures = new ArrayList<>(input.size());
+ for (EntityRelation relation : input) {
+ dashboardFutures.add(findByIdAsync(relation.getTo().getId()));
+ }
+ return Futures.successfulAsList(dashboardFutures);
+ });
}
}
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/device/DeviceCredentialsRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/device/DeviceCredentialsRepository.java
index 8abeadc..68da100 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/device/DeviceCredentialsRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/device/DeviceCredentialsRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/device/DeviceRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/device/DeviceRepository.java
index bcea4ce..3bab1c5 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/device/DeviceRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/device/DeviceRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/device/JpaDeviceCredentialsDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/device/JpaDeviceCredentialsDao.java
index 24832da..fb41a88 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/device/JpaDeviceCredentialsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/device/JpaDeviceCredentialsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/device/JpaDeviceDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/device/JpaDeviceDao.java
index a3f02f8..4f3cd7d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/device/JpaDeviceDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/device/JpaDeviceDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/event/EventRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/event/EventRepository.java
index 0fa23f4..89cd944 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/event/EventRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/event/EventRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/event/JpaBaseEventDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/event/JpaBaseEventDao.java
index 9bf8265..9b22773 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/event/JpaBaseEventDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/event/JpaBaseEventDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDao.java
index bc6b105..a0090c4 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDaoListeningExecutorService.java b/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDaoListeningExecutorService.java
index 7828267..bdb73c4 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDaoListeningExecutorService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractDaoListeningExecutorService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractSearchTextDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractSearchTextDao.java
index dab5f33..c9d2b8f 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractSearchTextDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractSearchTextDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractSearchTimeDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractSearchTimeDao.java
index 80f8588..4e24d3c 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractSearchTimeDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/JpaAbstractSearchTimeDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/plugin/JpaBasePluginDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/plugin/JpaBasePluginDao.java
index 0a523cb..7b76314 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/plugin/JpaBasePluginDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/plugin/JpaBasePluginDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/plugin/PluginMetaDataRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/plugin/PluginMetaDataRepository.java
index 577c3e7..614dfda 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/plugin/PluginMetaDataRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/plugin/PluginMetaDataRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/relation/JpaRelationDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/relation/JpaRelationDao.java
index b996aea..6776f56 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/relation/JpaRelationDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/relation/JpaRelationDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/relation/RelationRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/relation/RelationRepository.java
index c2de254..60c6a0e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/relation/RelationRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/relation/RelationRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaBaseRuleDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaBaseRuleDao.java
index 92d2225..5ff8298 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaBaseRuleDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/rule/JpaBaseRuleDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/rule/RuleMetaDataRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/rule/RuleMetaDataRepository.java
index c740f04..c2c0e01 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/rule/RuleMetaDataRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/rule/RuleMetaDataRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/settings/AdminSettingsRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/settings/AdminSettingsRepository.java
index 355b1a9..0fdc361 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/settings/AdminSettingsRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/settings/AdminSettingsRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/settings/JpaAdminSettingsDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/settings/JpaAdminSettingsDao.java
index 3c17b1d..4d200ff 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/settings/JpaAdminSettingsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/settings/JpaAdminSettingsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDao.java
index c486a49..e949cde 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/tenant/TenantRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/tenant/TenantRepository.java
index 1bb0fe4..050d507 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/tenant/TenantRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/tenant/TenantRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/JpaTimeseriesDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/JpaTimeseriesDao.java
index f12a292..6350352 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/JpaTimeseriesDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/JpaTimeseriesDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/TsKvLatestRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/TsKvLatestRepository.java
index ad5de77..c5e8861 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/TsKvLatestRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/TsKvLatestRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/TsKvRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/TsKvRepository.java
index d1e206e..a1d1920 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/TsKvRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/timeseries/TsKvRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/user/JpaUserCredentialsDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/user/JpaUserCredentialsDao.java
index b5ef3fa..d81db66 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/user/JpaUserCredentialsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/user/JpaUserCredentialsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/user/JpaUserDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/user/JpaUserDao.java
index 9a88769..fcabde5 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/user/JpaUserDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/user/JpaUserDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/user/UserCredentialsRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/user/UserCredentialsRepository.java
index cf1f0ec..f71f1b5 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/user/UserCredentialsRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/user/UserCredentialsRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/user/UserRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/user/UserRepository.java
index 18d4412..ede0071 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/user/UserRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/user/UserRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/widget/JpaWidgetsBundleDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/widget/JpaWidgetsBundleDao.java
index 1e5b5f3..12dea32 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/widget/JpaWidgetsBundleDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/widget/JpaWidgetsBundleDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/widget/JpaWidgetTypeDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/widget/JpaWidgetTypeDao.java
index 781be7a..a6cd8a0 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/widget/JpaWidgetTypeDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/widget/JpaWidgetTypeDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/widget/WidgetsBundleRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/widget/WidgetsBundleRepository.java
index 6b44d18..ea0e369 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/widget/WidgetsBundleRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/widget/WidgetsBundleRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/widget/WidgetTypeRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/widget/WidgetTypeRepository.java
index 4e0eb0b..2ac28cd 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/sql/widget/WidgetTypeRepository.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/sql/widget/WidgetTypeRepository.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/tenant/CassandraTenantDao.java b/dao/src/main/java/org/thingsboard/server/dao/tenant/CassandraTenantDao.java
index 64ef9f7..fc44403 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/tenant/CassandraTenantDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/tenant/CassandraTenantDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantDao.java b/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantDao.java
index 9c230d9..2f7a898 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantService.java b/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantService.java
index 21c8001..d421ce6 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/tenant/TenantService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 df68b6a..24abe52 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/AggregatePartitionsFunction.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/AggregatePartitionsFunction.java
index 2e0bad9..99a2bf1 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/AggregatePartitionsFunction.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/AggregatePartitionsFunction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/BaseTimeseriesService.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/BaseTimeseriesService.java
index 49f8a83..c981378 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/BaseTimeseriesService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/BaseTimeseriesService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesDao.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesDao.java
index 92cd042..d620e11 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/CassandraBaseTimeseriesDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java
index 3f3e031..57a13ea 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TimeseriesDao.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TimeseriesDao.java
index 5d593b7..1e3f4ce 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TimeseriesDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TimeseriesDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TimeseriesService.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TimeseriesService.java
index e6feebb..2cd2d8d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TimeseriesService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TimeseriesService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsInsertExecutorType.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsInsertExecutorType.java
index 6756f0f..2f0a293 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsInsertExecutorType.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsInsertExecutorType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsKvQueryCursor.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsKvQueryCursor.java
index ed53733..d6b6bbd 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsKvQueryCursor.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsKvQueryCursor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsPartitionDate.java b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsPartitionDate.java
index 2b63a9e..4148004 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsPartitionDate.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/timeseries/TsPartitionDate.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/user/CassandraUserCredentialsDao.java b/dao/src/main/java/org/thingsboard/server/dao/user/CassandraUserCredentialsDao.java
index f4f84d4..a5a8631 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/user/CassandraUserCredentialsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/user/CassandraUserCredentialsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/user/CassandraUserDao.java b/dao/src/main/java/org/thingsboard/server/dao/user/CassandraUserDao.java
index d8c6b83..430c143 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/user/CassandraUserDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/user/CassandraUserDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/user/UserCredentialsDao.java b/dao/src/main/java/org/thingsboard/server/dao/user/UserCredentialsDao.java
index 5861fa1..f1857f4 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/user/UserCredentialsDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/user/UserCredentialsDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/user/UserDao.java b/dao/src/main/java/org/thingsboard/server/dao/user/UserDao.java
index 292099a..5509738 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/user/UserDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/user/UserDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/user/UserService.java b/dao/src/main/java/org/thingsboard/server/dao/user/UserService.java
index 9f12288..5818588 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/user/UserService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/user/UserService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
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 be5aedf..350bf4f 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/AbstractJsonSqlTypeDescriptor.java b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/AbstractJsonSqlTypeDescriptor.java
index aa0c506..8ddfa52 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/AbstractJsonSqlTypeDescriptor.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/AbstractJsonSqlTypeDescriptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JacksonUtil.java b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JacksonUtil.java
index 06c5b9c..19bce27 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JacksonUtil.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JacksonUtil.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonStringSqlTypeDescriptor.java b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonStringSqlTypeDescriptor.java
index 782806c..0ff2366 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonStringSqlTypeDescriptor.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonStringSqlTypeDescriptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonStringType.java b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonStringType.java
index 5ac5b18..db7dcd4 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonStringType.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonStringType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonTypeDescriptor.java b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonTypeDescriptor.java
index c949327..740ff7d 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonTypeDescriptor.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/util/mapping/JsonTypeDescriptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/util/NoSqlDao.java b/dao/src/main/java/org/thingsboard/server/dao/util/NoSqlDao.java
index 32b1732..96dbdab 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/util/NoSqlDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/util/NoSqlDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/util/SqlDao.java b/dao/src/main/java/org/thingsboard/server/dao/util/SqlDao.java
index 1ebc271..3986f02 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/util/SqlDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/util/SqlDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/widget/CassandraWidgetsBundleDao.java b/dao/src/main/java/org/thingsboard/server/dao/widget/CassandraWidgetsBundleDao.java
index 82a1485..b5d0e5f 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/widget/CassandraWidgetsBundleDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/widget/CassandraWidgetsBundleDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/widget/CassandraWidgetTypeDao.java b/dao/src/main/java/org/thingsboard/server/dao/widget/CassandraWidgetTypeDao.java
index dc19015..43049f9 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/widget/CassandraWidgetTypeDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/widget/CassandraWidgetTypeDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleDao.java b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleDao.java
index d8c6044..f1b887f 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleService.java b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleService.java
index 27f9211..3314d87 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleServiceImpl.java
index f7b371e..1ae541c 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleServiceImpl.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetsBundleServiceImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeDao.java b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeDao.java
index dce7064..de5028b 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeDao.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeDao.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeService.java b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeService.java
index dcc70f7..5d71ddd 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeService.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeServiceImpl.java
index 90e1186..1cbe59e 100644
--- a/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeServiceImpl.java
+++ b/dao/src/main/java/org/thingsboard/server/dao/widget/WidgetTypeServiceImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
dao/src/main/resources/cassandra/schema.cql 93(+80 -13)
diff --git a/dao/src/main/resources/cassandra/schema.cql b/dao/src/main/resources/cassandra/schema.cql
index 05e6cfe..0c8a644 100644
--- a/dao/src/main/resources/cassandra/schema.cql
+++ b/dao/src/main/resources/cassandra/schema.cql
@@ -1,5 +1,5 @@
--
--- Copyright © 2016-2017 The Thingsboard Authors
+-- Copyright © 2016-2018 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.
@@ -364,26 +364,19 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS thingsboard.widget_type_by_tenant_and_ali
CREATE TABLE IF NOT EXISTS thingsboard.dashboard (
id timeuuid,
tenant_id timeuuid,
- customer_id timeuuid,
title text,
search_text text,
+ assigned_customers text,
configuration text,
- PRIMARY KEY (id, tenant_id, customer_id)
+ PRIMARY KEY (id, tenant_id)
);
CREATE MATERIALIZED VIEW IF NOT EXISTS thingsboard.dashboard_by_tenant_and_search_text AS
SELECT *
from thingsboard.dashboard
- WHERE tenant_id IS NOT NULL AND customer_id IS NOT NULL AND search_text IS NOT NULL AND id IS NOT NULL
- PRIMARY KEY ( tenant_id, search_text, id, customer_id )
- WITH CLUSTERING ORDER BY ( search_text ASC, id DESC, customer_id DESC );
-
-CREATE MATERIALIZED VIEW IF NOT EXISTS thingsboard.dashboard_by_customer_and_search_text AS
- SELECT *
- from thingsboard.dashboard
- WHERE tenant_id IS NOT NULL AND customer_id IS NOT NULL AND search_text IS NOT NULL AND id IS NOT NULL
- PRIMARY KEY ( customer_id, tenant_id, search_text, id )
- WITH CLUSTERING ORDER BY ( tenant_id DESC, search_text ASC, id DESC );
+ WHERE tenant_id IS NOT NULL AND search_text IS NOT NULL AND id IS NOT NULL
+ PRIMARY KEY ( tenant_id, search_text, id )
+ WITH CLUSTERING ORDER BY ( search_text ASC, id DESC );
CREATE TABLE IF NOT EXISTS thingsboard.ts_kv_cf (
entity_type text, // (DEVICE, CUSTOMER, TENANT)
@@ -597,3 +590,77 @@ AND compaction = {
'tombstone_threshold': '0.9',
'unchecked_tombstone_compaction': 'true'
};
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_entity_id (
+ tenant_id timeuuid,
+ id timeuuid,
+ customer_id timeuuid,
+ entity_id timeuuid,
+ entity_type text,
+ entity_name text,
+ user_id timeuuid,
+ user_name text,
+ action_type text,
+ action_data text,
+ action_status text,
+ action_failure_details text,
+ PRIMARY KEY ((tenant_id, entity_id, entity_type), id)
+);
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_customer_id (
+ tenant_id timeuuid,
+ id timeuuid,
+ customer_id timeuuid,
+ entity_id timeuuid,
+ entity_type text,
+ entity_name text,
+ user_id timeuuid,
+ user_name text,
+ action_type text,
+ action_data text,
+ action_status text,
+ action_failure_details text,
+ PRIMARY KEY ((tenant_id, customer_id), id)
+);
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_user_id (
+ tenant_id timeuuid,
+ id timeuuid,
+ customer_id timeuuid,
+ entity_id timeuuid,
+ entity_type text,
+ entity_name text,
+ user_id timeuuid,
+ user_name text,
+ action_type text,
+ action_data text,
+ action_status text,
+ action_failure_details text,
+ PRIMARY KEY ((tenant_id, user_id), id)
+);
+
+
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_tenant_id (
+ tenant_id timeuuid,
+ id timeuuid,
+ partition bigint,
+ customer_id timeuuid,
+ entity_id timeuuid,
+ entity_type text,
+ entity_name text,
+ user_id timeuuid,
+ user_name text,
+ action_type text,
+ action_data text,
+ action_status text,
+ action_failure_details text,
+ PRIMARY KEY ((tenant_id, partition), id)
+);
+
+CREATE TABLE IF NOT EXISTS thingsboard.audit_log_by_tenant_id_partitions (
+ tenant_id timeuuid,
+ partition bigint,
+ PRIMARY KEY (( tenant_id ), partition)
+) WITH CLUSTERING ORDER BY ( partition ASC )
+AND compaction = { 'class' : 'LeveledCompactionStrategy' };
diff --git a/dao/src/main/resources/cassandra/system-data.cql b/dao/src/main/resources/cassandra/system-data.cql
index fc7c315..2455ac6 100644
--- a/dao/src/main/resources/cassandra/system-data.cql
+++ b/dao/src/main/resources/cassandra/system-data.cql
@@ -1,5 +1,5 @@
--
--- Copyright © 2016-2017 The Thingsboard Authors
+-- Copyright © 2016-2018 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.
dao/src/main/resources/sql/schema.sql 19(+17 -2)
diff --git a/dao/src/main/resources/sql/schema.sql b/dao/src/main/resources/sql/schema.sql
index 26b314c..9f03dc8 100644
--- a/dao/src/main/resources/sql/schema.sql
+++ b/dao/src/main/resources/sql/schema.sql
@@ -1,5 +1,5 @@
--
--- Copyright © 2016-2017 The Thingsboard Authors
+-- Copyright © 2016-2018 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.
@@ -47,6 +47,21 @@ CREATE TABLE IF NOT EXISTS asset (
type varchar(255)
);
+CREATE TABLE IF NOT EXISTS audit_log (
+ id varchar(31) NOT NULL CONSTRAINT audit_log_pkey PRIMARY KEY,
+ tenant_id varchar(31),
+ customer_id varchar(31),
+ entity_id varchar(31),
+ entity_type varchar(255),
+ entity_name varchar(255),
+ user_id varchar(31),
+ user_name varchar(255),
+ action_type varchar(255),
+ action_data varchar(1000000),
+ action_status varchar(255),
+ action_failure_details varchar(1000000)
+);
+
CREATE TABLE IF NOT EXISTS attribute_kv (
entity_type varchar(255),
entity_id varchar(31),
@@ -90,7 +105,7 @@ CREATE TABLE IF NOT EXISTS customer (
CREATE TABLE IF NOT EXISTS dashboard (
id varchar(31) NOT NULL CONSTRAINT dashboard_pkey PRIMARY KEY,
configuration varchar(10000000),
- customer_id varchar(31),
+ assigned_customers varchar(1000000),
search_text varchar(255),
tenant_id varchar(31),
title varchar(255)
diff --git a/dao/src/main/resources/sql/system-data.sql b/dao/src/main/resources/sql/system-data.sql
index 1041103..39fd6bd 100644
--- a/dao/src/main/resources/sql/system-data.sql
+++ b/dao/src/main/resources/sql/system-data.sql
@@ -1,5 +1,5 @@
--
--- Copyright © 2016-2017 The Thingsboard Authors
+-- Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/AbstractJpaDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/AbstractJpaDaoTest.java
index 42c332e..8ed142a 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/AbstractJpaDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/AbstractJpaDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/CustomCassandraCQLUnit.java b/dao/src/test/java/org/thingsboard/server/dao/CustomCassandraCQLUnit.java
index 527a561..d214a70 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/CustomCassandraCQLUnit.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/CustomCassandraCQLUnit.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/CustomSqlUnit.java b/dao/src/test/java/org/thingsboard/server/dao/CustomSqlUnit.java
index 9649ad8..7a9ec9d 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/CustomSqlUnit.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/CustomSqlUnit.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/JpaDaoTestSuite.java b/dao/src/test/java/org/thingsboard/server/dao/JpaDaoTestSuite.java
index d936a38..48ba2fa 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/JpaDaoTestSuite.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/JpaDaoTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -24,7 +24,7 @@ import java.util.Arrays;
@RunWith(ClasspathSuite.class)
@ClassnameFilters({
- "org.thingsboard.server.dao.sql.*AAATest"
+ "org.thingsboard.server.dao.sql.*THIS_MUST_BE_FIXED_Test"
})
public class JpaDaoTestSuite {
diff --git a/dao/src/test/java/org/thingsboard/server/dao/JpaDbunitTestConfig.java b/dao/src/test/java/org/thingsboard/server/dao/JpaDbunitTestConfig.java
index 01c53b6..d83293c 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/JpaDbunitTestConfig.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/JpaDbunitTestConfig.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/NoSqlDaoServiceTestSuite.java b/dao/src/test/java/org/thingsboard/server/dao/NoSqlDaoServiceTestSuite.java
index 3178602..7e25baa 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/NoSqlDaoServiceTestSuite.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/NoSqlDaoServiceTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/AbstractServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/AbstractServiceTest.java
index e0b5f24..ffa9f0e 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/AbstractServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/AbstractServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
import com.fasterxml.jackson.databind.node.TextNode;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.annotation.DirtiesContext;
@@ -29,6 +30,7 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.support.AnnotationConfigContextLoader;
import org.thingsboard.server.common.data.BaseData;
+import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.Event;
import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.TenantId;
@@ -40,6 +42,8 @@ import org.thingsboard.server.common.data.plugin.PluginMetaData;
import org.thingsboard.server.common.data.rule.RuleMetaData;
import org.thingsboard.server.dao.alarm.AlarmService;
import org.thingsboard.server.dao.asset.AssetService;
+import org.thingsboard.server.dao.audit.AuditLogLevelFilter;
+import org.thingsboard.server.dao.audit.AuditLogLevelMask;
import org.thingsboard.server.dao.component.ComponentDescriptorService;
import org.thingsboard.server.dao.customer.CustomerService;
import org.thingsboard.server.dao.dashboard.DashboardService;
@@ -58,6 +62,8 @@ import org.thingsboard.server.dao.widget.WidgetsBundleService;
import java.io.IOException;
import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
@@ -227,4 +233,14 @@ public abstract class AbstractServiceTest {
oNode.set("configuration", readFromResource(configuration));
return oNode;
}
+
+ @Bean
+ public AuditLogLevelFilter auditLogLevelFilter() {
+ Map<String,String> mask = new HashMap<>();
+ for (EntityType entityType : EntityType.values()) {
+ mask.put(entityType.name().toLowerCase(), AuditLogLevelMask.RW.name());
+ }
+ return new AuditLogLevelFilter(mask);
+ }
+
}
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/attributes/BaseAttributesServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/attributes/BaseAttributesServiceTest.java
index 3a67574..113f0d0 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/attributes/BaseAttributesServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/attributes/BaseAttributesServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/attributes/nosql/AttributesServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/attributes/nosql/AttributesServiceNoSqlTest.java
index 295b888..523dd5c 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/attributes/nosql/AttributesServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/attributes/nosql/AttributesServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/attributes/sql/AttributesServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/attributes/sql/AttributesServiceSqlTest.java
index 7c06da0..5097f21 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/attributes/sql/AttributesServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/attributes/sql/AttributesServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java
index 11954b8..4ea39f0 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAdminSettingsServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java
index 23fc3cc..fd071e9 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAlarmServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java
index 6bcc74a..a807d78 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseAssetServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java
index d3f2d8f..8a781b8 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseCustomerServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java
index f0ed0b3..993e525 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDashboardServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -29,13 +29,17 @@ import org.thingsboard.server.common.data.id.CustomerId;
import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.page.TextPageData;
import org.thingsboard.server.common.data.page.TextPageLink;
+import org.thingsboard.server.common.data.page.TimePageData;
+import org.thingsboard.server.common.data.page.TimePageLink;
import org.thingsboard.server.dao.exception.DataValidationException;
import org.thingsboard.server.dao.model.ModelConstants;
import java.io.IOException;
+import java.sql.Time;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.concurrent.ExecutionException;
public abstract class BaseDashboardServiceTest extends AbstractServiceTest {
@@ -68,8 +72,6 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest {
Assert.assertNotNull(savedDashboard.getId());
Assert.assertTrue(savedDashboard.getCreatedTime() > 0);
Assert.assertEquals(dashboard.getTenantId(), savedDashboard.getTenantId());
- Assert.assertNotNull(savedDashboard.getCustomerId());
- Assert.assertEquals(ModelConstants.NULL_UUID, savedDashboard.getCustomerId().getId());
Assert.assertEquals(dashboard.getTitle(), savedDashboard.getTitle());
savedDashboard.setTitle("My new dashboard");
@@ -280,7 +282,7 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest {
}
@Test
- public void testFindDashboardsByTenantIdAndCustomerId() {
+ public void testFindDashboardsByTenantIdAndCustomerId() throws ExecutionException, InterruptedException {
Tenant tenant = new Tenant();
tenant.setTitle("Test tenant");
tenant = tenantService.saveTenant(tenant);
@@ -303,10 +305,10 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest {
}
List<DashboardInfo> loadedDashboards = new ArrayList<>();
- TextPageLink pageLink = new TextPageLink(23);
- TextPageData<DashboardInfo> pageData = null;
+ TimePageLink pageLink = new TimePageLink(23);
+ TimePageData<DashboardInfo> pageData = null;
do {
- pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink);
+ pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink).get();
loadedDashboards.addAll(pageData.getData());
if (pageData.hasNext()) {
pageLink = pageData.getNextPageLink();
@@ -318,98 +320,14 @@ public abstract class BaseDashboardServiceTest extends AbstractServiceTest {
Assert.assertEquals(dashboards, loadedDashboards);
- dashboardService.unassignCustomerDashboards(tenantId, customerId);
+ dashboardService.unassignCustomerDashboards(customerId);
- pageLink = new TextPageLink(42);
- pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink);
+ pageLink = new TimePageLink(42);
+ pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink).get();
Assert.assertFalse(pageData.hasNext());
Assert.assertTrue(pageData.getData().isEmpty());
tenantService.deleteTenant(tenantId);
}
-
- @Test
- public void testFindDashboardsByTenantIdCustomerIdAndTitle() {
-
- Customer customer = new Customer();
- customer.setTitle("Test customer");
- customer.setTenantId(tenantId);
- customer = customerService.saveCustomer(customer);
- CustomerId customerId = customer.getId();
-
- String title1 = "Dashboard title 1";
- List<DashboardInfo> dashboardsTitle1 = new ArrayList<>();
- for (int i=0;i<124;i++) {
- Dashboard dashboard = new Dashboard();
- dashboard.setTenantId(tenantId);
- String suffix = RandomStringUtils.randomAlphanumeric((int)(Math.random()*15));
- String title = title1+suffix;
- title = i % 2 == 0 ? title.toLowerCase() : title.toUpperCase();
- dashboard.setTitle(title);
- dashboard = dashboardService.saveDashboard(dashboard);
- dashboardsTitle1.add(new DashboardInfo(dashboardService.assignDashboardToCustomer(dashboard.getId(), customerId)));
- }
- String title2 = "Dashboard title 2";
- List<DashboardInfo> dashboardsTitle2 = new ArrayList<>();
- for (int i=0;i<151;i++) {
- Dashboard dashboard = new Dashboard();
- dashboard.setTenantId(tenantId);
- String suffix = RandomStringUtils.randomAlphanumeric((int)(Math.random()*15));
- String title = title2+suffix;
- title = i % 2 == 0 ? title.toLowerCase() : title.toUpperCase();
- dashboard.setTitle(title);
- dashboard = dashboardService.saveDashboard(dashboard);
- dashboardsTitle2.add(new DashboardInfo(dashboardService.assignDashboardToCustomer(dashboard.getId(), customerId)));
- }
-
- List<DashboardInfo> loadedDashboardsTitle1 = new ArrayList<>();
- TextPageLink pageLink = new TextPageLink(24, title1);
- TextPageData<DashboardInfo> pageData = null;
- do {
- pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink);
- loadedDashboardsTitle1.addAll(pageData.getData());
- if (pageData.hasNext()) {
- pageLink = pageData.getNextPageLink();
- }
- } while (pageData.hasNext());
-
- Collections.sort(dashboardsTitle1, idComparator);
- Collections.sort(loadedDashboardsTitle1, idComparator);
-
- Assert.assertEquals(dashboardsTitle1, loadedDashboardsTitle1);
-
- List<DashboardInfo> loadedDashboardsTitle2 = new ArrayList<>();
- pageLink = new TextPageLink(4, title2);
- do {
- pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink);
- loadedDashboardsTitle2.addAll(pageData.getData());
- if (pageData.hasNext()) {
- pageLink = pageData.getNextPageLink();
- }
- } while (pageData.hasNext());
- Collections.sort(dashboardsTitle2, idComparator);
- Collections.sort(loadedDashboardsTitle2, idComparator);
-
- Assert.assertEquals(dashboardsTitle2, loadedDashboardsTitle2);
-
- for (DashboardInfo dashboard : loadedDashboardsTitle1) {
- dashboardService.deleteDashboard(dashboard.getId());
- }
-
- pageLink = new TextPageLink(4, title1);
- pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink);
- Assert.assertFalse(pageData.hasNext());
- Assert.assertEquals(0, pageData.getData().size());
-
- for (DashboardInfo dashboard : loadedDashboardsTitle2) {
- dashboardService.deleteDashboard(dashboard.getId());
- }
-
- pageLink = new TextPageLink(4, title2);
- pageData = dashboardService.findDashboardsByTenantIdAndCustomerId(tenantId, customerId, pageLink);
- Assert.assertFalse(pageData.hasNext());
- Assert.assertEquals(0, pageData.getData().size());
- customerService.deleteCustomer(customerId);
- }
}
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsCacheTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsCacheTest.java
index 31b599a..61fbf05 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsCacheTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsCacheTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,16 +15,14 @@
*/
package org.thingsboard.server.dao.service;
-import com.hazelcast.core.HazelcastInstance;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.After;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.TestPropertySource;
+import org.springframework.cache.CacheManager;
import org.springframework.test.util.ReflectionTestUtils;
import org.thingsboard.server.common.data.CacheConstants;
import org.thingsboard.server.common.data.Device;
@@ -40,7 +38,6 @@ import java.util.UUID;
import static org.mockito.Mockito.*;
-@TestPropertySource(properties = {"cache.enabled = true"})
public abstract class BaseDeviceCredentialsCacheTest extends AbstractServiceTest {
private static final String CREDENTIALS_ID_1 = RandomStringUtils.randomAlphanumeric(20);
@@ -53,7 +50,7 @@ public abstract class BaseDeviceCredentialsCacheTest extends AbstractServiceTest
private DeviceService deviceService;
@Autowired
- private HazelcastInstance hazelcastInstance;
+ private CacheManager cacheManager;
private UUID deviceId = UUID.randomUUID();
@@ -67,7 +64,7 @@ public abstract class BaseDeviceCredentialsCacheTest extends AbstractServiceTest
@After
public void cleanup() {
- hazelcastInstance.getMap(CacheConstants.DEVICE_CREDENTIALS_CACHE).evictAll();
+ cacheManager.getCache(CacheConstants.DEVICE_CREDENTIALS_CACHE).clear();
}
@Test
@@ -77,7 +74,6 @@ public abstract class BaseDeviceCredentialsCacheTest extends AbstractServiceTest
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
- Assert.assertEquals(1, hazelcastInstance.getMap(CacheConstants.DEVICE_CREDENTIALS_CACHE).size());
verify(deviceCredentialsDao, times(1)).findByCredentialsId(CREDENTIALS_ID_1);
}
@@ -88,17 +84,13 @@ public abstract class BaseDeviceCredentialsCacheTest extends AbstractServiceTest
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
- Assert.assertEquals(1, hazelcastInstance.getMap(CacheConstants.DEVICE_CREDENTIALS_CACHE).size());
verify(deviceCredentialsDao, times(1)).findByCredentialsId(CREDENTIALS_ID_1);
deviceCredentialsService.deleteDeviceCredentials(createDummyDeviceCredentials(CREDENTIALS_ID_1, deviceId));
- Assert.assertEquals(0, hazelcastInstance.getMap(CacheConstants.DEVICE_CREDENTIALS_CACHE).size());
-
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
- Assert.assertEquals(1, hazelcastInstance.getMap(CacheConstants.DEVICE_CREDENTIALS_CACHE).size());
verify(deviceCredentialsDao, times(2)).findByCredentialsId(CREDENTIALS_ID_1);
}
@@ -109,7 +101,6 @@ public abstract class BaseDeviceCredentialsCacheTest extends AbstractServiceTest
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
- Assert.assertEquals(1, hazelcastInstance.getMap(CacheConstants.DEVICE_CREDENTIALS_CACHE).size());
verify(deviceCredentialsDao, times(1)).findByCredentialsId(CREDENTIALS_ID_1);
when(deviceCredentialsDao.findByDeviceId(deviceId)).thenReturn(createDummyDeviceCredentialsEntity(CREDENTIALS_ID_1));
@@ -119,13 +110,11 @@ public abstract class BaseDeviceCredentialsCacheTest extends AbstractServiceTest
when(deviceService.findDeviceById(new DeviceId(deviceId))).thenReturn(new Device());
deviceCredentialsService.updateDeviceCredentials(createDummyDeviceCredentials(deviceCredentialsId, CREDENTIALS_ID_2, deviceId));
- Assert.assertEquals(0, hazelcastInstance.getMap(CacheConstants.DEVICE_CREDENTIALS_CACHE).size());
when(deviceCredentialsDao.findByCredentialsId(CREDENTIALS_ID_1)).thenReturn(null);
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
deviceCredentialsService.findDeviceCredentialsByCredentialsId(CREDENTIALS_ID_1);
- Assert.assertEquals(0, hazelcastInstance.getMap(CacheConstants.DEVICE_CREDENTIALS_CACHE).size());
verify(deviceCredentialsDao, times(3)).findByCredentialsId(CREDENTIALS_ID_1);
}
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java
index 26f234a..032534e 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceCredentialsServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java
index 0c35798..cd8a478 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseDeviceServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationCacheTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationCacheTest.java
new file mode 100644
index 0000000..3a0b6ae
--- /dev/null
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseRelationCacheTest.java
@@ -0,0 +1,101 @@
+/**
+ * Copyright © 2016-2018 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.service;
+
+import com.google.common.util.concurrent.Futures;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.aop.framework.Advised;
+import org.springframework.aop.support.AopUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.CacheManager;
+import org.springframework.test.util.ReflectionTestUtils;
+import org.thingsboard.server.common.data.id.DeviceId;
+import org.thingsboard.server.common.data.id.EntityId;
+import org.thingsboard.server.common.data.relation.EntityRelation;
+import org.thingsboard.server.common.data.relation.RelationTypeGroup;
+import org.thingsboard.server.dao.relation.RelationDao;
+import org.thingsboard.server.dao.relation.RelationService;
+
+import java.util.UUID;
+import java.util.concurrent.ExecutionException;
+
+import static org.mockito.Mockito.*;
+import static org.thingsboard.server.common.data.CacheConstants.RELATIONS_CACHE;
+
+public abstract class BaseRelationCacheTest extends AbstractServiceTest {
+
+ private static final EntityId ENTITY_ID_FROM = new DeviceId(UUID.randomUUID());
+ private static final EntityId ENTITY_ID_TO = new DeviceId(UUID.randomUUID());
+ private static final String RELATION_TYPE = "Contains";
+
+ @Autowired
+ private RelationService relationService;
+ @Autowired
+ private CacheManager cacheManager;
+
+ private RelationDao relationDao;
+
+ @Before
+ public void setup() throws Exception {
+ relationDao = mock(RelationDao.class);
+ ReflectionTestUtils.setField(unwrapRelationService(), "relationDao", relationDao);
+ }
+
+ @After
+ public void cleanup() {
+ cacheManager.getCache(RELATIONS_CACHE).clear();
+ }
+
+ private RelationService unwrapRelationService() throws Exception {
+ if (AopUtils.isAopProxy(relationService) && relationService instanceof Advised) {
+ Object target = ((Advised) relationService).getTargetSource().getTarget();
+ return (RelationService) target;
+ }
+ return null;
+ }
+
+ @Test
+ public void testFindRelationByFrom_Cached() throws ExecutionException, InterruptedException {
+ when(relationDao.getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON))
+ .thenReturn(Futures.immediateFuture(new EntityRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE)));
+
+ relationService.getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+ relationService.getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+
+ verify(relationDao, times(1)).getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+ }
+
+ @Test
+ public void testDeleteRelations_EvictsCache() {
+ when(relationDao.getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON))
+ .thenReturn(Futures.immediateFuture(new EntityRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE)));
+
+ relationService.getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+ relationService.getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+
+ verify(relationDao, times(1)).getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+
+ relationService.deleteRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+
+ relationService.getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+ relationService.getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+
+ verify(relationDao, times(2)).getRelation(ENTITY_ID_FROM, ENTITY_ID_TO, RELATION_TYPE, RelationTypeGroup.COMMON);
+
+ }
+}
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 6b58af8..754454a 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
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -122,7 +122,7 @@ public abstract class BaseRelationServiceTest extends AbstractServiceTest {
saveRelation(relationB1);
saveRelation(relationB2);
- List<EntityRelation> relations = relationService.findByFrom(parentA, RelationTypeGroup.COMMON).get();
+ List<EntityRelation> relations = relationService.findByFrom(parentA, RelationTypeGroup.COMMON);
Assert.assertEquals(2, relations.size());
for (EntityRelation relation : relations) {
Assert.assertEquals(EntityRelation.CONTAINS_TYPE, relation.getType());
@@ -130,13 +130,13 @@ public abstract class BaseRelationServiceTest extends AbstractServiceTest {
Assert.assertTrue(childA.equals(relation.getTo()) || childB.equals(relation.getTo()));
}
- relations = relationService.findByFromAndType(parentA, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByFromAndType(parentA, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.COMMON);
Assert.assertEquals(2, relations.size());
- relations = relationService.findByFromAndType(parentA, EntityRelation.MANAGES_TYPE, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByFromAndType(parentA, EntityRelation.MANAGES_TYPE, RelationTypeGroup.COMMON);
Assert.assertEquals(0, relations.size());
- relations = relationService.findByFrom(parentB, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByFrom(parentB, RelationTypeGroup.COMMON);
Assert.assertEquals(2, relations.size());
for (EntityRelation relation : relations) {
Assert.assertEquals(EntityRelation.MANAGES_TYPE, relation.getType());
@@ -144,10 +144,10 @@ public abstract class BaseRelationServiceTest extends AbstractServiceTest {
Assert.assertTrue(childA.equals(relation.getTo()) || childB.equals(relation.getTo()));
}
- relations = relationService.findByFromAndType(parentB, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByFromAndType(parentB, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.COMMON);
Assert.assertEquals(0, relations.size());
- relations = relationService.findByFromAndType(parentB, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByFromAndType(parentB, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.COMMON);
Assert.assertEquals(0, relations.size());
}
@@ -177,26 +177,26 @@ public abstract class BaseRelationServiceTest extends AbstractServiceTest {
// Data propagation to views is async
Thread.sleep(3000);
- List<EntityRelation> relations = relationService.findByTo(childA, RelationTypeGroup.COMMON).get();
+ List<EntityRelation> relations = relationService.findByTo(childA, RelationTypeGroup.COMMON);
Assert.assertEquals(2, relations.size());
for (EntityRelation relation : relations) {
Assert.assertEquals(childA, relation.getTo());
Assert.assertTrue(parentA.equals(relation.getFrom()) || parentB.equals(relation.getFrom()));
}
- relations = relationService.findByToAndType(childA, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByToAndType(childA, EntityRelation.CONTAINS_TYPE, RelationTypeGroup.COMMON);
Assert.assertEquals(1, relations.size());
- relations = relationService.findByToAndType(childB, EntityRelation.MANAGES_TYPE, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByToAndType(childB, EntityRelation.MANAGES_TYPE, RelationTypeGroup.COMMON);
Assert.assertEquals(1, relations.size());
- relations = relationService.findByToAndType(parentA, EntityRelation.MANAGES_TYPE, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByToAndType(parentA, EntityRelation.MANAGES_TYPE, RelationTypeGroup.COMMON);
Assert.assertEquals(0, relations.size());
- relations = relationService.findByToAndType(parentB, EntityRelation.MANAGES_TYPE, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByToAndType(parentB, EntityRelation.MANAGES_TYPE, RelationTypeGroup.COMMON);
Assert.assertEquals(0, relations.size());
- relations = relationService.findByTo(childB, RelationTypeGroup.COMMON).get();
+ relations = relationService.findByTo(childB, RelationTypeGroup.COMMON);
Assert.assertEquals(2, relations.size());
for (EntityRelation relation : relations) {
Assert.assertEquals(childB, relation.getTo());
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java
index b8220d3..77121e0 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseTenantServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java
index 9e4f7f3..cd2dcc3 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseUserServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java
index 8f3e87d..11589e2 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetsBundleServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java
index 4066f77..28bdfbc 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/BaseWidgetTypeServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/DaoNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DaoNoSqlTest.java
index e369bb4..9263bc4 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/DaoNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/DaoNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/DaoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/DaoSqlTest.java
index 4034235..285c653 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/DaoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/DaoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/event/BaseEventServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/event/BaseEventServiceTest.java
index 7c99bf3..62af5a5 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/event/BaseEventServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/event/BaseEventServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/event/nosql/EventServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/event/nosql/EventServiceNoSqlTest.java
index 21f81fe..4375c49 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/event/nosql/EventServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/event/nosql/EventServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/event/sql/EventServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/event/sql/EventServiceSqlTest.java
index 77fee52..b6d1157 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/event/sql/EventServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/event/sql/EventServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AdminSettingsServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AdminSettingsServiceNoSqlTest.java
index b02c9cb..c30f864 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AdminSettingsServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AdminSettingsServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AlarmServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AlarmServiceNoSqlTest.java
index 9115a2d..f822adb 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AlarmServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AlarmServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AssetServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AssetServiceNoSqlTest.java
index 6370a71..3887788 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AssetServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/AssetServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/CustomerServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/CustomerServiceNoSqlTest.java
index f437551..99c77de 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/CustomerServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/CustomerServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DashboardServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DashboardServiceNoSqlTest.java
index 2ed8f55..3234805 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DashboardServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DashboardServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialCacheNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialCacheNoSqlTest.java
index 3dc4b84..218993f 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialCacheNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialCacheNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialServiceNoSqlTest.java
index 0a85622..a12658e 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceCredentialServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceServiceNoSqlTest.java
index a6f9554..5d01278 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/DeviceServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/RelationCacheNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/RelationCacheNoSqlTest.java
new file mode 100644
index 0000000..d268f30
--- /dev/null
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/RelationCacheNoSqlTest.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright © 2016-2018 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.service.nosql;
+
+import org.thingsboard.server.dao.service.BaseRelationCacheTest;
+import org.thingsboard.server.dao.service.DaoNoSqlTest;
+
+@DaoNoSqlTest
+public class RelationCacheNoSqlTest extends BaseRelationCacheTest {
+}
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/RelationServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/RelationServiceNoSqlTest.java
index 2133304..48d2026 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/RelationServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/RelationServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/TenantServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/TenantServiceNoSqlTest.java
index 8066e57..e19cd51 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/TenantServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/TenantServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/UserServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/UserServiceNoSqlTest.java
index d3a6452..0aa7175 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/UserServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/UserServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetsBundleServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetsBundleServiceNoSqlTest.java
index b0e7890..00b131d 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetsBundleServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetsBundleServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetTypeServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetTypeServiceNoSqlTest.java
index a814f35..98d867c 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetTypeServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/nosql/WidgetTypeServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/plugin/BasePluginServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/plugin/BasePluginServiceTest.java
index 64ef250..d9f551f 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/plugin/BasePluginServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/plugin/BasePluginServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/plugin/nosql/PluginServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/plugin/nosql/PluginServiceNoSqlTest.java
index f06e543..84539fe 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/plugin/nosql/PluginServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/plugin/nosql/PluginServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/plugin/sql/PluginServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/plugin/sql/PluginServiceSqlTest.java
index 448747f..4bd96f3 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/plugin/sql/PluginServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/plugin/sql/PluginServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/rule/BaseRuleServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/rule/BaseRuleServiceTest.java
index 1650b71..b6139df 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/rule/BaseRuleServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/rule/BaseRuleServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/rule/nosql/RuleServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/rule/nosql/RuleServiceNoSqlTest.java
index 2a34783..7ff9066 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/rule/nosql/RuleServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/rule/nosql/RuleServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/rule/sql/RuleServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/rule/sql/RuleServiceSqlTest.java
index 1e9325a..da3d4a0 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/rule/sql/RuleServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/rule/sql/RuleServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AdminSettingsServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AdminSettingsServiceSqlTest.java
index ff66d12..d5a69c0 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AdminSettingsServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AdminSettingsServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmServiceSqlTest.java
index f67f5d5..38d6080 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AlarmServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetServiceSqlTest.java
index 1bbc789..3020cec 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/AssetServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/CustomerServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/CustomerServiceSqlTest.java
index bdaca55..c900cc4 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/CustomerServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/CustomerServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DashboardServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DashboardServiceSqlTest.java
index 77a8cef..66aee43 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DashboardServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DashboardServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsCacheSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsCacheSqlTest.java
index 6f9211d..27febf8 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsCacheSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsCacheSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsServiceSqlTest.java
index 31fde40..f44c004 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceCredentialsServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceServiceSqlTest.java
index 647a602..f076237 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/DeviceServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationCacheSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationCacheSqlTest.java
new file mode 100644
index 0000000..ab67403
--- /dev/null
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationCacheSqlTest.java
@@ -0,0 +1,23 @@
+/**
+ * Copyright © 2016-2018 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.service.sql;
+
+import org.thingsboard.server.dao.service.BaseRelationCacheTest;
+import org.thingsboard.server.dao.service.DaoSqlTest;
+
+@DaoSqlTest
+public class RelationCacheSqlTest extends BaseRelationCacheTest {
+}
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationServiceSqlTest.java
index e9fefa4..b2410db 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/RelationServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantServiceSqlTest.java
index f2816da..30c2d8a 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/TenantServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/UserServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/UserServiceSqlTest.java
index 4b40857..2e9007c 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/UserServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/UserServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetsBundleServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetsBundleServiceSqlTest.java
index 7d44fa8..79a7e7b 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetsBundleServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetsBundleServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetTypeServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetTypeServiceSqlTest.java
index ec733d6..de2b0e6 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetTypeServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/sql/WidgetTypeServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java
index 9782058..0cb3f7f 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/BaseTimeseriesServiceTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/nosql/TimeseriesServiceNoSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/nosql/TimeseriesServiceNoSqlTest.java
index a5c29aa..018fa83 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/nosql/TimeseriesServiceNoSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/nosql/TimeseriesServiceNoSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/sql/TimeseriesServiceSqlTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/sql/TimeseriesServiceSqlTest.java
index fa13dea..5bbbc32 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/sql/TimeseriesServiceSqlTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/service/timeseries/sql/TimeseriesServiceSqlTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/alarm/JpaAlarmDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/alarm/JpaAlarmDaoTest.java
index 992cbba..b6a7353 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/alarm/JpaAlarmDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/alarm/JpaAlarmDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/asset/JpaAssetDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/asset/JpaAssetDaoTest.java
index 062f0e6..19674f8 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/asset/JpaAssetDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/asset/JpaAssetDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/audit/JpaAuditLogDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/audit/JpaAuditLogDaoTest.java
new file mode 100644
index 0000000..0e53c59
--- /dev/null
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/audit/JpaAuditLogDaoTest.java
@@ -0,0 +1,21 @@
+/**
+ * Copyright © 2016-2018 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.audit;
+
+import org.thingsboard.server.dao.AbstractJpaDaoTest;
+
+public class JpaAuditLogDaoTest extends AbstractJpaDaoTest {
+}
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDaoTest.java
index 38b088d..9874eff 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/component/JpaBaseComponentDescriptorDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/customer/JpaCustomerDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/customer/JpaCustomerDaoTest.java
index 82ceeb8..fd5b70c 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/customer/JpaCustomerDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/customer/JpaCustomerDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardInfoDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardInfoDaoTest.java
index 39bb084..aa80339 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardInfoDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/dashboard/JpaDashboardInfoDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -16,6 +16,7 @@
package org.thingsboard.server.dao.sql.dashboard;
import com.datastax.driver.core.utils.UUIDs;
+import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.thingsboard.server.common.data.DashboardInfo;
@@ -40,53 +41,26 @@ public class JpaDashboardInfoDaoTest extends AbstractJpaDaoTest {
@Test
public void testFindDashboardsByTenantId() {
UUID tenantId1 = UUIDs.timeBased();
- UUID customerId1 = UUIDs.timeBased();
UUID tenantId2 = UUIDs.timeBased();
- UUID customerId2 = UUIDs.timeBased();
for (int i = 0; i < 20; i++) {
- createDashboard(tenantId1, customerId1, i);
- createDashboard(tenantId2, customerId2, i * 2);
+ createDashboard(tenantId1, i);
+ createDashboard(tenantId2, i * 2);
}
TextPageLink pageLink1 = new TextPageLink(15, "DASHBOARD");
List<DashboardInfo> dashboardInfos1 = dashboardInfoDao.findDashboardsByTenantId(tenantId1, pageLink1);
- assertEquals(15, dashboardInfos1.size());
+ Assert.assertEquals(15, dashboardInfos1.size());
TextPageLink pageLink2 = new TextPageLink(15, "DASHBOARD", dashboardInfos1.get(14).getId().getId(), null);
List<DashboardInfo> dashboardInfos2 = dashboardInfoDao.findDashboardsByTenantId(tenantId1, pageLink2);
- assertEquals(5, dashboardInfos2.size());
+ Assert.assertEquals(5, dashboardInfos2.size());
}
- @Test
- public void testFindDashboardsByTenantAndCustomerId() {
- UUID tenantId1 = UUIDs.timeBased();
- UUID customerId1 = UUIDs.timeBased();
- UUID tenantId2 = UUIDs.timeBased();
- UUID customerId2 = UUIDs.timeBased();
-
- for (int i = 0; i < 20; i++) {
- createDashboard(tenantId1, customerId1, i);
- createDashboard(tenantId2, customerId2, i * 2);
- }
-
- TextPageLink pageLink1 = new TextPageLink(15, "DASHBOARD");
- List<DashboardInfo> dashboardInfos1 = dashboardInfoDao.findDashboardsByTenantIdAndCustomerId(tenantId1, customerId1, pageLink1);
- assertEquals(15, dashboardInfos1.size());
-
- TextPageLink pageLink2 = new TextPageLink(15, "DASHBOARD", dashboardInfos1.get(14).getId().getId(), null);
- List<DashboardInfo> dashboardInfos2 = dashboardInfoDao.findDashboardsByTenantIdAndCustomerId(tenantId1, customerId1, pageLink2);
- assertEquals(5, dashboardInfos2.size());
- }
-
- private void assertEquals(int i, int size) {
- }
-
- private void createDashboard(UUID tenantId, UUID customerId, int index) {
+ private void createDashboard(UUID tenantId, int index) {
DashboardInfo dashboardInfo = new DashboardInfo();
dashboardInfo.setId(new DashboardId(UUIDs.timeBased()));
dashboardInfo.setTenantId(new TenantId(tenantId));
- dashboardInfo.setCustomerId(new CustomerId(customerId));
dashboardInfo.setTitle("DASHBOARD_" + index);
dashboardInfoDao.save(dashboardInfo);
}
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/device/JpaDeviceCredentialsDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/device/JpaDeviceCredentialsDaoTest.java
index d13d9db..1ffe2c8 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/device/JpaDeviceCredentialsDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/device/JpaDeviceCredentialsDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/device/JpaDeviceDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/device/JpaDeviceDaoTest.java
index 182e4fe..f0bf47c 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/device/JpaDeviceDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/device/JpaDeviceDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/event/JpaBaseEventDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/event/JpaBaseEventDaoTest.java
index 3c414cd..67841f5 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/event/JpaBaseEventDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/event/JpaBaseEventDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/plugin/JpaBasePluginDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/plugin/JpaBasePluginDaoTest.java
index 8833135..792031d 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/plugin/JpaBasePluginDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/plugin/JpaBasePluginDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/rule/JpaBaseRuleDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/rule/JpaBaseRuleDaoTest.java
index 04bc4c7..16b6965 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/rule/JpaBaseRuleDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/rule/JpaBaseRuleDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDaoTest.java
index 4b3555a..43b87b4 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/tenant/JpaTenantDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/user/JpaUserCredentialsDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/user/JpaUserCredentialsDaoTest.java
index 8c75401..29e0471 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/user/JpaUserCredentialsDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/user/JpaUserCredentialsDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/user/JpaUserDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/user/JpaUserDaoTest.java
index 37407d5..67491a2 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/user/JpaUserDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/user/JpaUserDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/widget/JpaWidgetsBundleDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/widget/JpaWidgetsBundleDaoTest.java
index 1bd4d54..47cf034 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/widget/JpaWidgetsBundleDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/widget/JpaWidgetsBundleDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/sql/widget/JpaWidgetTypeDaoTest.java b/dao/src/test/java/org/thingsboard/server/dao/sql/widget/JpaWidgetTypeDaoTest.java
index 87ce37a..e8beca4 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/sql/widget/JpaWidgetTypeDaoTest.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/sql/widget/JpaWidgetTypeDaoTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/java/org/thingsboard/server/dao/SqlDaoServiceTestSuite.java b/dao/src/test/java/org/thingsboard/server/dao/SqlDaoServiceTestSuite.java
index c0ae494..3f65184 100644
--- a/dao/src/test/java/org/thingsboard/server/dao/SqlDaoServiceTestSuite.java
+++ b/dao/src/test/java/org/thingsboard/server/dao/SqlDaoServiceTestSuite.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/dao/src/test/resources/application-test.properties b/dao/src/test/resources/application-test.properties
index d87a181..42b71f8 100644
--- a/dao/src/test/resources/application-test.properties
+++ b/dao/src/test/resources/application-test.properties
@@ -1,10 +1,30 @@
-cache.enabled=false
-cache.device_credentials.time_to_live=3600
-cache.device_credentials.max_size.size=1000000
-cache.device_credentials.max_size.policy=PER_NODE
-
zk.enabled=false
zk.url=localhost:2181
zk.zk_dir=/thingsboard
-updates.enabled=false
\ No newline at end of file
+updates.enabled=false
+
+audit_log.enabled=true
+audit_log.by_tenant_partitioning=MONTHS
+audit_log.default_query_period=30
+audit_log.sink.type=none
+
+cache.type=caffeine
+#cache.type=redis
+
+caffeine.specs.relations.timeToLiveInMinutes=1440
+caffeine.specs.relations.maxSize=100000
+
+caffeine.specs.deviceCredentials.timeToLiveInMinutes=1440
+caffeine.specs.deviceCredentials.maxSize=100000
+
+caffeine.specs.devices.timeToLiveInMinutes=1440
+caffeine.specs.devices.maxSize=100000
+
+caching.specs.devices.timeToLiveInMinutes=1440
+caching.specs.devices.maxSize=100000
+
+redis.connection.host=localhost
+redis.connection.port=6379
+redis.connection.db=0
+redis.connection.password=
diff --git a/dao/src/test/resources/sql/drop-all-tables.sql b/dao/src/test/resources/sql/drop-all-tables.sql
index 49a3774..dfdc90f 100644
--- a/dao/src/test/resources/sql/drop-all-tables.sql
+++ b/dao/src/test/resources/sql/drop-all-tables.sql
@@ -1,6 +1,7 @@
DROP TABLE IF EXISTS admin_settings;
DROP TABLE IF EXISTS alarm;
DROP TABLE IF EXISTS asset;
+DROP TABLE IF EXISTS audit_log;
DROP TABLE IF EXISTS attribute_kv;
DROP TABLE IF EXISTS component_descriptor;
DROP TABLE IF EXISTS customer;
docker/cassandra/Dockerfile 4(+2 -2)
diff --git a/docker/cassandra/Dockerfile b/docker/cassandra/Dockerfile
index 76812cb..a4e5cc0 100644
--- a/docker/cassandra/Dockerfile
+++ b/docker/cassandra/Dockerfile
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
@@ -14,7 +14,7 @@
# limitations under the License.
#
-FROM cassandra:3.9
+FROM cassandra:3.11.2
ADD ready-probe.sh /ready-probe.sh
docker/cassandra/Makefile 2(+1 -1)
diff --git a/docker/cassandra/Makefile b/docker/cassandra/Makefile
index b581afd..adc9c7e 100644
--- a/docker/cassandra/Makefile
+++ b/docker/cassandra/Makefile
@@ -1,4 +1,4 @@
-VERSION=1.3.1
+VERSION=1.4.0
PROJECT=thingsboard
APP=cassandra
docker/cassandra/ready-probe.sh 2(+1 -1)
diff --git a/docker/cassandra/ready-probe.sh b/docker/cassandra/ready-probe.sh
index 72bd27b..8533b6a 100644
--- a/docker/cassandra/ready-probe.sh
+++ b/docker/cassandra/ready-probe.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
docker/cassandra-setup/Dockerfile 2(+1 -1)
diff --git a/docker/cassandra-setup/Dockerfile b/docker/cassandra-setup/Dockerfile
index f91f0f1..c3f7ddb 100644
--- a/docker/cassandra-setup/Dockerfile
+++ b/docker/cassandra-setup/Dockerfile
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
docker/cassandra-setup/install.sh 2(+1 -1)
diff --git a/docker/cassandra-setup/install.sh b/docker/cassandra-setup/install.sh
index 87aaeed..8578b2e 100755
--- a/docker/cassandra-setup/install.sh
+++ b/docker/cassandra-setup/install.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
docker/cassandra-setup/Makefile 2(+1 -1)
diff --git a/docker/cassandra-setup/Makefile b/docker/cassandra-setup/Makefile
index 12a30a4..fbe3ff9 100644
--- a/docker/cassandra-setup/Makefile
+++ b/docker/cassandra-setup/Makefile
@@ -1,4 +1,4 @@
-VERSION=1.3.1
+VERSION=1.4.0
PROJECT=thingsboard
APP=cassandra-setup
docker/docker-compose.static.yml 2(+1 -1)
diff --git a/docker/docker-compose.static.yml b/docker/docker-compose.static.yml
index 1071a75..4a0688a 100644
--- a/docker/docker-compose.static.yml
+++ b/docker/docker-compose.static.yml
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
docker/docker-compose.yml 8(+4 -4)
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 760dc9f..6662a8f 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
@@ -18,7 +18,7 @@ version: '2'
services:
tb:
- image: "thingsboard/application:1.3.1"
+ image: "thingsboard/application:1.4.0"
ports:
- "8080:8080"
- "1883:1883"
@@ -32,14 +32,14 @@ services:
- "${HSQLDB_DATA_DIR}:/usr/share/thingsboard/data/sql"
entrypoint: /run-application.sh
cassandra:
- image: "cassandra:3.9"
+ image: "cassandra:3.11.2"
ports:
- "9042"
- "9160"
volumes:
- "${CASSANDRA_DATA_DIR}:/var/lib/cassandra"
zk:
- image: "zookeeper:3.4.9"
+ image: "zookeeper:3.4.10"
ports:
- "2181"
restart: always
docker/docker-compose-tests.yml 27(+27 -0)
diff --git a/docker/docker-compose-tests.yml b/docker/docker-compose-tests.yml
new file mode 100644
index 0000000..64868b5
--- /dev/null
+++ b/docker/docker-compose-tests.yml
@@ -0,0 +1,27 @@
+#
+# Copyright © 2016-2018 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.
+#
+
+version: '3.3'
+services:
+ redis:
+ image: redis:4.0
+ networks:
+ - core
+ ports:
+ - "6379:6379"
+
+networks:
+ core:
docker/k8s/cassandra.yaml 4(+2 -2)
diff --git a/docker/k8s/cassandra.yaml b/docker/k8s/cassandra.yaml
index 478df0a..15d0e55 100644
--- a/docker/k8s/cassandra.yaml
+++ b/docker/k8s/cassandra.yaml
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
@@ -54,7 +54,7 @@ spec:
topologyKey: "kubernetes.io/hostname"
containers:
- name: cassandra
- image: thingsboard/cassandra:1.3.1
+ image: thingsboard/cassandra:1.4.0
imagePullPolicy: Always
ports:
- containerPort: 7000
docker/k8s/cassandra-setup.yaml 4(+2 -2)
diff --git a/docker/k8s/cassandra-setup.yaml b/docker/k8s/cassandra-setup.yaml
index 687d0f1..bf50ba9 100644
--- a/docker/k8s/cassandra-setup.yaml
+++ b/docker/k8s/cassandra-setup.yaml
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
@@ -22,7 +22,7 @@ spec:
containers:
- name: cassandra-setup
imagePullPolicy: Always
- image: thingsboard/cassandra-setup:1.3.1
+ image: thingsboard/cassandra-setup:1.4.0
env:
- name: ADD_DEMO_DATA
value: "true"
docker/k8s/common.yaml 2(+1 -1)
diff --git a/docker/k8s/common.yaml b/docker/k8s/common.yaml
index f650118..75a938a 100644
--- a/docker/k8s/common.yaml
+++ b/docker/k8s/common.yaml
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
docker/k8s/tb.yaml 4(+2 -2)
diff --git a/docker/k8s/tb.yaml b/docker/k8s/tb.yaml
index e56b1d1..74b6702 100644
--- a/docker/k8s/tb.yaml
+++ b/docker/k8s/tb.yaml
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
@@ -82,7 +82,7 @@ spec:
containers:
- name: tb
imagePullPolicy: Always
- image: thingsboard/application:1.3.1
+ image: thingsboard/application:1.4.0
ports:
- containerPort: 8080
name: ui
docker/k8s/zookeeper.yaml 4(+2 -2)
diff --git a/docker/k8s/zookeeper.yaml b/docker/k8s/zookeeper.yaml
index eda3a26..bea0833 100644
--- a/docker/k8s/zookeeper.yaml
+++ b/docker/k8s/zookeeper.yaml
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
@@ -87,7 +87,7 @@ spec:
containers:
- name: zk
imagePullPolicy: Always
- image: thingsboard/zk:1.3.1
+ image: thingsboard/zk:1.4.0
ports:
- containerPort: 2181
name: client
docker/tb/Dockerfile 2(+1 -1)
diff --git a/docker/tb/Dockerfile b/docker/tb/Dockerfile
index 993e7f3..8917657 100644
--- a/docker/tb/Dockerfile
+++ b/docker/tb/Dockerfile
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
docker/tb/Makefile 2(+1 -1)
diff --git a/docker/tb/Makefile b/docker/tb/Makefile
index f30f163..05d3f4d 100644
--- a/docker/tb/Makefile
+++ b/docker/tb/Makefile
@@ -1,4 +1,4 @@
-VERSION=1.3.1
+VERSION=1.4.0
PROJECT=thingsboard
APP=application
docker/tb/run-application.sh 2(+1 -1)
diff --git a/docker/tb/run-application.sh b/docker/tb/run-application.sh
index b3a37c2..e297335 100755
--- a/docker/tb/run-application.sh
+++ b/docker/tb/run-application.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
docker/zookeeper/Dockerfile 4(+2 -2)
diff --git a/docker/zookeeper/Dockerfile b/docker/zookeeper/Dockerfile
index 5ec1ac9..38f13fc 100644
--- a/docker/zookeeper/Dockerfile
+++ b/docker/zookeeper/Dockerfile
@@ -1,5 +1,5 @@
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
@@ -22,7 +22,7 @@ ZK_LOG_DIR=/var/log/zookeeper \
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
ARG GPG_KEY=C823E3E5B12AF29C67F81976F5CECB3CB5E9BD2D
-ARG ZK_DIST=zookeeper-3.4.9
+ARG ZK_DIST=zookeeper-3.4.10
RUN set -x \
&& apt-get update \
&& apt-get install -y openjdk-8-jre-headless wget netcat-openbsd \
docker/zookeeper/Makefile 2(+1 -1)
diff --git a/docker/zookeeper/Makefile b/docker/zookeeper/Makefile
index 7b99cf5..3386ff8 100644
--- a/docker/zookeeper/Makefile
+++ b/docker/zookeeper/Makefile
@@ -1,4 +1,4 @@
-VERSION=1.3.1
+VERSION=1.4.0
PROJECT=thingsboard
APP=zk
docker/zookeeper/zk-gen-config.sh 2(+1 -1)
diff --git a/docker/zookeeper/zk-gen-config.sh b/docker/zookeeper/zk-gen-config.sh
index 02fde70..5516f57 100755
--- a/docker/zookeeper/zk-gen-config.sh
+++ b/docker/zookeeper/zk-gen-config.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
docker/zookeeper/zk-ok.sh 2(+1 -1)
diff --git a/docker/zookeeper/zk-ok.sh b/docker/zookeeper/zk-ok.sh
index f2a2d32..9f45db2 100755
--- a/docker/zookeeper/zk-ok.sh
+++ b/docker/zookeeper/zk-ok.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
extensions/extension-kafka/pom.xml 4(+2 -2)
diff --git a/extensions/extension-kafka/pom.xml b/extensions/extension-kafka/pom.xml
index c53fc72..39d5f2b 100644
--- a/extensions/extension-kafka/pom.xml
+++ b/extensions/extension-kafka/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>extensions</artifactId>
</parent>
<groupId>org.thingsboard.extensions</groupId>
diff --git a/extensions/extension-kafka/src/assembly/extension.xml b/extensions/extension-kafka/src/assembly/extension.xml
index b131488..7281dad 100644
--- a/extensions/extension-kafka/src/assembly/extension.xml
+++ b/extensions/extension-kafka/src/assembly/extension.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionMsg.java b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionMsg.java
index 597ed1d..7a89d57 100644
--- a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionMsg.java
+++ b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionPayload.java b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionPayload.java
index 8f00831..e8e3381 100644
--- a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionPayload.java
+++ b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaActionPayload.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginAction.java b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginAction.java
index 1c3599f..aa95fe0 100644
--- a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginAction.java
+++ b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginActionConfiguration.java b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginActionConfiguration.java
index d2c77a8..1863627 100644
--- a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginActionConfiguration.java
+++ b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/action/KafkaPluginActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaMsgHandler.java b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaMsgHandler.java
index 87f890a..3e87507 100644
--- a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaMsgHandler.java
+++ b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPlugin.java b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPlugin.java
index 1eca470..effa47f 100644
--- a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPlugin.java
+++ b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPluginConfiguration.java b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPluginConfiguration.java
index 0d9547c..5d847c9 100644
--- a/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPluginConfiguration.java
+++ b/extensions/extension-kafka/src/main/java/org/thingsboard/server/extensions/kafka/plugin/KafkaPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-kafka/src/test/java/org/thingsboard/server/extensions/kafka/KafkaDemoClient.java b/extensions/extension-kafka/src/test/java/org/thingsboard/server/extensions/kafka/KafkaDemoClient.java
index 7d56d54..1b4c43e 100644
--- a/extensions/extension-kafka/src/test/java/org/thingsboard/server/extensions/kafka/KafkaDemoClient.java
+++ b/extensions/extension-kafka/src/test/java/org/thingsboard/server/extensions/kafka/KafkaDemoClient.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
extensions/extension-mqtt/pom.xml 4(+2 -2)
diff --git a/extensions/extension-mqtt/pom.xml b/extensions/extension-mqtt/pom.xml
index 517fbd3..62c4a7f 100644
--- a/extensions/extension-mqtt/pom.xml
+++ b/extensions/extension-mqtt/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>extensions</artifactId>
</parent>
<groupId>org.thingsboard.extensions</groupId>
diff --git a/extensions/extension-mqtt/src/assembly/extension.xml b/extensions/extension-mqtt/src/assembly/extension.xml
index 1229956..5af1eb4 100644
--- a/extensions/extension-mqtt/src/assembly/extension.xml
+++ b/extensions/extension-mqtt/src/assembly/extension.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionMsg.java b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionMsg.java
index 087696c..9c65e27 100644
--- a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionMsg.java
+++ b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionPayload.java b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionPayload.java
index dcdfdc1..cee3ac3 100644
--- a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionPayload.java
+++ b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttActionPayload.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginAction.java b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginAction.java
index 9077f12..a33fb47 100644
--- a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginAction.java
+++ b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginActionConfiguration.java b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginActionConfiguration.java
index 94deb51..900c5d5 100644
--- a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginActionConfiguration.java
+++ b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/action/MqttPluginActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttMsgHandler.java b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttMsgHandler.java
index 08e5059..e6ac32a 100644
--- a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttMsgHandler.java
+++ b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPlugin.java b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPlugin.java
index 206ef5f..40d91f7 100644
--- a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPlugin.java
+++ b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPluginConfiguration.java b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPluginConfiguration.java
index 4d50877..3918e6f 100644
--- a/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPluginConfiguration.java
+++ b/extensions/extension-mqtt/src/main/java/org/thingsboard/server/extensions/mqtt/plugin/MqttPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/pom.xml b/extensions/extension-rabbitmq/pom.xml
index 9f95670..0a31fc5 100644
--- a/extensions/extension-rabbitmq/pom.xml
+++ b/extensions/extension-rabbitmq/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>extensions</artifactId>
</parent>
<groupId>org.thingsboard.extensions</groupId>
diff --git a/extensions/extension-rabbitmq/src/assembly/extension.xml b/extensions/extension-rabbitmq/src/assembly/extension.xml
index 1229956..5af1eb4 100644
--- a/extensions/extension-rabbitmq/src/assembly/extension.xml
+++ b/extensions/extension-rabbitmq/src/assembly/extension.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionMsg.java b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionMsg.java
index 2afb0f0..bb932c8 100644
--- a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionMsg.java
+++ b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionPayload.java b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionPayload.java
index 28e6af6..9484673 100644
--- a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionPayload.java
+++ b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqActionPayload.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginAction.java b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginAction.java
index c194c67..90c6679 100644
--- a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginAction.java
+++ b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginActionConfiguration.java b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginActionConfiguration.java
index d639350..0a8c680 100644
--- a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginActionConfiguration.java
+++ b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/action/RabbitMqPluginActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqMsgHandler.java b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqMsgHandler.java
index 714812f..764dd0d 100644
--- a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqMsgHandler.java
+++ b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPlugin.java b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPlugin.java
index a0aecee..354c522 100644
--- a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPlugin.java
+++ b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPluginConfiguration.java b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPluginConfiguration.java
index d07bf3c..d98d3dc 100644
--- a/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPluginConfiguration.java
+++ b/extensions/extension-rabbitmq/src/main/java/org/thingsboard/server/extensions/rabbitmq/plugin/RabbitMqPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rabbitmq/src/test/java/org/thingsboard/server/extensions/rabbitmq/RabbitMqDemoClient.java b/extensions/extension-rabbitmq/src/test/java/org/thingsboard/server/extensions/rabbitmq/RabbitMqDemoClient.java
index 0319dde..4e829ae 100644
--- a/extensions/extension-rabbitmq/src/test/java/org/thingsboard/server/extensions/rabbitmq/RabbitMqDemoClient.java
+++ b/extensions/extension-rabbitmq/src/test/java/org/thingsboard/server/extensions/rabbitmq/RabbitMqDemoClient.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/pom.xml b/extensions/extension-rest-api-call/pom.xml
index a7872b8..e09a163 100644
--- a/extensions/extension-rest-api-call/pom.xml
+++ b/extensions/extension-rest-api-call/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -22,7 +22,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>extensions</artifactId>
</parent>
<groupId>org.thingsboard.extensions</groupId>
diff --git a/extensions/extension-rest-api-call/src/assembly/extension.xml b/extensions/extension-rest-api-call/src/assembly/extension.xml
index 1229956..5af1eb4 100644
--- a/extensions/extension-rest-api-call/src/assembly/extension.xml
+++ b/extensions/extension-rest-api-call/src/assembly/extension.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionMsg.java b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionMsg.java
index bf50eb7..c66d9fc 100644
--- a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionMsg.java
+++ b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionPayload.java b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionPayload.java
index 364bcfa..996ef36 100644
--- a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionPayload.java
+++ b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallActionPayload.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginAction.java b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginAction.java
index f537bad..eec95d1 100644
--- a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginAction.java
+++ b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginActionConfiguration.java b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginActionConfiguration.java
index 664fe82..2d67db9 100644
--- a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginActionConfiguration.java
+++ b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/action/RestApiCallPluginActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallMsgHandler.java b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallMsgHandler.java
index c0acf9b..bc7cc71 100644
--- a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallMsgHandler.java
+++ b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPlugin.java b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPlugin.java
index 53ab848..96a68d2 100644
--- a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPlugin.java
+++ b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPluginConfiguration.java b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPluginConfiguration.java
index c504972..608ca1c 100644
--- a/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPluginConfiguration.java
+++ b/extensions/extension-rest-api-call/src/main/java/org/thingsboard/server/extensions/rest/plugin/RestApiCallPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-rest-api-call/src/test/java/org/thingsboard/server/extensions/rest/RestApiCallDemoClient.java b/extensions/extension-rest-api-call/src/test/java/org/thingsboard/server/extensions/rest/RestApiCallDemoClient.java
index ed1d576..c54e047 100644
--- a/extensions/extension-rest-api-call/src/test/java/org/thingsboard/server/extensions/rest/RestApiCallDemoClient.java
+++ b/extensions/extension-rest-api-call/src/test/java/org/thingsboard/server/extensions/rest/RestApiCallDemoClient.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
extensions/extension-sns/pom.xml 4(+2 -2)
diff --git a/extensions/extension-sns/pom.xml b/extensions/extension-sns/pom.xml
index ae31773..dac1e17 100644
--- a/extensions/extension-sns/pom.xml
+++ b/extensions/extension-sns/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -22,7 +22,7 @@
<parent>
<artifactId>extensions</artifactId>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.thingsboard.extensions</groupId>
diff --git a/extensions/extension-sns/src/assembly/extension.xml b/extensions/extension-sns/src/assembly/extension.xml
index 2395d55..7179d37 100644
--- a/extensions/extension-sns/src/assembly/extension.xml
+++ b/extensions/extension-sns/src/assembly/extension.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionMsg.java b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionMsg.java
index b64a22b..4ed123b 100644
--- a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionMsg.java
+++ b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionPayload.java b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionPayload.java
index a1bf89a..afc0c45 100644
--- a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionPayload.java
+++ b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicActionPayload.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginAction.java b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginAction.java
index 79de23a..13add7d 100644
--- a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginAction.java
+++ b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginActionConfiguration.java b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginActionConfiguration.java
index 468c3dd..27e545e 100644
--- a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginActionConfiguration.java
+++ b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/action/SnsTopicPluginActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsMessageHandler.java b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsMessageHandler.java
index c7fd99c..d84208a 100644
--- a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsMessageHandler.java
+++ b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsMessageHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPlugin.java b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPlugin.java
index 86f5de0..7862ae7 100644
--- a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPlugin.java
+++ b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPluginConfiguration.java b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPluginConfiguration.java
index dee78f3..3c4e4b0 100644
--- a/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPluginConfiguration.java
+++ b/extensions/extension-sns/src/main/java/org/thingsboard/server/extensions/sns/plugin/SnsPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
extensions/extension-sqs/pom.xml 4(+2 -2)
diff --git a/extensions/extension-sqs/pom.xml b/extensions/extension-sqs/pom.xml
index 7f3818d..3fdd820 100644
--- a/extensions/extension-sqs/pom.xml
+++ b/extensions/extension-sqs/pom.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -22,7 +22,7 @@
<parent>
<artifactId>extensions</artifactId>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.thingsboard.extensions</groupId>
diff --git a/extensions/extension-sqs/src/assembly/extension.xml b/extensions/extension-sqs/src/assembly/extension.xml
index 2395d55..7179d37 100644
--- a/extensions/extension-sqs/src/assembly/extension.xml
+++ b/extensions/extension-sqs/src/assembly/extension.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionMsg.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionMsg.java
index c465063..d5e7f98 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionMsg.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionPayload.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionPayload.java
index 692cd90..6c1b40c 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionPayload.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueueActionPayload.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginAction.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginAction.java
index f107ea1..e834c6d 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginAction.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginActionConfiguration.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginActionConfiguration.java
index d100325..fada971 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginActionConfiguration.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/fifo/SqsFifoQueuePluginActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionMsg.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionMsg.java
index 6666b27..60c5638 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionMsg.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionPayload.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionPayload.java
index ce3dd27..3e35562 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionPayload.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueueActionPayload.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginAction.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginAction.java
index 1dd9d56..232e263 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginAction.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginActionConfiguration.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginActionConfiguration.java
index 5c21ef5..ce41708 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginActionConfiguration.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/action/standard/SqsStandardQueuePluginActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsMessageHandler.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsMessageHandler.java
index b71e0b1..d049b57 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsMessageHandler.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsMessageHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPlugin.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPlugin.java
index 3f0252e..9d76255 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPlugin.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPluginConfiguration.java b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPluginConfiguration.java
index a93b7f3..a73c6a0 100644
--- a/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPluginConfiguration.java
+++ b/extensions/extension-sqs/src/main/java/org/thingsboard/server/extensions/sqs/plugin/SqsPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions/extension-sqs/src/test/java/org/thingsboard/server/extensions/sqs/SqsDemoClient.java b/extensions/extension-sqs/src/test/java/org/thingsboard/server/extensions/sqs/SqsDemoClient.java
index 17c9b08..1394c4d 100644
--- a/extensions/extension-sqs/src/test/java/org/thingsboard/server/extensions/sqs/SqsDemoClient.java
+++ b/extensions/extension-sqs/src/test/java/org/thingsboard/server/extensions/sqs/SqsDemoClient.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
extensions/pom.xml 4(+2 -2)
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 50dca83..b8406d5 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
extensions-api/pom.xml 4(+2 -2)
diff --git a/extensions-api/pom.xml b/extensions-api/pom.xml
index 298da9a..49f9973 100644
--- a/extensions-api/pom.xml
+++ b/extensions-api/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Action.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Action.java
index 8e6930b..5f7577f 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Action.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Action.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/ConfigurableComponent.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/ConfigurableComponent.java
index aab9b74..14aa025 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/ConfigurableComponent.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/ConfigurableComponent.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/EmptyComponentConfiguration.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/EmptyComponentConfiguration.java
index 597f450..75f92f0 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/EmptyComponentConfiguration.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/EmptyComponentConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Filter.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Filter.java
index f5fd0c1..aaf7456 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Filter.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Filter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Plugin.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Plugin.java
index 328ff72..0f91354 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Plugin.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Plugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Processor.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Processor.java
index 132701a..32a958f 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Processor.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/component/Processor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configurable.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configurable.java
index 8dffc80..87b148d 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configurable.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configurable.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configuration.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configuration.java
index d2ef8d4..efaec93 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configuration.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/Configuration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/ConfigurationValidationException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/ConfigurationValidationException.java
index 2074cd8..48eb253 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/ConfigurationValidationException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/configuration/ConfigurationValidationException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributes.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributes.java
index 2cfeefb..8a03dec 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributes.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributes.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributesEventNotificationMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributesEventNotificationMsg.java
index f25f4f8..2fcf559 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributesEventNotificationMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceAttributesEventNotificationMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceCredentialsUpdateNotificationMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceCredentialsUpdateNotificationMsg.java
index a375acc..937018e 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceCredentialsUpdateNotificationMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceCredentialsUpdateNotificationMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceMetaData.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceMetaData.java
index 8e8ae1b..f6b48a7 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceMetaData.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceMetaData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceNameOrTypeUpdateMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceNameOrTypeUpdateMsg.java
index aab48f4..9083190 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceNameOrTypeUpdateMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/DeviceNameOrTypeUpdateMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/ToDeviceActorNotificationMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/ToDeviceActorNotificationMsg.java
index 94e3e7f..892d53e 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/ToDeviceActorNotificationMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/device/ToDeviceActorNotificationMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/AccessDeniedException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/AccessDeniedException.java
index e94a3e5..923ca82 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/AccessDeniedException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/AccessDeniedException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/EntityNotFoundException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/EntityNotFoundException.java
index afa2aa7..3fc9f51 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/EntityNotFoundException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/EntityNotFoundException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InternalErrorException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InternalErrorException.java
index 1f421a1..25fa28e 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InternalErrorException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InternalErrorException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InvalidParametersException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InvalidParametersException.java
index 8538703..3c7d227 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InvalidParametersException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/InvalidParametersException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/ToErrorResponseEntity.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/ToErrorResponseEntity.java
index 5507bf9..0d3345b 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/ToErrorResponseEntity.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/ToErrorResponseEntity.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UnauthorizedException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UnauthorizedException.java
index f83cfa3..c23b36d 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UnauthorizedException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UnauthorizedException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UncheckedApiException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UncheckedApiException.java
index 4c5c697..c594eb9 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UncheckedApiException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/exception/UncheckedApiException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/AbstractPlugin.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/AbstractPlugin.java
index 3f76339..34f4ce7 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/AbstractPlugin.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/AbstractPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRestMsgHandler.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRestMsgHandler.java
index 4360ad6..dec50e4 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRestMsgHandler.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRestMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRpcMsgHandler.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRpcMsgHandler.java
index 94146dd..949fd02 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRpcMsgHandler.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRpcMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRuleMsgHandler.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRuleMsgHandler.java
index 2b6e9f5..27b476d 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRuleMsgHandler.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultRuleMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultWebsocketMsgHandler.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultWebsocketMsgHandler.java
index 62558b6..53bb31a 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultWebsocketMsgHandler.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/DefaultWebsocketMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RestMsgHandler.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RestMsgHandler.java
index bddb4b2..19dde6c 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RestMsgHandler.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RestMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RpcMsgHandler.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RpcMsgHandler.java
index bf78d6a..8875209 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RpcMsgHandler.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RpcMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RuleMsgHandler.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RuleMsgHandler.java
index 2579416..7357578 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RuleMsgHandler.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/RuleMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/WebsocketMsgHandler.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/WebsocketMsgHandler.java
index e26a0a7..efda4e9 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/WebsocketMsgHandler.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/handlers/WebsocketMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractPluginToRuleMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractPluginToRuleMsg.java
index 271cd49..39275c8 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractPluginToRuleMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractPluginToRuleMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractRuleToPluginMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractRuleToPluginMsg.java
index 8586045..d246315 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractRuleToPluginMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/AbstractRuleToPluginMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/FromDeviceRpcResponse.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/FromDeviceRpcResponse.java
index 364dda6..6ca00d2 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/FromDeviceRpcResponse.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/FromDeviceRpcResponse.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetAttributesRequestRuleToPluginMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetAttributesRequestRuleToPluginMsg.java
index cd87508..566cc79 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetAttributesRequestRuleToPluginMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetAttributesRequestRuleToPluginMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetRequestRuleToPluginMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetRequestRuleToPluginMsg.java
index 565486b..f6ea021 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetRequestRuleToPluginMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/GetRequestRuleToPluginMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/PluginToRuleMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/PluginToRuleMsg.java
index a9b78b2..7871ea3 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/PluginToRuleMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/PluginToRuleMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ResponsePluginToRuleMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ResponsePluginToRuleMsg.java
index 45042cd..22491c8 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ResponsePluginToRuleMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ResponsePluginToRuleMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcError.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcError.java
index 7937059..e4a4655 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcError.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcError.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcRequestRuleToPluginMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcRequestRuleToPluginMsg.java
index e41c083..17b42a4 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcRequestRuleToPluginMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcRequestRuleToPluginMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcResponsePluginToRuleMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcResponsePluginToRuleMsg.java
index 9a9edd6..0d6526e 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcResponsePluginToRuleMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RpcResponsePluginToRuleMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RuleToPluginMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RuleToPluginMsg.java
index 9ef3e7b..c4e7465 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RuleToPluginMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/RuleToPluginMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TelemetryUploadRequestRuleToPluginMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TelemetryUploadRequestRuleToPluginMsg.java
index df5c900..6d560f1 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TelemetryUploadRequestRuleToPluginMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TelemetryUploadRequestRuleToPluginMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutIntMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutIntMsg.java
index 0de7b87..e25d5d7 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutIntMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutIntMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutMsg.java
index 9a76b53..03b2cd7 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutUUIDMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutUUIDMsg.java
index e4ba5a6..d6a697e 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutUUIDMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/TimeoutUUIDMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequest.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequest.java
index f9269de..a303b69 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequest.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -18,6 +18,7 @@ package org.thingsboard.server.extensions.api.plugins.msg;
import lombok.Data;
import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.TenantId;
+import org.thingsboard.server.extensions.api.plugins.PluginApiCallSecurityContext;
import java.io.Serializable;
import java.util.UUID;
@@ -28,6 +29,7 @@ import java.util.UUID;
@Data
public class ToDeviceRpcRequest implements Serializable {
private final UUID id;
+ private final PluginApiCallSecurityContext securityCtx;
private final TenantId tenantId;
private final DeviceId deviceId;
private final boolean oneway;
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestBody.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestBody.java
index 5735a5f..b650336 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestBody.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestBody.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestPluginMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestPluginMsg.java
index b9142aa..faf1696 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestPluginMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToDeviceRpcRequestPluginMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginActorMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginActorMsg.java
index 7301950..32804d4 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginActorMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginActorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginRpcResponseDeviceMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginRpcResponseDeviceMsg.java
index f65b6a7..1122bad 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginRpcResponseDeviceMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/ToPluginRpcResponseDeviceMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/UpdateAttributesRequestRuleToPluginMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/UpdateAttributesRequestRuleToPluginMsg.java
index f12b90d..991ad8d 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/UpdateAttributesRequestRuleToPluginMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/msg/UpdateAttributesRequestRuleToPluginMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/Plugin.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/Plugin.java
index 934c71e..a41f3c1 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/Plugin.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/Plugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginAction.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginAction.java
index c2ab092..3c19571 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginAction.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginApiCallSecurityContext.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginApiCallSecurityContext.java
index 32600d3..2bbc261 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginApiCallSecurityContext.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginApiCallSecurityContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,10 +15,7 @@
*/
package org.thingsboard.server.extensions.api.plugins;
-import org.thingsboard.server.common.data.id.CustomerId;
-import org.thingsboard.server.common.data.id.EntityId;
-import org.thingsboard.server.common.data.id.PluginId;
-import org.thingsboard.server.common.data.id.TenantId;
+import org.thingsboard.server.common.data.id.*;
import java.io.Serializable;
@@ -30,13 +27,18 @@ public final class PluginApiCallSecurityContext implements Serializable {
private final PluginId pluginId;
private final TenantId tenantId;
private final CustomerId customerId;
+ private final UserId userId;
+ private final String userName;
- public PluginApiCallSecurityContext(TenantId pluginTenantId, PluginId pluginId, TenantId tenantId, CustomerId customerId) {
+ public PluginApiCallSecurityContext(TenantId pluginTenantId, PluginId pluginId, TenantId tenantId, CustomerId customerId,
+ UserId userId, String userName) {
super();
this.pluginTenantId = pluginTenantId;
this.pluginId = pluginId;
this.tenantId = tenantId;
this.customerId = customerId;
+ this.userId = userId;
+ this.userName = userName;
}
public TenantId getPluginTenantId(){
@@ -67,4 +69,12 @@ public final class PluginApiCallSecurityContext implements Serializable {
return customerId;
}
+ public UserId getUserId() {
+ return userId;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
}
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginCallback.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginCallback.java
index 2db56c8..413e36b 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginCallback.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginCallback.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginConstants.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginConstants.java
index 5a89aec..ac9600a 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginConstants.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginConstants.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginContext.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginContext.java
index c825594..37f4c4a 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginContext.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -24,9 +24,7 @@ import org.thingsboard.server.common.data.kv.TsKvQuery;
import org.thingsboard.server.common.data.relation.EntityRelation;
import org.thingsboard.server.common.data.relation.RelationTypeGroup;
import org.thingsboard.server.common.msg.cluster.ServerAddress;
-import org.thingsboard.server.extensions.api.plugins.msg.PluginToRuleMsg;
-import org.thingsboard.server.extensions.api.plugins.msg.TimeoutMsg;
-import org.thingsboard.server.extensions.api.plugins.msg.ToDeviceRpcRequest;
+import org.thingsboard.server.extensions.api.plugins.msg.*;
import org.thingsboard.server.extensions.api.plugins.rpc.RpcMsg;
import org.thingsboard.server.extensions.api.plugins.ws.PluginWebsocketSessionRef;
import org.thingsboard.server.extensions.api.plugins.ws.msg.PluginWebsocketMsg;
@@ -60,6 +58,7 @@ public interface PluginContext {
void scheduleTimeoutMsg(TimeoutMsg<?> timeoutMsg);
+ void logRpcRequest(PluginApiCallSecurityContext ctx, DeviceId deviceId, ToDeviceRpcRequestBody body, boolean oneWay, Optional<RpcError> rpcError, Exception e);
/*
Websocket API
@@ -96,6 +95,12 @@ public interface PluginContext {
Attributes API
*/
+ void logAttributesUpdated(PluginApiCallSecurityContext ctx, EntityId entityId, String attributeType, List<AttributeKvEntry> attributes, Exception e);
+
+ void logAttributesDeleted(PluginApiCallSecurityContext ctx, EntityId entityId, String attributeType, List<String> keys, Exception e);
+
+ void logAttributesRead(PluginApiCallSecurityContext ctx, EntityId entityId, String attributeType, List<String> keys, Exception e);
+
void saveAttributes(TenantId tenantId, EntityId entityId, String attributeType, List<AttributeKvEntry> attributes, PluginCallback<Void> callback);
void removeAttributes(TenantId tenantId, EntityId entityId, String scope, List<String> attributeKeys, PluginCallback<Void> callback);
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginException.java
index df8e533..a7856f7 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginInitializationException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginInitializationException.java
index 909bb2f..cbae159 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginInitializationException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/PluginInitializationException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/BasicPluginRestMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/BasicPluginRestMsg.java
index 76fcf6b..5619ebe 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/BasicPluginRestMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/BasicPluginRestMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/PluginRestMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/PluginRestMsg.java
index 71aa090..07c8245 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/PluginRestMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/PluginRestMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/RestRequest.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/RestRequest.java
index e11967d..8807c85 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/RestRequest.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rest/RestRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/PluginRpcMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/PluginRpcMsg.java
index c00c89a..ed5e5b2 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/PluginRpcMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/PluginRpcMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/RpcMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/RpcMsg.java
index 5b5e118..91abaae 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/RpcMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/rpc/RpcMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/BasicPluginWebsocketSessionRef.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/BasicPluginWebsocketSessionRef.java
index c5a63c6..a3247a8 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/BasicPluginWebsocketSessionRef.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/BasicPluginWebsocketSessionRef.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/AbstractPluginWebSocketMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/AbstractPluginWebSocketMsg.java
index a50ffab..dbcd731 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/AbstractPluginWebSocketMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/AbstractPluginWebSocketMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/BinaryPluginWebSocketMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/BinaryPluginWebSocketMsg.java
index 021511d..c5969aa 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/BinaryPluginWebSocketMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/BinaryPluginWebSocketMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/EmptyPluginWebsocketMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/EmptyPluginWebsocketMsg.java
index 04a6f57..1545663 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/EmptyPluginWebsocketMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/EmptyPluginWebsocketMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PingPluginWebsocketMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PingPluginWebsocketMsg.java
index de66851..3e521f8 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PingPluginWebsocketMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PingPluginWebsocketMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PluginWebsocketMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PluginWebsocketMsg.java
index e367312..b07ad8c 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PluginWebsocketMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PluginWebsocketMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PongPluginWebsocketMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PongPluginWebsocketMsg.java
index 6f2f3e8..3c7e978 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PongPluginWebsocketMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/PongPluginWebsocketMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/SessionEventPluginWebSocketMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/SessionEventPluginWebSocketMsg.java
index d97c757..c3e23c8 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/SessionEventPluginWebSocketMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/SessionEventPluginWebSocketMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/TextPluginWebSocketMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/TextPluginWebSocketMsg.java
index c4bebbd..1111f1f 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/TextPluginWebSocketMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/msg/TextPluginWebSocketMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/PluginWebsocketSessionRef.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/PluginWebsocketSessionRef.java
index 0efdd90..0871612 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/PluginWebsocketSessionRef.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/PluginWebsocketSessionRef.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/SessionEvent.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/SessionEvent.java
index 0d685ba..928dd91 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/SessionEvent.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/SessionEvent.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/WsSessionMetaData.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/WsSessionMetaData.java
index 09e9121..28d108c 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/WsSessionMetaData.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/plugins/ws/WsSessionMetaData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleContext.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleContext.java
index 6b381be..378cb2b 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleContext.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleContext.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleException.java
index 994fcc5..b1b82be 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleFilter.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleFilter.java
index c8622b7..9489a53 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleFilter.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleInitializationException.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleInitializationException.java
index 34c7cd4..c12f90f 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleInitializationException.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleInitializationException.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleLifecycleComponent.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleLifecycleComponent.java
index e1d6f2f..0ab96ef 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleLifecycleComponent.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleLifecycleComponent.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessingMetaData.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessingMetaData.java
index 3c8f0e2..03cf9c8 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessingMetaData.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessingMetaData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessor.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessor.java
index 1e4fbf2..3fd5e96 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessor.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/RuleProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/SimpleRuleLifecycleComponent.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/SimpleRuleLifecycleComponent.java
index 7cb20f5..bea04b0 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/SimpleRuleLifecycleComponent.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/SimpleRuleLifecycleComponent.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/ToRuleActorMsg.java b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/ToRuleActorMsg.java
index 2d50314..5dd386c 100644
--- a/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/ToRuleActorMsg.java
+++ b/extensions-api/src/main/java/org/thingsboard/server/extensions/api/rules/ToRuleActorMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
extensions-core/pom.xml 4(+2 -2)
diff --git a/extensions-core/pom.xml b/extensions-core/pom.xml
index 14f91a1..da8ff0f 100644
--- a/extensions-core/pom.xml
+++ b/extensions-core/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailAction.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailAction.java
index 0f3bacd..f765a12 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailAction.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionConfiguration.java
index ec54f57..2b27275 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionMsg.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionMsg.java
index c829d42..8ef30a5 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionMsg.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailRuleToPluginActionMsg.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailRuleToPluginActionMsg.java
index 98f84e3..eced02a 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailRuleToPluginActionMsg.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/mail/SendMailRuleToPluginActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/RpcPluginAction.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/RpcPluginAction.java
index e3f9bba..b195982 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/RpcPluginAction.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/RpcPluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallAction.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallAction.java
index 36a438f..80c8efb 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallAction.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionConfiguration.java
index 49f217e..c7cd0c8 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionMsg.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionMsg.java
index f11e12b..13cf126 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionMsg.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallRuleToPluginActionMsg.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallRuleToPluginActionMsg.java
index bc248e5..a5389a7 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallRuleToPluginActionMsg.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/rpc/ServerSideRpcCallRuleToPluginActionMsg.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginAction.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginAction.java
index 24dfd54..b36aced 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginAction.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginActionConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginActionConfiguration.java
index 896481e..b3aabce 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginActionConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/telemetry/TelemetryPluginActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/AbstractTemplatePluginAction.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/AbstractTemplatePluginAction.java
index 57fdcd3..6d7f75a 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/AbstractTemplatePluginAction.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/AbstractTemplatePluginAction.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/TemplateActionConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/TemplateActionConfiguration.java
index ae9db3b..c43c3ec 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/TemplateActionConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/action/template/TemplateActionConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/BasicJsFilter.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/BasicJsFilter.java
index 8e99807..9c092da 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/BasicJsFilter.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/BasicJsFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilter.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilter.java
index 7dbe6b1..db7f8c2 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilter.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterConfiguration.java
index 68b881a..76fcef1 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTelemetryFilter.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTelemetryFilter.java
index d16258e..cd8f87c 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTelemetryFilter.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTelemetryFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilter.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilter.java
index 8dbd430..eb00762 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilter.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilterConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilterConfiguration.java
index 7906126..5f5eb67 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilterConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/DeviceTypeFilterConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/JsFilterConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/JsFilterConfiguration.java
index 1ebb0ed..85a92aa 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/JsFilterConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/JsFilterConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilter.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilter.java
index df16935..e5672b8 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilter.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilterConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilterConfiguration.java
index df571a9..a018af1 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilterConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MethodNameFilterConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilter.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilter.java
index 741cb31..ef0094e 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilter.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilter.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilterConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilterConfiguration.java
index 54fd6f5..ea71373 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilterConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/MsgTypeFilterConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/NashornJsEvaluator.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/NashornJsEvaluator.java
index 5d4f3d5..20cb397 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/NashornJsEvaluator.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/filter/NashornJsEvaluator.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/KeyValuePluginProperties.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/KeyValuePluginProperties.java
index cc0f394..443c306 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/KeyValuePluginProperties.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/KeyValuePluginProperties.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPlugin.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPlugin.java
index d0c3490..2477f8f 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPlugin.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -108,12 +108,12 @@ public class MailPlugin extends AbstractPlugin<MailPluginConfiguration> implemen
MimeMessage mailMsg = mailSender.createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(mailMsg, "UTF-8");
helper.setFrom(msg.getFrom());
- helper.setTo(msg.getTo());
+ helper.setTo(msg.getTo().split("\\s*,\\s*"));
if (!StringUtils.isEmpty(msg.getCc())) {
- helper.setCc(msg.getCc());
+ helper.setCc(msg.getCc().split("\\s*,\\s*"));
}
if (!StringUtils.isEmpty(msg.getBcc())) {
- helper.setBcc(msg.getBcc());
+ helper.setBcc(msg.getBcc().split("\\s*,\\s*"));
}
helper.setSubject(msg.getSubject());
helper.setText(msg.getBody());
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPluginConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPluginConfiguration.java
index 17b8773..0492130 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPluginConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/mail/MailPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPlugin.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPlugin.java
index 011ccca..6b5d359 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPlugin.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPluginConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPluginConfiguration.java
index 5d6f7c5..3495038 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPluginConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingRuleMsgHandler.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingRuleMsgHandler.java
index 4684337..bd18b8b 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingRuleMsgHandler.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/DeviceMessagingRuleMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -152,7 +152,7 @@ public class DeviceMessagingRuleMsgHandler implements RuleMsgHandler {
pendingMsgs.put(uid, requestMd);
log.trace("[{}] Forwarding {} to [{}]", uid, params, targetDeviceId);
ToDeviceRpcRequestBody requestBody = new ToDeviceRpcRequestBody(ON_MSG_METHOD_NAME, GSON.toJson(params.get("body")));
- ctx.sendRpcRequest(new ToDeviceRpcRequest(uid, targetDevice.getTenantId(), targetDeviceId, oneWay, System.currentTimeMillis() + timeout, requestBody));
+ ctx.sendRpcRequest(new ToDeviceRpcRequest(uid, null, targetDevice.getTenantId(), targetDeviceId, oneWay, System.currentTimeMillis() + timeout, requestBody));
} else {
replyWithError(ctx, requestMd, RpcError.FORBIDDEN);
}
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/PendingRpcRequestMetadata.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/PendingRpcRequestMetadata.java
index fc99f6b..9937ea5 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/PendingRpcRequestMetadata.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/messaging/PendingRpcRequestMetadata.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/cmd/RpcRequest.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/cmd/RpcRequest.java
index 51ed0f8..31a6911 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/cmd/RpcRequest.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/cmd/RpcRequest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRestMsgHandler.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRestMsgHandler.java
index f88b796..b2fbaca 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRestMsgHandler.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRestMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -94,11 +94,12 @@ public class RpcRestMsgHandler extends DefaultRestMsgHandler {
private boolean handleDeviceRPCRequest(PluginContext ctx, final PluginRestMsg msg, TenantId tenantId, DeviceId deviceId, RpcRequest cmd, boolean oneWay) throws JsonProcessingException {
long timeout = System.currentTimeMillis() + (cmd.getTimeout() != null ? cmd.getTimeout() : defaultTimeout);
+ ToDeviceRpcRequestBody body = new ToDeviceRpcRequestBody(cmd.getMethodName(), cmd.getRequestData());
ctx.checkAccess(deviceId, new PluginCallback<Void>() {
@Override
public void onSuccess(PluginContext ctx, Void value) {
- ToDeviceRpcRequestBody body = new ToDeviceRpcRequestBody(cmd.getMethodName(), cmd.getRequestData());
ToDeviceRpcRequest rpcRequest = new ToDeviceRpcRequest(UUID.randomUUID(),
+ msg.getSecurityCtx(),
tenantId,
deviceId,
oneWay,
@@ -116,15 +117,17 @@ public class RpcRestMsgHandler extends DefaultRestMsgHandler {
} else {
response = new ResponseEntity(HttpStatus.UNAUTHORIZED);
}
+ ctx.logRpcRequest(msg.getSecurityCtx(), deviceId, body, oneWay, Optional.empty(), e);
msg.getResponseHolder().setResult(response);
}
});
return true;
}
- public void reply(PluginContext ctx, DeferredResult<ResponseEntity> responseWriter, FromDeviceRpcResponse response) {
+ public void reply(PluginContext ctx, ToDeviceRpcRequest rpcRequest, DeferredResult<ResponseEntity> responseWriter, FromDeviceRpcResponse response) {
Optional<RpcError> rpcError = response.getError();
if (rpcError.isPresent()) {
+ ctx.logRpcRequest(rpcRequest.getSecurityCtx(), rpcRequest.getDeviceId(), rpcRequest.getBody(), rpcRequest.isOneway(), rpcError, null);
RpcError error = rpcError.get();
switch (error) {
case TIMEOUT:
@@ -142,12 +145,15 @@ public class RpcRestMsgHandler extends DefaultRestMsgHandler {
if (responseData.isPresent() && !StringUtils.isEmpty(responseData.get())) {
String data = responseData.get();
try {
+ ctx.logRpcRequest(rpcRequest.getSecurityCtx(), rpcRequest.getDeviceId(), rpcRequest.getBody(), rpcRequest.isOneway(), rpcError, null);
responseWriter.setResult(new ResponseEntity<>(jsonMapper.readTree(data), HttpStatus.OK));
} catch (IOException e) {
log.debug("Failed to decode device response: {}", data, e);
+ ctx.logRpcRequest(rpcRequest.getSecurityCtx(), rpcRequest.getDeviceId(), rpcRequest.getBody(), rpcRequest.isOneway(), rpcError, e);
responseWriter.setResult(new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE));
}
} else {
+ ctx.logRpcRequest(rpcRequest.getSecurityCtx(), rpcRequest.getDeviceId(), rpcRequest.getBody(), rpcRequest.isOneway(), rpcError, null);
responseWriter.setResult(new ResponseEntity<>(HttpStatus.OK));
}
}
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRuleMsgHandler.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRuleMsgHandler.java
index f193c01..b7dd667 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRuleMsgHandler.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/handlers/RpcRuleMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -77,7 +77,7 @@ public class RpcRuleMsgHandler implements RuleMsgHandler {
@Override
public void onSuccess(PluginContext ctx, Void value) {
ctx.sendRpcRequest(new ToDeviceRpcRequest(UUID.randomUUID(),
- tenantId, tmpId, true, expirationTime, body)
+ null, tenantId, tmpId, true, expirationTime, body)
);
log.trace("[{}] Sent RPC Call Action msg", tmpId);
}
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/LocalRequestMetaData.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/LocalRequestMetaData.java
index 3e048b4..67dff86 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/LocalRequestMetaData.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/LocalRequestMetaData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcManager.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcManager.java
index 25f7238..ff41de5 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcManager.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcManager.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -49,7 +49,7 @@ public class RpcManager {
LocalRequestMetaData md = localRpcRequests.remove(requestId);
if (md != null) {
log.trace("[{}] Processing local rpc response from device [{}]", requestId, md.getRequest().getDeviceId());
- restHandler.reply(ctx, md.getResponseWriter(), response);
+ restHandler.reply(ctx, md.getRequest(), md.getResponseWriter(), response);
} else {
log.trace("[{}] Unknown or stale rpc response received [{}]", requestId, response);
}
@@ -62,7 +62,7 @@ public class RpcManager {
LocalRequestMetaData md = localRpcRequests.remove(requestId);
if (md != null) {
log.trace("[{}] Processing rpc timeout for local device [{}]", requestId, md.getRequest().getDeviceId());
- restHandler.reply(ctx, md.getResponseWriter(), timeoutReponse);
+ restHandler.reply(ctx, md.getRequest(), md.getResponseWriter(), timeoutReponse);
}
}
}
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPlugin.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPlugin.java
index aab9648..de8caa1 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPlugin.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPluginConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPluginConfiguration.java
index f303d57..f4c52b9 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPluginConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/rpc/RpcPluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/AttributeData.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/AttributeData.java
index ca827c5..e4b73bc 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/AttributeData.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/AttributeData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/AttributesSubscriptionCmd.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/AttributesSubscriptionCmd.java
index e9888f7..d116b2e 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/AttributesSubscriptionCmd.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/AttributesSubscriptionCmd.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/GetHistoryCmd.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/GetHistoryCmd.java
index 9555dd6..426e434 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/GetHistoryCmd.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/GetHistoryCmd.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/SubscriptionCmd.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/SubscriptionCmd.java
index 0b69b89..b06476a 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/SubscriptionCmd.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/SubscriptionCmd.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmd.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmd.java
index 9cddbc2..84ce795 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmd.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmd.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmdsWrapper.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmdsWrapper.java
index 929c6a2..c065bd9 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmdsWrapper.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TelemetryPluginCmdsWrapper.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TimeseriesSubscriptionCmd.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TimeseriesSubscriptionCmd.java
index 9f3f7ec..4d64ca7 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TimeseriesSubscriptionCmd.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/cmd/TimeseriesSubscriptionCmd.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/BiPluginCallBack.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/BiPluginCallBack.java
index bc5285c..6d16950 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/BiPluginCallBack.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/BiPluginCallBack.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryFeature.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryFeature.java
index d7340c6..b776e05 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryFeature.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryFeature.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRestMsgHandler.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRestMsgHandler.java
index 7e92fc1..3ea754a 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRestMsgHandler.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRestMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -28,6 +28,7 @@ import org.thingsboard.server.common.data.EntityType;
import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.EntityId;
import org.thingsboard.server.common.data.id.EntityIdFactory;
+import org.thingsboard.server.common.data.id.UUIDBased;
import org.thingsboard.server.common.data.kv.*;
import org.thingsboard.server.common.msg.core.TelemetryUploadRequest;
import org.thingsboard.server.common.transport.adaptor.JsonConverter;
@@ -150,18 +151,19 @@ public class TelemetryRestMsgHandler extends DefaultRestMsgHandler {
private void handleHttpGetAttributesValues(PluginContext ctx, PluginRestMsg msg,
RestRequest request, String scope, EntityId entityId) throws ServletException {
String keys = request.getParameter("keys", "");
-
- PluginCallback<List<AttributeKvEntry>> callback = getAttributeValuesPluginCallback(msg);
+ List<String> keyList = null;
+ if (!StringUtils.isEmpty(keys)) {
+ keyList = Arrays.asList(keys.split(","));
+ }
+ PluginCallback<List<AttributeKvEntry>> callback = getAttributeValuesPluginCallback(msg, scope, entityId, keyList);
if (!StringUtils.isEmpty(scope)) {
- if (!StringUtils.isEmpty(keys)) {
- List<String> keyList = Arrays.asList(keys.split(","));
+ if (keyList != null && !keyList.isEmpty()) {
ctx.loadAttributes(entityId, scope, keyList, callback);
} else {
ctx.loadAttributes(entityId, scope, callback);
}
} else {
- if (!StringUtils.isEmpty(keys)) {
- List<String> keyList = Arrays.asList(keys.split(","));
+ if (keyList != null && !keyList.isEmpty()) {
ctx.loadAttributes(entityId, Arrays.asList(DataConstants.allScopes()), keyList, callback);
} else {
ctx.loadAttributes(entityId, Arrays.asList(DataConstants.allScopes()), callback);
@@ -230,9 +232,11 @@ public class TelemetryRestMsgHandler extends DefaultRestMsgHandler {
if (attributes.isEmpty()) {
throw new IllegalArgumentException("No attributes data found in request body!");
}
+
ctx.saveAttributes(ctx.getSecurityCtx().orElseThrow(IllegalArgumentException::new).getTenantId(), entityId, scope, attributes, new PluginCallback<Void>() {
@Override
public void onSuccess(PluginContext ctx, Void value) {
+ ctx.logAttributesUpdated(msg.getSecurityCtx(), entityId, scope, attributes, null);
msg.getResponseHolder().setResult(new ResponseEntity<>(HttpStatus.OK));
subscriptionManager.onAttributesUpdateFromServer(ctx, entityId, scope, attributes);
}
@@ -240,6 +244,7 @@ public class TelemetryRestMsgHandler extends DefaultRestMsgHandler {
@Override
public void onFailure(PluginContext ctx, Exception e) {
log.error("Failed to save attributes", e);
+ ctx.logAttributesUpdated(msg.getSecurityCtx(), entityId, scope, attributes, e);
handleError(e, msg, HttpStatus.BAD_REQUEST);
}
});
@@ -334,15 +339,18 @@ public class TelemetryRestMsgHandler extends DefaultRestMsgHandler {
String keysParam = request.getParameter("keys");
if (!StringUtils.isEmpty(keysParam)) {
String[] keys = keysParam.split(",");
- ctx.removeAttributes(ctx.getSecurityCtx().orElseThrow(IllegalArgumentException::new).getTenantId(), entityId, scope, Arrays.asList(keys), new PluginCallback<Void>() {
+ List<String> keyList = Arrays.asList(keys);
+ ctx.removeAttributes(ctx.getSecurityCtx().orElseThrow(IllegalArgumentException::new).getTenantId(), entityId, scope, keyList, new PluginCallback<Void>() {
@Override
public void onSuccess(PluginContext ctx, Void value) {
+ ctx.logAttributesDeleted(msg.getSecurityCtx(), entityId, scope, keyList, null);
msg.getResponseHolder().setResult(new ResponseEntity<>(HttpStatus.OK));
}
@Override
public void onFailure(PluginContext ctx, Exception e) {
log.error("Failed to remove attributes", e);
+ ctx.logAttributesDeleted(msg.getSecurityCtx(), entityId, scope, keyList, e);
handleError(e, msg, HttpStatus.INTERNAL_SERVER_ERROR);
}
});
@@ -373,18 +381,21 @@ public class TelemetryRestMsgHandler extends DefaultRestMsgHandler {
};
}
- private PluginCallback<List<AttributeKvEntry>> getAttributeValuesPluginCallback(final PluginRestMsg msg) {
+ private PluginCallback<List<AttributeKvEntry>> getAttributeValuesPluginCallback(final PluginRestMsg msg, final String scope,
+ final EntityId entityId, final List<String> keyList) {
return new PluginCallback<List<AttributeKvEntry>>() {
@Override
public void onSuccess(PluginContext ctx, List<AttributeKvEntry> attributes) {
List<AttributeData> values = attributes.stream().map(attribute -> new AttributeData(attribute.getLastUpdateTs(),
attribute.getKey(), attribute.getValue())).collect(Collectors.toList());
+ ctx.logAttributesRead(msg.getSecurityCtx(), entityId, scope, keyList, null);
msg.getResponseHolder().setResult(new ResponseEntity<>(values, HttpStatus.OK));
}
@Override
public void onFailure(PluginContext ctx, Exception e) {
log.error("Failed to fetch attributes", e);
+ ctx.logAttributesRead(msg.getSecurityCtx(), entityId, scope, keyList, e);
handleError(e, msg, HttpStatus.INTERNAL_SERVER_ERROR);
}
};
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRpcMsgHandler.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRpcMsgHandler.java
index ba5d610..c6e7a54 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRpcMsgHandler.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRpcMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -114,7 +114,7 @@ public class TelemetryRpcMsgHandler implements RpcMsgHandler {
}
Map<String, Long> statesMap = proto.getKeyStatesList().stream().collect(Collectors.toMap(SubscriptionKetStateProto::getKey, SubscriptionKetStateProto::getTs));
Subscription subscription = new Subscription(
- new SubscriptionState(proto.getSessionId(), proto.getSubscriptionId(), EntityIdFactory.getByTypeAndId(proto.getEntityType(), proto.getEntityId()), SubscriptionType.valueOf(proto.getType()), proto.getAllKeys(), statesMap),
+ new SubscriptionState(proto.getSessionId(), proto.getSubscriptionId(), EntityIdFactory.getByTypeAndId(proto.getEntityType(), proto.getEntityId()), SubscriptionType.valueOf(proto.getType()), proto.getAllKeys(), statesMap, proto.getScope()),
false, msg.getServerAddress());
subscriptionManager.addRemoteWsSubscription(ctx, msg.getServerAddress(), proto.getSessionId(), subscription);
}
@@ -127,6 +127,7 @@ public class TelemetryRpcMsgHandler implements RpcMsgHandler {
builder.setEntityId(cmd.getEntityId().getId().toString());
builder.setType(cmd.getType().name());
builder.setAllKeys(cmd.isAllKeys());
+ builder.setScope(cmd.getScope());
cmd.getKeyStates().entrySet().forEach(e -> builder.addKeyStates(SubscriptionKetStateProto.newBuilder().setKey(e.getKey()).setTs(e.getValue()).build()));
ctx.sendPluginRpcMsg(new RpcMsg(address, SUBSCRIPTION_CLAZZ, builder.build().toByteArray()));
}
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRuleMsgHandler.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRuleMsgHandler.java
index 4475573..4fdfe4a 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRuleMsgHandler.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryRuleMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryWebsocketMsgHandler.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryWebsocketMsgHandler.java
index 7b0e6d8..1374ef6 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryWebsocketMsgHandler.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/handlers/TelemetryWebsocketMsgHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -131,7 +131,7 @@ public class TelemetryWebsocketMsgHandler extends DefaultWebsocketMsgHandler {
keys.forEach(key -> subState.put(key, 0L));
attributesData.forEach(v -> subState.put(v.getKey(), v.getTs()));
- SubscriptionState sub = new SubscriptionState(sessionId, cmd.getCmdId(), entityId, SubscriptionType.ATTRIBUTES, false, subState);
+ SubscriptionState sub = new SubscriptionState(sessionId, cmd.getCmdId(), entityId, SubscriptionType.ATTRIBUTES, false, subState, cmd.getScope());
subscriptionManager.addLocalWsSubscription(ctx, sessionId, entityId, sub);
}
@@ -168,7 +168,7 @@ public class TelemetryWebsocketMsgHandler extends DefaultWebsocketMsgHandler {
Map<String, Long> subState = new HashMap<>(attributesData.size());
attributesData.forEach(v -> subState.put(v.getKey(), v.getTs()));
- SubscriptionState sub = new SubscriptionState(sessionId, cmd.getCmdId(), entityId, SubscriptionType.ATTRIBUTES, true, subState);
+ SubscriptionState sub = new SubscriptionState(sessionId, cmd.getCmdId(), entityId, SubscriptionType.ATTRIBUTES, true, subState, cmd.getScope());
subscriptionManager.addLocalWsSubscription(ctx, sessionId, entityId, sub);
}
@@ -234,7 +234,7 @@ public class TelemetryWebsocketMsgHandler extends DefaultWebsocketMsgHandler {
sendWsMsg(ctx, sessionRef, new SubscriptionUpdate(cmd.getCmdId(), data));
Map<String, Long> subState = new HashMap<>(data.size());
data.forEach(v -> subState.put(v.getKey(), v.getTs()));
- SubscriptionState sub = new SubscriptionState(sessionId, cmd.getCmdId(), entityId, SubscriptionType.TIMESERIES, true, subState);
+ SubscriptionState sub = new SubscriptionState(sessionId, cmd.getCmdId(), entityId, SubscriptionType.TIMESERIES, true, subState, cmd.getScope());
subscriptionManager.addLocalWsSubscription(ctx, sessionId, entityId, sub);
}
@@ -262,7 +262,7 @@ public class TelemetryWebsocketMsgHandler extends DefaultWebsocketMsgHandler {
Map<String, Long> subState = new HashMap<>(keys.size());
keys.forEach(key -> subState.put(key, startTs));
data.forEach(v -> subState.put(v.getKey(), v.getTs()));
- SubscriptionState sub = new SubscriptionState(sessionId, cmd.getCmdId(), entityId, SubscriptionType.TIMESERIES, false, subState);
+ SubscriptionState sub = new SubscriptionState(sessionId, cmd.getCmdId(), entityId, SubscriptionType.TIMESERIES, false, subState, cmd.getScope());
subscriptionManager.addLocalWsSubscription(ctx, sessionId, entityId, sub);
}
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/Subscription.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/Subscription.java
index 1285cfa..fc04713 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/Subscription.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/Subscription.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -51,6 +51,10 @@ public class Subscription {
return getSub().getType();
}
+ public String getScope() {
+ return getSub().getScope();
+ }
+
public boolean isAllKeys() {
return getSub().isAllKeys();
}
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionErrorCode.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionErrorCode.java
index 99d53ca..b43e807 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionErrorCode.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionErrorCode.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionState.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionState.java
index 5e15fda..c9598ef 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionState.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionState.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -33,6 +33,7 @@ public class SubscriptionState {
@Getter private final SubscriptionType type;
@Getter private final boolean allKeys;
@Getter private final Map<String, Long> keyStates;
+ @Getter private final String scope;
@Override
public boolean equals(Object o) {
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionType.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionType.java
index dc7e0bb..4a3b1e3 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionType.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionType.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionUpdate.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionUpdate.java
index 618ddc7..a9a3a3b 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionUpdate.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/sub/SubscriptionUpdate.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/SubscriptionManager.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/SubscriptionManager.java
index d137e10..ec00677 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/SubscriptionManager.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/SubscriptionManager.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -17,6 +17,7 @@ package org.thingsboard.server.extensions.core.plugin.telemetry;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.StringUtils;
import org.thingsboard.server.common.data.DataConstants;
import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.EntityId;
@@ -33,6 +34,7 @@ import org.thingsboard.server.extensions.core.plugin.telemetry.sub.SubscriptionU
import java.util.*;
import java.util.function.Function;
+import java.util.function.Predicate;
/**
* @author Andrew Shvayka
@@ -174,9 +176,13 @@ public class SubscriptionManager {
}
public void onLocalSubscriptionUpdate(PluginContext ctx, EntityId entityId, SubscriptionType type, Function<Subscription, List<TsKvEntry>> f) {
+ onLocalSubscriptionUpdate(ctx, entityId, s -> type == s.getType(), f);
+ }
+
+ public void onLocalSubscriptionUpdate(PluginContext ctx, EntityId entityId, Predicate<Subscription> filter, Function<Subscription, List<TsKvEntry>> f) {
Set<Subscription> deviceSubscriptions = subscriptionsByEntityId.get(entityId);
if (deviceSubscriptions != null) {
- deviceSubscriptions.stream().filter(s -> type == s.getType()).forEach(s -> {
+ deviceSubscriptions.stream().filter(filter).forEach(s -> {
String sessionId = s.getWsSessionId();
List<TsKvEntry> subscriptionUpdate = f.apply(s);
if (!subscriptionUpdate.isEmpty()) {
@@ -206,7 +212,7 @@ public class SubscriptionManager {
public void onAttributesUpdateFromServer(PluginContext ctx, EntityId entityId, String scope, List<AttributeKvEntry> attributes) {
Optional<ServerAddress> serverAddress = ctx.resolve(entityId);
if (!serverAddress.isPresent()) {
- onLocalSubscriptionUpdate(ctx, entityId, SubscriptionType.ATTRIBUTES, s -> {
+ onLocalSubscriptionUpdate(ctx, entityId, s -> SubscriptionType.ATTRIBUTES == s.getType() && (StringUtils.isEmpty(s.getScope()) || scope.equals(s.getScope())), s -> {
List<TsKvEntry> subscriptionUpdate = new ArrayList<TsKvEntry>();
for (AttributeKvEntry kv : attributes) {
if (s.isAllKeys() || s.getKeyStates().containsKey(kv.getKey())) {
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TelemetryStoragePlugin.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TelemetryStoragePlugin.java
index 91027fe..e3260e1 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TelemetryStoragePlugin.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TelemetryStoragePlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TsData.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TsData.java
index 8e573db..2b48567 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TsData.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/telemetry/TsData.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePlugin.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePlugin.java
index a8c2570..2e23a0b 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePlugin.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePluginConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePluginConfiguration.java
index 962cf84..138e53a 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePluginConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/plugin/time/TimePluginConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessor.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessor.java
index 4a39ee1..f7ad274 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessor.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessorConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessorConfiguration.java
index 850e86d..e638735 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessorConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmDeduplicationProcessorConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessor.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessor.java
index 9e5d5e9..b4e3440 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessor.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessorConfiguration.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessorConfiguration.java
index 8d73dd6..6b80bdb 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessorConfiguration.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/processor/AlarmProcessorConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/utils/VelocityUtils.java b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/utils/VelocityUtils.java
index fa7ad1a..5a45d43 100644
--- a/extensions-core/src/main/java/org/thingsboard/server/extensions/core/utils/VelocityUtils.java
+++ b/extensions-core/src/main/java/org/thingsboard/server/extensions/core/utils/VelocityUtils.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/extensions-core/src/main/proto/telemetry.proto b/extensions-core/src/main/proto/telemetry.proto
index 2bfef59..0ef0031 100644
--- a/extensions-core/src/main/proto/telemetry.proto
+++ b/extensions-core/src/main/proto/telemetry.proto
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -27,6 +27,7 @@ message SubscriptionProto {
string type = 5;
bool allKeys = 6;
repeated SubscriptionKetStateProto keyStates = 7;
+ string scope = 8;
}
message SubscriptionUpdateProto {
diff --git a/extensions-core/src/test/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterTest.java b/extensions-core/src/test/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterTest.java
index ab06ff0..c2421de 100644
--- a/extensions-core/src/test/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterTest.java
+++ b/extensions-core/src/test/java/org/thingsboard/server/extensions/core/filter/DeviceAttributesFilterTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
license-header-template.txt 2(+1 -1)
diff --git a/license-header-template.txt b/license-header-template.txt
index 9da26f0..9d2572a 100644
--- a/license-header-template.txt
+++ b/license-header-template.txt
@@ -1,4 +1,4 @@
-Copyright © ${project.inceptionYear}-2017 ${owner}
+Copyright © ${project.inceptionYear}-2018 ${owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
pom.xml 30(+27 -3)
diff --git a/pom.xml b/pom.xml
index 27e5216..121644a 100755
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.thingsboard</groupId>
<artifactId>thingsboard</artifactId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Thingsboard</name>
@@ -32,6 +32,8 @@
<spring-boot.version>1.4.3.RELEASE</spring-boot.version>
<spring.version>4.3.4.RELEASE</spring.version>
<spring-security.version>4.2.0.RELEASE</spring-security.version>
+ <spring-data-redis.version>1.8.10.RELEASE</spring-data-redis.version>
+ <jedis.version>2.9.0</jedis.version>
<jjwt.version>0.7.0</jjwt.version>
<json-path.version>2.2.0</json-path.version>
<junit.version>4.12</junit.version>
@@ -43,6 +45,7 @@
<cassandra-unit.version>3.0.0.1</cassandra-unit.version>
<takari-cpsuite.version>1.2.7</takari-cpsuite.version>
<guava.version>18.0</guava.version>
+ <caffeine.version>2.6.1</caffeine.version>
<commons-lang3.version>3.4</commons-lang3.version>
<commons-validator.version>1.5.0</commons-validator.version>
<commons-io.version>2.5</commons-io.version>
@@ -61,7 +64,7 @@
<grpc.version>1.0.0</grpc.version>
<lombok.version>1.16.18</lombok.version>
<paho.client.version>1.1.0</paho.client.version>
- <netty.version>4.1.3.Final</netty.version>
+ <netty.version>4.1.22.Final</netty.version>
<os-maven-plugin.version>1.5.0</os-maven-plugin.version>
<rabbitmq.version>3.6.5</rabbitmq.version>
<kafka.version>0.9.0.0</kafka.version>
@@ -77,6 +80,7 @@
<spring-test-dbunit.version>1.2.1</spring-test-dbunit.version>
<postgresql.driver.version>9.4.1211</postgresql.driver.version>
<sonar.exclusions>org/thingsboard/server/gen/**/*, org/thingsboard/server/extensions/core/plugin/telemetry/gen/**/*</sonar.exclusions>
+ <elasticsearch.version>5.0.2</elasticsearch.version>
</properties>
<modules>
@@ -646,6 +650,11 @@
<version>${guava.version}</version>
</dependency>
<dependency>
+ <groupId>com.github.ben-manes.caffeine</groupId>
+ <artifactId>caffeine</artifactId>
+ <version>${caffeine.version}</version>
+ </dependency>
+ <dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>${protobuf.version}</version>
@@ -779,6 +788,16 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.springframework.data</groupId>
+ <artifactId>spring-data-redis</artifactId>
+ <version>${spring-data-redis.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>redis.clients</groupId>
+ <artifactId>jedis</artifactId>
+ <version>${jedis.version}</version>
+ </dependency>
+ <dependency>
<groupId>com.sun.winsw</groupId>
<artifactId>winsw</artifactId>
<version>${winsw.version}</version>
@@ -786,6 +805,11 @@
<type>exe</type>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.elasticsearch.client</groupId>
+ <artifactId>rest</artifactId>
+ <version>${elasticsearch.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
resume.bat 2(+1 -1)
diff --git a/resume.bat b/resume.bat
index c3c0e1d..4bb1595 100644
--- a/resume.bat
+++ b/resume.bat
@@ -1,5 +1,5 @@
@REM
-@REM Copyright © 2016-2017 The Thingsboard Authors
+@REM Copyright © 2016-2018 The Thingsboard Authors
@REM
@REM Licensed under the Apache License, Version 2.0 (the "License");
@REM you may not use this file except in compliance with the License.
tools/pom.xml 4(+2 -2)
diff --git a/tools/pom.xml b/tools/pom.xml
index 5b74b56..112d8f1 100644
--- a/tools/pom.xml
+++ b/tools/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
diff --git a/tools/src/main/java/org/thingsboard/client/tools/MqttSslClient.java b/tools/src/main/java/org/thingsboard/client/tools/MqttSslClient.java
index 7cba5f1..dd27e44 100644
--- a/tools/src/main/java/org/thingsboard/client/tools/MqttSslClient.java
+++ b/tools/src/main/java/org/thingsboard/client/tools/MqttSslClient.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/tools/src/main/java/org/thingsboard/client/tools/RestClient.java b/tools/src/main/java/org/thingsboard/client/tools/RestClient.java
index 0baf1db..4c8c0a4 100644
--- a/tools/src/main/java/org/thingsboard/client/tools/RestClient.java
+++ b/tools/src/main/java/org/thingsboard/client/tools/RestClient.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/tools/src/main/python/mqtt-send-telemetry.py b/tools/src/main/python/mqtt-send-telemetry.py
index 8c4263d..dd6d978 100644
--- a/tools/src/main/python/mqtt-send-telemetry.py
+++ b/tools/src/main/python/mqtt-send-telemetry.py
@@ -1,6 +1,5 @@
-# -*- coding: utf-8 -*-
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/tools/src/main/python/one-way-ssl-mqtt-client.py b/tools/src/main/python/one-way-ssl-mqtt-client.py
index f4e7e1d..213a139 100644
--- a/tools/src/main/python/one-way-ssl-mqtt-client.py
+++ b/tools/src/main/python/one-way-ssl-mqtt-client.py
@@ -1,6 +1,5 @@
-# -*- coding: utf-8 -*-
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/tools/src/main/python/simple-mqtt-client.py b/tools/src/main/python/simple-mqtt-client.py
index 8b21df6..5814ba9 100644
--- a/tools/src/main/python/simple-mqtt-client.py
+++ b/tools/src/main/python/simple-mqtt-client.py
@@ -1,6 +1,5 @@
-# -*- coding: utf-8 -*-
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/tools/src/main/python/two-way-ssl-mqtt-client.py b/tools/src/main/python/two-way-ssl-mqtt-client.py
index 169c0e5..c018aa8 100644
--- a/tools/src/main/python/two-way-ssl-mqtt-client.py
+++ b/tools/src/main/python/two-way-ssl-mqtt-client.py
@@ -1,6 +1,5 @@
-# -*- coding: utf-8 -*-
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/tools/src/main/shell/client.keygen.sh b/tools/src/main/shell/client.keygen.sh
index bb59077..b560933 100755
--- a/tools/src/main/shell/client.keygen.sh
+++ b/tools/src/main/shell/client.keygen.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
diff --git a/tools/src/main/shell/server.keygen.sh b/tools/src/main/shell/server.keygen.sh
index cfa4683..a70169c 100755
--- a/tools/src/main/shell/server.keygen.sh
+++ b/tools/src/main/shell/server.keygen.sh
@@ -1,6 +1,6 @@
#!/bin/bash
#
-# Copyright © 2016-2017 The Thingsboard Authors
+# Copyright © 2016-2018 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.
transport/coap/pom.xml 4(+2 -2)
diff --git a/transport/coap/pom.xml b/transport/coap/pom.xml
index 7212023..52f0357 100644
--- a/transport/coap/pom.xml
+++ b/transport/coap/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>
diff --git a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/CoapTransportAdaptor.java b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/CoapTransportAdaptor.java
index 0f671b5..d9a04b1 100644
--- a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/CoapTransportAdaptor.java
+++ b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/CoapTransportAdaptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/JsonCoapAdaptor.java b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/JsonCoapAdaptor.java
index 6e5805b..e3ef2cc 100644
--- a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/JsonCoapAdaptor.java
+++ b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/adaptors/JsonCoapAdaptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DeviceEmulator.java b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DeviceEmulator.java
index 13506f4..c376d03 100644
--- a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DeviceEmulator.java
+++ b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/client/DeviceEmulator.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportResource.java b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportResource.java
index 834a911..7ba5e36 100644
--- a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportResource.java
+++ b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportResource.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -34,6 +34,7 @@ import org.thingsboard.server.common.msg.session.*;
import org.thingsboard.server.common.transport.SessionMsgProcessor;
import org.thingsboard.server.common.transport.adaptor.AdaptorException;
import org.thingsboard.server.common.transport.auth.DeviceAuthService;
+import org.thingsboard.server.common.transport.quota.QuotaService;
import org.thingsboard.server.transport.coap.adaptors.CoapTransportAdaptor;
import org.thingsboard.server.transport.coap.session.CoapExchangeObserverProxy;
import org.thingsboard.server.transport.coap.session.CoapSessionCtx;
@@ -51,13 +52,16 @@ public class CoapTransportResource extends CoapResource {
private final CoapTransportAdaptor adaptor;
private final SessionMsgProcessor processor;
private final DeviceAuthService authService;
+ private final QuotaService quotaService;
private final Field observerField;
private final long timeout;
- public CoapTransportResource(SessionMsgProcessor processor, DeviceAuthService authService, CoapTransportAdaptor adaptor, String name, long timeout) {
+ public CoapTransportResource(SessionMsgProcessor processor, DeviceAuthService authService, CoapTransportAdaptor adaptor, String name,
+ long timeout, QuotaService quotaService) {
super(name);
this.processor = processor;
this.authService = authService;
+ this.quotaService = quotaService;
this.adaptor = adaptor;
this.timeout = timeout;
// This is important to turn off existing observable logic in
@@ -70,6 +74,12 @@ public class CoapTransportResource extends CoapResource {
@Override
public void handleGET(CoapExchange exchange) {
+ if(quotaService.isQuotaExceeded(exchange.getSourceAddress().getHostAddress())) {
+ log.warn("COAP Quota exceeded for [{}:{}] . Disconnect", exchange.getSourceAddress().getHostAddress(), exchange.getSourcePort());
+ exchange.respond(ResponseCode.BAD_REQUEST);
+ return;
+ }
+
Optional<FeatureType> featureType = getFeatureType(exchange.advanced().getRequest());
if (!featureType.isPresent()) {
log.trace("Missing feature type parameter");
diff --git a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportService.java b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportService.java
index a78c718..15706d4 100644
--- a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportService.java
+++ b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/CoapTransportService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,28 +15,28 @@
*/
package org.thingsboard.server.transport.coap;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-
import lombok.extern.slf4j.Slf4j;
import org.eclipse.californium.core.CoapResource;
import org.eclipse.californium.core.CoapServer;
import org.eclipse.californium.core.network.CoapEndpoint;
-import org.thingsboard.server.common.transport.SessionMsgProcessor;
-import org.thingsboard.server.common.transport.auth.DeviceAuthService;
-import org.thingsboard.server.transport.coap.adaptors.CoapTransportAdaptor;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
+import org.thingsboard.server.common.transport.SessionMsgProcessor;
+import org.thingsboard.server.common.transport.auth.DeviceAuthService;
+import org.thingsboard.server.common.transport.quota.QuotaService;
+import org.thingsboard.server.transport.coap.adaptors.CoapTransportAdaptor;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
@Service("CoapTransportService")
+@ConditionalOnProperty(prefix = "coap", value = "enabled", havingValue = "true", matchIfMissing = true)
@Slf4j
public class CoapTransportService {
@@ -54,6 +54,9 @@ public class CoapTransportService {
@Autowired(required = false)
private DeviceAuthService authService;
+ @Autowired(required = false)
+ private QuotaService quotaService;
+
@Value("${coap.bind_address}")
private String host;
@@ -83,7 +86,7 @@ public class CoapTransportService {
private void createResources() {
CoapResource api = new CoapResource(API);
- api.add(new CoapTransportResource(processor, authService, adaptor, V1, timeout));
+ api.add(new CoapTransportResource(processor, authService, adaptor, V1, timeout, quotaService));
server.add(api);
}
diff --git a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapExchangeObserverProxy.java b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapExchangeObserverProxy.java
index 8911ce4..0c26481 100644
--- a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapExchangeObserverProxy.java
+++ b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapExchangeObserverProxy.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionCtx.java b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionCtx.java
index cecc42d..7a703b2 100644
--- a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionCtx.java
+++ b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionCtx.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionId.java b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionId.java
index 7431c1f..888fb2f 100644
--- a/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionId.java
+++ b/transport/coap/src/main/java/org/thingsboard/server/transport/coap/session/CoapSessionId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTest.java b/transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTest.java
index 706af80..072c735 100644
--- a/transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTest.java
+++ b/transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTest.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -50,6 +50,7 @@ import org.thingsboard.server.common.msg.session.*;
import org.thingsboard.server.common.transport.SessionMsgProcessor;
import org.thingsboard.server.common.transport.auth.DeviceAuthResult;
import org.thingsboard.server.common.transport.auth.DeviceAuthService;
+import org.thingsboard.server.common.transport.quota.QuotaService;
import java.util.ArrayList;
import java.util.List;
@@ -131,6 +132,11 @@ public class CoapServerTest {
}
};
}
+
+ @Bean
+ public static QuotaService quotaService() {
+ return key -> false;
+ }
}
@Autowired
diff --git a/transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTestConfiguration.java b/transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTestConfiguration.java
index cac46c2..f2cd080 100644
--- a/transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTestConfiguration.java
+++ b/transport/coap/src/test/java/org/thingsboard/server/transport/coap/CoapServerTestConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
transport/http/pom.xml 4(+2 -2)
diff --git a/transport/http/pom.xml b/transport/http/pom.xml
index dc5dfa5..63bbbe0 100644
--- a/transport/http/pom.xml
+++ b/transport/http/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>
diff --git a/transport/http/src/main/java/org/thingsboard/server/transport/http/DeviceApiController.java b/transport/http/src/main/java/org/thingsboard/server/transport/http/DeviceApiController.java
index 70767af..4d90b5f 100644
--- a/transport/http/src/main/java/org/thingsboard/server/transport/http/DeviceApiController.java
+++ b/transport/http/src/main/java/org/thingsboard/server/transport/http/DeviceApiController.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -35,10 +35,11 @@ import org.thingsboard.server.common.msg.session.FromDeviceMsg;
import org.thingsboard.server.common.transport.SessionMsgProcessor;
import org.thingsboard.server.common.transport.adaptor.JsonConverter;
import org.thingsboard.server.common.transport.auth.DeviceAuthService;
+import org.thingsboard.server.common.transport.quota.QuotaService;
import org.thingsboard.server.transport.http.session.HttpSessionCtx;
+import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
-import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -59,11 +60,18 @@ public class DeviceApiController {
@Autowired(required = false)
private DeviceAuthService authService;
+ @Autowired(required = false)
+ private QuotaService quotaService;
+
@RequestMapping(value = "/{deviceToken}/attributes", method = RequestMethod.GET, produces = "application/json")
public DeferredResult<ResponseEntity> getDeviceAttributes(@PathVariable("deviceToken") String deviceToken,
@RequestParam(value = "clientKeys", required = false, defaultValue = "") String clientKeys,
- @RequestParam(value = "sharedKeys", required = false, defaultValue = "") String sharedKeys) {
+ @RequestParam(value = "sharedKeys", required = false, defaultValue = "") String sharedKeys,
+ HttpServletRequest httpRequest) {
DeferredResult<ResponseEntity> responseWriter = new DeferredResult<ResponseEntity>();
+ if (quotaExceeded(httpRequest, responseWriter)) {
+ return responseWriter;
+ }
HttpSessionCtx ctx = getHttpSessionCtx(responseWriter);
if (ctx.login(new DeviceTokenCredentials(deviceToken))) {
GetAttributesRequest request;
@@ -84,8 +92,11 @@ public class DeviceApiController {
@RequestMapping(value = "/{deviceToken}/attributes", method = RequestMethod.POST)
public DeferredResult<ResponseEntity> postDeviceAttributes(@PathVariable("deviceToken") String deviceToken,
- @RequestBody String json) {
+ @RequestBody String json, HttpServletRequest request) {
DeferredResult<ResponseEntity> responseWriter = new DeferredResult<ResponseEntity>();
+ if (quotaExceeded(request, responseWriter)) {
+ return responseWriter;
+ }
HttpSessionCtx ctx = getHttpSessionCtx(responseWriter);
if (ctx.login(new DeviceTokenCredentials(deviceToken))) {
try {
@@ -101,8 +112,11 @@ public class DeviceApiController {
@RequestMapping(value = "/{deviceToken}/telemetry", method = RequestMethod.POST)
public DeferredResult<ResponseEntity> postTelemetry(@PathVariable("deviceToken") String deviceToken,
- @RequestBody String json) {
+ @RequestBody String json, HttpServletRequest request) {
DeferredResult<ResponseEntity> responseWriter = new DeferredResult<ResponseEntity>();
+ if (quotaExceeded(request, responseWriter)) {
+ return responseWriter;
+ }
HttpSessionCtx ctx = getHttpSessionCtx(responseWriter);
if (ctx.login(new DeviceTokenCredentials(deviceToken))) {
try {
@@ -118,15 +132,20 @@ public class DeviceApiController {
@RequestMapping(value = "/{deviceToken}/rpc", method = RequestMethod.GET, produces = "application/json")
public DeferredResult<ResponseEntity> subscribeToCommands(@PathVariable("deviceToken") String deviceToken,
- @RequestParam(value = "timeout", required = false, defaultValue = "0") long timeout) {
- return subscribe(deviceToken, timeout, new RpcSubscribeMsg());
+ @RequestParam(value = "timeout", required = false, defaultValue = "0") long timeout,
+ HttpServletRequest request) {
+
+ return subscribe(deviceToken, timeout, new RpcSubscribeMsg(), request);
}
@RequestMapping(value = "/{deviceToken}/rpc/{requestId}", method = RequestMethod.POST)
public DeferredResult<ResponseEntity> replyToCommand(@PathVariable("deviceToken") String deviceToken,
@PathVariable("requestId") Integer requestId,
- @RequestBody String json) {
+ @RequestBody String json, HttpServletRequest request) {
DeferredResult<ResponseEntity> responseWriter = new DeferredResult<ResponseEntity>();
+ if (quotaExceeded(request, responseWriter)) {
+ return responseWriter;
+ }
HttpSessionCtx ctx = getHttpSessionCtx(responseWriter);
if (ctx.login(new DeviceTokenCredentials(deviceToken))) {
try {
@@ -143,8 +162,11 @@ public class DeviceApiController {
@RequestMapping(value = "/{deviceToken}/rpc", method = RequestMethod.POST)
public DeferredResult<ResponseEntity> postRpcRequest(@PathVariable("deviceToken") String deviceToken,
- @RequestBody String json) {
+ @RequestBody String json, HttpServletRequest httpRequest) {
DeferredResult<ResponseEntity> responseWriter = new DeferredResult<ResponseEntity>();
+ if (quotaExceeded(httpRequest, responseWriter)) {
+ return responseWriter;
+ }
HttpSessionCtx ctx = getHttpSessionCtx(responseWriter);
if (ctx.login(new DeviceTokenCredentials(deviceToken))) {
try {
@@ -163,12 +185,17 @@ public class DeviceApiController {
@RequestMapping(value = "/{deviceToken}/attributes/updates", method = RequestMethod.GET, produces = "application/json")
public DeferredResult<ResponseEntity> subscribeToAttributes(@PathVariable("deviceToken") String deviceToken,
- @RequestParam(value = "timeout", required = false, defaultValue = "0") long timeout) {
- return subscribe(deviceToken, timeout, new AttributesSubscribeMsg());
+ @RequestParam(value = "timeout", required = false, defaultValue = "0") long timeout,
+ HttpServletRequest httpRequest) {
+
+ return subscribe(deviceToken, timeout, new AttributesSubscribeMsg(), httpRequest);
}
- private DeferredResult<ResponseEntity> subscribe(String deviceToken, long timeout, FromDeviceMsg msg) {
+ private DeferredResult<ResponseEntity> subscribe(String deviceToken, long timeout, FromDeviceMsg msg, HttpServletRequest httpRequest) {
DeferredResult<ResponseEntity> responseWriter = new DeferredResult<ResponseEntity>();
+ if (quotaExceeded(httpRequest, responseWriter)) {
+ return responseWriter;
+ }
HttpSessionCtx ctx = getHttpSessionCtx(responseWriter, timeout);
if (ctx.login(new DeviceTokenCredentials(deviceToken))) {
try {
@@ -195,4 +222,13 @@ public class DeviceApiController {
processor.process(new BasicToDeviceActorSessionMsg(ctx.getDevice(), msg));
}
+ private boolean quotaExceeded(HttpServletRequest request, DeferredResult<ResponseEntity> responseWriter) {
+ if (quotaService.isQuotaExceeded(request.getRemoteAddr())) {
+ log.warn("REST Quota exceeded for [{}] . Disconnect", request.getRemoteAddr());
+ responseWriter.setResult(new ResponseEntity<>(HttpStatus.BANDWIDTH_LIMIT_EXCEEDED));
+ return true;
+ }
+ return false;
+ }
+
}
diff --git a/transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionCtx.java b/transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionCtx.java
index a3fc4d3..743b3e7 100644
--- a/transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionCtx.java
+++ b/transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionCtx.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionId.java b/transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionId.java
index 42fd81e..3211765 100644
--- a/transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionId.java
+++ b/transport/http/src/main/java/org/thingsboard/server/transport/http/session/HttpSessionId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
transport/mqtt/pom.xml 4(+2 -2)
diff --git a/transport/mqtt/pom.xml b/transport/mqtt/pom.xml
index d8f5703..a048218 100644
--- a/transport/mqtt/pom.xml
+++ b/transport/mqtt/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>transport</artifactId>
</parent>
<groupId>org.thingsboard.transport</groupId>
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/JsonMqttAdaptor.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/JsonMqttAdaptor.java
index a661475..64df6bc 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/JsonMqttAdaptor.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/JsonMqttAdaptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/MqttTransportAdaptor.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/MqttTransportAdaptor.java
index 7f8e1d7..bf83a1f 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/MqttTransportAdaptor.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/adaptors/MqttTransportAdaptor.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttSslHandlerProvider.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttSslHandlerProvider.java
index f1f0266..9c458fd 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttSslHandlerProvider.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttSslHandlerProvider.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTopics.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTopics.java
index c273b8e..6e86523 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTopics.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTopics.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java
index 7e4c2ea..8766599 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -16,7 +16,6 @@
package org.thingsboard.server.transport.mqtt;
import com.fasterxml.jackson.databind.JsonNode;
-import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.mqtt.*;
@@ -36,18 +35,18 @@ import org.thingsboard.server.common.msg.session.ctrl.SessionCloseMsg;
import org.thingsboard.server.common.transport.SessionMsgProcessor;
import org.thingsboard.server.common.transport.adaptor.AdaptorException;
import org.thingsboard.server.common.transport.auth.DeviceAuthService;
+import org.thingsboard.server.common.transport.quota.QuotaService;
import org.thingsboard.server.dao.EncryptionUtil;
import org.thingsboard.server.dao.device.DeviceService;
import org.thingsboard.server.dao.relation.RelationService;
import org.thingsboard.server.transport.mqtt.adaptors.MqttTransportAdaptor;
-import org.thingsboard.server.transport.mqtt.session.GatewaySessionCtx;
import org.thingsboard.server.transport.mqtt.session.DeviceSessionCtx;
+import org.thingsboard.server.transport.mqtt.session.GatewaySessionCtx;
import org.thingsboard.server.transport.mqtt.util.SslUtil;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.security.cert.X509Certificate;
import java.net.InetSocketAddress;
-import java.net.SocketAddress;
import java.util.ArrayList;
import java.util.List;
@@ -72,13 +71,14 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
private final DeviceService deviceService;
private final DeviceAuthService authService;
private final RelationService relationService;
+ private final QuotaService quotaService;
private final SslHandler sslHandler;
private volatile boolean connected;
private volatile InetSocketAddress address;
private volatile GatewaySessionCtx gatewaySessionCtx;
public MqttTransportHandler(SessionMsgProcessor processor, DeviceService deviceService, DeviceAuthService authService, RelationService relationService,
- MqttTransportAdaptor adaptor, SslHandler sslHandler) {
+ MqttTransportAdaptor adaptor, SslHandler sslHandler, QuotaService quotaService) {
this.processor = processor;
this.deviceService = deviceService;
this.relationService = relationService;
@@ -87,6 +87,7 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
this.deviceSessionCtx = new DeviceSessionCtx(processor, authService, adaptor);
this.sessionId = deviceSessionCtx.getSessionId().toUidStr();
this.sslHandler = sslHandler;
+ this.quotaService = quotaService;
}
@Override
@@ -102,35 +103,43 @@ public class MqttTransportHandler extends ChannelInboundHandlerAdapter implement
if (msg.fixedHeader() == null) {
log.info("[{}:{}] Invalid message received", address.getHostName(), address.getPort());
processDisconnect(ctx);
- } else {
- deviceSessionCtx.setChannel(ctx);
- switch (msg.fixedHeader().messageType()) {
- case CONNECT:
- processConnect(ctx, (MqttConnectMessage) msg);
- break;
- case PUBLISH:
- processPublish(ctx, (MqttPublishMessage) msg);
- break;
- case SUBSCRIBE:
- processSubscribe(ctx, (MqttSubscribeMessage) msg);
- break;
- case UNSUBSCRIBE:
- processUnsubscribe(ctx, (MqttUnsubscribeMessage) msg);
- break;
- case PINGREQ:
- if (checkConnected(ctx)) {
- ctx.writeAndFlush(new MqttMessage(new MqttFixedHeader(PINGRESP, false, AT_MOST_ONCE, false, 0)));
- }
- break;
- case DISCONNECT:
- if (checkConnected(ctx)) {
- processDisconnect(ctx);
- }
- break;
- default:
- break;
- }
+ return;
+ }
+
+ if (quotaService.isQuotaExceeded(address.getHostName())) {
+ log.warn("MQTT Quota exceeded for [{}:{}] . Disconnect", address.getHostName(), address.getPort());
+ processDisconnect(ctx);
+ return;
}
+
+ deviceSessionCtx.setChannel(ctx);
+ switch (msg.fixedHeader().messageType()) {
+ case CONNECT:
+ processConnect(ctx, (MqttConnectMessage) msg);
+ break;
+ case PUBLISH:
+ processPublish(ctx, (MqttPublishMessage) msg);
+ break;
+ case SUBSCRIBE:
+ processSubscribe(ctx, (MqttSubscribeMessage) msg);
+ break;
+ case UNSUBSCRIBE:
+ processUnsubscribe(ctx, (MqttUnsubscribeMessage) msg);
+ break;
+ case PINGREQ:
+ if (checkConnected(ctx)) {
+ ctx.writeAndFlush(new MqttMessage(new MqttFixedHeader(PINGRESP, false, AT_MOST_ONCE, false, 0)));
+ }
+ break;
+ case DISCONNECT:
+ if (checkConnected(ctx)) {
+ processDisconnect(ctx);
+ }
+ break;
+ default:
+ break;
+ }
+
}
private void processPublish(ChannelHandlerContext ctx, MqttPublishMessage mqttMsg) {
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportServerInitializer.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportServerInitializer.java
index 1469290..976d8ba 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportServerInitializer.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportServerInitializer.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -15,27 +15,19 @@
*/
package org.thingsboard.server.transport.mqtt;
-import io.netty.buffer.ByteBufAllocator;
-import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.codec.mqtt.MqttDecoder;
import io.netty.handler.codec.mqtt.MqttEncoder;
-import io.netty.handler.ssl.SslContext;
-import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.SslHandler;
-import io.netty.handler.ssl.util.SelfSignedCertificate;
-import org.springframework.beans.factory.annotation.Value;
import org.thingsboard.server.common.transport.SessionMsgProcessor;
import org.thingsboard.server.common.transport.auth.DeviceAuthService;
+import org.thingsboard.server.common.transport.quota.QuotaService;
import org.thingsboard.server.dao.device.DeviceService;
import org.thingsboard.server.dao.relation.RelationService;
import org.thingsboard.server.transport.mqtt.adaptors.MqttTransportAdaptor;
-import javax.net.ssl.SSLException;
-import java.security.cert.CertificateException;
-
/**
* @author Andrew Shvayka
*/
@@ -49,16 +41,18 @@ public class MqttTransportServerInitializer extends ChannelInitializer<SocketCha
private final RelationService relationService;
private final MqttTransportAdaptor adaptor;
private final MqttSslHandlerProvider sslHandlerProvider;
+ private final QuotaService quotaService;
public MqttTransportServerInitializer(SessionMsgProcessor processor, DeviceService deviceService, DeviceAuthService authService, RelationService relationService,
- MqttTransportAdaptor adaptor,
- MqttSslHandlerProvider sslHandlerProvider) {
+ MqttTransportAdaptor adaptor, MqttSslHandlerProvider sslHandlerProvider,
+ QuotaService quotaService) {
this.processor = processor;
this.deviceService = deviceService;
this.authService = authService;
this.relationService = relationService;
this.adaptor = adaptor;
this.sslHandlerProvider = sslHandlerProvider;
+ this.quotaService = quotaService;
}
@Override
@@ -72,7 +66,9 @@ public class MqttTransportServerInitializer extends ChannelInitializer<SocketCha
pipeline.addLast("decoder", new MqttDecoder(MAX_PAYLOAD_SIZE));
pipeline.addLast("encoder", MqttEncoder.INSTANCE);
- MqttTransportHandler handler = new MqttTransportHandler(processor, deviceService, authService, relationService, adaptor, sslHandler);
+ MqttTransportHandler handler = new MqttTransportHandler(processor, deviceService, authService, relationService,
+ adaptor, sslHandler, quotaService);
+
pipeline.addLast(handler);
ch.closeFuture().addListener(handler);
}
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportService.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportService.java
index 179dad5..1ae7d38 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportService.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/MqttTransportService.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -24,10 +24,12 @@ import io.netty.util.ResourceLeakDetector;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.thingsboard.server.common.transport.SessionMsgProcessor;
import org.thingsboard.server.common.transport.auth.DeviceAuthService;
+import org.thingsboard.server.common.transport.quota.QuotaService;
import org.thingsboard.server.dao.device.DeviceService;
import org.thingsboard.server.dao.relation.RelationService;
import org.thingsboard.server.transport.mqtt.adaptors.MqttTransportAdaptor;
@@ -39,6 +41,7 @@ import javax.annotation.PreDestroy;
* @author Andrew Shvayka
*/
@Service("MqttTransportService")
+@ConditionalOnProperty(prefix = "mqtt", value = "enabled", havingValue = "true", matchIfMissing = false)
@Slf4j
public class MqttTransportService {
@@ -63,6 +66,9 @@ public class MqttTransportService {
@Autowired(required = false)
private MqttSslHandlerProvider sslHandlerProvider;
+ @Autowired(required = false)
+ private QuotaService quotaService;
+
@Value("${mqtt.bind_address}")
private String host;
@Value("${mqtt.bind_port}")
@@ -99,7 +105,8 @@ public class MqttTransportService {
ServerBootstrap b = new ServerBootstrap();
b.group(bossGroup, workerGroup)
.channel(NioServerSocketChannel.class)
- .childHandler(new MqttTransportServerInitializer(processor, deviceService, authService, relationService, adaptor, sslHandlerProvider));
+ .childHandler(new MqttTransportServerInitializer(processor, deviceService, authService, relationService,
+ adaptor, sslHandlerProvider, quotaService));
serverChannel = b.bind(host, port).sync().channel();
log.info("Mqtt transport started!");
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/DeviceSessionCtx.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/DeviceSessionCtx.java
index f458b86..9367a04 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/DeviceSessionCtx.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/DeviceSessionCtx.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewayDeviceSessionCtx.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewayDeviceSessionCtx.java
index 7bed03a..632ab28 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewayDeviceSessionCtx.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewayDeviceSessionCtx.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java
index d69341c..7eda5bd 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/GatewaySessionCtx.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -84,16 +84,15 @@ public class GatewaySessionCtx {
private void onDeviceConnect(String deviceName, String deviceType) {
if (!devices.containsKey(deviceName)) {
- Optional<Device> deviceOpt = deviceService.findDeviceByTenantIdAndName(gateway.getTenantId(), deviceName);
- Device device = deviceOpt.orElseGet(() -> {
- Device newDevice = new Device();
- newDevice.setTenantId(gateway.getTenantId());
- newDevice.setName(deviceName);
- newDevice.setType(deviceType);
- newDevice = deviceService.saveDevice(newDevice);
- relationService.saveRelationAsync(new EntityRelation(gateway.getId(), newDevice.getId(), "Created"));
- return newDevice;
- });
+ Device device = deviceService.findDeviceByTenantIdAndName(gateway.getTenantId(), deviceName);
+ if (device == null) {
+ device = new Device();
+ device.setTenantId(gateway.getTenantId());
+ device.setName(deviceName);
+ device.setType(deviceType);
+ device = deviceService.saveDevice(device);
+ relationService.saveRelationAsync(new EntityRelation(gateway.getId(), device.getId(), "Created"));
+ }
GatewayDeviceSessionCtx ctx = new GatewayDeviceSessionCtx(this, device);
devices.put(deviceName, ctx);
log.debug("[{}] Added device [{}] to the gateway session", gatewaySessionId, deviceName);
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/MqttSessionId.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/MqttSessionId.java
index d6f6c3f..0300612 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/MqttSessionId.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/session/MqttSessionId.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/util/SslUtil.java b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/util/SslUtil.java
index 590c289..96cdf14 100644
--- a/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/util/SslUtil.java
+++ b/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/util/SslUtil.java
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
transport/pom.xml 4(+2 -2)
diff --git a/transport/pom.xml b/transport/pom.xml
index 63b1fe1..e3e6d66 100644
--- a/transport/pom.xml
+++ b/transport/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
ui/package.json 2(+1 -1)
diff --git a/ui/package.json b/ui/package.json
index 81f4574..ad95ef4 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -1,7 +1,7 @@
{
"name": "thingsboard",
"private": true,
- "version": "1.4.0",
+ "version": "1.4.1",
"description": "Thingsboard UI",
"licenses": [
{
ui/pom.xml 4(+2 -2)
diff --git a/ui/pom.xml b/ui/pom.xml
index e840067..12e5979 100644
--- a/ui/pom.xml
+++ b/ui/pom.xml
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.thingsboard</groupId>
- <version>1.4.0-SNAPSHOT</version>
+ <version>1.4.1-SNAPSHOT</version>
<artifactId>thingsboard</artifactId>
</parent>
<groupId>org.thingsboard</groupId>
ui/server.js 2(+1 -1)
diff --git a/ui/server.js b/ui/server.js
index 1f1d82b..fae132f 100644
--- a/ui/server.js
+++ b/ui/server.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/admin/admin.controller.js 2(+1 -1)
diff --git a/ui/src/app/admin/admin.controller.js b/ui/src/app/admin/admin.controller.js
index 2fb82a2..10967c9 100644
--- a/ui/src/app/admin/admin.controller.js
+++ b/ui/src/app/admin/admin.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/admin/admin.routes.js 2(+1 -1)
diff --git a/ui/src/app/admin/admin.routes.js b/ui/src/app/admin/admin.routes.js
index 0f299be..a74b414 100644
--- a/ui/src/app/admin/admin.routes.js
+++ b/ui/src/app/admin/admin.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/admin/general-settings.tpl.html b/ui/src/app/admin/general-settings.tpl.html
index 50342d3..1540ca7 100644
--- a/ui/src/app/admin/general-settings.tpl.html
+++ b/ui/src/app/admin/general-settings.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/admin/index.js 2(+1 -1)
diff --git a/ui/src/app/admin/index.js b/ui/src/app/admin/index.js
index d3cb34a..a2c498a 100644
--- a/ui/src/app/admin/index.js
+++ b/ui/src/app/admin/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/admin/outgoing-mail-settings.tpl.html b/ui/src/app/admin/outgoing-mail-settings.tpl.html
index 3c59593..a58b63f 100644
--- a/ui/src/app/admin/outgoing-mail-settings.tpl.html
+++ b/ui/src/app/admin/outgoing-mail-settings.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/alarm/alarm.scss 3(+1 -2)
diff --git a/ui/src/app/alarm/alarm.scss b/ui/src/app/alarm/alarm.scss
index aea5225..faf7feb 100644
--- a/ui/src/app/alarm/alarm.scss
+++ b/ui/src/app/alarm/alarm.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-alarm-container {
overflow-x: auto;
}
diff --git a/ui/src/app/alarm/alarm-details-dialog.controller.js b/ui/src/app/alarm/alarm-details-dialog.controller.js
index d97d299..dfe2272 100644
--- a/ui/src/app/alarm/alarm-details-dialog.controller.js
+++ b/ui/src/app/alarm/alarm-details-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/alarm/alarm-details-dialog.scss b/ui/src/app/alarm/alarm-details-dialog.scss
index 9b923d0..b7d3cd0 100644
--- a/ui/src/app/alarm/alarm-details-dialog.scss
+++ b/ui/src/app/alarm/alarm-details-dialog.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-alarm-details-panel {
margin-left: 15px;
border: 1px solid #C0C0C0;
diff --git a/ui/src/app/alarm/alarm-details-dialog.tpl.html b/ui/src/app/alarm/alarm-details-dialog.tpl.html
index cc213d1..7511f53 100644
--- a/ui/src/app/alarm/alarm-details-dialog.tpl.html
+++ b/ui/src/app/alarm/alarm-details-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/alarm/alarm-header.directive.js b/ui/src/app/alarm/alarm-header.directive.js
index b66a972..61dc5f0 100644
--- a/ui/src/app/alarm/alarm-header.directive.js
+++ b/ui/src/app/alarm/alarm-header.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/alarm/alarm-header.tpl.html b/ui/src/app/alarm/alarm-header.tpl.html
index b67ac8f..bc6f168 100644
--- a/ui/src/app/alarm/alarm-header.tpl.html
+++ b/ui/src/app/alarm/alarm-header.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/alarm/alarm-row.directive.js b/ui/src/app/alarm/alarm-row.directive.js
index 62bed11..37eec7c 100644
--- a/ui/src/app/alarm/alarm-row.directive.js
+++ b/ui/src/app/alarm/alarm-row.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/alarm/alarm-row.tpl.html 2(+1 -1)
diff --git a/ui/src/app/alarm/alarm-row.tpl.html b/ui/src/app/alarm/alarm-row.tpl.html
index 00c8324..600ddc1 100644
--- a/ui/src/app/alarm/alarm-row.tpl.html
+++ b/ui/src/app/alarm/alarm-row.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/alarm/alarm-table.directive.js b/ui/src/app/alarm/alarm-table.directive.js
index c93ea03..03470c6 100644
--- a/ui/src/app/alarm/alarm-table.directive.js
+++ b/ui/src/app/alarm/alarm-table.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/alarm/alarm-table.tpl.html b/ui/src/app/alarm/alarm-table.tpl.html
index 98d42a2..b9e466f 100644
--- a/ui/src/app/alarm/alarm-table.tpl.html
+++ b/ui/src/app/alarm/alarm-table.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -29,7 +29,7 @@
</section>
<div flex layout="column" class="tb-alarm-container md-whiteframe-z1">
<md-list flex layout="column" class="tb-alarm-table">
- <md-list class="tb-row tb-header" layout="row" tb-alarm-header>
+ <md-list class="tb-row tb-header" layout="row" layout-align="start center" tb-alarm-header>
</md-list>
<md-progress-linear style="max-height: 0px;" md-mode="indeterminate" ng-disabled="!$root.loading"
ng-show="$root.loading"></md-progress-linear>
@@ -39,7 +39,7 @@
class="tb-prompt" ng-show="noData()">alarm.no-alarms-prompt</span>
<md-virtual-repeat-container ng-show="hasData()" flex md-top-index="topIndex" tb-scope-element="repeatContainer">
<md-list-item md-virtual-repeat="alarm in theAlarms" md-on-demand flex ng-style="hasScroll() ? {'margin-right':'-15px'} : {}">
- <md-list class="tb-row" flex layout="row" tb-alarm-row alarm="{{alarm}}">
+ <md-list class="tb-row" flex layout="row" layout-align="start center" tb-alarm-row alarm="{{alarm}}">
</md-list>
<md-divider flex></md-divider>
</md-list-item>
ui/src/app/alarm/index.js 3(+1 -2)
diff --git a/ui/src/app/alarm/index.js b/ui/src/app/alarm/index.js
index 0ea4610..01359db 100644
--- a/ui/src/app/alarm/index.js
+++ b/ui/src/app/alarm/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import AlarmDetailsDialogController from './alarm-details-dialog.controller';
import AlarmHeaderDirective from './alarm-header.directive';
import AlarmRowDirective from './alarm-row.directive';
ui/src/app/api/admin.service.js 2(+1 -1)
diff --git a/ui/src/app/api/admin.service.js b/ui/src/app/api/admin.service.js
index 1591397..fd306c2 100644
--- a/ui/src/app/api/admin.service.js
+++ b/ui/src/app/api/admin.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/alarm.service.js 2(+1 -1)
diff --git a/ui/src/app/api/alarm.service.js b/ui/src/app/api/alarm.service.js
index f59ecbc..825aeae 100644
--- a/ui/src/app/api/alarm.service.js
+++ b/ui/src/app/api/alarm.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/alias-controller.js 3(+1 -2)
diff --git a/ui/src/app/api/alias-controller.js b/ui/src/app/api/alias-controller.js
index 3c5f786..10b1107 100644
--- a/ui/src/app/api/alias-controller.js
+++ b/ui/src/app/api/alias-controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default class AliasController {
constructor($scope, $q, $filter, utils, types, entityService, stateController, entityAliases) {
ui/src/app/api/asset.service.js 2(+1 -1)
diff --git a/ui/src/app/api/asset.service.js b/ui/src/app/api/asset.service.js
index 51ea107..bb28b6f 100644
--- a/ui/src/app/api/asset.service.js
+++ b/ui/src/app/api/asset.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/attribute.service.js 2(+1 -1)
diff --git a/ui/src/app/api/attribute.service.js b/ui/src/app/api/attribute.service.js
index 6e1aeec..f01629c 100644
--- a/ui/src/app/api/attribute.service.js
+++ b/ui/src/app/api/attribute.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/audit-log.service.js 116(+116 -0)
diff --git a/ui/src/app/api/audit-log.service.js b/ui/src/app/api/audit-log.service.js
new file mode 100644
index 0000000..5b570e5
--- /dev/null
+++ b/ui/src/app/api/audit-log.service.js
@@ -0,0 +1,116 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+export default angular.module('thingsboard.api.auditLog', [])
+ .factory('auditLogService', AuditLogService)
+ .name;
+
+/*@ngInject*/
+function AuditLogService($http, $q) {
+
+ var service = {
+ getAuditLogsByEntityId: getAuditLogsByEntityId,
+ getAuditLogsByUserId: getAuditLogsByUserId,
+ getAuditLogsByCustomerId: getAuditLogsByCustomerId,
+ getAuditLogs: getAuditLogs
+ }
+
+ return service;
+
+ function getAuditLogsByEntityId (entityType, entityId, pageLink) {
+ var deferred = $q.defer();
+ var url = `/api/audit/logs/entity/${entityType}/${entityId}?limit=${pageLink.limit}`;
+
+ if (angular.isDefined(pageLink.startTime) && pageLink.startTime != null) {
+ url += '&startTime=' + pageLink.startTime;
+ }
+ if (angular.isDefined(pageLink.endTime) && pageLink.endTime != null) {
+ url += '&endTime=' + pageLink.endTime;
+ }
+ if (angular.isDefined(pageLink.idOffset) && pageLink.idOffset != null) {
+ url += '&offset=' + pageLink.idOffset;
+ }
+ $http.get(url, null).then(function success(response) {
+ deferred.resolve(response.data);
+ }, function fail() {
+ deferred.reject();
+ });
+ return deferred.promise;
+ }
+
+ function getAuditLogsByUserId (userId, pageLink) {
+ var deferred = $q.defer();
+ var url = `/api/audit/logs/user/${userId}?limit=${pageLink.limit}`;
+
+ if (angular.isDefined(pageLink.startTime) && pageLink.startTime != null) {
+ url += '&startTime=' + pageLink.startTime;
+ }
+ if (angular.isDefined(pageLink.endTime) && pageLink.endTime != null) {
+ url += '&endTime=' + pageLink.endTime;
+ }
+ if (angular.isDefined(pageLink.idOffset) && pageLink.idOffset != null) {
+ url += '&offset=' + pageLink.idOffset;
+ }
+ $http.get(url, null).then(function success(response) {
+ deferred.resolve(response.data);
+ }, function fail() {
+ deferred.reject();
+ });
+ return deferred.promise;
+ }
+
+ function getAuditLogsByCustomerId (customerId, pageLink) {
+ var deferred = $q.defer();
+ var url = `/api/audit/logs/customer/${customerId}?limit=${pageLink.limit}`;
+
+ if (angular.isDefined(pageLink.startTime) && pageLink.startTime != null) {
+ url += '&startTime=' + pageLink.startTime;
+ }
+ if (angular.isDefined(pageLink.endTime) && pageLink.endTime != null) {
+ url += '&endTime=' + pageLink.endTime;
+ }
+ if (angular.isDefined(pageLink.idOffset) && pageLink.idOffset != null) {
+ url += '&offset=' + pageLink.idOffset;
+ }
+ $http.get(url, null).then(function success(response) {
+ deferred.resolve(response.data);
+ }, function fail() {
+ deferred.reject();
+ });
+ return deferred.promise;
+ }
+
+ function getAuditLogs (pageLink) {
+ var deferred = $q.defer();
+ var url = `/api/audit/logs?limit=${pageLink.limit}`;
+
+ if (angular.isDefined(pageLink.startTime) && pageLink.startTime != null) {
+ url += '&startTime=' + pageLink.startTime;
+ }
+ if (angular.isDefined(pageLink.endTime) && pageLink.endTime != null) {
+ url += '&endTime=' + pageLink.endTime;
+ }
+ if (angular.isDefined(pageLink.idOffset) && pageLink.idOffset != null) {
+ url += '&offset=' + pageLink.idOffset;
+ }
+ $http.get(url, null).then(function success(response) {
+ deferred.resolve(response.data);
+ }, function fail() {
+ deferred.reject();
+ });
+ return deferred.promise;
+ }
+
+}
diff --git a/ui/src/app/api/component-descriptor.service.js b/ui/src/app/api/component-descriptor.service.js
index ed13e5c..4478d71 100644
--- a/ui/src/app/api/component-descriptor.service.js
+++ b/ui/src/app/api/component-descriptor.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/customer.service.js 2(+1 -1)
diff --git a/ui/src/app/api/customer.service.js b/ui/src/app/api/customer.service.js
index b520a09..28f1bd0 100644
--- a/ui/src/app/api/customer.service.js
+++ b/ui/src/app/api/customer.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/dashboard.service.js 152(+105 -47)
diff --git a/ui/src/app/api/dashboard.service.js b/ui/src/app/api/dashboard.service.js
index 3082bd3..507fe97 100644
--- a/ui/src/app/api/dashboard.service.js
+++ b/ui/src/app/api/dashboard.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -17,7 +17,7 @@ export default angular.module('thingsboard.api.dashboard', [])
.factory('dashboardService', DashboardService).name;
/*@ngInject*/
-function DashboardService($rootScope, $http, $q, $location, customerService) {
+function DashboardService($rootScope, $http, $q, $location, $filter) {
var stDiffPromise;
@@ -37,7 +37,11 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
deleteDashboard: deleteDashboard,
saveDashboard: saveDashboard,
unassignDashboardFromCustomer: unassignDashboardFromCustomer,
+ updateDashboardCustomers: updateDashboardCustomers,
+ addDashboardCustomers: addDashboardCustomers,
+ removeDashboardCustomers: removeDashboardCustomers,
makeDashboardPublic: makeDashboardPublic,
+ makeDashboardPrivate: makeDashboardPrivate,
getPublicDashboardLink: getPublicDashboardLink
}
@@ -56,14 +60,14 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
url += '&textOffset=' + pageLink.textOffset;
}
$http.get(url, config).then(function success(response) {
- deferred.resolve(response.data);
+ deferred.resolve(prepareDashboards(response.data));
}, function fail() {
deferred.reject();
});
return deferred.promise;
}
- function getTenantDashboards(pageLink, applyCustomersInfo, config) {
+ function getTenantDashboards(pageLink, config) {
var deferred = $q.defer();
var url = '/api/tenant/dashboards?limit=' + pageLink.limit;
if (angular.isDefined(pageLink.textSearch)) {
@@ -76,51 +80,25 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
url += '&textOffset=' + pageLink.textOffset;
}
$http.get(url, config).then(function success(response) {
- if (applyCustomersInfo) {
- customerService.applyAssignedCustomersInfo(response.data.data).then(
- function success(data) {
- response.data.data = data;
- deferred.resolve(response.data);
- },
- function fail() {
- deferred.reject();
- }
- );
- } else {
- deferred.resolve(response.data);
- }
+ deferred.resolve(prepareDashboards(response.data));
}, function fail() {
deferred.reject();
});
return deferred.promise;
}
- function getCustomerDashboards(customerId, pageLink, applyCustomersInfo, config) {
+ function getCustomerDashboards(customerId, pageLink, config) {
var deferred = $q.defer();
var url = '/api/customer/' + customerId + '/dashboards?limit=' + pageLink.limit;
- if (angular.isDefined(pageLink.textSearch)) {
- url += '&textSearch=' + pageLink.textSearch;
- }
if (angular.isDefined(pageLink.idOffset)) {
- url += '&idOffset=' + pageLink.idOffset;
- }
- if (angular.isDefined(pageLink.textOffset)) {
- url += '&textOffset=' + pageLink.textOffset;
+ url += '&offset=' + pageLink.idOffset;
}
$http.get(url, config).then(function success(response) {
- if (applyCustomersInfo) {
- customerService.applyAssignedCustomerInfo(response.data.data, customerId).then(
- function success(data) {
- response.data.data = data;
- deferred.resolve(response.data);
- },
- function fail() {
- deferred.reject();
- }
- );
- } else {
- deferred.resolve(response.data);
+ response.data = prepareDashboards(response.data);
+ if (pageLink.textSearch) {
+ response.data.data = $filter('filter')(response.data.data, {title: pageLink.textSearch});
}
+ deferred.resolve(response.data);
}, function fail() {
deferred.reject();
});
@@ -151,7 +129,7 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
var deferred = $q.defer();
var url = '/api/dashboard/' + dashboardId;
$http.get(url, null).then(function success(response) {
- deferred.resolve(response.data);
+ deferred.resolve(prepareDashboard(response.data));
}, function fail() {
deferred.reject();
});
@@ -162,7 +140,7 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
var deferred = $q.defer();
var url = '/api/dashboard/info/' + dashboardId;
$http.get(url, config).then(function success(response) {
- deferred.resolve(response.data);
+ deferred.resolve(prepareDashboard(response.data));
}, function fail() {
deferred.reject();
});
@@ -172,8 +150,8 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
function saveDashboard(dashboard) {
var deferred = $q.defer();
var url = '/api/dashboard';
- $http.post(url, dashboard).then(function success(response) {
- deferred.resolve(response.data);
+ $http.post(url, cleanDashboard(dashboard)).then(function success(response) {
+ deferred.resolve(prepareDashboard(response.data));
}, function fail() {
deferred.reject();
});
@@ -195,18 +173,51 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
var deferred = $q.defer();
var url = '/api/customer/' + customerId + '/dashboard/' + dashboardId;
$http.post(url, null).then(function success(response) {
- deferred.resolve(response.data);
+ deferred.resolve(prepareDashboard(response.data));
}, function fail() {
deferred.reject();
});
return deferred.promise;
}
- function unassignDashboardFromCustomer(dashboardId) {
+ function unassignDashboardFromCustomer(customerId, dashboardId) {
var deferred = $q.defer();
- var url = '/api/customer/dashboard/' + dashboardId;
+ var url = '/api/customer/' + customerId + '/dashboard/' + dashboardId;
$http.delete(url).then(function success(response) {
- deferred.resolve(response.data);
+ deferred.resolve(prepareDashboard(response.data));
+ }, function fail() {
+ deferred.reject();
+ });
+ return deferred.promise;
+ }
+
+ function updateDashboardCustomers(dashboardId, customerIds) {
+ var deferred = $q.defer();
+ var url = '/api/dashboard/' + dashboardId + '/customers';
+ $http.post(url, customerIds).then(function success(response) {
+ deferred.resolve(prepareDashboard(response.data));
+ }, function fail() {
+ deferred.reject();
+ });
+ return deferred.promise;
+ }
+
+ function addDashboardCustomers(dashboardId, customerIds) {
+ var deferred = $q.defer();
+ var url = '/api/dashboard/' + dashboardId + '/customers/add';
+ $http.post(url, customerIds).then(function success(response) {
+ deferred.resolve(prepareDashboard(response.data));
+ }, function fail() {
+ deferred.reject();
+ });
+ return deferred.promise;
+ }
+
+ function removeDashboardCustomers(dashboardId, customerIds) {
+ var deferred = $q.defer();
+ var url = '/api/dashboard/' + dashboardId + '/customers/remove';
+ $http.post(url, customerIds).then(function success(response) {
+ deferred.resolve(prepareDashboard(response.data));
}, function fail() {
deferred.reject();
});
@@ -217,7 +228,18 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
var deferred = $q.defer();
var url = '/api/customer/public/dashboard/' + dashboardId;
$http.post(url, null).then(function success(response) {
- deferred.resolve(response.data);
+ deferred.resolve(prepareDashboard(response.data));
+ }, function fail() {
+ deferred.reject();
+ });
+ return deferred.promise;
+ }
+
+ function makeDashboardPrivate(dashboardId) {
+ var deferred = $q.defer();
+ var url = '/api/customer/public/dashboard/' + dashboardId;
+ $http.delete(url).then(function success(response) {
+ deferred.resolve(prepareDashboard(response.data));
}, function fail() {
deferred.reject();
});
@@ -230,8 +252,44 @@ function DashboardService($rootScope, $http, $q, $location, customerService) {
if (port != 80 && port != 443) {
url += ":" + port;
}
- url += "/dashboards/" + dashboard.id.id + "?publicId=" + dashboard.customerId.id;
+ url += "/dashboards/" + dashboard.id.id + "?publicId=" + dashboard.publicCustomerId;
return url;
}
+ function prepareDashboards(dashboardsData) {
+ if (dashboardsData.data) {
+ for (var i = 0; i < dashboardsData.data.length; i++) {
+ dashboardsData.data[i] = prepareDashboard(dashboardsData.data[i]);
+ }
+ }
+ return dashboardsData;
+ }
+
+ function prepareDashboard(dashboard) {
+ dashboard.publicCustomerId = null;
+ dashboard.assignedCustomersText = "";
+ dashboard.assignedCustomersIds = [];
+ if (dashboard.assignedCustomers && dashboard.assignedCustomers.length) {
+ var assignedCustomersTitles = [];
+ for (var i = 0; i < dashboard.assignedCustomers.length; i++) {
+ var assignedCustomer = dashboard.assignedCustomers[i];
+ dashboard.assignedCustomersIds.push(assignedCustomer.customerId.id);
+ if (assignedCustomer.public) {
+ dashboard.publicCustomerId = assignedCustomer.customerId.id;
+ } else {
+ assignedCustomersTitles.push(assignedCustomer.title);
+ }
+ }
+ dashboard.assignedCustomersText = assignedCustomersTitles.join(', ');
+ }
+ return dashboard;
+ }
+
+ function cleanDashboard(dashboard) {
+ delete dashboard.publicCustomerId;
+ delete dashboard.assignedCustomersText;
+ delete dashboard.assignedCustomersIds;
+ return dashboard;
+ }
+
}
ui/src/app/api/data-aggregator.js 3(+1 -2)
diff --git a/ui/src/app/api/data-aggregator.js b/ui/src/app/api/data-aggregator.js
index 64e4e40..07f413f 100644
--- a/ui/src/app/api/data-aggregator.js
+++ b/ui/src/app/api/data-aggregator.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default class DataAggregator {
constructor(onDataCb, tsKeyNames, startTs, limit, aggregationType, timeWindow, interval,
ui/src/app/api/datasource.service.js 2(+1 -1)
diff --git a/ui/src/app/api/datasource.service.js b/ui/src/app/api/datasource.service.js
index a01704c..dd1a34f 100644
--- a/ui/src/app/api/datasource.service.js
+++ b/ui/src/app/api/datasource.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/device.service.js 29(+21 -8)
diff --git a/ui/src/app/api/device.service.js b/ui/src/app/api/device.service.js
index bb4249e..d46fad1 100644
--- a/ui/src/app/api/device.service.js
+++ b/ui/src/app/api/device.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@ export default angular.module('thingsboard.api.device', [thingsboardTypes])
.name;
/*@ngInject*/
-function DeviceService($http, $q, attributeService, customerService, types) {
+function DeviceService($http, $q, $window, userService, attributeService, customerService, types) {
var service = {
assignDeviceToCustomer: assignDeviceToCustomer,
@@ -181,14 +181,27 @@ function DeviceService($http, $q, attributeService, customerService, types) {
return deferred.promise;
}
- function getDeviceCredentials(deviceId) {
+ function getDeviceCredentials(deviceId, sync) {
var deferred = $q.defer();
var url = '/api/device/' + deviceId + '/credentials';
- $http.get(url, null).then(function success(response) {
- deferred.resolve(response.data);
- }, function fail() {
- deferred.reject();
- });
+ if (sync) {
+ var request = new $window.XMLHttpRequest();
+ request.open('GET', url, false);
+ request.setRequestHeader("Accept", "application/json, text/plain, */*");
+ userService.setAuthorizationRequestHeader(request);
+ request.send(null);
+ if (request.status === 200) {
+ deferred.resolve(angular.fromJson(request.responseText));
+ } else {
+ deferred.reject();
+ }
+ } else {
+ $http.get(url, null).then(function success(response) {
+ deferred.resolve(response.data);
+ }, function fail() {
+ deferred.reject();
+ });
+ }
return deferred.promise;
}
ui/src/app/api/entity.service.js 45(+36 -9)
diff --git a/ui/src/app/api/entity.service.js b/ui/src/app/api/entity.service.js
index df1c3e0..e4c51a2 100644
--- a/ui/src/app/api/entity.service.js
+++ b/ui/src/app/api/entity.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -273,9 +273,9 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
break;
case types.entityType.dashboard:
if (user.authority === 'CUSTOMER_USER') {
- promise = dashboardService.getCustomerDashboards(customerId, pageLink, false, config);
+ promise = dashboardService.getCustomerDashboards(customerId, pageLink, config);
} else {
- promise = dashboardService.getTenantDashboards(pageLink, false, config);
+ promise = dashboardService.getTenantDashboards(pageLink, config);
}
break;
case types.entityType.user:
@@ -403,6 +403,21 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
return deferred.promise;
}
+ function resolveAliasEntityId(entityType, id) {
+ var entityId = {
+ entityType: entityType,
+ id: id
+ };
+ if (entityType == types.aliasEntityType.current_customer) {
+ var user = userService.getCurrentUser();
+ entityId.entityType = types.entityType.customer;
+ if (user.authority === 'CUSTOMER_USER') {
+ entityId.id = user.customerId;
+ }
+ }
+ return entityId;
+ }
+
function getStateEntityId(filter, stateParams) {
var entityId = null;
if (stateParams) {
@@ -417,6 +432,9 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
if (!entityId) {
entityId = filter.defaultStateEntity;
}
+ if (entityId) {
+ entityId = resolveAliasEntityId(entityId.entityType, entityId.id);
+ }
return entityId;
}
@@ -432,7 +450,8 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
var stateEntityId = getStateEntityId(filter, stateParams);
switch (filter.type) {
case types.aliasFilterType.singleEntity.value:
- getEntity(filter.singleEntity.entityType, filter.singleEntity.id, {ignoreLoading: true}).then(
+ var aliasEntityId = resolveAliasEntityId(filter.singleEntity.entityType, filter.singleEntity.id);
+ getEntity(aliasEntityId.entityType, aliasEntityId.id, {ignoreLoading: true}).then(
function success(entity) {
result.entities = entitiesToEntitiesInfo([entity]);
deferred.resolve(result);
@@ -530,10 +549,11 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
rootEntityId = filter.rootEntity.id;
}
if (rootEntityType && rootEntityId) {
+ var relationQueryRootEntityId = resolveAliasEntityId(rootEntityType, rootEntityId);
var searchQuery = {
parameters: {
- rootId: rootEntityId,
- rootType: rootEntityType,
+ rootId: relationQueryRootEntityId.id,
+ rootType: relationQueryRootEntityId.entityType,
direction: filter.direction
},
filters: filter.filters
@@ -571,10 +591,11 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
rootEntityId = filter.rootEntity.id;
}
if (rootEntityType && rootEntityId) {
+ var searchQueryRootEntityId = resolveAliasEntityId(rootEntityType, rootEntityId);
searchQuery = {
parameters: {
- rootId: rootEntityId,
- rootType: rootEntityType,
+ rootId: searchQueryRootEntityId.id,
+ rootType: searchQueryRootEntityId.entityType,
direction: filter.direction
},
relationType: filter.relationType
@@ -709,7 +730,7 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
return result;
}
- function prepareAllowedEntityTypesList(allowedEntityTypes) {
+ function prepareAllowedEntityTypesList(allowedEntityTypes, useAliasEntityTypes) {
var authority = userService.getAuthority();
var entityTypes = {};
switch(authority) {
@@ -726,12 +747,18 @@ function EntityService($http, $q, $filter, $translate, $log, userService, device
entityTypes.rule = types.entityType.rule;
entityTypes.plugin = types.entityType.plugin;
entityTypes.dashboard = types.entityType.dashboard;
+ if (useAliasEntityTypes) {
+ entityTypes.current_customer = types.aliasEntityType.current_customer;
+ }
break;
case 'CUSTOMER_USER':
entityTypes.device = types.entityType.device;
entityTypes.asset = types.entityType.asset;
entityTypes.customer = types.entityType.customer;
entityTypes.dashboard = types.entityType.dashboard;
+ if (useAliasEntityTypes) {
+ entityTypes.current_customer = types.aliasEntityType.current_customer;
+ }
break;
}
diff --git a/ui/src/app/api/entity-relation.service.js b/ui/src/app/api/entity-relation.service.js
index 79f80da..7b6a511 100644
--- a/ui/src/app/api/entity-relation.service.js
+++ b/ui/src/app/api/entity-relation.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/event.service.js 2(+1 -1)
diff --git a/ui/src/app/api/event.service.js b/ui/src/app/api/event.service.js
index 4ba174f..0a57d83 100644
--- a/ui/src/app/api/event.service.js
+++ b/ui/src/app/api/event.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/login.service.js 2(+1 -1)
diff --git a/ui/src/app/api/login.service.js b/ui/src/app/api/login.service.js
index 74f9587..d8769be 100644
--- a/ui/src/app/api/login.service.js
+++ b/ui/src/app/api/login.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/plugin.service.js 2(+1 -1)
diff --git a/ui/src/app/api/plugin.service.js b/ui/src/app/api/plugin.service.js
index 28f63de..f8bc51b 100644
--- a/ui/src/app/api/plugin.service.js
+++ b/ui/src/app/api/plugin.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/rule.service.js 2(+1 -1)
diff --git a/ui/src/app/api/rule.service.js b/ui/src/app/api/rule.service.js
index df37305..20f522f 100644
--- a/ui/src/app/api/rule.service.js
+++ b/ui/src/app/api/rule.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/subscription.js 3(+1 -2)
diff --git a/ui/src/app/api/subscription.js b/ui/src/app/api/subscription.js
index 022a31c..350b1ef 100644
--- a/ui/src/app/api/subscription.js
+++ b/ui/src/app/api/subscription.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*
options = {
type,
diff --git a/ui/src/app/api/telemetry-websocket.service.js b/ui/src/app/api/telemetry-websocket.service.js
index b0e8ea9..3e08e60 100644
--- a/ui/src/app/api/telemetry-websocket.service.js
+++ b/ui/src/app/api/telemetry-websocket.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/tenant.service.js 2(+1 -1)
diff --git a/ui/src/app/api/tenant.service.js b/ui/src/app/api/tenant.service.js
index be04ae9..8d81e54 100644
--- a/ui/src/app/api/tenant.service.js
+++ b/ui/src/app/api/tenant.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/time.service.js 2(+1 -1)
diff --git a/ui/src/app/api/time.service.js b/ui/src/app/api/time.service.js
index cce12bf..8742b58 100644
--- a/ui/src/app/api/time.service.js
+++ b/ui/src/app/api/time.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/api/user.service.js 15(+12 -3)
diff --git a/ui/src/app/api/user.service.js b/ui/src/app/api/user.service.js
index 1a146b4..cb85709 100644
--- a/ui/src/app/api/user.service.js
+++ b/ui/src/app/api/user.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -54,6 +54,7 @@ function UserService($http, $q, $rootScope, adminService, dashboardService, logi
refreshJwtToken: refreshJwtToken,
refreshTokenPending: refreshTokenPending,
updateAuthorizationHeader: updateAuthorizationHeader,
+ setAuthorizationRequestHeader: setAuthorizationRequestHeader,
gotoDefaultPlace: gotoDefaultPlace,
forceDefaultPlace: forceDefaultPlace,
updateLastPublicDashboardId: updateLastPublicDashboardId,
@@ -265,9 +266,9 @@ function UserService($http, $q, $rootScope, adminService, dashboardService, logi
var pageLink = {limit: 100};
var fetchDashboardsPromise;
if (currentUser.authority === 'TENANT_ADMIN') {
- fetchDashboardsPromise = dashboardService.getTenantDashboards(pageLink, false);
+ fetchDashboardsPromise = dashboardService.getTenantDashboards(pageLink);
} else {
- fetchDashboardsPromise = dashboardService.getCustomerDashboards(currentUser.customerId, pageLink, false);
+ fetchDashboardsPromise = dashboardService.getCustomerDashboards(currentUser.customerId, pageLink);
}
fetchDashboardsPromise.then(
function success(result) {
@@ -367,6 +368,14 @@ function UserService($http, $q, $rootScope, adminService, dashboardService, logi
return jwtToken;
}
+ function setAuthorizationRequestHeader(request) {
+ var jwtToken = store.get('jwt_token');
+ if (jwtToken) {
+ request.setRequestHeader('X-Authorization', 'Bearer ' + jwtToken);
+ }
+ return jwtToken;
+ }
+
function getTenantAdmins(tenantId, pageLink) {
var deferred = $q.defer();
var url = '/api/tenant/' + tenantId + '/users?limit=' + pageLink.limit;
ui/src/app/api/widget.service.js 2(+1 -1)
diff --git a/ui/src/app/api/widget.service.js b/ui/src/app/api/widget.service.js
index fe95729..4a09ffc 100644
--- a/ui/src/app/api/widget.service.js
+++ b/ui/src/app/api/widget.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/app.config.js 3(+2 -1)
diff --git a/ui/src/app/app.config.js b/ui/src/app/app.config.js
index b520c1a..a84bdde 100644
--- a/ui/src/app/app.config.js
+++ b/ui/src/app/app.config.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -49,6 +49,7 @@ export default function AppConfig($provide,
$translateProvider.useSanitizeValueStrategy(null);
$translateProvider.useMissingTranslationHandler('tbMissingTranslationHandler');
$translateProvider.addInterpolation('$translateMessageFormatInterpolation');
+ $translateProvider.fallbackLanguage('en_US');
addLocaleKorean(locales);
addLocaleChinese(locales);
ui/src/app/app.js 7(+5 -2)
diff --git a/ui/src/app/app.js b/ui/src/app/app.js
index 5b19089..0b6a141 100644
--- a/ui/src/app/app.js
+++ b/ui/src/app/app.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './ie.support';
import 'event-source-polyfill';
@@ -63,6 +62,7 @@ import thingsboardApiTime from './api/time.service';
import thingsboardKeyboardShortcut from './components/keyboard-shortcut.filter';
import thingsboardHelp from './help/help.directive';
import thingsboardToast from './services/toast';
+import thingsboardClipboard from './services/clipboard.service';
import thingsboardHome from './layout';
import thingsboardApiLogin from './api/login.service';
import thingsboardApiDevice from './api/device.service';
@@ -72,6 +72,7 @@ import thingsboardApiAsset from './api/asset.service';
import thingsboardApiAttribute from './api/attribute.service';
import thingsboardApiEntity from './api/entity.service';
import thingsboardApiAlarm from './api/alarm.service';
+import thingsboardApiAuditLog from './api/audit-log.service';
import 'typeface-roboto';
import 'font-awesome/css/font-awesome.min.css';
@@ -123,6 +124,7 @@ angular.module('thingsboard', [
thingsboardKeyboardShortcut,
thingsboardHelp,
thingsboardToast,
+ thingsboardClipboard,
thingsboardHome,
thingsboardApiLogin,
thingsboardApiDevice,
@@ -132,6 +134,7 @@ angular.module('thingsboard', [
thingsboardApiAttribute,
thingsboardApiEntity,
thingsboardApiAlarm,
+ thingsboardApiAuditLog,
uiRouter])
.config(AppConfig)
.factory('globalInterceptor', GlobalInterceptor)
ui/src/app/app.run.js 10(+8 -2)
diff --git a/ui/src/app/app.run.js b/ui/src/app/app.run.js
index 2ab5fe2..f3886b8 100644
--- a/ui/src/app/app.run.js
+++ b/ui/src/app/app.run.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -20,7 +20,13 @@ import UrlHandler from './url.handler';
export default function AppRun($rootScope, $window, $injector, $location, $log, $state, $mdDialog, $filter, loginService, userService, $translate) {
$window.Flow = Flow;
- var frame = $window.frameElement;
+ var frame = null;
+ try {
+ frame = $window.frameElement;
+ } catch(e) {
+ // ie11 fix
+ }
+
var unauthorizedDialog = null;
var forbiddenDialog = null;
ui/src/app/asset/add-asset.tpl.html 2(+1 -1)
diff --git a/ui/src/app/asset/add-asset.tpl.html b/ui/src/app/asset/add-asset.tpl.html
index 71901e4..67dfb6d 100644
--- a/ui/src/app/asset/add-asset.tpl.html
+++ b/ui/src/app/asset/add-asset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/asset/add-assets-to-customer.controller.js b/ui/src/app/asset/add-assets-to-customer.controller.js
index 53feb7d..8cfa28b 100644
--- a/ui/src/app/asset/add-assets-to-customer.controller.js
+++ b/ui/src/app/asset/add-assets-to-customer.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/asset/add-assets-to-customer.tpl.html b/ui/src/app/asset/add-assets-to-customer.tpl.html
index 64edcf8..98c49b5 100644
--- a/ui/src/app/asset/add-assets-to-customer.tpl.html
+++ b/ui/src/app/asset/add-assets-to-customer.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/asset/asset.controller.js 2(+1 -1)
diff --git a/ui/src/app/asset/asset.controller.js b/ui/src/app/asset/asset.controller.js
index 1253891..26b6bb1 100644
--- a/ui/src/app/asset/asset.controller.js
+++ b/ui/src/app/asset/asset.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/asset/asset.directive.js 2(+1 -1)
diff --git a/ui/src/app/asset/asset.directive.js b/ui/src/app/asset/asset.directive.js
index 7110e6a..645766d 100644
--- a/ui/src/app/asset/asset.directive.js
+++ b/ui/src/app/asset/asset.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/asset/asset.routes.js 2(+1 -1)
diff --git a/ui/src/app/asset/asset.routes.js b/ui/src/app/asset/asset.routes.js
index 732f74c..9c86baa 100644
--- a/ui/src/app/asset/asset.routes.js
+++ b/ui/src/app/asset/asset.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/asset/asset-card.tpl.html 2(+1 -1)
diff --git a/ui/src/app/asset/asset-card.tpl.html b/ui/src/app/asset/asset-card.tpl.html
index b02b2e2..aff9eb0 100644
--- a/ui/src/app/asset/asset-card.tpl.html
+++ b/ui/src/app/asset/asset-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/asset/asset-fieldset.tpl.html b/ui/src/app/asset/asset-fieldset.tpl.html
index afa14ad..9282ae0 100644
--- a/ui/src/app/asset/asset-fieldset.tpl.html
+++ b/ui/src/app/asset/asset-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/asset/assets.tpl.html 8(+7 -1)
diff --git a/ui/src/app/asset/assets.tpl.html b/ui/src/app/asset/assets.tpl.html
index c4c0267..0f4fc19 100644
--- a/ui/src/app/asset/assets.tpl.html
+++ b/ui/src/app/asset/assets.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -66,4 +66,10 @@
entity-type="{{vm.types.entityType.asset}}">
</tb-relation-table>
</md-tab>
+ <md-tab ng-if="!vm.grid.detailsConfig.isDetailsEditMode && vm.grid.isTenantAdmin()" md-on-select="vm.grid.triggerResize()" label="{{ 'audit-log.audit-logs' | translate }}">
+ <tb-audit-log-table flex entity-type="vm.types.entityType.asset"
+ entity-id="vm.grid.operatingItem().id.id"
+ audit-log-mode="{{vm.types.auditLogMode.entity}}">
+ </tb-audit-log-table>
+ </md-tab>
</tb-grid>
diff --git a/ui/src/app/asset/assign-to-customer.controller.js b/ui/src/app/asset/assign-to-customer.controller.js
index 3df90ef..1c30a78 100644
--- a/ui/src/app/asset/assign-to-customer.controller.js
+++ b/ui/src/app/asset/assign-to-customer.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/asset/assign-to-customer.tpl.html b/ui/src/app/asset/assign-to-customer.tpl.html
index 9030ec4..357100d 100644
--- a/ui/src/app/asset/assign-to-customer.tpl.html
+++ b/ui/src/app/asset/assign-to-customer.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/asset/index.js 2(+1 -1)
diff --git a/ui/src/app/asset/index.js b/ui/src/app/asset/index.js
index 2426e85..6521c03 100644
--- a/ui/src/app/asset/index.js
+++ b/ui/src/app/asset/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/audit/audit-log.routes.js 44(+44 -0)
diff --git a/ui/src/app/audit/audit-log.routes.js b/ui/src/app/audit/audit-log.routes.js
new file mode 100644
index 0000000..bb098c7
--- /dev/null
+++ b/ui/src/app/audit/audit-log.routes.js
@@ -0,0 +1,44 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+/* eslint-disable import/no-unresolved, import/default */
+
+import auditLogsTemplate from './audit-logs.tpl.html';
+
+/* eslint-enable import/no-unresolved, import/default */
+
+/*@ngInject*/
+export default function AuditLogRoutes($stateProvider) {
+ $stateProvider
+ .state('home.auditLogs', {
+ url: '/auditLogs',
+ module: 'private',
+ auth: ['TENANT_ADMIN'],
+ views: {
+ "content@home": {
+ templateUrl: auditLogsTemplate,
+ controller: 'AuditLogsController',
+ controllerAs: 'vm'
+ }
+ },
+ data: {
+ searchEnabled: false,
+ pageTitle: 'audit-log.audit-logs'
+ },
+ ncyBreadcrumb: {
+ label: '{"icon": "track_changes", "label": "audit-log.audit-logs"}'
+ }
+ });
+}
ui/src/app/audit/audit-log.scss 90(+90 -0)
diff --git a/ui/src/app/audit/audit-log.scss b/ui/src/app/audit/audit-log.scss
new file mode 100644
index 0000000..7cae107
--- /dev/null
+++ b/ui/src/app/audit/audit-log.scss
@@ -0,0 +1,90 @@
+/**
+ * Copyright © 2016-2018 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.
+ */
+.tb-audit-logs {
+ background-color: #fff;
+ .tb-audit-log-margin-18px {
+ margin-bottom: 18px;
+ }
+ .tb-audit-log-toolbar {
+ font-size: 20px;
+ }
+ md-input-container.tb-audit-log-search-input {
+ .md-errors-spacer {
+ min-height: 0px;
+ }
+ }
+}
+
+.tb-audit-log-container {
+ overflow-x: auto;
+}
+
+
+
+md-list.tb-audit-log-table {
+ padding: 0px;
+ min-width: 700px;
+ &.tb-audit-log-table-full {
+ min-width: 900px;
+ }
+
+ md-list-item {
+ padding: 0px;
+ }
+
+ .tb-row {
+ height: 48px;
+ padding: 0px;
+ overflow: hidden;
+ }
+
+ .tb-row:hover {
+ background-color: #EEEEEE;
+ }
+
+ .tb-header:hover {
+ background: none;
+ }
+
+ .tb-header {
+ .tb-cell {
+ color: rgba(0,0,0,.54);
+ font-size: 12px;
+ font-weight: 700;
+ white-space: nowrap;
+ background: none;
+ }
+ }
+
+ .tb-cell {
+ padding: 0 24px;
+ margin: auto 0;
+ color: rgba(0,0,0,.87);
+ font-size: 13px;
+ vertical-align: middle;
+ text-align: left;
+ overflow: hidden;
+ .md-button {
+ padding: 0;
+ margin: 0;
+ }
+ }
+
+ .tb-cell.tb-number {
+ text-align: right;
+ }
+
+}
diff --git a/ui/src/app/audit/audit-log-details-dialog.controller.js b/ui/src/app/audit/audit-log-details-dialog.controller.js
new file mode 100644
index 0000000..01109bd
--- /dev/null
+++ b/ui/src/app/audit/audit-log-details-dialog.controller.js
@@ -0,0 +1,103 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+import $ from 'jquery';
+import 'brace/ext/language_tools';
+import 'brace/mode/java';
+import 'brace/theme/github';
+
+/* eslint-disable angular/angularelement */
+
+import './audit-log-details-dialog.scss';
+
+/*@ngInject*/
+export default function AuditLogDetailsDialogController($mdDialog, types, auditLog, showingCallback) {
+
+ var vm = this;
+
+ showingCallback.onShowing = function(scope, element) {
+ updateEditorSize(element, vm.actionData, 'tb-audit-log-action-data');
+ vm.actionDataEditor.resize();
+ if (vm.displayFailureDetails) {
+ updateEditorSize(element, vm.actionFailureDetails, 'tb-audit-log-failure-details');
+ vm.failureDetailsEditor.resize();
+ }
+ };
+
+ vm.types = types;
+ vm.auditLog = auditLog;
+ vm.displayFailureDetails = auditLog.actionStatus == types.auditLogActionStatus.FAILURE.value;
+ vm.actionData = auditLog.actionDataText;
+ vm.actionFailureDetails = auditLog.actionFailureDetails;
+
+ vm.actionDataContentOptions = {
+ useWrapMode: false,
+ mode: 'java',
+ showGutter: false,
+ showPrintMargin: false,
+ theme: 'github',
+ advanced: {
+ enableSnippets: false,
+ enableBasicAutocompletion: false,
+ enableLiveAutocompletion: false
+ },
+ onLoad: function (_ace) {
+ vm.actionDataEditor = _ace;
+ }
+ };
+
+ vm.failureDetailsContentOptions = {
+ useWrapMode: false,
+ mode: 'java',
+ showGutter: false,
+ showPrintMargin: false,
+ theme: 'github',
+ advanced: {
+ enableSnippets: false,
+ enableBasicAutocompletion: false,
+ enableLiveAutocompletion: false
+ },
+ onLoad: function (_ace) {
+ vm.failureDetailsEditor = _ace;
+ }
+ };
+
+ function updateEditorSize(element, content, editorId) {
+ var newHeight = 200;
+ var newWidth = 600;
+ if (content && content.length > 0) {
+ var lines = content.split('\n');
+ newHeight = 16 * lines.length + 16;
+ var maxLineLength = 0;
+ for (var i in lines) {
+ var line = lines[i].replace(/\t/g, ' ').replace(/\n/g, '');
+ var lineLength = line.length;
+ maxLineLength = Math.max(maxLineLength, lineLength);
+ }
+ newWidth = 8 * maxLineLength + 16;
+ }
+ $('#'+editorId, element).height(newHeight.toString() + "px").css('min-height', newHeight.toString() + "px")
+ .width(newWidth.toString() + "px");
+ }
+
+ vm.close = close;
+
+ function close () {
+ $mdDialog.hide();
+ }
+
+}
+
+/* eslint-enable angular/angularelement */
diff --git a/ui/src/app/audit/audit-log-details-dialog.scss b/ui/src/app/audit/audit-log-details-dialog.scss
new file mode 100644
index 0000000..1a1507c
--- /dev/null
+++ b/ui/src/app/audit/audit-log-details-dialog.scss
@@ -0,0 +1,22 @@
+/**
+ * Copyright © 2016-2018 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.
+ */
+#tb-audit-log-action-data, #tb-audit-log-failure-details {
+ min-width: 400px;
+ min-height: 50px;
+ width: 100%;
+ height: 100%;
+ border: 1px solid #C0C0C0;
+}
\ No newline at end of file
diff --git a/ui/src/app/audit/audit-log-details-dialog.tpl.html b/ui/src/app/audit/audit-log-details-dialog.tpl.html
new file mode 100644
index 0000000..9c415b7
--- /dev/null
+++ b/ui/src/app/audit/audit-log-details-dialog.tpl.html
@@ -0,0 +1,49 @@
+<!--
+
+ Copyright © 2016-2018 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.
+
+-->
+<md-dialog aria-label="{{ 'audit-log.audit-log-details' | translate }}">
+ <md-toolbar>
+ <div class="md-toolbar-tools">
+ <h2 translate>audit-log.audit-log-details</h2>
+ <span flex></span>
+ <md-button class="md-icon-button" ng-click="vm.close()">
+ <ng-md-icon icon="close" aria-label="{{ 'dialog.close' | translate }}"></ng-md-icon>
+ </md-button>
+ </div>
+ </md-toolbar>
+ <md-dialog-content>
+ <div class="md-dialog-content" layout="column">
+ <label translate class="tb-title no-padding">audit-log.action-data</label>
+ <div flex id="tb-audit-log-action-data" readonly
+ ui-ace="vm.actionDataContentOptions"
+ ng-model="vm.actionData">
+ </div>
+ <span style="height: 30px;"></span>
+ <label ng-show="vm.displayFailureDetails" translate class="tb-title no-padding">audit-log.failure-details</label>
+ <div ng-show="vm.displayFailureDetails" flex id="tb-audit-log-failure-details" readonly
+ ui-ace="vm.failureDetailsContentOptions"
+ ng-model="vm.actionFailureDetails">
+ </div>
+ </div>
+ </md-dialog-content>
+ <md-dialog-actions layout="row">
+ <span flex></span>
+ <md-button ng-disabled="$root.loading" ng-click="vm.close()" style="margin-right:20px;">{{ 'action.close' |
+ translate }}
+ </md-button>
+ </md-dialog-actions>
+</md-dialog>
diff --git a/ui/src/app/audit/audit-log-header.directive.js b/ui/src/app/audit/audit-log-header.directive.js
new file mode 100644
index 0000000..3388cc2
--- /dev/null
+++ b/ui/src/app/audit/audit-log-header.directive.js
@@ -0,0 +1,41 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+/* eslint-disable import/no-unresolved, import/default */
+
+import auditLogHeaderTemplate from './audit-log-header.tpl.html';
+
+/* eslint-enable import/no-unresolved, import/default */
+
+/*@ngInject*/
+export default function AuditLogHeaderDirective($compile, $templateCache, types) {
+
+ var linker = function (scope, element, attrs) {
+
+ var template = $templateCache.get(auditLogHeaderTemplate);
+ element.html(template);
+ scope.auditLogMode = attrs.auditLogMode;
+ scope.types = types;
+ $compile(element.contents())(scope);
+
+ };
+
+ return {
+ restrict: "A",
+ replace: false,
+ link: linker,
+ scope: false
+ };
+}
ui/src/app/audit/audit-log-header.tpl.html 24(+24 -0)
diff --git a/ui/src/app/audit/audit-log-header.tpl.html b/ui/src/app/audit/audit-log-header.tpl.html
new file mode 100644
index 0000000..741c832
--- /dev/null
+++ b/ui/src/app/audit/audit-log-header.tpl.html
@@ -0,0 +1,24 @@
+<!--
+
+ Copyright © 2016-2018 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.
+
+-->
+<div translate class="tb-cell" flex="30">audit-log.timestamp</div>
+<div ng-if="auditLogMode != types.auditLogMode.entity" translate class="tb-cell" flex="10">audit-log.entity-type</div>
+<div ng-if="auditLogMode != types.auditLogMode.entity" translate class="tb-cell" flex="30">audit-log.entity-name</div>
+<div ng-if="auditLogMode != types.auditLogMode.user" translate class="tb-cell" flex="30">audit-log.user</div>
+<div translate class="tb-cell" flex="15">audit-log.type</div>
+<div translate class="tb-cell" flex="15">audit-log.status</div>
+<div translate class="tb-cell" flex="10">audit-log.details</div>
ui/src/app/audit/audit-log-row.directive.js 67(+67 -0)
diff --git a/ui/src/app/audit/audit-log-row.directive.js b/ui/src/app/audit/audit-log-row.directive.js
new file mode 100644
index 0000000..2c2e170
--- /dev/null
+++ b/ui/src/app/audit/audit-log-row.directive.js
@@ -0,0 +1,67 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+/* eslint-disable import/no-unresolved, import/default */
+
+import auditLogDetailsDialogTemplate from './audit-log-details-dialog.tpl.html';
+
+import auditLogRowTemplate from './audit-log-row.tpl.html';
+
+/* eslint-enable import/no-unresolved, import/default */
+
+/*@ngInject*/
+export default function AuditLogRowDirective($compile, $templateCache, types, $mdDialog, $document) {
+
+ var linker = function (scope, element, attrs) {
+
+ var template = $templateCache.get(auditLogRowTemplate);
+ element.html(template);
+
+ scope.auditLog = attrs.auditLog;
+ scope.auditLogMode = attrs.auditLogMode;
+ scope.types = types;
+
+ scope.showAuditLogDetails = function($event) {
+ var onShowingCallback = {
+ onShowing: function(){}
+ }
+ $mdDialog.show({
+ controller: 'AuditLogDetailsDialogController',
+ controllerAs: 'vm',
+ templateUrl: auditLogDetailsDialogTemplate,
+ locals: {
+ auditLog: scope.auditLog,
+ showingCallback: onShowingCallback
+ },
+ parent: angular.element($document[0].body),
+ targetEvent: $event,
+ fullscreen: true,
+ skipHide: true,
+ onShowing: function(scope, element) {
+ onShowingCallback.onShowing(scope, element);
+ }
+ });
+ }
+
+ $compile(element.contents())(scope);
+ }
+
+ return {
+ restrict: "A",
+ replace: false,
+ link: linker,
+ scope: false
+ };
+}
ui/src/app/audit/audit-log-row.tpl.html 36(+36 -0)
diff --git a/ui/src/app/audit/audit-log-row.tpl.html b/ui/src/app/audit/audit-log-row.tpl.html
new file mode 100644
index 0000000..a735169
--- /dev/null
+++ b/ui/src/app/audit/audit-log-row.tpl.html
@@ -0,0 +1,36 @@
+<!--
+
+ Copyright © 2016-2018 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.
+
+-->
+<div class="tb-cell" flex="30">{{ auditLog.createdTime | date : 'yyyy-MM-dd HH:mm:ss' }}</div>
+<div ng-if="auditLogMode != types.auditLogMode.entity" class="tb-cell" flex="10">{{ auditLog.entityTypeText }}</div>
+<div ng-if="auditLogMode != types.auditLogMode.entity" class="tb-cell" flex="30">{{ auditLog.entityName }}</div>
+<div ng-if="auditLogMode != types.auditLogMode.user" class="tb-cell" flex="30">{{ auditLog.userName }}</div>
+<div class="tb-cell" flex="15">{{ auditLog.actionTypeText }}</div>
+<div class="tb-cell" flex="15">{{ auditLog.actionStatusText }}</div>
+<div class="tb-cell" flex="10">
+ <md-button class="md-icon-button md-primary"
+ ng-click="showAuditLogDetails($event)"
+ aria-label="{{ 'action.view' | translate }}">
+ <md-tooltip md-direction="top">
+ {{ 'audit-log.details' | translate }}
+ </md-tooltip>
+ <md-icon aria-label="{{ 'action.view' | translate }}"
+ class="material-icons">
+ more_horiz
+ </md-icon>
+ </md-button>
+</div>
ui/src/app/audit/audit-logs.controller.js 23(+23 -0)
diff --git a/ui/src/app/audit/audit-logs.controller.js b/ui/src/app/audit/audit-logs.controller.js
new file mode 100644
index 0000000..25bca75
--- /dev/null
+++ b/ui/src/app/audit/audit-logs.controller.js
@@ -0,0 +1,23 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+/*@ngInject*/
+export default function AuditLogsController(types) {
+
+ var vm = this;
+
+ vm.types = types;
+
+}
\ No newline at end of file
ui/src/app/audit/audit-logs.tpl.html 22(+22 -0)
diff --git a/ui/src/app/audit/audit-logs.tpl.html b/ui/src/app/audit/audit-logs.tpl.html
new file mode 100644
index 0000000..feea322
--- /dev/null
+++ b/ui/src/app/audit/audit-logs.tpl.html
@@ -0,0 +1,22 @@
+<!--
+
+ Copyright © 2016-2018 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.
+
+-->
+<tb-audit-log-table class="md-whiteframe-z1"
+ flex
+ audit-log-mode="{{vm.types.auditLogMode.tenant}}"
+ page-mode="true">
+</tb-audit-log-table>
ui/src/app/audit/audit-log-table.directive.js 262(+262 -0)
diff --git a/ui/src/app/audit/audit-log-table.directive.js b/ui/src/app/audit/audit-log-table.directive.js
new file mode 100644
index 0000000..81bfd4f
--- /dev/null
+++ b/ui/src/app/audit/audit-log-table.directive.js
@@ -0,0 +1,262 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+import './audit-log.scss';
+
+/* eslint-disable import/no-unresolved, import/default */
+
+import auditLogTableTemplate from './audit-log-table.tpl.html';
+
+/* eslint-enable import/no-unresolved, import/default */
+
+/*@ngInject*/
+export default function AuditLogTableDirective($compile, $templateCache, $rootScope, $filter, $translate, types, auditLogService) {
+
+ var linker = function (scope, element) {
+
+ var template = $templateCache.get(auditLogTableTemplate);
+
+ element.html(template);
+
+ scope.types = types;
+
+ var pageSize = 20;
+ var startTime = 0;
+ var endTime = 0;
+
+ scope.timewindow = {
+ history: {
+ timewindowMs: 24 * 60 * 60 * 1000 // 1 day
+ }
+ }
+
+ scope.topIndex = 0;
+ scope.searchText = '';
+
+ scope.theAuditLogs = {
+ getItemAtIndex: function (index) {
+ if (index > scope.auditLogs.filtered.length) {
+ scope.theAuditLogs.fetchMoreItems_(index);
+ return null;
+ }
+ return scope.auditLogs.filtered[index];
+ },
+
+ getLength: function () {
+ if (scope.auditLogs.hasNext) {
+ return scope.auditLogs.filtered.length + scope.auditLogs.nextPageLink.limit;
+ } else {
+ return scope.auditLogs.filtered.length;
+ }
+ },
+
+ fetchMoreItems_: function () {
+ if (scope.auditLogs.hasNext && !scope.auditLogs.pending) {
+ var promise = getAuditLogsPromise(scope.auditLogs.nextPageLink);
+ if (promise) {
+ scope.auditLogs.pending = true;
+ promise.then(
+ function success(auditLogs) {
+ scope.auditLogs.data = scope.auditLogs.data.concat(prepareAuditLogsData(auditLogs.data));
+ scope.auditLogs.filtered = $filter('filter')(scope.auditLogs.data, {$: scope.searchText});
+ scope.auditLogs.nextPageLink = auditLogs.nextPageLink;
+ scope.auditLogs.hasNext = auditLogs.hasNext;
+ if (scope.auditLogs.hasNext) {
+ scope.auditLogs.nextPageLink.limit = pageSize;
+ }
+ scope.auditLogs.pending = false;
+ },
+ function fail() {
+ scope.auditLogs.hasNext = false;
+ scope.auditLogs.pending = false;
+ });
+ } else {
+ scope.auditLogs.hasNext = false;
+ }
+ }
+ }
+ };
+
+ function prepareAuditLogsData(data) {
+ data.forEach(
+ auditLog => {
+ auditLog.entityTypeText = $translate.instant(types.entityTypeTranslations[auditLog.entityId.entityType].type);
+ auditLog.actionTypeText = $translate.instant(types.auditLogActionType[auditLog.actionType].name);
+ auditLog.actionStatusText = $translate.instant(types.auditLogActionStatus[auditLog.actionStatus].name);
+ auditLog.actionDataText = auditLog.actionData ? angular.toJson(auditLog.actionData, true) : '';
+ }
+ );
+ return data;
+ }
+
+ scope.$watch("entityId", function(newVal, prevVal) {
+ if (newVal && !angular.equals(newVal, prevVal)) {
+ resetFilter();
+ scope.reload();
+ }
+ });
+
+ scope.$watch("userId", function(newVal, prevVal) {
+ if (newVal && !angular.equals(newVal, prevVal)) {
+ resetFilter();
+ scope.reload();
+ }
+ });
+
+ scope.$watch("customerId", function(newVal, prevVal) {
+ if (newVal && !angular.equals(newVal, prevVal)) {
+ resetFilter();
+ scope.reload();
+ }
+ });
+
+ function getAuditLogsPromise(pageLink) {
+ switch(scope.auditLogMode) {
+ case types.auditLogMode.tenant:
+ return auditLogService.getAuditLogs(pageLink);
+ case types.auditLogMode.entity:
+ if (scope.entityType && scope.entityId) {
+ return auditLogService.getAuditLogsByEntityId(scope.entityType, scope.entityId,
+ pageLink);
+ } else {
+ return null;
+ }
+ case types.auditLogMode.user:
+ if (scope.userId) {
+ return auditLogService.getAuditLogsByUserId(scope.userId, pageLink);
+ } else {
+ return null;
+ }
+ case types.auditLogMode.customer:
+ if (scope.customerId) {
+ return auditLogService.getAuditLogsByCustomerId(scope.customerId, pageLink);
+ } else {
+ return null;
+ }
+ }
+ }
+
+ function destroyWatchers() {
+ if (scope.timewindowWatchHandle) {
+ scope.timewindowWatchHandle();
+ scope.timewindowWatchHandle = null;
+ }
+ if (scope.searchTextWatchHandle) {
+ scope.searchTextWatchHandle();
+ scope.searchTextWatchHandle = null;
+ }
+ }
+
+ function initWatchers() {
+ scope.timewindowWatchHandle = scope.$watch("timewindow", function(newVal, prevVal) {
+ if (newVal && !angular.equals(newVal, prevVal)) {
+ scope.reload();
+ }
+ }, true);
+
+ scope.searchTextWatchHandle = scope.$watch("searchText", function(newVal, prevVal) {
+ if (!angular.equals(newVal, prevVal)) {
+ scope.searchTextUpdated();
+ }
+ }, true);
+ }
+
+ function resetFilter() {
+ destroyWatchers();
+ scope.timewindow = {
+ history: {
+ timewindowMs: 24 * 60 * 60 * 1000 // 1 day
+ }
+ };
+ scope.searchText = '';
+ initWatchers();
+ }
+
+ function updateTimeWindowRange () {
+ if (scope.timewindow.history.timewindowMs) {
+ var currentTime = (new Date).getTime();
+ startTime = currentTime - scope.timewindow.history.timewindowMs;
+ endTime = currentTime;
+ } else {
+ startTime = scope.timewindow.history.fixedTimewindow.startTimeMs;
+ endTime = scope.timewindow.history.fixedTimewindow.endTimeMs;
+ }
+ }
+
+ scope.reload = function() {
+ scope.topIndex = 0;
+ updateTimeWindowRange();
+ scope.auditLogs = {
+ data: [],
+ filtered: [],
+ nextPageLink: {
+ limit: pageSize,
+ startTime: startTime,
+ endTime: endTime
+ },
+ hasNext: true,
+ pending: false
+ };
+ scope.theAuditLogs.getItemAtIndex(pageSize);
+ }
+
+ scope.searchTextUpdated = function() {
+ scope.auditLogs.filtered = $filter('filter')(scope.auditLogs.data, {$: scope.searchText});
+ scope.theAuditLogs.getItemAtIndex(pageSize);
+ }
+
+ scope.noData = function() {
+ return scope.auditLogs.data.length == 0 && !scope.auditLogs.hasNext;
+ }
+
+ scope.hasData = function() {
+ return scope.auditLogs.data.length > 0;
+ }
+
+ scope.loading = function() {
+ return $rootScope.loading;
+ }
+
+ scope.hasScroll = function() {
+ var repeatContainer = scope.repeatContainer[0];
+ if (repeatContainer) {
+ var scrollElement = repeatContainer.children[0];
+ if (scrollElement) {
+ return scrollElement.scrollHeight > scrollElement.clientHeight;
+ }
+ }
+ return false;
+ }
+
+ scope.reload();
+
+ initWatchers();
+
+ $compile(element.contents())(scope);
+ }
+
+ return {
+ restrict: "E",
+ link: linker,
+ scope: {
+ entityType: '=?',
+ entityId: '=?',
+ userId: '=?',
+ customerId: '=?',
+ auditLogMode: '@',
+ pageMode: '@?'
+ }
+ };
+}
ui/src/app/audit/audit-log-table.tpl.html 68(+68 -0)
diff --git a/ui/src/app/audit/audit-log-table.tpl.html b/ui/src/app/audit/audit-log-table.tpl.html
new file mode 100644
index 0000000..46a4679
--- /dev/null
+++ b/ui/src/app/audit/audit-log-table.tpl.html
@@ -0,0 +1,68 @@
+<!--
+
+ Copyright © 2016-2018 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.
+
+-->
+<md-content flex class="md-padding tb-absolute-fill" layout="column">
+ <div flex layout="column" class="tb-audit-logs" ng-class="{'md-whiteframe-z1': pageMode}">
+ <div layout="column" layout-gt-sm="row" layout-align-gt-sm="start center" class="tb-audit-log-toolbar" ng-class="{'md-padding': pageMode, 'tb-audit-log-margin-18px': !pageMode}">
+ <tb-timewindow ng-model="timewindow" history-only as-button="true"></tb-timewindow>
+ <div flex layout="row" layout-align="start center">
+ <md-button class="md-icon-button" aria-label="{{ 'action.search' | translate }}">
+ <md-icon aria-label="{{ 'action.search' | translate }}" class="material-icons">search</md-icon>
+ <md-tooltip md-direction="top">
+ {{'audit-log.search' | translate}}
+ </md-tooltip>
+ </md-button>
+ <md-input-container flex class="tb-audit-log-search-input">
+ <label> </label>
+ <input ng-model="searchText" placeholder="{{'audit-log.search' | translate}}"/>
+ </md-input-container>
+ <md-button ng-disabled="$root.loading" class="md-icon-button" aria-label="Close" ng-click="searchText = ''">
+ <md-icon aria-label="Close" class="material-icons">close</md-icon>
+ <md-tooltip md-direction="top">
+ {{ 'audit-log.clear-search' | translate }}
+ </md-tooltip>
+ </md-button>
+ <md-button ng-disabled="$root.loading"
+ class="md-icon-button" ng-click="reload()">
+ <md-icon>refresh</md-icon>
+ <md-tooltip md-direction="top">
+ {{ 'action.refresh' | translate }}
+ </md-tooltip>
+ </md-button>
+ </div>
+ </div>
+ <div flex layout="column" class="tb-audit-log-container" ng-class="{'md-whiteframe-z1': !pageMode}">
+ <md-list flex layout="column" class="tb-audit-log-table" ng-class="{'tb-audit-log-table-full': pageMode}">
+ <md-list class="tb-row tb-header" layout="row" layout-align="start center" tb-audit-log-header audit-log-mode="{{auditLogMode}}">
+ </md-list>
+ <md-progress-linear style="max-height: 0px;" md-mode="indeterminate" ng-disabled="!$root.loading"
+ ng-show="$root.loading"></md-progress-linear>
+ <md-divider></md-divider>
+ <span translate layout-align="center center"
+ style="margin-top: 25px;"
+ class="tb-prompt" ng-show="noData()">audit-log.no-audit-logs-prompt</span>
+ <md-virtual-repeat-container ng-show="hasData()" flex md-top-index="topIndex" tb-scope-element="repeatContainer">
+ <md-list-item md-virtual-repeat="auditLog in theAuditLogs" md-on-demand flex ng-style="hasScroll() ? {'margin-right':'-15px'} : {}">
+ <md-list class="tb-row" flex layout="row" layout-align="start center" tb-audit-log-row audit-log-mode="{{auditLogMode}}" audit-log="{{auditLog}}">
+ </md-list>
+ <md-divider flex></md-divider>
+ </md-list-item>
+ </md-virtual-repeat-container>
+ </md-list>
+ </div>
+ </div>
+</md-content>
ui/src/app/audit/index.js 30(+30 -0)
diff --git a/ui/src/app/audit/index.js b/ui/src/app/audit/index.js
new file mode 100644
index 0000000..d522e09
--- /dev/null
+++ b/ui/src/app/audit/index.js
@@ -0,0 +1,30 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+import AuditLogRoutes from './audit-log.routes';
+import AuditLogsController from './audit-logs.controller';
+import AuditLogDetailsDialogController from './audit-log-details-dialog.controller';
+import AuditLogHeaderDirective from './audit-log-header.directive';
+import AuditLogRowDirective from './audit-log-row.directive';
+import AuditLogTableDirective from './audit-log-table.directive';
+
+export default angular.module('thingsboard.auditLog', [])
+ .config(AuditLogRoutes)
+ .controller('AuditLogsController', AuditLogsController)
+ .controller('AuditLogDetailsDialogController', AuditLogDetailsDialogController)
+ .directive('tbAuditLogHeader', AuditLogHeaderDirective)
+ .directive('tbAuditLogRow', AuditLogRowDirective)
+ .directive('tbAuditLogTable', AuditLogTableDirective)
+ .name;
diff --git a/ui/src/app/common/dashboard-utils.service.js b/ui/src/app/common/dashboard-utils.service.js
index c4b2486..f1401b7 100644
--- a/ui/src/app/common/dashboard-utils.service.js
+++ b/ui/src/app/common/dashboard-utils.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default angular.module('thingsboard.dashboardUtils', [])
.factory('dashboardUtils', DashboardUtils)
.name;
ui/src/app/common/raf.provider.js 3(+1 -2)
diff --git a/ui/src/app/common/raf.provider.js b/ui/src/app/common/raf.provider.js
index 136f6ae..13ff62e 100644
--- a/ui/src/app/common/raf.provider.js
+++ b/ui/src/app/common/raf.provider.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default angular.module('thingsboard.raf', [])
.provider('tbRaf', TbRAFProvider)
.name;
ui/src/app/common/types.constant.js 66(+65 -1)
diff --git a/ui/src/app/common/types.constant.js b/ui/src/app/common/types.constant.js
index 5b3c9e4..ef6ffde 100644
--- a/ui/src/app/common/types.constant.js
+++ b/ui/src/app/common/types.constant.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -156,6 +156,63 @@ export default angular.module('thingsboard.types', [])
color: "green"
}
},
+ auditLogActionType: {
+ "ADDED": {
+ name: "audit-log.type-added"
+ },
+ "DELETED": {
+ name: "audit-log.type-deleted"
+ },
+ "UPDATED": {
+ name: "audit-log.type-updated"
+ },
+ "ATTRIBUTES_UPDATED": {
+ name: "audit-log.type-attributes-updated"
+ },
+ "ATTRIBUTES_DELETED": {
+ name: "audit-log.type-attributes-deleted"
+ },
+ "RPC_CALL": {
+ name: "audit-log.type-rpc-call"
+ },
+ "CREDENTIALS_UPDATED": {
+ name: "audit-log.type-credentials-updated"
+ },
+ "ASSIGNED_TO_CUSTOMER": {
+ name: "audit-log.type-assigned-to-customer"
+ },
+ "UNASSIGNED_FROM_CUSTOMER": {
+ name: "audit-log.type-unassigned-from-customer"
+ },
+ "ACTIVATED": {
+ name: "audit-log.type-activated"
+ },
+ "SUSPENDED": {
+ name: "audit-log.type-suspended"
+ },
+ "CREDENTIALS_READ": {
+ name: "audit-log.type-credentials-read"
+ },
+ "ATTRIBUTES_READ": {
+ name: "audit-log.type-attributes-read"
+ }
+ },
+ auditLogActionStatus: {
+ "SUCCESS": {
+ value: "SUCCESS",
+ name: "audit-log.status-success"
+ },
+ "FAILURE": {
+ value: "FAILURE",
+ name: "audit-log.status-failure"
+ }
+ },
+ auditLogMode: {
+ tenant: "tenant",
+ entity: "entity",
+ user: "user",
+ customer: "customer"
+ },
aliasFilterType: {
singleEntity: {
value: 'singleEntity',
@@ -239,6 +296,9 @@ export default angular.module('thingsboard.types', [])
dashboard: "DASHBOARD",
alarm: "ALARM"
},
+ aliasEntityType: {
+ current_customer: "CURRENT_CUSTOMER"
+ },
entityTypeTranslations: {
"DEVICE": {
type: 'entity.type-device',
@@ -293,6 +353,10 @@ export default angular.module('thingsboard.types', [])
typePlural: 'entity.type-alarms',
list: 'entity.list-of-alarms',
nameStartsWith: 'entity.alarm-name-starts-with'
+ },
+ "CURRENT_CUSTOMER": {
+ type: 'entity.type-current-customer',
+ list: 'entity.type-current-customer'
}
},
entitySearchDirection: {
ui/src/app/common/utf8-support.js 3(+1 -2)
diff --git a/ui/src/app/common/utf8-support.js b/ui/src/app/common/utf8-support.js
index 464fa40..012b432 100644
--- a/ui/src/app/common/utf8-support.js
+++ b/ui/src/app/common/utf8-support.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export function utf8Encode(str) {
var result;
ui/src/app/common/utils.service.js 7(+4 -3)
diff --git a/ui/src/app/common/utils.service.js b/ui/src/app/common/utils.service.js
index 085a28b..53aa1c5 100644
--- a/ui/src/app/common/utils.service.js
+++ b/ui/src/app/common/utils.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import materialIconsCodepoints from 'raw-loader!material-design-icons/iconfont/codepoints';
@@ -553,7 +552,9 @@ function Utils($mdColorPalette, $rootScope, $window, $translate, $q, $timeout, t
var aspect = imageAspectMap[urlHashCode];
if (angular.isUndefined(aspect)) {
var testImage = document.createElement('img'); // eslint-disable-line
- testImage.style.visibility = 'hidden';
+ testImage.style.position = 'absolute';
+ testImage.style.left = '-99999px';
+ testImage.style.top = '-99999px';
testImage.onload = function() {
aspect = testImage.width / testImage.height;
document.body.removeChild(testImage); //eslint-disable-line
diff --git a/ui/src/app/component/component.directive.js b/ui/src/app/component/component.directive.js
index b381f7c..35e79c0 100644
--- a/ui/src/app/component/component.directive.js
+++ b/ui/src/app/component/component.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/component/component.tpl.html b/ui/src/app/component/component.tpl.html
index d007ba6..9edfeff 100644
--- a/ui/src/app/component/component.tpl.html
+++ b/ui/src/app/component/component.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/component/component-dialog.controller.js b/ui/src/app/component/component-dialog.controller.js
index eacb74c..9bceca9 100644
--- a/ui/src/app/component/component-dialog.controller.js
+++ b/ui/src/app/component/component-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/component/component-dialog.service.js b/ui/src/app/component/component-dialog.service.js
index c3946c1..cbd3ccb 100644
--- a/ui/src/app/component/component-dialog.service.js
+++ b/ui/src/app/component/component-dialog.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/component/component-dialog.tpl.html b/ui/src/app/component/component-dialog.tpl.html
index 841d7ef..5bea1a5 100644
--- a/ui/src/app/component/component-dialog.tpl.html
+++ b/ui/src/app/component/component-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/component/index.js 2(+1 -1)
diff --git a/ui/src/app/component/index.js b/ui/src/app/component/index.js
index c1cea63..de63f9d 100644
--- a/ui/src/app/component/index.js
+++ b/ui/src/app/component/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/circular-progress.directive.js b/ui/src/app/components/circular-progress.directive.js
index e957e9d..5ac5b2e 100644
--- a/ui/src/app/components/circular-progress.directive.js
+++ b/ui/src/app/components/circular-progress.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/confirm-on-exit.directive.js b/ui/src/app/components/confirm-on-exit.directive.js
index 28b0734..fe9a9bd 100644
--- a/ui/src/app/components/confirm-on-exit.directive.js
+++ b/ui/src/app/components/confirm-on-exit.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/contact.directive.js b/ui/src/app/components/contact.directive.js
index c32d50a..344d0e9 100644
--- a/ui/src/app/components/contact.directive.js
+++ b/ui/src/app/components/contact.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/contact.tpl.html b/ui/src/app/components/contact.tpl.html
index 7b360f7..3490121 100644
--- a/ui/src/app/components/contact.tpl.html
+++ b/ui/src/app/components/contact.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/contact-short.filter.js b/ui/src/app/components/contact-short.filter.js
index 3b05d06..c162985 100644
--- a/ui/src/app/components/contact-short.filter.js
+++ b/ui/src/app/components/contact-short.filter.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/dashboard.directive.js b/ui/src/app/components/dashboard.directive.js
index c489c32..0cfdc82 100644
--- a/ui/src/app/components/dashboard.directive.js
+++ b/ui/src/app/components/dashboard.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/components/dashboard.scss 2(+1 -1)
diff --git a/ui/src/app/components/dashboard.scss b/ui/src/app/components/dashboard.scss
index cf56c15..9f76347 100644
--- a/ui/src/app/components/dashboard.scss
+++ b/ui/src/app/components/dashboard.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/dashboard.tpl.html b/ui/src/app/components/dashboard.tpl.html
index e374fab..376f2d6 100644
--- a/ui/src/app/components/dashboard.tpl.html
+++ b/ui/src/app/components/dashboard.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/dashboard-autocomplete.directive.js b/ui/src/app/components/dashboard-autocomplete.directive.js
index 2235b82..ee35335 100644
--- a/ui/src/app/components/dashboard-autocomplete.directive.js
+++ b/ui/src/app/components/dashboard-autocomplete.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -48,7 +48,7 @@ function DashboardAutocomplete($compile, $templateCache, $q, dashboardService, u
var promise;
if (scope.dashboardsScope === 'customer' || userService.getAuthority() === 'CUSTOMER_USER') {
if (scope.customerId) {
- promise = dashboardService.getCustomerDashboards(scope.customerId, pageLink, false, {ignoreLoading: true});
+ promise = dashboardService.getCustomerDashboards(scope.customerId, pageLink, {ignoreLoading: true});
} else {
promise = $q.when({data: []});
}
@@ -60,7 +60,7 @@ function DashboardAutocomplete($compile, $templateCache, $q, dashboardService, u
promise = $q.when({data: []});
}
} else {
- promise = dashboardService.getTenantDashboards(pageLink, false, {ignoreLoading: true});
+ promise = dashboardService.getTenantDashboards(pageLink, {ignoreLoading: true});
}
}
diff --git a/ui/src/app/components/dashboard-autocomplete.scss b/ui/src/app/components/dashboard-autocomplete.scss
index 1c73689..9541fe1 100644
--- a/ui/src/app/components/dashboard-autocomplete.scss
+++ b/ui/src/app/components/dashboard-autocomplete.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/dashboard-autocomplete.tpl.html b/ui/src/app/components/dashboard-autocomplete.tpl.html
index d1193c2..791747e 100644
--- a/ui/src/app/components/dashboard-autocomplete.tpl.html
+++ b/ui/src/app/components/dashboard-autocomplete.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/dashboard-select.directive.js b/ui/src/app/components/dashboard-select.directive.js
index ac5cd3d..99069e7 100644
--- a/ui/src/app/components/dashboard-select.directive.js
+++ b/ui/src/app/components/dashboard-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -48,12 +48,12 @@ function DashboardSelect($compile, $templateCache, $q, $mdMedia, $mdPanel, $docu
var promise;
if (scope.dashboardsScope === 'customer' || userService.getAuthority() === 'CUSTOMER_USER') {
if (scope.customerId && scope.customerId != types.id.nullUid) {
- promise = dashboardService.getCustomerDashboards(scope.customerId, pageLink, false, {ignoreLoading: true});
+ promise = dashboardService.getCustomerDashboards(scope.customerId, pageLink, {ignoreLoading: true});
} else {
promise = $q.when({data: []});
}
} else {
- promise = dashboardService.getTenantDashboards(pageLink, false, {ignoreLoading: true});
+ promise = dashboardService.getTenantDashboards(pageLink, {ignoreLoading: true});
}
promise.then(function success(result) {
diff --git a/ui/src/app/components/dashboard-select.scss b/ui/src/app/components/dashboard-select.scss
index 5c16f2b..1dee53d 100644
--- a/ui/src/app/components/dashboard-select.scss
+++ b/ui/src/app/components/dashboard-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import '../../scss/constants';
tb-dashboard-select {
diff --git a/ui/src/app/components/dashboard-select.tpl.html b/ui/src/app/components/dashboard-select.tpl.html
index 6915d6f..77ed013 100644
--- a/ui/src/app/components/dashboard-select.tpl.html
+++ b/ui/src/app/components/dashboard-select.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<md-select hide-xs hide-sm hide-md
ng-required="tbRequired"
ng-disabled="disabled"
diff --git a/ui/src/app/components/dashboard-select-panel.controller.js b/ui/src/app/components/dashboard-select-panel.controller.js
index c4d94d8..cfefb09 100644
--- a/ui/src/app/components/dashboard-select-panel.controller.js
+++ b/ui/src/app/components/dashboard-select-panel.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function DashboardSelectPanelController(mdPanelRef, $scope, $filter, dashboards, dashboardId, onDashboardSelected) {
diff --git a/ui/src/app/components/dashboard-select-panel.tpl.html b/ui/src/app/components/dashboard-select-panel.tpl.html
index c9b4f4b..3125e45 100644
--- a/ui/src/app/components/dashboard-select-panel.tpl.html
+++ b/ui/src/app/components/dashboard-select-panel.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datakey-config.directive.js b/ui/src/app/components/datakey-config.directive.js
index d19617f..fafc09e 100644
--- a/ui/src/app/components/datakey-config.directive.js
+++ b/ui/src/app/components/datakey-config.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datakey-config.scss b/ui/src/app/components/datakey-config.scss
index d1110c9..0de8b63 100644
--- a/ui/src/app/components/datakey-config.scss
+++ b/ui/src/app/components/datakey-config.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datakey-config.tpl.html b/ui/src/app/components/datakey-config.tpl.html
index bb7a4b9..f9126e6 100644
--- a/ui/src/app/components/datakey-config.tpl.html
+++ b/ui/src/app/components/datakey-config.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datakey-config-dialog.controller.js b/ui/src/app/components/datakey-config-dialog.controller.js
index c4e8594..7c41157 100644
--- a/ui/src/app/components/datakey-config-dialog.controller.js
+++ b/ui/src/app/components/datakey-config-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datakey-config-dialog.tpl.html b/ui/src/app/components/datakey-config-dialog.tpl.html
index 574a7af..8526076 100644
--- a/ui/src/app/components/datakey-config-dialog.tpl.html
+++ b/ui/src/app/components/datakey-config-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource.directive.js b/ui/src/app/components/datasource.directive.js
index 6d81553..84ad67f 100644
--- a/ui/src/app/components/datasource.directive.js
+++ b/ui/src/app/components/datasource.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource.scss b/ui/src/app/components/datasource.scss
index f188a04..bb5f827 100644
--- a/ui/src/app/components/datasource.scss
+++ b/ui/src/app/components/datasource.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource.tpl.html b/ui/src/app/components/datasource.tpl.html
index df0b150..f850494 100644
--- a/ui/src/app/components/datasource.tpl.html
+++ b/ui/src/app/components/datasource.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource-entity.directive.js b/ui/src/app/components/datasource-entity.directive.js
index 2cc5d2c..b02a30d 100644
--- a/ui/src/app/components/datasource-entity.directive.js
+++ b/ui/src/app/components/datasource-entity.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource-entity.scss b/ui/src/app/components/datasource-entity.scss
index df17907..f054cab 100644
--- a/ui/src/app/components/datasource-entity.scss
+++ b/ui/src/app/components/datasource-entity.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource-entity.tpl.html b/ui/src/app/components/datasource-entity.tpl.html
index f2e080e..484164f 100644
--- a/ui/src/app/components/datasource-entity.tpl.html
+++ b/ui/src/app/components/datasource-entity.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource-func.directive.js b/ui/src/app/components/datasource-func.directive.js
index 5ab1dcd..7515b61 100644
--- a/ui/src/app/components/datasource-func.directive.js
+++ b/ui/src/app/components/datasource-func.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource-func.scss b/ui/src/app/components/datasource-func.scss
index e7c6ac1..4fc4281 100644
--- a/ui/src/app/components/datasource-func.scss
+++ b/ui/src/app/components/datasource-func.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datasource-func.tpl.html b/ui/src/app/components/datasource-func.tpl.html
index 6fb00c0..134dcd7 100644
--- a/ui/src/app/components/datasource-func.tpl.html
+++ b/ui/src/app/components/datasource-func.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datetime-period.directive.js b/ui/src/app/components/datetime-period.directive.js
index f33c014..572dbbb 100644
--- a/ui/src/app/components/datetime-period.directive.js
+++ b/ui/src/app/components/datetime-period.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datetime-period.scss b/ui/src/app/components/datetime-period.scss
index c128617..61009ad 100644
--- a/ui/src/app/components/datetime-period.scss
+++ b/ui/src/app/components/datetime-period.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/datetime-period.tpl.html b/ui/src/app/components/datetime-period.tpl.html
index 3d9453f..605c3a8 100644
--- a/ui/src/app/components/datetime-period.tpl.html
+++ b/ui/src/app/components/datetime-period.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/details-sidenav.directive.js b/ui/src/app/components/details-sidenav.directive.js
index 1ae77fc..e455a80 100644
--- a/ui/src/app/components/details-sidenav.directive.js
+++ b/ui/src/app/components/details-sidenav.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/details-sidenav.scss b/ui/src/app/components/details-sidenav.scss
index 159162a..c7e9919 100644
--- a/ui/src/app/components/details-sidenav.scss
+++ b/ui/src/app/components/details-sidenav.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/details-sidenav.tpl.html b/ui/src/app/components/details-sidenav.tpl.html
index 934aed3..c504a24 100644
--- a/ui/src/app/components/details-sidenav.tpl.html
+++ b/ui/src/app/components/details-sidenav.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/entity-alias-select.directive.js b/ui/src/app/components/entity-alias-select.directive.js
index ca2db85..d0b4439 100644
--- a/ui/src/app/components/entity-alias-select.directive.js
+++ b/ui/src/app/components/entity-alias-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/entity-alias-select.scss b/ui/src/app/components/entity-alias-select.scss
index c23982f..d143933 100644
--- a/ui/src/app/components/entity-alias-select.scss
+++ b/ui/src/app/components/entity-alias-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/entity-alias-select.tpl.html b/ui/src/app/components/entity-alias-select.tpl.html
index 37ca52a..145bb66 100644
--- a/ui/src/app/components/entity-alias-select.tpl.html
+++ b/ui/src/app/components/entity-alias-select.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/expand-fullscreen.directive.js b/ui/src/app/components/expand-fullscreen.directive.js
index b70fd94..a268866 100644
--- a/ui/src/app/components/expand-fullscreen.directive.js
+++ b/ui/src/app/components/expand-fullscreen.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/expand-fullscreen.scss b/ui/src/app/components/expand-fullscreen.scss
index 197e084..eef599c 100644
--- a/ui/src/app/components/expand-fullscreen.scss
+++ b/ui/src/app/components/expand-fullscreen.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/finish-render.directive.js b/ui/src/app/components/finish-render.directive.js
index 9092e2d..046b1e7 100644
--- a/ui/src/app/components/finish-render.directive.js
+++ b/ui/src/app/components/finish-render.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default angular.module('thingsboard.directives.finishRender', [])
.directive('tbOnFinishRender', OnFinishRender)
.name;
diff --git a/ui/src/app/components/grid.directive.js b/ui/src/app/components/grid.directive.js
index 727b999..60e6a77 100644
--- a/ui/src/app/components/grid.directive.js
+++ b/ui/src/app/components/grid.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -125,7 +125,7 @@ function Grid() {
}
/*@ngInject*/
-function GridController($scope, $state, $mdDialog, $document, $q, $mdUtil, $timeout, $translate, $mdMedia, $templateCache, $window) {
+function GridController($scope, $state, $mdDialog, $document, $q, $mdUtil, $timeout, $translate, $mdMedia, $templateCache, $window, userService) {
var vm = this;
@@ -157,6 +157,7 @@ function GridController($scope, $state, $mdDialog, $document, $q, $mdUtil, $time
vm.saveItem = saveItem;
vm.toggleItemSelection = toggleItemSelection;
vm.triggerResize = triggerResize;
+ vm.isTenantAdmin = isTenantAdmin;
$scope.$watch(function () {
return $mdMedia('xs') || $mdMedia('sm');
@@ -634,6 +635,10 @@ function GridController($scope, $state, $mdDialog, $document, $q, $mdUtil, $time
w.triggerHandler('resize');
}
+ function isTenantAdmin() {
+ return userService.getAuthority() == 'TENANT_ADMIN';
+ }
+
function moveToTop() {
moveToIndex(0, true);
}
ui/src/app/components/grid.scss 2(+1 -1)
diff --git a/ui/src/app/components/grid.scss b/ui/src/app/components/grid.scss
index 6af1f67..17054d5 100644
--- a/ui/src/app/components/grid.scss
+++ b/ui/src/app/components/grid.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/components/grid.tpl.html 2(+1 -1)
diff --git a/ui/src/app/components/grid.tpl.html b/ui/src/app/components/grid.tpl.html
index b334567..74cfaee 100644
--- a/ui/src/app/components/grid.tpl.html
+++ b/ui/src/app/components/grid.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/js-func.directive.js b/ui/src/app/components/js-func.directive.js
index ad53471..f95d003 100644
--- a/ui/src/app/components/js-func.directive.js
+++ b/ui/src/app/components/js-func.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/components/js-func.scss 2(+1 -1)
diff --git a/ui/src/app/components/js-func.scss b/ui/src/app/components/js-func.scss
index 3124dc1..2bd5df1 100644
--- a/ui/src/app/components/js-func.scss
+++ b/ui/src/app/components/js-func.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/js-func.tpl.html b/ui/src/app/components/js-func.tpl.html
index bec7991..806de4a 100644
--- a/ui/src/app/components/js-func.tpl.html
+++ b/ui/src/app/components/js-func.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/json-form.directive.js b/ui/src/app/components/json-form.directive.js
index 9e6dd74..5749271 100644
--- a/ui/src/app/components/json-form.directive.js
+++ b/ui/src/app/components/json-form.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/components/json-form.scss 2(+1 -1)
diff --git a/ui/src/app/components/json-form.scss b/ui/src/app/components/json-form.scss
index 04c16c2..66a5c1a 100644
--- a/ui/src/app/components/json-form.scss
+++ b/ui/src/app/components/json-form.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/json-form.tpl.html b/ui/src/app/components/json-form.tpl.html
index 4a890b1..04929fc 100644
--- a/ui/src/app/components/json-form.tpl.html
+++ b/ui/src/app/components/json-form.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/keyboard-shortcut.filter.js b/ui/src/app/components/keyboard-shortcut.filter.js
index 96d6c6b..31d9ebe 100644
--- a/ui/src/app/components/keyboard-shortcut.filter.js
+++ b/ui/src/app/components/keyboard-shortcut.filter.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/led-light.directive.js b/ui/src/app/components/led-light.directive.js
index 3400cbe..6fb0a41 100644
--- a/ui/src/app/components/led-light.directive.js
+++ b/ui/src/app/components/led-light.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/legend.directive.js b/ui/src/app/components/legend.directive.js
index 39c8e58..714c8aa 100644
--- a/ui/src/app/components/legend.directive.js
+++ b/ui/src/app/components/legend.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './legend.scss';
/* eslint-disable import/no-unresolved, import/default */
ui/src/app/components/legend.scss 3(+1 -2)
diff --git a/ui/src/app/components/legend.scss b/ui/src/app/components/legend.scss
index 4c63f94..257a77f 100644
--- a/ui/src/app/components/legend.scss
+++ b/ui/src/app/components/legend.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
table.tb-legend {
width: 100%;
font-size: 12px;
diff --git a/ui/src/app/components/legend.tpl.html b/ui/src/app/components/legend.tpl.html
index 18c9137..8dc2029 100644
--- a/ui/src/app/components/legend.tpl.html
+++ b/ui/src/app/components/legend.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/legend-config.directive.js b/ui/src/app/components/legend-config.directive.js
index 60a351d..ecb4f50 100644
--- a/ui/src/app/components/legend-config.directive.js
+++ b/ui/src/app/components/legend-config.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './legend-config.scss';
import $ from 'jquery';
diff --git a/ui/src/app/components/legend-config.scss b/ui/src/app/components/legend-config.scss
index cc89ca0..fb10928 100644
--- a/ui/src/app/components/legend-config.scss
+++ b/ui/src/app/components/legend-config.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.md-panel {
&.tb-legend-config-panel {
position: absolute;
diff --git a/ui/src/app/components/legend-config-button.tpl.html b/ui/src/app/components/legend-config-button.tpl.html
index 7992e9c..f47b626 100644
--- a/ui/src/app/components/legend-config-button.tpl.html
+++ b/ui/src/app/components/legend-config-button.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/legend-config-panel.controller.js b/ui/src/app/components/legend-config-panel.controller.js
index add2774..a6033e3 100644
--- a/ui/src/app/components/legend-config-panel.controller.js
+++ b/ui/src/app/components/legend-config-panel.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function LegendConfigPanelController(mdPanelRef, $scope, types, legendConfig, onLegendConfigUpdate) {
diff --git a/ui/src/app/components/legend-config-panel.tpl.html b/ui/src/app/components/legend-config-panel.tpl.html
index fe64204..c8fe991 100644
--- a/ui/src/app/components/legend-config-panel.tpl.html
+++ b/ui/src/app/components/legend-config-panel.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/material-icons-dialog.controller.js b/ui/src/app/components/material-icons-dialog.controller.js
index 94b18dc..4e121af 100644
--- a/ui/src/app/components/material-icons-dialog.controller.js
+++ b/ui/src/app/components/material-icons-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './material-icons-dialog.scss';
/*@ngInject*/
diff --git a/ui/src/app/components/material-icons-dialog.scss b/ui/src/app/components/material-icons-dialog.scss
index dbd8395..3048fd1 100644
--- a/ui/src/app/components/material-icons-dialog.scss
+++ b/ui/src/app/components/material-icons-dialog.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-material-icons-dialog {
button.md-icon-button.tb-select-icon-button {
border: solid 1px orange;
diff --git a/ui/src/app/components/material-icons-dialog.tpl.html b/ui/src/app/components/material-icons-dialog.tpl.html
index db1abda..01af21b 100644
--- a/ui/src/app/components/material-icons-dialog.tpl.html
+++ b/ui/src/app/components/material-icons-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/material-icon-select.directive.js b/ui/src/app/components/material-icon-select.directive.js
index f40d1c8..67caff2 100644
--- a/ui/src/app/components/material-icon-select.directive.js
+++ b/ui/src/app/components/material-icon-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './material-icon-select.scss';
import MaterialIconsDialogController from './material-icons-dialog.controller';
diff --git a/ui/src/app/components/material-icon-select.scss b/ui/src/app/components/material-icon-select.scss
index 5196e11..e12e1d0 100644
--- a/ui/src/app/components/material-icon-select.scss
+++ b/ui/src/app/components/material-icon-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-material-icon-select {
md-icon {
padding: 4px;
diff --git a/ui/src/app/components/material-icon-select.tpl.html b/ui/src/app/components/material-icon-select.tpl.html
index c2bee3f..2de5ec9 100644
--- a/ui/src/app/components/material-icon-select.tpl.html
+++ b/ui/src/app/components/material-icon-select.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/menu-link.directive.js b/ui/src/app/components/menu-link.directive.js
index eb458aa..46d55af 100644
--- a/ui/src/app/components/menu-link.directive.js
+++ b/ui/src/app/components/menu-link.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/components/menu-link.scss 2(+1 -1)
diff --git a/ui/src/app/components/menu-link.scss b/ui/src/app/components/menu-link.scss
index 64bd526..b21c0f4 100644
--- a/ui/src/app/components/menu-link.scss
+++ b/ui/src/app/components/menu-link.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/menu-link.tpl.html b/ui/src/app/components/menu-link.tpl.html
index c5e497c..e807dd7 100644
--- a/ui/src/app/components/menu-link.tpl.html
+++ b/ui/src/app/components/menu-link.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/menu-toggle.tpl.html b/ui/src/app/components/menu-toggle.tpl.html
index 6303c3b..4c78976 100644
--- a/ui/src/app/components/menu-toggle.tpl.html
+++ b/ui/src/app/components/menu-toggle.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/mousepoint-menu.directive.js b/ui/src/app/components/mousepoint-menu.directive.js
index 79b669b..2a0ab52 100644
--- a/ui/src/app/components/mousepoint-menu.directive.js
+++ b/ui/src/app/components/mousepoint-menu.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/no-animate.directive.js b/ui/src/app/components/no-animate.directive.js
index dff3be0..ff81dac 100644
--- a/ui/src/app/components/no-animate.directive.js
+++ b/ui/src/app/components/no-animate.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/plugin-select.directive.js b/ui/src/app/components/plugin-select.directive.js
index 0e52657..bc42798 100644
--- a/ui/src/app/components/plugin-select.directive.js
+++ b/ui/src/app/components/plugin-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/plugin-select.scss b/ui/src/app/components/plugin-select.scss
index 68c7602..3d60d8e 100644
--- a/ui/src/app/components/plugin-select.scss
+++ b/ui/src/app/components/plugin-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/plugin-select.tpl.html b/ui/src/app/components/plugin-select.tpl.html
index 9a46d7f..73a4a4d 100644
--- a/ui/src/app/components/plugin-select.tpl.html
+++ b/ui/src/app/components/plugin-select.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form.scss b/ui/src/app/components/react/json-form.scss
index 2813087..f84fb85 100644
--- a/ui/src/app/components/react/json-form.scss
+++ b/ui/src/app/components/react/json-form.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-ace-editor.jsx b/ui/src/app/components/react/json-form-ace-editor.jsx
index f1db764..1c4c02e 100644
--- a/ui/src/app/components/react/json-form-ace-editor.jsx
+++ b/ui/src/app/components/react/json-form-ace-editor.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-ace-editor.scss b/ui/src/app/components/react/json-form-ace-editor.scss
index e947c2f..42ab8c5 100644
--- a/ui/src/app/components/react/json-form-ace-editor.scss
+++ b/ui/src/app/components/react/json-form-ace-editor.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-array.jsx b/ui/src/app/components/react/json-form-array.jsx
index 3ff1ed7..56f2860 100644
--- a/ui/src/app/components/react/json-form-array.jsx
+++ b/ui/src/app/components/react/json-form-array.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-base-component.jsx b/ui/src/app/components/react/json-form-base-component.jsx
index c329a70..67adce7 100644
--- a/ui/src/app/components/react/json-form-base-component.jsx
+++ b/ui/src/app/components/react/json-form-base-component.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-checkbox.jsx b/ui/src/app/components/react/json-form-checkbox.jsx
index ca7d660..ced7f83 100644
--- a/ui/src/app/components/react/json-form-checkbox.jsx
+++ b/ui/src/app/components/react/json-form-checkbox.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-color.jsx b/ui/src/app/components/react/json-form-color.jsx
index 4a07d9d..ec02ef6 100644
--- a/ui/src/app/components/react/json-form-color.jsx
+++ b/ui/src/app/components/react/json-form-color.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-color.scss b/ui/src/app/components/react/json-form-color.scss
index af869dc..ee55ec3 100644
--- a/ui/src/app/components/react/json-form-color.scss
+++ b/ui/src/app/components/react/json-form-color.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-css.jsx b/ui/src/app/components/react/json-form-css.jsx
index 9c5dcc6..d07565d 100644
--- a/ui/src/app/components/react/json-form-css.jsx
+++ b/ui/src/app/components/react/json-form-css.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-date.jsx b/ui/src/app/components/react/json-form-date.jsx
index 3c3718a..66d6936 100644
--- a/ui/src/app/components/react/json-form-date.jsx
+++ b/ui/src/app/components/react/json-form-date.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-fieldset.jsx b/ui/src/app/components/react/json-form-fieldset.jsx
index 05603b3..541590d 100644
--- a/ui/src/app/components/react/json-form-fieldset.jsx
+++ b/ui/src/app/components/react/json-form-fieldset.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-html.jsx b/ui/src/app/components/react/json-form-html.jsx
index f45952f..a4a9d74 100644
--- a/ui/src/app/components/react/json-form-html.jsx
+++ b/ui/src/app/components/react/json-form-html.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-image.jsx b/ui/src/app/components/react/json-form-image.jsx
index 4f148a9..cf38dc9 100644
--- a/ui/src/app/components/react/json-form-image.jsx
+++ b/ui/src/app/components/react/json-form-image.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-image.scss b/ui/src/app/components/react/json-form-image.scss
index 913c04e..8872b09 100644
--- a/ui/src/app/components/react/json-form-image.scss
+++ b/ui/src/app/components/react/json-form-image.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-javascript.jsx b/ui/src/app/components/react/json-form-javascript.jsx
index d444cb0..81c28ae 100644
--- a/ui/src/app/components/react/json-form-javascript.jsx
+++ b/ui/src/app/components/react/json-form-javascript.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-json.jsx b/ui/src/app/components/react/json-form-json.jsx
index e8d419a..2db238b 100644
--- a/ui/src/app/components/react/json-form-json.jsx
+++ b/ui/src/app/components/react/json-form-json.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-number.jsx b/ui/src/app/components/react/json-form-number.jsx
index fce7a1c..cf70163 100644
--- a/ui/src/app/components/react/json-form-number.jsx
+++ b/ui/src/app/components/react/json-form-number.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-rc-select.jsx b/ui/src/app/components/react/json-form-rc-select.jsx
index 67f10fc..ffa0331 100644
--- a/ui/src/app/components/react/json-form-rc-select.jsx
+++ b/ui/src/app/components/react/json-form-rc-select.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-react.jsx b/ui/src/app/components/react/json-form-react.jsx
index 9557ffe..e372371 100644
--- a/ui/src/app/components/react/json-form-react.jsx
+++ b/ui/src/app/components/react/json-form-react.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-schema-form.jsx b/ui/src/app/components/react/json-form-schema-form.jsx
index d708d53..e006eb9 100644
--- a/ui/src/app/components/react/json-form-schema-form.jsx
+++ b/ui/src/app/components/react/json-form-schema-form.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/json-form-text.jsx b/ui/src/app/components/react/json-form-text.jsx
index cd80a68..d97c90a 100644
--- a/ui/src/app/components/react/json-form-text.jsx
+++ b/ui/src/app/components/react/json-form-text.jsx
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/react/styles/thingsboardTheme.js b/ui/src/app/components/react/styles/thingsboardTheme.js
index e55fc88..a2f3cf6 100644
--- a/ui/src/app/components/react/styles/thingsboardTheme.js
+++ b/ui/src/app/components/react/styles/thingsboardTheme.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/related-entity-autocomplete.directive.js b/ui/src/app/components/related-entity-autocomplete.directive.js
index 7ce0252..cd86bc4 100644
--- a/ui/src/app/components/related-entity-autocomplete.directive.js
+++ b/ui/src/app/components/related-entity-autocomplete.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/related-entity-autocomplete.scss b/ui/src/app/components/related-entity-autocomplete.scss
index 32df94f..8d4683a 100644
--- a/ui/src/app/components/related-entity-autocomplete.scss
+++ b/ui/src/app/components/related-entity-autocomplete.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/related-entity-autocomplete.tpl.html b/ui/src/app/components/related-entity-autocomplete.tpl.html
index a5b50e9..92229f9 100644
--- a/ui/src/app/components/related-entity-autocomplete.tpl.html
+++ b/ui/src/app/components/related-entity-autocomplete.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/scope-element.directive.js b/ui/src/app/components/scope-element.directive.js
index 27337c7..132684b 100644
--- a/ui/src/app/components/scope-element.directive.js
+++ b/ui/src/app/components/scope-element.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/side-menu.directive.js b/ui/src/app/components/side-menu.directive.js
index 804f5e3..3b8438b 100644
--- a/ui/src/app/components/side-menu.directive.js
+++ b/ui/src/app/components/side-menu.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/components/side-menu.scss 2(+1 -1)
diff --git a/ui/src/app/components/side-menu.scss b/ui/src/app/components/side-menu.scss
index 58cde01..469c575 100644
--- a/ui/src/app/components/side-menu.scss
+++ b/ui/src/app/components/side-menu.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/side-menu.tpl.html b/ui/src/app/components/side-menu.tpl.html
index 57ff082..f7c29b1 100644
--- a/ui/src/app/components/side-menu.tpl.html
+++ b/ui/src/app/components/side-menu.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/socialshare-panel.directive.js b/ui/src/app/components/socialshare-panel.directive.js
index 891d913..56aadcc 100644
--- a/ui/src/app/components/socialshare-panel.directive.js
+++ b/ui/src/app/components/socialshare-panel.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import socialsharePanelTemplate from './socialshare-panel.tpl.html';
diff --git a/ui/src/app/components/socialshare-panel.tpl.html b/ui/src/app/components/socialshare-panel.tpl.html
index 7b9560d..bec400e 100644
--- a/ui/src/app/components/socialshare-panel.tpl.html
+++ b/ui/src/app/components/socialshare-panel.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<div layout="row" ng-show="!vm.isShareLinkLocal()">
<md-button class="md-icon-button md-raised md-primary"
socialshare
diff --git a/ui/src/app/components/tb-event-directives.js b/ui/src/app/components/tb-event-directives.js
index 18cf31b..36c93a1 100644
--- a/ui/src/app/components/tb-event-directives.js
+++ b/ui/src/app/components/tb-event-directives.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/timeinterval.directive.js b/ui/src/app/components/timeinterval.directive.js
index 8f7e4a4..da0e54d 100644
--- a/ui/src/app/components/timeinterval.directive.js
+++ b/ui/src/app/components/timeinterval.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/timeinterval.scss b/ui/src/app/components/timeinterval.scss
index 525bfd1..4bae01d 100644
--- a/ui/src/app/components/timeinterval.scss
+++ b/ui/src/app/components/timeinterval.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/timeinterval.tpl.html b/ui/src/app/components/timeinterval.tpl.html
index e6719f2..27f094b 100644
--- a/ui/src/app/components/timeinterval.tpl.html
+++ b/ui/src/app/components/timeinterval.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/timewindow.directive.js b/ui/src/app/components/timewindow.directive.js
index 90f5bbe..6513671 100644
--- a/ui/src/app/components/timewindow.directive.js
+++ b/ui/src/app/components/timewindow.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/timewindow.scss b/ui/src/app/components/timewindow.scss
index f1f03f4..01ad5f9 100644
--- a/ui/src/app/components/timewindow.scss
+++ b/ui/src/app/components/timewindow.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.md-panel {
&.tb-timewindow-panel {
position: absolute;
diff --git a/ui/src/app/components/timewindow.tpl.html b/ui/src/app/components/timewindow.tpl.html
index c722734..ce92a30 100644
--- a/ui/src/app/components/timewindow.tpl.html
+++ b/ui/src/app/components/timewindow.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/timewindow-button.tpl.html b/ui/src/app/components/timewindow-button.tpl.html
index cea776c..eb1b551 100644
--- a/ui/src/app/components/timewindow-button.tpl.html
+++ b/ui/src/app/components/timewindow-button.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/timewindow-panel.controller.js b/ui/src/app/components/timewindow-panel.controller.js
index e6af0b0..3cf368b 100644
--- a/ui/src/app/components/timewindow-panel.controller.js
+++ b/ui/src/app/components/timewindow-panel.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/timewindow-panel.tpl.html b/ui/src/app/components/timewindow-panel.tpl.html
index 0c80538..271ac4c 100644
--- a/ui/src/app/components/timewindow-panel.tpl.html
+++ b/ui/src/app/components/timewindow-panel.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/truncate.filter.js b/ui/src/app/components/truncate.filter.js
index 7ad4486..11f8fa2 100644
--- a/ui/src/app/components/truncate.filter.js
+++ b/ui/src/app/components/truncate.filter.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widget/action/manage-widget-actions.directive.js b/ui/src/app/components/widget/action/manage-widget-actions.directive.js
index 93ca06f..81c40cd 100644
--- a/ui/src/app/components/widget/action/manage-widget-actions.directive.js
+++ b/ui/src/app/components/widget/action/manage-widget-actions.directive.js
@@ -1,3 +1,18 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
/**
* Created by igor on 6/20/17.
*/
diff --git a/ui/src/app/components/widget/action/manage-widget-actions.scss b/ui/src/app/components/widget/action/manage-widget-actions.scss
index aee98ad..91d587b 100644
--- a/ui/src/app/components/widget/action/manage-widget-actions.scss
+++ b/ui/src/app/components/widget/action/manage-widget-actions.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widget/action/manage-widget-actions.tpl.html b/ui/src/app/components/widget/action/manage-widget-actions.tpl.html
index b06959b..fc9262e 100644
--- a/ui/src/app/components/widget/action/manage-widget-actions.tpl.html
+++ b/ui/src/app/components/widget/action/manage-widget-actions.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widget/action/widget-action-dialog.controller.js b/ui/src/app/components/widget/action/widget-action-dialog.controller.js
index 63aa128..a1adee0 100644
--- a/ui/src/app/components/widget/action/widget-action-dialog.controller.js
+++ b/ui/src/app/components/widget/action/widget-action-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function WidgetActionDialogController($scope, $mdDialog, $filter, $q, dashboardService, dashboardUtils, types, utils,
isAdd, fetchDashboardStates, actionSources, widgetActions, action) {
diff --git a/ui/src/app/components/widget/action/widget-action-dialog.tpl.html b/ui/src/app/components/widget/action/widget-action-dialog.tpl.html
index 91b4981..021d68f 100644
--- a/ui/src/app/components/widget/action/widget-action-dialog.tpl.html
+++ b/ui/src/app/components/widget/action/widget-action-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widget/widget.controller.js b/ui/src/app/components/widget/widget.controller.js
index a5faada..9feb40d 100644
--- a/ui/src/app/components/widget/widget.controller.js
+++ b/ui/src/app/components/widget/widget.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widget/widget.directive.js b/ui/src/app/components/widget/widget.directive.js
index 40d5a83..f070d07 100644
--- a/ui/src/app/components/widget/widget.directive.js
+++ b/ui/src/app/components/widget/widget.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './widget.scss';
import thingsboardLegend from '../legend.directive';
diff --git a/ui/src/app/components/widget/widget.scss b/ui/src/app/components/widget/widget.scss
index ddeddcc..347417b 100644
--- a/ui/src/app/components/widget/widget.scss
+++ b/ui/src/app/components/widget/widget.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widget/widget-config.directive.js b/ui/src/app/components/widget/widget-config.directive.js
index 3b66757..d0ee6a3 100644
--- a/ui/src/app/components/widget/widget-config.directive.js
+++ b/ui/src/app/components/widget/widget-config.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import thingsboardTypes from '../../common/types.constant';
import thingsboardUtils from '../../common/utils.service';
import thingsboardEntityAliasSelect from '../entity-alias-select.directive';
diff --git a/ui/src/app/components/widget/widget-config.scss b/ui/src/app/components/widget/widget-config.scss
index 4982b6c..7ff2051 100644
--- a/ui/src/app/components/widget/widget-config.scss
+++ b/ui/src/app/components/widget/widget-config.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widget/widget-config.tpl.html b/ui/src/app/components/widget/widget-config.tpl.html
index c50aade..ce796d4 100644
--- a/ui/src/app/components/widget/widget-config.tpl.html
+++ b/ui/src/app/components/widget/widget-config.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widgets-bundle-select.directive.js b/ui/src/app/components/widgets-bundle-select.directive.js
index 7e1ed71..84b89ae 100644
--- a/ui/src/app/components/widgets-bundle-select.directive.js
+++ b/ui/src/app/components/widgets-bundle-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widgets-bundle-select.scss b/ui/src/app/components/widgets-bundle-select.scss
index d770c7b..41c4ee7 100644
--- a/ui/src/app/components/widgets-bundle-select.scss
+++ b/ui/src/app/components/widgets-bundle-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/components/widgets-bundle-select.tpl.html b/ui/src/app/components/widgets-bundle-select.tpl.html
index cbfda36..240c64e 100644
--- a/ui/src/app/components/widgets-bundle-select.tpl.html
+++ b/ui/src/app/components/widgets-bundle-select.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/customer/add-customer.tpl.html b/ui/src/app/customer/add-customer.tpl.html
index 69c3832..6fc0798 100644
--- a/ui/src/app/customer/add-customer.tpl.html
+++ b/ui/src/app/customer/add-customer.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/customer/customer.controller.js b/ui/src/app/customer/customer.controller.js
index 5175052..94efb5f 100644
--- a/ui/src/app/customer/customer.controller.js
+++ b/ui/src/app/customer/customer.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/customer/customer.directive.js b/ui/src/app/customer/customer.directive.js
index e48934b..a3c3d79 100644
--- a/ui/src/app/customer/customer.directive.js
+++ b/ui/src/app/customer/customer.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/customer/customer.routes.js b/ui/src/app/customer/customer.routes.js
index 19c3ccf..a262369 100644
--- a/ui/src/app/customer/customer.routes.js
+++ b/ui/src/app/customer/customer.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/customer/customer-card.tpl.html b/ui/src/app/customer/customer-card.tpl.html
index e15ed9d..fb39697 100644
--- a/ui/src/app/customer/customer-card.tpl.html
+++ b/ui/src/app/customer/customer-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/customer/customer-fieldset.tpl.html b/ui/src/app/customer/customer-fieldset.tpl.html
index e367c88..e9be039 100644
--- a/ui/src/app/customer/customer-fieldset.tpl.html
+++ b/ui/src/app/customer/customer-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/customer/customers.tpl.html b/ui/src/app/customer/customers.tpl.html
index da0a2e9..28f9e06 100644
--- a/ui/src/app/customer/customers.tpl.html
+++ b/ui/src/app/customer/customers.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -66,5 +66,10 @@
entity-type="{{vm.types.entityType.customer}}">
</tb-relation-table>
</md-tab>
+ <md-tab ng-if="!vm.grid.detailsConfig.isDetailsEditMode && vm.grid.isTenantAdmin()" md-on-select="vm.grid.triggerResize()" label="{{ 'audit-log.audit-logs' | translate }}">
+ <tb-audit-log-table flex customer-id="vm.grid.operatingItem().id.id"
+ audit-log-mode="{{vm.types.auditLogMode.customer}}">
+ </tb-audit-log-table>
+ </md-tab>
</md-tabs>
</tb-grid>
ui/src/app/customer/index.js 2(+1 -1)
diff --git a/ui/src/app/customer/index.js b/ui/src/app/customer/index.js
index d0596d8..0b155d3 100644
--- a/ui/src/app/customer/index.js
+++ b/ui/src/app/customer/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/add-dashboard.tpl.html b/ui/src/app/dashboard/add-dashboard.tpl.html
index 79735e0..6dc9f7a 100644
--- a/ui/src/app/dashboard/add-dashboard.tpl.html
+++ b/ui/src/app/dashboard/add-dashboard.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/add-dashboards-to-customer.controller.js b/ui/src/app/dashboard/add-dashboards-to-customer.controller.js
index 6fe6e79..883a667 100644
--- a/ui/src/app/dashboard/add-dashboards-to-customer.controller.js
+++ b/ui/src/app/dashboard/add-dashboards-to-customer.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -52,7 +52,7 @@ export default function AddDashboardsToCustomerController(dashboardService, $mdD
fetchMoreItems_: function () {
if (vm.dashboards.hasNext && !vm.dashboards.pending) {
vm.dashboards.pending = true;
- dashboardService.getTenantDashboards(vm.dashboards.nextPageLink, false).then(
+ dashboardService.getTenantDashboards(vm.dashboards.nextPageLink).then(
function success(dashboards) {
vm.dashboards.data = vm.dashboards.data.concat(dashboards.data);
vm.dashboards.nextPageLink = dashboards.nextPageLink;
diff --git a/ui/src/app/dashboard/add-dashboards-to-customer.tpl.html b/ui/src/app/dashboard/add-dashboards-to-customer.tpl.html
index 6ae2f8d..3cf5412 100644
--- a/ui/src/app/dashboard/add-dashboards-to-customer.tpl.html
+++ b/ui/src/app/dashboard/add-dashboards-to-customer.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/add-widget.controller.js b/ui/src/app/dashboard/add-widget.controller.js
index bae486b..caa69d6 100644
--- a/ui/src/app/dashboard/add-widget.controller.js
+++ b/ui/src/app/dashboard/add-widget.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/add-widget.tpl.html b/ui/src/app/dashboard/add-widget.tpl.html
index 8d5e130..450ce33 100644
--- a/ui/src/app/dashboard/add-widget.tpl.html
+++ b/ui/src/app/dashboard/add-widget.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/dashboard.controller.js b/ui/src/app/dashboard/dashboard.controller.js
index d4d3a1c..f672f3f 100644
--- a/ui/src/app/dashboard/dashboard.controller.js
+++ b/ui/src/app/dashboard/dashboard.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/dashboard/dashboard.directive.js 31(+7 -24)
diff --git a/ui/src/app/dashboard/dashboard.directive.js b/ui/src/app/dashboard/dashboard.directive.js
index b2f3117..8f04285 100644
--- a/ui/src/app/dashboard/dashboard.directive.js
+++ b/ui/src/app/dashboard/dashboard.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -20,36 +20,17 @@ import dashboardFieldsetTemplate from './dashboard-fieldset.tpl.html';
/* eslint-enable import/no-unresolved, import/default */
/*@ngInject*/
-export default function DashboardDirective($compile, $templateCache, $translate, types, toast, customerService, dashboardService) {
+export default function DashboardDirective($compile, $templateCache, $translate, types, toast, dashboardService) {
var linker = function (scope, element) {
var template = $templateCache.get(dashboardFieldsetTemplate);
element.html(template);
-
- scope.isAssignedToCustomer = false;
- scope.isPublic = false;
- scope.assignedCustomer = null;
scope.publicLink = null;
-
scope.$watch('dashboard', function(newVal) {
if (newVal) {
- if (scope.dashboard.customerId && scope.dashboard.customerId.id !== types.id.nullUid) {
- scope.isAssignedToCustomer = true;
- customerService.getShortCustomerInfo(scope.dashboard.customerId.id).then(
- function success(customer) {
- scope.assignedCustomer = customer;
- scope.isPublic = customer.isPublic;
- if (scope.isPublic) {
- scope.publicLink = dashboardService.getPublicDashboardLink(scope.dashboard);
- } else {
- scope.publicLink = null;
- }
- }
- );
+ if (scope.dashboard.publicCustomerId) {
+ scope.publicLink = dashboardService.getPublicDashboardLink(scope.dashboard);
} else {
- scope.isAssignedToCustomer = false;
- scope.isPublic = false;
scope.publicLink = null;
- scope.assignedCustomer = null;
}
}
});
@@ -66,10 +47,12 @@ export default function DashboardDirective($compile, $templateCache, $translate,
scope: {
dashboard: '=',
isEdit: '=',
+ customerId: '=',
dashboardScope: '=',
theForm: '=',
- onAssignToCustomer: '&',
onMakePublic: '&',
+ onMakePrivate: '&',
+ onManageAssignedCustomers: '&',
onUnassignFromCustomer: '&',
onExportDashboard: '&',
onDeleteDashboard: '&'
diff --git a/ui/src/app/dashboard/dashboard.routes.js b/ui/src/app/dashboard/dashboard.routes.js
index 92bb362..ccb43c7 100644
--- a/ui/src/app/dashboard/dashboard.routes.js
+++ b/ui/src/app/dashboard/dashboard.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/dashboard/dashboard.scss 3(+1 -2)
diff --git a/ui/src/app/dashboard/dashboard.scss b/ui/src/app/dashboard/dashboard.scss
index daae8ec..224dcf7 100644
--- a/ui/src/app/dashboard/dashboard.scss
+++ b/ui/src/app/dashboard/dashboard.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import "~compass-sass-mixins/lib/compass";
@import '../../scss/constants';
diff --git a/ui/src/app/dashboard/dashboard.tpl.html b/ui/src/app/dashboard/dashboard.tpl.html
index fab4634..9626509 100644
--- a/ui/src/app/dashboard/dashboard.tpl.html
+++ b/ui/src/app/dashboard/dashboard.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/dashboard/dashboard-card.scss 26(+26 -0)
diff --git a/ui/src/app/dashboard/dashboard-card.scss b/ui/src/app/dashboard/dashboard-card.scss
new file mode 100644
index 0000000..0dac213
--- /dev/null
+++ b/ui/src/app/dashboard/dashboard-card.scss
@@ -0,0 +1,26 @@
+/**
+ * Copyright © 2016-2018 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.
+ */
+.tb-dashboard-assigned-customers {
+ display: block;
+ display: -webkit-box;
+ height: 34px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -webkit-line-clamp: 2;
+ -webkit-box-orient: vertical;
+ margin-bottom: 4px;
+}
+
diff --git a/ui/src/app/dashboard/dashboard-card.tpl.html b/ui/src/app/dashboard/dashboard-card.tpl.html
index 6367867..9e71d2a 100644
--- a/ui/src/app/dashboard/dashboard-card.tpl.html
+++ b/ui/src/app/dashboard/dashboard-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,6 +15,6 @@
limitations under the License.
-->
-<div class="tb-small" ng-show="vm.isAssignedToCustomer()">{{'dashboard.assignedToCustomer' | translate}} '{{vm.item.assignedCustomer.title}}'</div>
-<div class="tb-small" ng-show="vm.isPublic()">{{'dashboard.public' | translate}}</div>
+<div class="tb-small tb-dashboard-assigned-customers" ng-show="vm.parentCtl.dashboardsScope === 'tenant' && vm.item.assignedCustomersText">{{'dashboard.assignedToCustomers' | translate}}: '{{vm.item.assignedCustomersText}}'</div>
+<div class="tb-small" ng-show="vm.parentCtl.dashboardsScope === 'tenant' && vm.item.publicCustomerId">{{'dashboard.public' | translate}}</div>
ui/src/app/dashboard/dashboard-fieldset.tpl.html 29(+17 -12)
diff --git a/ui/src/app/dashboard/dashboard-fieldset.tpl.html b/ui/src/app/dashboard/dashboard-fieldset.tpl.html
index a54f477..f92f5f9 100644
--- a/ui/src/app/dashboard/dashboard-fieldset.tpl.html
+++ b/ui/src/app/dashboard/dashboard-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -19,24 +19,29 @@
ng-show="!isEdit && dashboardScope === 'tenant'"
class="md-raised md-primary">{{ 'dashboard.export' | translate }}</md-button>
<md-button ng-click="onMakePublic({event: $event})"
- ng-show="!isEdit && dashboardScope === 'tenant' && !isAssignedToCustomer && !isPublic"
+ ng-show="!isEdit && dashboardScope === 'tenant' && !dashboard.publicCustomerId"
class="md-raised md-primary">{{ 'dashboard.make-public' | translate }}</md-button>
-<md-button ng-click="onAssignToCustomer({event: $event})"
- ng-show="!isEdit && dashboardScope === 'tenant' && !isAssignedToCustomer"
- class="md-raised md-primary">{{ 'dashboard.assign-to-customer' | translate }}</md-button>
-<md-button ng-click="onUnassignFromCustomer({event: $event, isPublic: isPublic})"
- ng-show="!isEdit && (dashboardScope === 'customer' || dashboardScope === 'tenant') && isAssignedToCustomer"
- class="md-raised md-primary">{{ isPublic ? 'dashboard.make-private' : 'dashboard.unassign-from-customer' | translate }}</md-button>
+<md-button ng-click="onMakePrivate({event: $event})"
+ ng-show="!isEdit && ((dashboardScope === 'tenant' && dashboard.publicCustomerId ||
+ dashboardScope === 'customer' && customerId == dashboard.publicCustomerId))"
+ class="md-raised md-primary">{{ 'dashboard.make-private' | translate }}</md-button>
+<md-button ng-click="onManageAssignedCustomers({event: $event})"
+ ng-show="!isEdit && dashboardScope === 'tenant'"
+ class="md-raised md-primary">{{ 'dashboard.manage-assigned-customers' | translate }}</md-button>
+<md-button ng-click="onUnassignFromCustomer({event: $event})"
+ ng-show="!isEdit && dashboardScope === 'customer' && customerId != dashboard.publicCustomerId"
+ class="md-raised md-primary">{{ 'dashboard.unassign-from-customer' | translate }}</md-button>
<md-button ng-click="onDeleteDashboard({event: $event})"
ng-show="!isEdit && dashboardScope === 'tenant'"
class="md-raised md-primary">{{ 'dashboard.delete' | translate }}</md-button>
<md-content class="md-padding" layout="column">
<md-input-container class="md-block"
- ng-show="!isEdit && isAssignedToCustomer && !isPublic && dashboardScope === 'tenant'">
- <label translate>dashboard.assignedToCustomer</label>
- <input ng-model="assignedCustomer.title" disabled>
+ ng-show="!isEdit && dashboard.assignedCustomersText && dashboardScope === 'tenant'">
+ <label translate>dashboard.assignedToCustomers</label>
+ <input ng-model="dashboard.assignedCustomersText" disabled>
</md-input-container>
- <div layout="column" ng-show="!isEdit && isPublic && (dashboardScope === 'customer' || dashboardScope === 'tenant')">
+ <div layout="column" ng-show="!isEdit && ((dashboardScope === 'tenant' && dashboard.publicCustomerId ||
+ dashboardScope === 'customer' && customerId == dashboard.publicCustomerId))">
<tb-social-share-panel style="padding-bottom: 10px;"
share-title="{{ 'dashboard.socialshare-title' | translate:{dashboardTitle: dashboard.title} }}"
share-text="{{ 'dashboard.socialshare-text' | translate:{dashboardTitle: dashboard.title} }}"
ui/src/app/dashboard/dashboards.controller.js 228(+123 -105)
diff --git a/ui/src/app/dashboard/dashboards.controller.js b/ui/src/app/dashboard/dashboards.controller.js
index d2887f8..c9ec083 100644
--- a/ui/src/app/dashboard/dashboards.controller.js
+++ b/ui/src/app/dashboard/dashboards.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -17,12 +17,14 @@
import addDashboardTemplate from './add-dashboard.tpl.html';
import dashboardCard from './dashboard-card.tpl.html';
-import assignToCustomerTemplate from './assign-to-customer.tpl.html';
import addDashboardsToCustomerTemplate from './add-dashboards-to-customer.tpl.html';
import makeDashboardPublicDialogTemplate from './make-dashboard-public-dialog.tpl.html';
+import manageAssignedCustomersTemplate from './manage-assigned-customers.tpl.html';
/* eslint-enable import/no-unresolved, import/default */
+import './dashboard-card.scss';
+
/*@ngInject*/
export function MakeDashboardPublicDialogController($mdDialog, $translate, toast, dashboardService, dashboard) {
@@ -48,23 +50,8 @@ export function MakeDashboardPublicDialogController($mdDialog, $translate, toast
export function DashboardCardController(types) {
var vm = this;
-
vm.types = types;
- vm.isAssignedToCustomer = function() {
- if (vm.item && vm.item.customerId && vm.parentCtl.dashboardsScope === 'tenant' &&
- vm.item.customerId.id != vm.types.id.nullUid && !vm.item.assignedCustomer.isPublic) {
- return true;
- }
- return false;
- }
-
- vm.isPublic = function() {
- if (vm.item && vm.item.assignedCustomer && vm.parentCtl.dashboardsScope === 'tenant' && vm.item.assignedCustomer.isPublic) {
- return true;
- }
- return false;
- }
}
/*@ngInject*/
@@ -135,8 +122,9 @@ export function DashboardsController(userService, dashboardService, customerServ
vm.dashboardsScope = $state.$current.data.dashboardsType;
- vm.assignToCustomer = assignToCustomer;
vm.makePublic = makePublic;
+ vm.makePrivate = makePrivate;
+ vm.manageAssignedCustomers = manageAssignedCustomers;
vm.unassignFromCustomer = unassignFromCustomer;
vm.exportDashboard = exportDashboard;
@@ -155,6 +143,7 @@ export function DashboardsController(userService, dashboardService, customerServ
}
if (customerId) {
+ vm.customerId = customerId;
vm.customerDashboardsTitle = $translate.instant('customer.dashboards');
customerService.getShortCustomerInfo(customerId).then(
function success(info) {
@@ -167,7 +156,7 @@ export function DashboardsController(userService, dashboardService, customerServ
if (vm.dashboardsScope === 'tenant') {
fetchDashboardsFunction = function (pageLink) {
- return dashboardService.getTenantDashboards(pageLink, true);
+ return dashboardService.getTenantDashboards(pageLink);
};
deleteDashboardFunction = function (dashboardId) {
return dashboardService.deleteDashboard(dashboardId);
@@ -194,11 +183,33 @@ export function DashboardsController(userService, dashboardService, customerServ
details: function() { return $translate.instant('dashboard.make-public') },
icon: "share",
isEnabled: function(dashboard) {
- return dashboard && (!dashboard.customerId || dashboard.customerId.id === types.id.nullUid);
+ return dashboard && !dashboard.publicCustomerId;
}
});
-
dashboardActionsList.push({
+ onAction: function ($event, item) {
+ makePrivate($event, item);
+ },
+ name: function() { return $translate.instant('action.make-private') },
+ details: function() { return $translate.instant('dashboard.make-private') },
+ icon: "reply",
+ isEnabled: function(dashboard) {
+ return dashboard && dashboard.publicCustomerId;
+ }
+ });
+ dashboardActionsList.push({
+ onAction: function ($event, item) {
+ manageAssignedCustomers($event, item);
+ },
+ name: function() { return $translate.instant('action.assign') },
+ details: function() { return $translate.instant('dashboard.manage-assigned-customers') },
+ icon: "assignment_ind",
+ isEnabled: function(dashboard) {
+ return dashboard;
+ }
+ });
+
+ /*dashboardActionsList.push({
onAction: function ($event, item) {
assignToCustomer($event, [ item.id.id ]);
},
@@ -208,8 +219,8 @@ export function DashboardsController(userService, dashboardService, customerServ
isEnabled: function(dashboard) {
return dashboard && (!dashboard.customerId || dashboard.customerId.id === types.id.nullUid);
}
- });
- dashboardActionsList.push({
+ });*/
+ /*dashboardActionsList.push({
onAction: function ($event, item) {
unassignFromCustomer($event, item, false);
},
@@ -219,18 +230,7 @@ export function DashboardsController(userService, dashboardService, customerServ
isEnabled: function(dashboard) {
return dashboard && dashboard.customerId && dashboard.customerId.id !== types.id.nullUid && !dashboard.assignedCustomer.isPublic;
}
- });
- dashboardActionsList.push({
- onAction: function ($event, item) {
- unassignFromCustomer($event, item, true);
- },
- name: function() { return $translate.instant('action.make-private') },
- details: function() { return $translate.instant('dashboard.make-private') },
- icon: "reply",
- isEnabled: function(dashboard) {
- return dashboard && dashboard.customerId && dashboard.customerId.id !== types.id.nullUid && dashboard.assignedCustomer.isPublic;
- }
- });
+ });*/
dashboardActionsList.push(
{
@@ -246,7 +246,7 @@ export function DashboardsController(userService, dashboardService, customerServ
dashboardGroupActionsList.push(
{
onAction: function ($event, items) {
- assignDashboardsToCustomer($event, items);
+ assignDashboardsToCustomers($event, items);
},
name: function() { return $translate.instant('dashboard.assign-dashboards') },
details: function(selectedCount) {
@@ -255,6 +255,17 @@ export function DashboardsController(userService, dashboardService, customerServ
icon: "assignment_ind"
}
);
+ dashboardGroupActionsList.push(
+ {
+ onAction: function ($event, items) {
+ unassignDashboardsFromCustomers($event, items);
+ },
+ name: function() { return $translate.instant('dashboard.unassign-dashboards') },
+ details: function(selectedCount) {
+ return $translate.instant('dashboard.unassign-dashboards-action-text', {count: selectedCount}, "messageformat");
+ },
+ icon: "assignment_return" }
+ );
dashboardGroupActionsList.push(
{
@@ -290,10 +301,10 @@ export function DashboardsController(userService, dashboardService, customerServ
});
} else if (vm.dashboardsScope === 'customer' || vm.dashboardsScope === 'customer_user') {
fetchDashboardsFunction = function (pageLink) {
- return dashboardService.getCustomerDashboards(customerId, pageLink, true);
+ return dashboardService.getCustomerDashboards(customerId, pageLink);
};
deleteDashboardFunction = function (dashboardId) {
- return dashboardService.unassignDashboardFromCustomer(dashboardId);
+ return dashboardService.unassignDashboardFromCustomer(customerId, dashboardId);
};
refreshDashboardsParamsFunction = function () {
return {"customerId": customerId, "topIndex": vm.topIndex};
@@ -314,26 +325,27 @@ export function DashboardsController(userService, dashboardService, customerServ
dashboardActionsList.push(
{
onAction: function ($event, item) {
- unassignFromCustomer($event, item, false);
+ makePrivate($event, item);
},
- name: function() { return $translate.instant('action.unassign') },
- details: function() { return $translate.instant('dashboard.unassign-from-customer') },
- icon: "assignment_return",
+ name: function() { return $translate.instant('action.make-private') },
+ details: function() { return $translate.instant('dashboard.make-private') },
+ icon: "reply",
isEnabled: function(dashboard) {
- return dashboard && !dashboard.assignedCustomer.isPublic;
+ return dashboard && customerId == dashboard.publicCustomerId;
}
}
);
+
dashboardActionsList.push(
{
onAction: function ($event, item) {
- unassignFromCustomer($event, item, true);
+ unassignFromCustomer($event, item, customerId);
},
- name: function() { return $translate.instant('action.make-private') },
- details: function() { return $translate.instant('dashboard.make-private') },
- icon: "reply",
+ name: function() { return $translate.instant('action.unassign') },
+ details: function() { return $translate.instant('dashboard.unassign-from-customer') },
+ icon: "assignment_return",
isEnabled: function(dashboard) {
- return dashboard && dashboard.assignedCustomer.isPublic;
+ return dashboard && customerId != dashboard.publicCustomerId;
}
}
);
@@ -341,7 +353,7 @@ export function DashboardsController(userService, dashboardService, customerServ
dashboardGroupActionsList.push(
{
onAction: function ($event, items) {
- unassignDashboardsFromCustomer($event, items);
+ unassignDashboardsFromCustomer($event, items, customerId);
},
name: function() { return $translate.instant('dashboard.unassign-dashboards') },
details: function(selectedCount) {
@@ -351,7 +363,6 @@ export function DashboardsController(userService, dashboardService, customerServ
}
);
-
vm.dashboardGridConfig.addItemAction = {
onAction: function ($event) {
addDashboardsToCustomer($event);
@@ -428,39 +439,42 @@ export function DashboardsController(userService, dashboardService, customerServ
return deferred.promise;
}
- function assignToCustomer($event, dashboardIds) {
+ function manageAssignedCustomers($event, dashboard) {
+ showManageAssignedCustomersDialog($event, [dashboard.id.id], 'manage', dashboard.assignedCustomersIds);
+ }
+
+ function assignDashboardsToCustomers($event, items) {
+ var dashboardIds = [];
+ for (var id in items.selections) {
+ dashboardIds.push(id);
+ }
+ showManageAssignedCustomersDialog($event, dashboardIds, 'assign');
+ }
+
+ function unassignDashboardsFromCustomers($event, items) {
+ var dashboardIds = [];
+ for (var id in items.selections) {
+ dashboardIds.push(id);
+ }
+ showManageAssignedCustomersDialog($event, dashboardIds, 'unassign');
+ }
+
+ function showManageAssignedCustomersDialog($event, dashboardIds, actionType, assignedCustomers) {
if ($event) {
$event.stopPropagation();
}
- var pageSize = 10;
- customerService.getCustomers({limit: pageSize, textSearch: ''}).then(
- function success(_customers) {
- var customers = {
- pageSize: pageSize,
- data: _customers.data,
- nextPageLink: _customers.nextPageLink,
- selection: null,
- hasNext: _customers.hasNext,
- pending: false
- };
- if (customers.hasNext) {
- customers.nextPageLink.limit = pageSize;
- }
- $mdDialog.show({
- controller: 'AssignDashboardToCustomerController',
- controllerAs: 'vm',
- templateUrl: assignToCustomerTemplate,
- locals: {dashboardIds: dashboardIds, customers: customers},
- parent: angular.element($document[0].body),
- fullscreen: true,
- targetEvent: $event
- }).then(function () {
- vm.grid.refreshList();
- }, function () {
- });
- },
- function fail() {
- });
+ $mdDialog.show({
+ controller: 'ManageAssignedCustomersController',
+ controllerAs: 'vm',
+ templateUrl: manageAssignedCustomersTemplate,
+ locals: {actionType: actionType, dashboardIds: dashboardIds, assignedCustomers: assignedCustomers},
+ parent: angular.element($document[0].body),
+ fullscreen: true,
+ targetEvent: $event
+ }).then(function () {
+ vm.grid.refreshList();
+ }, function () {
+ });
}
function addDashboardsToCustomer($event) {
@@ -468,7 +482,7 @@ export function DashboardsController(userService, dashboardService, customerServ
$event.stopPropagation();
}
var pageSize = 10;
- dashboardService.getTenantDashboards({limit: pageSize, textSearch: ''}, false).then(
+ dashboardService.getTenantDashboards({limit: pageSize, textSearch: ''}).then(
function success(_dashboards) {
var dashboards = {
pageSize: pageSize,
@@ -499,30 +513,13 @@ export function DashboardsController(userService, dashboardService, customerServ
});
}
- function assignDashboardsToCustomer($event, items) {
- var dashboardIds = [];
- for (var id in items.selections) {
- dashboardIds.push(id);
- }
- assignToCustomer($event, dashboardIds);
- }
-
- function unassignFromCustomer($event, dashboard, isPublic) {
+ function unassignFromCustomer($event, dashboard, customerId) {
if ($event) {
$event.stopPropagation();
}
- var title;
- var content;
- var label;
- if (isPublic) {
- title = $translate.instant('dashboard.make-private-dashboard-title', {dashboardTitle: dashboard.title});
- content = $translate.instant('dashboard.make-private-dashboard-text');
- label = $translate.instant('dashboard.make-private-dashboard');
- } else {
- title = $translate.instant('dashboard.unassign-dashboard-title', {dashboardTitle: dashboard.title});
- content = $translate.instant('dashboard.unassign-dashboard-text');
- label = $translate.instant('dashboard.unassign-dashboard');
- }
+ var title = $translate.instant('dashboard.unassign-dashboard-title', {dashboardTitle: dashboard.title});
+ var content = $translate.instant('dashboard.unassign-dashboard-text');
+ var label = $translate.instant('dashboard.unassign-dashboard');
var confirm = $mdDialog.confirm()
.targetEvent($event)
.title(title)
@@ -531,7 +528,7 @@ export function DashboardsController(userService, dashboardService, customerServ
.cancel($translate.instant('action.no'))
.ok($translate.instant('action.yes'));
$mdDialog.show(confirm).then(function () {
- dashboardService.unassignDashboardFromCustomer(dashboard.id.id).then(function success() {
+ dashboardService.unassignDashboardFromCustomer(customerId, dashboard.id.id).then(function success() {
vm.grid.refreshList();
});
});
@@ -556,12 +553,33 @@ export function DashboardsController(userService, dashboardService, customerServ
});
}
+ function makePrivate($event, dashboard) {
+ if ($event) {
+ $event.stopPropagation();
+ }
+ var title = $translate.instant('dashboard.make-private-dashboard-title', {dashboardTitle: dashboard.title});
+ var content = $translate.instant('dashboard.make-private-dashboard-text');
+ var label = $translate.instant('dashboard.make-private-dashboard');
+ var confirm = $mdDialog.confirm()
+ .targetEvent($event)
+ .title(title)
+ .htmlContent(content)
+ .ariaLabel(label)
+ .cancel($translate.instant('action.no'))
+ .ok($translate.instant('action.yes'));
+ $mdDialog.show(confirm).then(function () {
+ dashboardService.makeDashboardPrivate(dashboard.id.id).then(function success() {
+ vm.grid.refreshList();
+ });
+ });
+ }
+
function exportDashboard($event, dashboard) {
$event.stopPropagation();
importExport.exportDashboard(dashboard.id.id);
}
- function unassignDashboardsFromCustomer($event, items) {
+ function unassignDashboardsFromCustomer($event, items, customerId) {
var confirm = $mdDialog.confirm()
.targetEvent($event)
.title($translate.instant('dashboard.unassign-dashboards-title', {count: items.selectedCount}, 'messageformat'))
@@ -572,7 +590,7 @@ export function DashboardsController(userService, dashboardService, customerServ
$mdDialog.show(confirm).then(function () {
var tasks = [];
for (var id in items.selections) {
- tasks.push(dashboardService.unassignDashboardFromCustomer(id));
+ tasks.push(dashboardService.unassignDashboardFromCustomer(customerId, id));
}
$q.all(tasks).then(function () {
vm.grid.refreshList();
ui/src/app/dashboard/dashboards.tpl.html 33(+23 -10)
diff --git a/ui/src/app/dashboard/dashboards.tpl.html b/ui/src/app/dashboard/dashboards.tpl.html
index dde2f86..02e4df0 100644
--- a/ui/src/app/dashboard/dashboards.tpl.html
+++ b/ui/src/app/dashboard/dashboards.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -19,13 +19,26 @@
<details-buttons tb-help="'dashboards'" help-container-id="help-container">
<div id="help-container"></div>
</details-buttons>
- <tb-dashboard-details dashboard="vm.grid.operatingItem()"
- is-edit="vm.grid.detailsConfig.isDetailsEditMode"
- dashboard-scope="vm.dashboardsScope"
- the-form="vm.grid.detailsForm"
- on-assign-to-customer="vm.assignToCustomer(event, [ vm.grid.detailsConfig.currentItem.id.id ])"
- on-make-public="vm.makePublic(event, vm.grid.detailsConfig.currentItem)"
- on-unassign-from-customer="vm.unassignFromCustomer(event, vm.grid.detailsConfig.currentItem, isPublic)"
- on-export-dashboard="vm.exportDashboard(event, vm.grid.detailsConfig.currentItem)"
- on-delete-dashboard="vm.grid.deleteItem(event, vm.grid.detailsConfig.currentItem)"></tb-dashboard-details>
+ <md-tabs ng-class="{'tb-headless': vm.grid.detailsConfig.isDetailsEditMode}"
+ id="tabs" md-border-bottom flex class="tb-absolute-fill">
+ <md-tab label="{{ 'dashboard.details' | translate }}">
+ <tb-dashboard-details dashboard="vm.grid.operatingItem()"
+ is-edit="vm.grid.detailsConfig.isDetailsEditMode"
+ dashboard-scope="vm.dashboardsScope"
+ customer-id="vm.customerId"
+ the-form="vm.grid.detailsForm"
+ on-make-public="vm.makePublic(event, vm.grid.detailsConfig.currentItem)"
+ on-make-private="vm.makePrivate(event, vm.grid.detailsConfig.currentItem)"
+ on-manage-assigned-customers="vm.manageAssignedCustomers(event, vm.grid.detailsConfig.currentItem)"
+ on-unassign-from-customer="vm.unassignFromCustomer(event, vm.grid.detailsConfig.currentItem, vm.customerId)"
+ on-export-dashboard="vm.exportDashboard(event, vm.grid.detailsConfig.currentItem)"
+ on-delete-dashboard="vm.grid.deleteItem(event, vm.grid.detailsConfig.currentItem)"></tb-dashboard-details>
+ </md-tab>
+ <md-tab ng-if="!vm.grid.detailsConfig.isDetailsEditMode && vm.grid.isTenantAdmin()" md-on-select="vm.grid.triggerResize()" label="{{ 'audit-log.audit-logs' | translate }}">
+ <tb-audit-log-table flex entity-type="vm.types.entityType.dashboard"
+ entity-id="vm.grid.operatingItem().id.id"
+ audit-log-mode="{{vm.types.auditLogMode.entity}}">
+ </tb-audit-log-table>
+ </md-tab>
+ </md-tabs>
</tb-grid>
diff --git a/ui/src/app/dashboard/dashboard-settings.controller.js b/ui/src/app/dashboard/dashboard-settings.controller.js
index 4799729..ae98a59 100644
--- a/ui/src/app/dashboard/dashboard-settings.controller.js
+++ b/ui/src/app/dashboard/dashboard-settings.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/dashboard-settings.scss b/ui/src/app/dashboard/dashboard-settings.scss
index ec0e42a..37da008 100644
--- a/ui/src/app/dashboard/dashboard-settings.scss
+++ b/ui/src/app/dashboard/dashboard-settings.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/dashboard-settings.tpl.html b/ui/src/app/dashboard/dashboard-settings.tpl.html
index da2b254..8b6ddf6 100644
--- a/ui/src/app/dashboard/dashboard-settings.tpl.html
+++ b/ui/src/app/dashboard/dashboard-settings.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/dashboard-toolbar.directive.js b/ui/src/app/dashboard/dashboard-toolbar.directive.js
index 52121cd..aea8c37 100644
--- a/ui/src/app/dashboard/dashboard-toolbar.directive.js
+++ b/ui/src/app/dashboard/dashboard-toolbar.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './dashboard-toolbar.scss';
import 'javascript-detect-element-resize/detect-element-resize';
diff --git a/ui/src/app/dashboard/dashboard-toolbar.scss b/ui/src/app/dashboard/dashboard-toolbar.scss
index 5d44f0a..40c17c4 100644
--- a/ui/src/app/dashboard/dashboard-toolbar.scss
+++ b/ui/src/app/dashboard/dashboard-toolbar.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import "~compass-sass-mixins/lib/compass";
@import '../../scss/constants';
diff --git a/ui/src/app/dashboard/dashboard-toolbar.tpl.html b/ui/src/app/dashboard/dashboard-toolbar.tpl.html
index 97858e8..02946af 100644
--- a/ui/src/app/dashboard/dashboard-toolbar.tpl.html
+++ b/ui/src/app/dashboard/dashboard-toolbar.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<md-fab-toolbar md-open="vm.toolbarOpened"
md-direction="left"
ng-class="{'is-fullscreen': vm.forceFullscreen, 'md-whiteframe-z1': vm.forceFullscreen && vm.toolbarOpened }">
diff --git a/ui/src/app/dashboard/edit-widget.directive.js b/ui/src/app/dashboard/edit-widget.directive.js
index 9357812..e6858b4 100644
--- a/ui/src/app/dashboard/edit-widget.directive.js
+++ b/ui/src/app/dashboard/edit-widget.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/edit-widget.tpl.html b/ui/src/app/dashboard/edit-widget.tpl.html
index 5b225e2..00ef80f 100644
--- a/ui/src/app/dashboard/edit-widget.tpl.html
+++ b/ui/src/app/dashboard/edit-widget.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/dashboard/index.js 6(+3 -3)
diff --git a/ui/src/app/dashboard/index.js b/ui/src/app/dashboard/index.js
index 4089716..8a0d4d4 100644
--- a/ui/src/app/dashboard/index.js
+++ b/ui/src/app/dashboard/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -40,8 +40,8 @@ import DashboardRoutes from './dashboard.routes';
import {DashboardsController, DashboardCardController, MakeDashboardPublicDialogController} from './dashboards.controller';
import DashboardController from './dashboard.controller';
import DashboardSettingsController from './dashboard-settings.controller';
-import AssignDashboardToCustomerController from './assign-to-customer.controller';
import AddDashboardsToCustomerController from './add-dashboards-to-customer.controller';
+import ManageAssignedCustomersController from './manage-assigned-customers.controller';
import AddWidgetController from './add-widget.controller';
import DashboardDirective from './dashboard.directive';
import EditWidgetDirective from './edit-widget.directive';
@@ -74,8 +74,8 @@ export default angular.module('thingsboard.dashboard', [
.controller('MakeDashboardPublicDialogController', MakeDashboardPublicDialogController)
.controller('DashboardController', DashboardController)
.controller('DashboardSettingsController', DashboardSettingsController)
- .controller('AssignDashboardToCustomerController', AssignDashboardToCustomerController)
.controller('AddDashboardsToCustomerController', AddDashboardsToCustomerController)
+ .controller('ManageAssignedCustomersController', ManageAssignedCustomersController)
.controller('AddWidgetController', AddWidgetController)
.directive('tbDashboardDetails', DashboardDirective)
.directive('tbEditWidget', EditWidgetDirective)
diff --git a/ui/src/app/dashboard/layouts/dashboard-layout.directive.js b/ui/src/app/dashboard/layouts/dashboard-layout.directive.js
index 9ce569f..1901b62 100644
--- a/ui/src/app/dashboard/layouts/dashboard-layout.directive.js
+++ b/ui/src/app/dashboard/layouts/dashboard-layout.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/layouts/dashboard-layout.tpl.html b/ui/src/app/dashboard/layouts/dashboard-layout.tpl.html
index c54901e..083b433 100644
--- a/ui/src/app/dashboard/layouts/dashboard-layout.tpl.html
+++ b/ui/src/app/dashboard/layouts/dashboard-layout.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/layouts/index.js b/ui/src/app/dashboard/layouts/index.js
index 6315565..3b5862e 100644
--- a/ui/src/app/dashboard/layouts/index.js
+++ b/ui/src/app/dashboard/layouts/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import ManageDashboardLayoutsController from './manage-dashboard-layouts.controller';
import SelectTargetLayoutController from './select-target-layout.controller';
import DashboardLayoutDirective from './dashboard-layout.directive';
diff --git a/ui/src/app/dashboard/layouts/manage-dashboard-layouts.controller.js b/ui/src/app/dashboard/layouts/manage-dashboard-layouts.controller.js
index 1ccf48f..5ce8a6c 100644
--- a/ui/src/app/dashboard/layouts/manage-dashboard-layouts.controller.js
+++ b/ui/src/app/dashboard/layouts/manage-dashboard-layouts.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import dashboardSettingsTemplate from '../dashboard-settings.tpl.html';
diff --git a/ui/src/app/dashboard/layouts/manage-dashboard-layouts.tpl.html b/ui/src/app/dashboard/layouts/manage-dashboard-layouts.tpl.html
index 335563d..559432d 100644
--- a/ui/src/app/dashboard/layouts/manage-dashboard-layouts.tpl.html
+++ b/ui/src/app/dashboard/layouts/manage-dashboard-layouts.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/layouts/select-target-layout.controller.js b/ui/src/app/dashboard/layouts/select-target-layout.controller.js
index 1af289a..a55d723 100644
--- a/ui/src/app/dashboard/layouts/select-target-layout.controller.js
+++ b/ui/src/app/dashboard/layouts/select-target-layout.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function SelectTargetLayoutController($scope, $mdDialog) {
diff --git a/ui/src/app/dashboard/layouts/select-target-layout.tpl.html b/ui/src/app/dashboard/layouts/select-target-layout.tpl.html
index a84f4f2..d08095d 100644
--- a/ui/src/app/dashboard/layouts/select-target-layout.tpl.html
+++ b/ui/src/app/dashboard/layouts/select-target-layout.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/make-dashboard-public-dialog.tpl.html b/ui/src/app/dashboard/make-dashboard-public-dialog.tpl.html
index 8d96b30..c8deb05 100644
--- a/ui/src/app/dashboard/make-dashboard-public-dialog.tpl.html
+++ b/ui/src/app/dashboard/make-dashboard-public-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/manage-assigned-customers.controller.js b/ui/src/app/dashboard/manage-assigned-customers.controller.js
new file mode 100644
index 0000000..b142992
--- /dev/null
+++ b/ui/src/app/dashboard/manage-assigned-customers.controller.js
@@ -0,0 +1,69 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+/*@ngInject*/
+export default function ManageAssignedCustomersController($mdDialog, $q, types, dashboardService, actionType, dashboardIds, assignedCustomers) {
+
+ var vm = this;
+
+ vm.types = types;
+ vm.actionType = actionType;
+ vm.dashboardIds = dashboardIds;
+ vm.assignedCustomers = assignedCustomers;
+ if (actionType != 'manage') {
+ vm.assignedCustomers = [];
+ }
+
+ if (actionType == 'manage') {
+ vm.titleText = 'dashboard.manage-assigned-customers';
+ vm.labelText = 'dashboard.assigned-customers';
+ vm.actionName = 'action.update';
+ } else if (actionType == 'assign') {
+ vm.titleText = 'dashboard.assign-to-customers';
+ vm.labelText = 'dashboard.assign-to-customers-text';
+ vm.actionName = 'action.assign';
+ } else if (actionType == 'unassign') {
+ vm.titleText = 'dashboard.unassign-from-customers';
+ vm.labelText = 'dashboard.unassign-from-customers-text';
+ vm.actionName = 'action.unassign';
+ }
+
+ vm.submit = submit;
+ vm.cancel = cancel;
+
+ function cancel () {
+ $mdDialog.cancel();
+ }
+
+ function submit () {
+ var tasks = [];
+ for (var i=0;i<vm.dashboardIds.length;i++) {
+ var dashboardId = vm.dashboardIds[i];
+ var promise;
+ if (vm.actionType == 'manage') {
+ promise = dashboardService.updateDashboardCustomers(dashboardId, vm.assignedCustomers);
+ } else if (vm.actionType == 'assign') {
+ promise = dashboardService.addDashboardCustomers(dashboardId, vm.assignedCustomers);
+ } else if (vm.actionType == 'unassign') {
+ promise = dashboardService.removeDashboardCustomers(dashboardId, vm.assignedCustomers);
+ }
+ tasks.push(promise);
+ }
+ $q.all(tasks).then(function () {
+ $mdDialog.hide();
+ });
+ }
+
+}
diff --git a/ui/src/app/dashboard/states/dashboard-state-dialog.controller.js b/ui/src/app/dashboard/states/dashboard-state-dialog.controller.js
index 8af5a77..8d46ee4 100644
--- a/ui/src/app/dashboard/states/dashboard-state-dialog.controller.js
+++ b/ui/src/app/dashboard/states/dashboard-state-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function DashboardStateDialogController($scope, $mdDialog, $filter, dashboardUtils, isAdd, allStates, state) {
diff --git a/ui/src/app/dashboard/states/dashboard-state-dialog.tpl.html b/ui/src/app/dashboard/states/dashboard-state-dialog.tpl.html
index 3f9fb43..3c31ebf 100644
--- a/ui/src/app/dashboard/states/dashboard-state-dialog.tpl.html
+++ b/ui/src/app/dashboard/states/dashboard-state-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/states/default-state-controller.js b/ui/src/app/dashboard/states/default-state-controller.js
index eecd1bc..d62152a 100644
--- a/ui/src/app/dashboard/states/default-state-controller.js
+++ b/ui/src/app/dashboard/states/default-state-controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './default-state-controller.scss';
/*@ngInject*/
diff --git a/ui/src/app/dashboard/states/default-state-controller.scss b/ui/src/app/dashboard/states/default-state-controller.scss
index 906ba7a..5d6ae97 100644
--- a/ui/src/app/dashboard/states/default-state-controller.scss
+++ b/ui/src/app/dashboard/states/default-state-controller.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
md-select.default-state-controller {
margin: 0px;
}
\ No newline at end of file
diff --git a/ui/src/app/dashboard/states/default-state-controller.tpl.html b/ui/src/app/dashboard/states/default-state-controller.tpl.html
index 62d11f0..e37e784 100644
--- a/ui/src/app/dashboard/states/default-state-controller.tpl.html
+++ b/ui/src/app/dashboard/states/default-state-controller.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/states/entity-state-controller.js b/ui/src/app/dashboard/states/entity-state-controller.js
index 527cd08..94fa19c 100644
--- a/ui/src/app/dashboard/states/entity-state-controller.js
+++ b/ui/src/app/dashboard/states/entity-state-controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './entity-state-controller.scss';
/*@ngInject*/
diff --git a/ui/src/app/dashboard/states/entity-state-controller.scss b/ui/src/app/dashboard/states/entity-state-controller.scss
index 28cd948..4c2d0c3 100644
--- a/ui/src/app/dashboard/states/entity-state-controller.scss
+++ b/ui/src/app/dashboard/states/entity-state-controller.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import '../../../scss/constants';
tb-states-component {
diff --git a/ui/src/app/dashboard/states/entity-state-controller.tpl.html b/ui/src/app/dashboard/states/entity-state-controller.tpl.html
index bb55fc9..45383ae 100644
--- a/ui/src/app/dashboard/states/entity-state-controller.tpl.html
+++ b/ui/src/app/dashboard/states/entity-state-controller.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/dashboard/states/index.js 3(+1 -2)
diff --git a/ui/src/app/dashboard/states/index.js b/ui/src/app/dashboard/states/index.js
index ce59e38..a7fe4eb 100644
--- a/ui/src/app/dashboard/states/index.js
+++ b/ui/src/app/dashboard/states/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import ManageDashboardStatesController from './manage-dashboard-states.controller';
import DashboardStateDialogController from './dashboard-state-dialog.controller';
import SelectTargetStateController from './select-target-state.controller';
diff --git a/ui/src/app/dashboard/states/manage-dashboard-states.controller.js b/ui/src/app/dashboard/states/manage-dashboard-states.controller.js
index 1aa95b7..98df466 100644
--- a/ui/src/app/dashboard/states/manage-dashboard-states.controller.js
+++ b/ui/src/app/dashboard/states/manage-dashboard-states.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './manage-dashboard-states.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/dashboard/states/manage-dashboard-states.scss b/ui/src/app/dashboard/states/manage-dashboard-states.scss
index 53e6724..2aa1ca2 100644
--- a/ui/src/app/dashboard/states/manage-dashboard-states.scss
+++ b/ui/src/app/dashboard/states/manage-dashboard-states.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.manage-dashboard-states {
table.md-table {
tbody {
diff --git a/ui/src/app/dashboard/states/manage-dashboard-states.tpl.html b/ui/src/app/dashboard/states/manage-dashboard-states.tpl.html
index 9f73652..1ac2302 100644
--- a/ui/src/app/dashboard/states/manage-dashboard-states.tpl.html
+++ b/ui/src/app/dashboard/states/manage-dashboard-states.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/states/select-target-state.controller.js b/ui/src/app/dashboard/states/select-target-state.controller.js
index fa62eef..6148ec9 100644
--- a/ui/src/app/dashboard/states/select-target-state.controller.js
+++ b/ui/src/app/dashboard/states/select-target-state.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function SelectTargetStateController($scope, $mdDialog, dashboardUtils, states) {
diff --git a/ui/src/app/dashboard/states/select-target-state.tpl.html b/ui/src/app/dashboard/states/select-target-state.tpl.html
index 412b818..5fd3122 100644
--- a/ui/src/app/dashboard/states/select-target-state.tpl.html
+++ b/ui/src/app/dashboard/states/select-target-state.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/dashboard/states/states-component.directive.js b/ui/src/app/dashboard/states/states-component.directive.js
index 8864d74..be40c17 100644
--- a/ui/src/app/dashboard/states/states-component.directive.js
+++ b/ui/src/app/dashboard/states/states-component.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function StatesComponent($compile, $templateCache, $controller, statesControllerService) {
diff --git a/ui/src/app/dashboard/states/states-controller.service.js b/ui/src/app/dashboard/states/states-controller.service.js
index b320b15..1bfc591 100644
--- a/ui/src/app/dashboard/states/states-controller.service.js
+++ b/ui/src/app/dashboard/states/states-controller.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import defaultStateControllerTemplate from './default-state-controller.tpl.html';
diff --git a/ui/src/app/device/add-device.tpl.html b/ui/src/app/device/add-device.tpl.html
index 3e26d70..3575454 100644
--- a/ui/src/app/device/add-device.tpl.html
+++ b/ui/src/app/device/add-device.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/add-devices-to-customer.controller.js b/ui/src/app/device/add-devices-to-customer.controller.js
index c54daab..42e8153 100644
--- a/ui/src/app/device/add-devices-to-customer.controller.js
+++ b/ui/src/app/device/add-devices-to-customer.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/add-devices-to-customer.tpl.html b/ui/src/app/device/add-devices-to-customer.tpl.html
index 04b28fd..4caa8dd 100644
--- a/ui/src/app/device/add-devices-to-customer.tpl.html
+++ b/ui/src/app/device/add-devices-to-customer.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/assign-to-customer.controller.js b/ui/src/app/device/assign-to-customer.controller.js
index b58435d..82310d8 100644
--- a/ui/src/app/device/assign-to-customer.controller.js
+++ b/ui/src/app/device/assign-to-customer.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/assign-to-customer.tpl.html b/ui/src/app/device/assign-to-customer.tpl.html
index 7bc2a12..42e94d2 100644
--- a/ui/src/app/device/assign-to-customer.tpl.html
+++ b/ui/src/app/device/assign-to-customer.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/device.controller.js b/ui/src/app/device/device.controller.js
index 3e8c9ac..4916ae3 100644
--- a/ui/src/app/device/device.controller.js
+++ b/ui/src/app/device/device.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/device/device.directive.js 29(+16 -13)
diff --git a/ui/src/app/device/device.directive.js b/ui/src/app/device/device.directive.js
index eda4fb2..3136290 100644
--- a/ui/src/app/device/device.directive.js
+++ b/ui/src/app/device/device.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -20,7 +20,7 @@ import deviceFieldsetTemplate from './device-fieldset.tpl.html';
/* eslint-enable import/no-unresolved, import/default */
/*@ngInject*/
-export default function DeviceDirective($compile, $templateCache, toast, $translate, types, deviceService, customerService) {
+export default function DeviceDirective($compile, $templateCache, toast, $translate, types, clipboardService, deviceService, customerService) {
var linker = function (scope, element) {
var template = $templateCache.get(deviceFieldsetTemplate);
element.html(template);
@@ -30,17 +30,8 @@ export default function DeviceDirective($compile, $templateCache, toast, $transl
scope.isPublic = false;
scope.assignedCustomer = null;
- scope.deviceCredentials = null;
-
scope.$watch('device', function(newVal) {
if (newVal) {
- if (scope.device.id) {
- deviceService.getDeviceCredentials(scope.device.id.id).then(
- function success(credentials) {
- scope.deviceCredentials = credentials;
- }
- );
- }
if (scope.device.customerId && scope.device.customerId.id !== types.id.nullUid) {
scope.isAssignedToCustomer = true;
customerService.getShortCustomerInfo(scope.device.customerId.id).then(
@@ -61,8 +52,20 @@ export default function DeviceDirective($compile, $templateCache, toast, $transl
toast.showSuccess($translate.instant('device.idCopiedMessage'), 750, angular.element(element).parent().parent(), 'bottom left');
};
- scope.onAccessTokenCopied = function() {
- toast.showSuccess($translate.instant('device.accessTokenCopiedMessage'), 750, angular.element(element).parent().parent(), 'bottom left');
+ scope.copyAccessToken = function(e) {
+ const trigger = e.delegateTarget || e.currentTarget;
+ if (scope.device.id) {
+ deviceService.getDeviceCredentials(scope.device.id.id, true).then(
+ function success(credentials) {
+ var credentialsId = credentials.credentialsId;
+ clipboardService.copyToClipboard(trigger, credentialsId).then(
+ () => {
+ toast.showSuccess($translate.instant('device.accessTokenCopiedMessage'), 750, angular.element(element).parent().parent(), 'bottom left');
+ }
+ );
+ }
+ );
+ }
};
$compile(element.contents())(scope);
ui/src/app/device/device.routes.js 2(+1 -1)
diff --git a/ui/src/app/device/device.routes.js b/ui/src/app/device/device.routes.js
index b1ca7ed..2f997bd 100644
--- a/ui/src/app/device/device.routes.js
+++ b/ui/src/app/device/device.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/device-card.tpl.html b/ui/src/app/device/device-card.tpl.html
index d7cd588..522f1ab 100644
--- a/ui/src/app/device/device-card.tpl.html
+++ b/ui/src/app/device/device-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/device-credentials.controller.js b/ui/src/app/device/device-credentials.controller.js
index 537df5d..4580bf2 100644
--- a/ui/src/app/device/device-credentials.controller.js
+++ b/ui/src/app/device/device-credentials.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/device-credentials.tpl.html b/ui/src/app/device/device-credentials.tpl.html
index c050349..7481051 100644
--- a/ui/src/app/device/device-credentials.tpl.html
+++ b/ui/src/app/device/device-credentials.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/device/device-fieldset.tpl.html b/ui/src/app/device/device-fieldset.tpl.html
index a4d15f3..ebbdee4 100644
--- a/ui/src/app/device/device-fieldset.tpl.html
+++ b/ui/src/app/device/device-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -39,10 +39,8 @@
<md-icon md-svg-icon="mdi:clipboard-arrow-left"></md-icon>
<span translate>device.copyId</span>
</md-button>
- <md-button ngclipboard data-clipboard-action="copy"
- ngclipboard-success="onAccessTokenCopied(e)"
- data-clipboard-text="{{deviceCredentials.credentialsId}}" ng-show="!isEdit"
- class="md-raised">
+ <md-button ng-show="!isEdit"
+ class="md-raised" ng-click="copyAccessToken($event)">
<md-icon md-svg-icon="mdi:clipboard-arrow-left"></md-icon>
<span translate>device.copyAccessToken</span>
</md-button>
ui/src/app/device/devices.tpl.html 8(+7 -1)
diff --git a/ui/src/app/device/devices.tpl.html b/ui/src/app/device/devices.tpl.html
index 1ec0134..65bd1e4 100644
--- a/ui/src/app/device/devices.tpl.html
+++ b/ui/src/app/device/devices.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -74,4 +74,10 @@
entity-type="{{vm.types.entityType.device}}">
</tb-extension-table>
</md-tab>
+ <md-tab ng-if="!vm.grid.detailsConfig.isDetailsEditMode && vm.grid.isTenantAdmin()" md-on-select="vm.grid.triggerResize()" label="{{ 'audit-log.audit-logs' | translate }}">
+ <tb-audit-log-table flex entity-type="vm.types.entityType.device"
+ entity-id="vm.grid.operatingItem().id.id"
+ audit-log-mode="{{vm.types.auditLogMode.entity}}">
+ </tb-audit-log-table>
+ </md-tab>
</tb-grid>
ui/src/app/device/index.js 2(+1 -1)
diff --git a/ui/src/app/device/index.js b/ui/src/app/device/index.js
index 5a8adaf..66d5749 100644
--- a/ui/src/app/device/index.js
+++ b/ui/src/app/device/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/alias/aliases-entity-select.directive.js b/ui/src/app/entity/alias/aliases-entity-select.directive.js
index 9a61311..a622bc1 100644
--- a/ui/src/app/entity/alias/aliases-entity-select.directive.js
+++ b/ui/src/app/entity/alias/aliases-entity-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './aliases-entity-select.scss';
import $ from 'jquery';
diff --git a/ui/src/app/entity/alias/aliases-entity-select.scss b/ui/src/app/entity/alias/aliases-entity-select.scss
index cc1061e..978bb3e 100644
--- a/ui/src/app/entity/alias/aliases-entity-select.scss
+++ b/ui/src/app/entity/alias/aliases-entity-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import '../../../scss/constants';
tb-aliases-entity-select {
diff --git a/ui/src/app/entity/alias/aliases-entity-select-button.tpl.html b/ui/src/app/entity/alias/aliases-entity-select-button.tpl.html
index 3d75803..1a6d1b5 100644
--- a/ui/src/app/entity/alias/aliases-entity-select-button.tpl.html
+++ b/ui/src/app/entity/alias/aliases-entity-select-button.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<section class="tb-aliases-entity-select" layout='row' layout-align="start center">
<md-button class="md-icon-button" aria-label="{{ 'entity.select-entities' | translate }}" ng-click="openEditMode($event)">
<md-tooltip md-direction="{{tooltipDirection}}">
diff --git a/ui/src/app/entity/alias/aliases-entity-select-panel.controller.js b/ui/src/app/entity/alias/aliases-entity-select-panel.controller.js
index 90248b2..6ff7863 100644
--- a/ui/src/app/entity/alias/aliases-entity-select-panel.controller.js
+++ b/ui/src/app/entity/alias/aliases-entity-select-panel.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function AliasesEntitySelectPanelController(mdPanelRef, $scope, $filter, types, aliasController, onEntityAliasesUpdate) {
diff --git a/ui/src/app/entity/alias/aliases-entity-select-panel.tpl.html b/ui/src/app/entity/alias/aliases-entity-select-panel.tpl.html
index d197d0b..bfce77c 100644
--- a/ui/src/app/entity/alias/aliases-entity-select-panel.tpl.html
+++ b/ui/src/app/entity/alias/aliases-entity-select-panel.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/alias/entity-alias-dialog.controller.js b/ui/src/app/entity/alias/entity-alias-dialog.controller.js
index d1f353d..0d52df7 100644
--- a/ui/src/app/entity/alias/entity-alias-dialog.controller.js
+++ b/ui/src/app/entity/alias/entity-alias-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './entity-alias-dialog.scss';
/*@ngInject*/
diff --git a/ui/src/app/entity/alias/entity-alias-dialog.scss b/ui/src/app/entity/alias/entity-alias-dialog.scss
index 96df6fd..bd4cd51 100644
--- a/ui/src/app/entity/alias/entity-alias-dialog.scss
+++ b/ui/src/app/entity/alias/entity-alias-dialog.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-entity-alias-dialog {
.tb-resolve-multiple-switch {
padding-left: 10px;
diff --git a/ui/src/app/entity/alias/entity-alias-dialog.tpl.html b/ui/src/app/entity/alias/entity-alias-dialog.tpl.html
index 546f8bf..a9f4bd0 100644
--- a/ui/src/app/entity/alias/entity-alias-dialog.tpl.html
+++ b/ui/src/app/entity/alias/entity-alias-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/alias/entity-aliases.controller.js b/ui/src/app/entity/alias/entity-aliases.controller.js
index b72b9ec..732f10f 100644
--- a/ui/src/app/entity/alias/entity-aliases.controller.js
+++ b/ui/src/app/entity/alias/entity-aliases.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/alias/entity-aliases.scss b/ui/src/app/entity/alias/entity-aliases.scss
index 9803be1..4b1fbeb 100644
--- a/ui/src/app/entity/alias/entity-aliases.scss
+++ b/ui/src/app/entity/alias/entity-aliases.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-aliases-dialog {
.md-dialog-content {
padding-bottom: 0px;
diff --git a/ui/src/app/entity/alias/entity-aliases.tpl.html b/ui/src/app/entity/alias/entity-aliases.tpl.html
index 227619b..a760eab 100644
--- a/ui/src/app/entity/alias/entity-aliases.tpl.html
+++ b/ui/src/app/entity/alias/entity-aliases.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/attribute/add-attribute-dialog.controller.js b/ui/src/app/entity/attribute/add-attribute-dialog.controller.js
index af0c32e..9a9ac81 100644
--- a/ui/src/app/entity/attribute/add-attribute-dialog.controller.js
+++ b/ui/src/app/entity/attribute/add-attribute-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/attribute/add-attribute-dialog.tpl.html b/ui/src/app/entity/attribute/add-attribute-dialog.tpl.html
index 6df9343..2043459 100644
--- a/ui/src/app/entity/attribute/add-attribute-dialog.tpl.html
+++ b/ui/src/app/entity/attribute/add-attribute-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/attribute/add-widget-to-dashboard-dialog.controller.js b/ui/src/app/entity/attribute/add-widget-to-dashboard-dialog.controller.js
index 64726db..5346e03 100644
--- a/ui/src/app/entity/attribute/add-widget-to-dashboard-dialog.controller.js
+++ b/ui/src/app/entity/attribute/add-widget-to-dashboard-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import selectTargetStateTemplate from '../../dashboard/states/select-target-state.tpl.html';
diff --git a/ui/src/app/entity/attribute/add-widget-to-dashboard-dialog.tpl.html b/ui/src/app/entity/attribute/add-widget-to-dashboard-dialog.tpl.html
index d74aa34..49c1716 100644
--- a/ui/src/app/entity/attribute/add-widget-to-dashboard-dialog.tpl.html
+++ b/ui/src/app/entity/attribute/add-widget-to-dashboard-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/attribute/attribute-table.directive.js b/ui/src/app/entity/attribute/attribute-table.directive.js
index bb138ed..b551ae6 100644
--- a/ui/src/app/entity/attribute/attribute-table.directive.js
+++ b/ui/src/app/entity/attribute/attribute-table.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/attribute/attribute-table.scss b/ui/src/app/entity/attribute/attribute-table.scss
index 3f40cdf..5d5c0be 100644
--- a/ui/src/app/entity/attribute/attribute-table.scss
+++ b/ui/src/app/entity/attribute/attribute-table.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/attribute/attribute-table.tpl.html b/ui/src/app/entity/attribute/attribute-table.tpl.html
index f7075fb..d55a6da 100644
--- a/ui/src/app/entity/attribute/attribute-table.tpl.html
+++ b/ui/src/app/entity/attribute/attribute-table.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/attribute/edit-attribute-value.controller.js b/ui/src/app/entity/attribute/edit-attribute-value.controller.js
index fba5b4d..85950f9 100644
--- a/ui/src/app/entity/attribute/edit-attribute-value.controller.js
+++ b/ui/src/app/entity/attribute/edit-attribute-value.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/attribute/edit-attribute-value.tpl.html b/ui/src/app/entity/attribute/edit-attribute-value.tpl.html
index 8ce8d81..0a57d80 100644
--- a/ui/src/app/entity/attribute/edit-attribute-value.tpl.html
+++ b/ui/src/app/entity/attribute/edit-attribute-value.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/entity-autocomplete.directive.js b/ui/src/app/entity/entity-autocomplete.directive.js
index 62f3d6d..c2053c0 100644
--- a/ui/src/app/entity/entity-autocomplete.directive.js
+++ b/ui/src/app/entity/entity-autocomplete.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -38,7 +38,12 @@ export default function EntityAutocomplete($compile, $templateCache, $q, $filter
if (scope.excludeEntityIds && scope.excludeEntityIds.length) {
limit += scope.excludeEntityIds.length;
}
- entityService.getEntitiesByNameFilter(scope.entityType, searchText, limit, {ignoreLoading: true}, scope.entitySubtype).then(function success(result) {
+ var targetType = scope.entityType;
+ if (targetType == types.aliasEntityType.current_customer) {
+ targetType = types.entityType.customer;
+ }
+
+ entityService.getEntitiesByNameFilter(targetType, searchText, limit, {ignoreLoading: true}, scope.entitySubtype).then(function success(result) {
if (result) {
if (scope.excludeEntityIds && scope.excludeEntityIds.length) {
var entities = [];
@@ -71,7 +76,11 @@ export default function EntityAutocomplete($compile, $templateCache, $q, $filter
ngModelCtrl.$render = function () {
if (ngModelCtrl.$viewValue) {
- entityService.getEntity(scope.entityType, ngModelCtrl.$viewValue).then(
+ var targetType = scope.entityType;
+ if (targetType == types.aliasEntityType.current_customer) {
+ targetType = types.entityType.customer;
+ }
+ entityService.getEntity(targetType, ngModelCtrl.$viewValue).then(
function success(entity) {
scope.entity = entity;
},
@@ -114,55 +123,61 @@ export default function EntityAutocomplete($compile, $templateCache, $q, $filter
scope.selectEntityText = 'asset.select-asset';
scope.entityText = 'asset.asset';
scope.noEntitiesMatchingText = 'asset.no-assets-matching';
- scope.entityRequiredText = 'asset.asset-required'
+ scope.entityRequiredText = 'asset.asset-required';
break;
case types.entityType.device:
scope.selectEntityText = 'device.select-device';
scope.entityText = 'device.device';
scope.noEntitiesMatchingText = 'device.no-devices-matching';
- scope.entityRequiredText = 'device.device-required'
+ scope.entityRequiredText = 'device.device-required';
break;
case types.entityType.rule:
scope.selectEntityText = 'rule.select-rule';
scope.entityText = 'rule.rule';
scope.noEntitiesMatchingText = 'rule.no-rules-matching';
- scope.entityRequiredText = 'rule.rule-required'
+ scope.entityRequiredText = 'rule.rule-required';
break;
case types.entityType.plugin:
scope.selectEntityText = 'plugin.select-plugin';
scope.entityText = 'plugin.plugin';
scope.noEntitiesMatchingText = 'plugin.no-plugins-matching';
- scope.entityRequiredText = 'plugin.plugin-required'
+ scope.entityRequiredText = 'plugin.plugin-required';
break;
case types.entityType.tenant:
scope.selectEntityText = 'tenant.select-tenant';
scope.entityText = 'tenant.tenant';
scope.noEntitiesMatchingText = 'tenant.no-tenants-matching';
- scope.entityRequiredText = 'tenant.tenant-required'
+ scope.entityRequiredText = 'tenant.tenant-required';
break;
case types.entityType.customer:
scope.selectEntityText = 'customer.select-customer';
scope.entityText = 'customer.customer';
scope.noEntitiesMatchingText = 'customer.no-customers-matching';
- scope.entityRequiredText = 'customer.customer-required'
+ scope.entityRequiredText = 'customer.customer-required';
break;
case types.entityType.user:
scope.selectEntityText = 'user.select-user';
scope.entityText = 'user.user';
scope.noEntitiesMatchingText = 'user.no-users-matching';
- scope.entityRequiredText = 'user.user-required'
+ scope.entityRequiredText = 'user.user-required';
break;
case types.entityType.dashboard:
scope.selectEntityText = 'dashboard.select-dashboard';
scope.entityText = 'dashboard.dashboard';
scope.noEntitiesMatchingText = 'dashboard.no-dashboards-matching';
- scope.entityRequiredText = 'dashboard.dashboard-required'
+ scope.entityRequiredText = 'dashboard.dashboard-required';
break;
case types.entityType.alarm:
scope.selectEntityText = 'alarm.select-alarm';
scope.entityText = 'alarm.alarm';
scope.noEntitiesMatchingText = 'alarm.no-alarms-matching';
- scope.entityRequiredText = 'alarm.alarm-required'
+ scope.entityRequiredText = 'alarm.alarm-required';
+ break;
+ case types.aliasEntityType.current_customer:
+ scope.selectEntityText = 'customer.select-default-customer';
+ scope.entityText = 'customer.default-customer';
+ scope.noEntitiesMatchingText = 'customer.no-customers-matching';
+ scope.entityRequiredText = 'customer.default-customer-required';
break;
}
if (scope.entity && scope.entity.id.entityType != scope.entityType) {
diff --git a/ui/src/app/entity/entity-autocomplete.scss b/ui/src/app/entity/entity-autocomplete.scss
index c6affa5..dad3d97 100644
--- a/ui/src/app/entity/entity-autocomplete.scss
+++ b/ui/src/app/entity/entity-autocomplete.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/entity-autocomplete.tpl.html b/ui/src/app/entity/entity-autocomplete.tpl.html
index ca6f37b..0eed26e 100644
--- a/ui/src/app/entity/entity-autocomplete.tpl.html
+++ b/ui/src/app/entity/entity-autocomplete.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/entity-filter.directive.js b/ui/src/app/entity/entity-filter.directive.js
index 3cede93..0c8f646 100644
--- a/ui/src/app/entity/entity-filter.directive.js
+++ b/ui/src/app/entity/entity-filter.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import entityFilterTemplate from './entity-filter.tpl.html';
ui/src/app/entity/entity-filter.scss 3(+1 -2)
diff --git a/ui/src/app/entity/entity-filter.scss b/ui/src/app/entity/entity-filter.scss
index 7e998ca..bbaa108 100644
--- a/ui/src/app/entity/entity-filter.scss
+++ b/ui/src/app/entity/entity-filter.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-entity-filter {
#relationsQueryFilter {
ui/src/app/entity/entity-filter.tpl.html 10(+9 -1)
diff --git a/ui/src/app/entity/entity-filter.tpl.html b/ui/src/app/entity/entity-filter.tpl.html
index 9f62454..f9aac3c 100644
--- a/ui/src/app/entity/entity-filter.tpl.html
+++ b/ui/src/app/entity/entity-filter.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -32,6 +32,7 @@
<tb-entity-select flex
the-form="theForm"
tb-required="true"
+ use-alias-entity-types="true"
ng-model="filter.singleEntity">
</tb-entity-select>
</section>
@@ -78,6 +79,7 @@
<tb-entity-select flex
the-form="theForm"
tb-required="false"
+ use-alias-entity-types="true"
ng-model="filter.defaultStateEntity">
</tb-entity-select>
</div>
@@ -123,6 +125,7 @@
the-form="theForm"
tb-required="!filter.rootStateEntity"
ng-disabled="filter.rootStateEntity"
+ use-alias-entity-types="true"
ng-model="filter.rootEntity">
</tb-entity-select>
</div>
@@ -139,6 +142,7 @@
<tb-entity-select flex
the-form="theForm"
tb-required="false"
+ use-alias-entity-types="true"
ng-model="filter.defaultStateEntity">
</tb-entity-select>
</div>
@@ -182,6 +186,7 @@
the-form="theForm"
tb-required="!filter.rootStateEntity"
ng-disabled="filter.rootStateEntity"
+ use-alias-entity-types="true"
ng-model="filter.rootEntity">
</tb-entity-select>
</div>
@@ -198,6 +203,7 @@
<tb-entity-select flex
the-form="theForm"
tb-required="false"
+ use-alias-entity-types="true"
ng-model="filter.defaultStateEntity">
</tb-entity-select>
</div>
@@ -249,6 +255,7 @@
the-form="theForm"
tb-required="!filter.rootStateEntity"
ng-disabled="filter.rootStateEntity"
+ use-alias-entity-types="true"
ng-model="filter.rootEntity">
</tb-entity-select>
</div>
@@ -265,6 +272,7 @@
<tb-entity-select flex
the-form="theForm"
tb-required="false"
+ use-alias-entity-types="true"
ng-model="filter.defaultStateEntity">
</tb-entity-select>
</div>
diff --git a/ui/src/app/entity/entity-filter-view.directive.js b/ui/src/app/entity/entity-filter-view.directive.js
index 4db8e79..8bd3422 100644
--- a/ui/src/app/entity/entity-filter-view.directive.js
+++ b/ui/src/app/entity/entity-filter-view.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import entityFilterViewTemplate from './entity-filter-view.tpl.html';
diff --git a/ui/src/app/entity/entity-filter-view.scss b/ui/src/app/entity/entity-filter-view.scss
index 437f296..69922c8 100644
--- a/ui/src/app/entity/entity-filter-view.scss
+++ b/ui/src/app/entity/entity-filter-view.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-entity-filter-view {
.entity-filter-empty {
color: rgba(221, 44, 0, 0.87);
diff --git a/ui/src/app/entity/entity-filter-view.tpl.html b/ui/src/app/entity/entity-filter-view.tpl.html
index 84c5405..9caea00 100644
--- a/ui/src/app/entity/entity-filter-view.tpl.html
+++ b/ui/src/app/entity/entity-filter-view.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<div layout='column' class="tb-entity-filter-view">
<div ng-if="!filter || !filter.type" class="entity-filter-empty" translate>alias.no-entity-filter-specified</div>
<div ng-if="filter && filter.type" layout="column">
diff --git a/ui/src/app/entity/entity-list.directive.js b/ui/src/app/entity/entity-list.directive.js
index f0bd7d9..61a71a9 100644
--- a/ui/src/app/entity/entity-list.directive.js
+++ b/ui/src/app/entity/entity-list.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import entityListTemplate from './entity-list.tpl.html';
ui/src/app/entity/entity-list.scss 3(+1 -2)
diff --git a/ui/src/app/entity/entity-list.scss b/ui/src/app/entity/entity-list.scss
index 437e292..6e1c892 100644
--- a/ui/src/app/entity/entity-list.scss
+++ b/ui/src/app/entity/entity-list.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*.tb-entity-list {
#entity_list_chips {
.md-chips {
diff --git a/ui/src/app/entity/entity-list.tpl.html b/ui/src/app/entity/entity-list.tpl.html
index 6bbb920..896013f 100644
--- a/ui/src/app/entity/entity-list.tpl.html
+++ b/ui/src/app/entity/entity-list.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<section flex layout='column' class="tb-entity-list">
<md-chips flex
readonly="disabled"
diff --git a/ui/src/app/entity/entity-select.directive.js b/ui/src/app/entity/entity-select.directive.js
index 2778a79..8e4031c 100644
--- a/ui/src/app/entity/entity-select.directive.js
+++ b/ui/src/app/entity/entity-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -105,7 +105,8 @@ export default function EntitySelect($compile, $templateCache) {
scope: {
theForm: '=?',
tbRequired: '=?',
- disabled:'=ngDisabled'
+ disabled:'=ngDisabled',
+ useAliasEntityTypes: "=?"
}
};
}
ui/src/app/entity/entity-select.scss 3(+1 -2)
diff --git a/ui/src/app/entity/entity-select.scss b/ui/src/app/entity/entity-select.scss
index 166c519..ab7bd3d 100644
--- a/ui/src/app/entity/entity-select.scss
+++ b/ui/src/app/entity/entity-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-entity-select {
}
\ No newline at end of file
diff --git a/ui/src/app/entity/entity-select.tpl.html b/ui/src/app/entity/entity-select.tpl.html
index 13e17e7..9e5e227 100644
--- a/ui/src/app/entity/entity-select.tpl.html
+++ b/ui/src/app/entity/entity-select.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -20,6 +20,7 @@
the-form="theForm"
ng-disabled="disabled"
tb-required="tbRequired"
+ use-alias-entity-types="useAliasEntityTypes"
ng-model="model.entityType">
</tb-entity-type-select>
<tb-entity-autocomplete flex ng-if="model.entityType"
diff --git a/ui/src/app/entity/entity-subtype-autocomplete.directive.js b/ui/src/app/entity/entity-subtype-autocomplete.directive.js
index 511f275..5812715 100644
--- a/ui/src/app/entity/entity-subtype-autocomplete.directive.js
+++ b/ui/src/app/entity/entity-subtype-autocomplete.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/entity-subtype-autocomplete.scss b/ui/src/app/entity/entity-subtype-autocomplete.scss
index a50aee5..c8e3edc 100644
--- a/ui/src/app/entity/entity-subtype-autocomplete.scss
+++ b/ui/src/app/entity/entity-subtype-autocomplete.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/entity-subtype-autocomplete.tpl.html b/ui/src/app/entity/entity-subtype-autocomplete.tpl.html
index ce220ee..97da504 100644
--- a/ui/src/app/entity/entity-subtype-autocomplete.tpl.html
+++ b/ui/src/app/entity/entity-subtype-autocomplete.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/entity-subtype-list.directive.js b/ui/src/app/entity/entity-subtype-list.directive.js
index 4468f64..d74a7b0 100644
--- a/ui/src/app/entity/entity-subtype-list.directive.js
+++ b/ui/src/app/entity/entity-subtype-list.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import entitySubtypeListTemplate from './entity-subtype-list.tpl.html';
diff --git a/ui/src/app/entity/entity-subtype-list.scss b/ui/src/app/entity/entity-subtype-list.scss
index bbb2a1c..f024956 100644
--- a/ui/src/app/entity/entity-subtype-list.scss
+++ b/ui/src/app/entity/entity-subtype-list.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*.tb-entity-subtype-list {
#entity_subtype_list_chips {
.md-chips {
diff --git a/ui/src/app/entity/entity-subtype-list.tpl.html b/ui/src/app/entity/entity-subtype-list.tpl.html
index 2a1519a..ce77d43 100644
--- a/ui/src/app/entity/entity-subtype-list.tpl.html
+++ b/ui/src/app/entity/entity-subtype-list.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<section flex layout='column' class="tb-entity-subtype-list">
<md-chips flex
readonly="disabled"
diff --git a/ui/src/app/entity/entity-subtype-select.directive.js b/ui/src/app/entity/entity-subtype-select.directive.js
index 72c4250..b86e944 100644
--- a/ui/src/app/entity/entity-subtype-select.directive.js
+++ b/ui/src/app/entity/entity-subtype-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './entity-subtype-select.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/entity/entity-subtype-select.scss b/ui/src/app/entity/entity-subtype-select.scss
index a6b2fe1..15b3f2a 100644
--- a/ui/src/app/entity/entity-subtype-select.scss
+++ b/ui/src/app/entity/entity-subtype-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
md-select.tb-entity-subtype-select {
min-width: 200px;
}
diff --git a/ui/src/app/entity/entity-subtype-select.tpl.html b/ui/src/app/entity/entity-subtype-select.tpl.html
index 323f07f..94af188 100644
--- a/ui/src/app/entity/entity-subtype-select.tpl.html
+++ b/ui/src/app/entity/entity-subtype-select.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/entity-type-list.directive.js b/ui/src/app/entity/entity-type-list.directive.js
index cb07cfc..f042e5c 100644
--- a/ui/src/app/entity/entity-type-list.directive.js
+++ b/ui/src/app/entity/entity-type-list.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import entityTypeListTemplate from './entity-type-list.tpl.html';
diff --git a/ui/src/app/entity/entity-type-list.scss b/ui/src/app/entity/entity-type-list.scss
index b94b992..21a88ee 100644
--- a/ui/src/app/entity/entity-type-list.scss
+++ b/ui/src/app/entity/entity-type-list.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*.tb-entity-type-list {
#entity_type_list_chips {
.md-chips {
diff --git a/ui/src/app/entity/entity-type-list.tpl.html b/ui/src/app/entity/entity-type-list.tpl.html
index ff10a30..eb32124 100644
--- a/ui/src/app/entity/entity-type-list.tpl.html
+++ b/ui/src/app/entity/entity-type-list.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<section flex layout='column' class="tb-entity-type-list">
<md-chips flex
readonly="disabled"
diff --git a/ui/src/app/entity/entity-type-select.directive.js b/ui/src/app/entity/entity-type-select.directive.js
index 068c141..0478630 100644
--- a/ui/src/app/entity/entity-type-select.directive.js
+++ b/ui/src/app/entity/entity-type-select.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './entity-type-select.scss';
/* eslint-disable import/no-unresolved, import/default */
@@ -39,7 +38,7 @@ export default function EntityTypeSelect($compile, $templateCache, utils, entity
scope.ngModelCtrl = ngModelCtrl;
- scope.entityTypes = entityService.prepareAllowedEntityTypesList(scope.allowedEntityTypes);
+ scope.entityTypes = entityService.prepareAllowedEntityTypesList(scope.allowedEntityTypes, scope.useAliasEntityTypes);
scope.typeName = function(type) {
return type ? types.entityTypeTranslations[type].type : '';
@@ -79,7 +78,8 @@ export default function EntityTypeSelect($compile, $templateCache, utils, entity
theForm: '=?',
tbRequired: '=?',
disabled:'=ngDisabled',
- allowedEntityTypes: "=?"
+ allowedEntityTypes: "=?",
+ useAliasEntityTypes: "=?"
}
};
}
diff --git a/ui/src/app/entity/entity-type-select.scss b/ui/src/app/entity/entity-type-select.scss
index 58ff6cc..3a60865 100644
--- a/ui/src/app/entity/entity-type-select.scss
+++ b/ui/src/app/entity/entity-type-select.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,6 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
md-select.tb-entity-type-select {
}
diff --git a/ui/src/app/entity/entity-type-select.tpl.html b/ui/src/app/entity/entity-type-select.tpl.html
index 86d0eeb..a2096bc 100644
--- a/ui/src/app/entity/entity-type-select.tpl.html
+++ b/ui/src/app/entity/entity-type-select.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/entity/index.js 3(+1 -2)
diff --git a/ui/src/app/entity/index.js b/ui/src/app/entity/index.js
index 2b8d434..2f8c464 100644
--- a/ui/src/app/entity/index.js
+++ b/ui/src/app/entity/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import EntityAliasesController from './alias/entity-aliases.controller';
import EntityAliasDialogController from './alias/entity-alias-dialog.controller';
import EntityTypeSelectDirective from './entity-type-select.directive';
diff --git a/ui/src/app/entity/relation/relation-dialog.controller.js b/ui/src/app/entity/relation/relation-dialog.controller.js
index d13b4db..6c681af 100644
--- a/ui/src/app/entity/relation/relation-dialog.controller.js
+++ b/ui/src/app/entity/relation/relation-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import 'brace/ext/language_tools';
import 'brace/mode/json';
import 'brace/theme/github';
diff --git a/ui/src/app/entity/relation/relation-dialog.scss b/ui/src/app/entity/relation/relation-dialog.scss
index 1bd038b..1c0bf2e 100644
--- a/ui/src/app/entity/relation/relation-dialog.scss
+++ b/ui/src/app/entity/relation/relation-dialog.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-relation-additional-info-panel {
margin-left: 15px;
border: 1px solid #C0C0C0;
diff --git a/ui/src/app/entity/relation/relation-dialog.tpl.html b/ui/src/app/entity/relation/relation-dialog.tpl.html
index 652b9d2..e67c8e0 100644
--- a/ui/src/app/entity/relation/relation-dialog.tpl.html
+++ b/ui/src/app/entity/relation/relation-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/relation/relation-filters.directive.js b/ui/src/app/entity/relation/relation-filters.directive.js
index 59821dd..00d3b26 100644
--- a/ui/src/app/entity/relation/relation-filters.directive.js
+++ b/ui/src/app/entity/relation/relation-filters.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './relation-filters.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/entity/relation/relation-filters.scss b/ui/src/app/entity/relation/relation-filters.scss
index 50d49af..649879d 100644
--- a/ui/src/app/entity/relation/relation-filters.scss
+++ b/ui/src/app/entity/relation/relation-filters.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-relation-filters {
.header {
padding-left: 5px;
diff --git a/ui/src/app/entity/relation/relation-filters.tpl.html b/ui/src/app/entity/relation/relation-filters.tpl.html
index 4f84fe1..1d01e83 100644
--- a/ui/src/app/entity/relation/relation-filters.tpl.html
+++ b/ui/src/app/entity/relation/relation-filters.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/relation/relation-table.directive.js b/ui/src/app/entity/relation/relation-table.directive.js
index 17436a6..3247811 100644
--- a/ui/src/app/entity/relation/relation-table.directive.js
+++ b/ui/src/app/entity/relation/relation-table.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/relation/relation-table.scss b/ui/src/app/entity/relation/relation-table.scss
index f5df1fc..2d618fb 100644
--- a/ui/src/app/entity/relation/relation-table.scss
+++ b/ui/src/app/entity/relation/relation-table.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/relation/relation-table.tpl.html b/ui/src/app/entity/relation/relation-table.tpl.html
index 1553d93..16d422c 100644
--- a/ui/src/app/entity/relation/relation-table.tpl.html
+++ b/ui/src/app/entity/relation/relation-table.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/relation/relation-type-autocomplete.directive.js b/ui/src/app/entity/relation/relation-type-autocomplete.directive.js
index 4b5480d..f72cfd0 100644
--- a/ui/src/app/entity/relation/relation-type-autocomplete.directive.js
+++ b/ui/src/app/entity/relation/relation-type-autocomplete.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/relation/relation-type-autocomplete.scss b/ui/src/app/entity/relation/relation-type-autocomplete.scss
index 9fd0fe0..2293d79 100644
--- a/ui/src/app/entity/relation/relation-type-autocomplete.scss
+++ b/ui/src/app/entity/relation/relation-type-autocomplete.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/entity/relation/relation-type-autocomplete.tpl.html b/ui/src/app/entity/relation/relation-type-autocomplete.tpl.html
index 39f32d6..6aa35e0 100644
--- a/ui/src/app/entity/relation/relation-type-autocomplete.tpl.html
+++ b/ui/src/app/entity/relation/relation-type-autocomplete.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/event/event.scss 2(+1 -1)
diff --git a/ui/src/app/event/event.scss b/ui/src/app/event/event.scss
index 8622b0d..b3be35c 100644
--- a/ui/src/app/event/event.scss
+++ b/ui/src/app/event/event.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-content-dialog.controller.js b/ui/src/app/event/event-content-dialog.controller.js
index 235cfcf..108f95e 100644
--- a/ui/src/app/event/event-content-dialog.controller.js
+++ b/ui/src/app/event/event-content-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-content-dialog.tpl.html b/ui/src/app/event/event-content-dialog.tpl.html
index 9678616..d203d83 100644
--- a/ui/src/app/event/event-content-dialog.tpl.html
+++ b/ui/src/app/event/event-content-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-header.directive.js b/ui/src/app/event/event-header.directive.js
index c43894e..afac804 100644
--- a/ui/src/app/event/event-header.directive.js
+++ b/ui/src/app/event/event-header.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-header-error.tpl.html b/ui/src/app/event/event-header-error.tpl.html
index 337cbc5..680e6c5 100644
--- a/ui/src/app/event/event-header-error.tpl.html
+++ b/ui/src/app/event/event-header-error.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-header-lc-event.tpl.html b/ui/src/app/event/event-header-lc-event.tpl.html
index 71d4c54..e5a25fe 100644
--- a/ui/src/app/event/event-header-lc-event.tpl.html
+++ b/ui/src/app/event/event-header-lc-event.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-header-stats.tpl.html b/ui/src/app/event/event-header-stats.tpl.html
index 3db9fc3..6d8c6a4 100644
--- a/ui/src/app/event/event-header-stats.tpl.html
+++ b/ui/src/app/event/event-header-stats.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-row.directive.js b/ui/src/app/event/event-row.directive.js
index d1feb60..f005542 100644
--- a/ui/src/app/event/event-row.directive.js
+++ b/ui/src/app/event/event-row.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-row-error.tpl.html b/ui/src/app/event/event-row-error.tpl.html
index 67129a1..8f58096 100644
--- a/ui/src/app/event/event-row-error.tpl.html
+++ b/ui/src/app/event/event-row-error.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-row-lc-event.tpl.html b/ui/src/app/event/event-row-lc-event.tpl.html
index 8bb4b97..52710ca 100644
--- a/ui/src/app/event/event-row-lc-event.tpl.html
+++ b/ui/src/app/event/event-row-lc-event.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-row-stats.tpl.html b/ui/src/app/event/event-row-stats.tpl.html
index 71e8975..3abdd73 100644
--- a/ui/src/app/event/event-row-stats.tpl.html
+++ b/ui/src/app/event/event-row-stats.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/event/event-table.directive.js b/ui/src/app/event/event-table.directive.js
index 7ffa449..4291014 100644
--- a/ui/src/app/event/event-table.directive.js
+++ b/ui/src/app/event/event-table.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/event/event-table.tpl.html 13(+10 -3)
diff --git a/ui/src/app/event/event-table.tpl.html b/ui/src/app/event/event-table.tpl.html
index 760b55b..68c418f 100644
--- a/ui/src/app/event/event-table.tpl.html
+++ b/ui/src/app/event/event-table.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -26,9 +26,16 @@
</md-select>
</md-input-container>
<tb-timewindow flex ng-model="timewindow" history-only as-button="true"></tb-timewindow>
+ <md-button ng-disabled="$root.loading"
+ class="md-icon-button" ng-click="reload()">
+ <md-icon>refresh</md-icon>
+ <md-tooltip md-direction="top">
+ {{ 'action.refresh' | translate }}
+ </md-tooltip>
+ </md-button>
</section>
<md-list flex layout="column" class="md-whiteframe-z1 tb-event-table">
- <md-list class="tb-row tb-header" layout="row" tb-event-header event-type="{{eventType}}">
+ <md-list class="tb-row tb-header" layout="row" layout-align="start center" tb-event-header event-type="{{eventType}}">
</md-list>
<md-progress-linear style="max-height: 0px;" md-mode="indeterminate" ng-disabled="!$root.loading"
ng-show="$root.loading"></md-progress-linear>
@@ -38,7 +45,7 @@
class="tb-prompt" ng-show="noData()">event.no-events-prompt</span>
<md-virtual-repeat-container ng-show="hasData()" flex md-top-index="topIndex" tb-scope-element="repeatContainer">
<md-list-item md-virtual-repeat="event in theEvents" md-on-demand flex ng-style="hasScroll() ? {'margin-right':'-15px'} : {}">
- <md-list class="tb-row" flex layout="row" tb-event-row event-type="{{eventType}}" event="{{event}}">
+ <md-list class="tb-row" flex layout="row" layout-align="start center" tb-event-row event-type="{{eventType}}" event="{{event}}">
</md-list>
<md-divider flex></md-divider>
</md-list-item>
ui/src/app/event/index.js 2(+1 -1)
diff --git a/ui/src/app/event/index.js b/ui/src/app/event/index.js
index 8dd3300..561e56a 100644
--- a/ui/src/app/event/index.js
+++ b/ui/src/app/event/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/extension/extension-dialog.controller.js b/ui/src/app/extension/extension-dialog.controller.js
index fe5825c..2b0eded 100644
--- a/ui/src/app/extension/extension-dialog.controller.js
+++ b/ui/src/app/extension/extension-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import beautify from 'js-beautify';
const js_beautify = beautify.js;
diff --git a/ui/src/app/extension/extension-dialog.tpl.html b/ui/src/app/extension/extension-dialog.tpl.html
index 50520d1..4e200d5 100644
--- a/ui/src/app/extension/extension-dialog.tpl.html
+++ b/ui/src/app/extension/extension-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/extension/extensions-forms/extension-form.scss b/ui/src/app/extension/extensions-forms/extension-form.scss
index 97ac717..c7fcbf4 100644
--- a/ui/src/app/extension/extensions-forms/extension-form.scss
+++ b/ui/src/app/extension/extensions-forms/extension-form.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/extension/extensions-forms/extension-form-http.directive.js b/ui/src/app/extension/extensions-forms/extension-form-http.directive.js
index 37a9444..9553c0d 100644
--- a/ui/src/app/extension/extensions-forms/extension-form-http.directive.js
+++ b/ui/src/app/extension/extensions-forms/extension-form-http.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import 'brace/ext/language_tools';
import 'brace/mode/json';
import 'brace/theme/github';
diff --git a/ui/src/app/extension/extensions-forms/extension-form-http.tpl.html b/ui/src/app/extension/extensions-forms/extension-form-http.tpl.html
index b39794a..abf2e4c 100644
--- a/ui/src/app/extension/extensions-forms/extension-form-http.tpl.html
+++ b/ui/src/app/extension/extensions-forms/extension-form-http.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/extension/extensions-forms/extension-form-mqtt.directive.js b/ui/src/app/extension/extensions-forms/extension-form-mqtt.directive.js
index 39a1eb8..9526ad4 100644
--- a/ui/src/app/extension/extensions-forms/extension-form-mqtt.directive.js
+++ b/ui/src/app/extension/extensions-forms/extension-form-mqtt.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './extension-form.scss';
/* eslint-disable angular/log */
diff --git a/ui/src/app/extension/extensions-forms/extension-form-mqtt.tpl.html b/ui/src/app/extension/extensions-forms/extension-form-mqtt.tpl.html
index f665fb0..9f0b547 100644
--- a/ui/src/app/extension/extensions-forms/extension-form-mqtt.tpl.html
+++ b/ui/src/app/extension/extensions-forms/extension-form-mqtt.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/extension/extensions-forms/extension-form-opc.directive.js b/ui/src/app/extension/extensions-forms/extension-form-opc.directive.js
index fc69b68..bf4886c 100644
--- a/ui/src/app/extension/extensions-forms/extension-form-opc.directive.js
+++ b/ui/src/app/extension/extensions-forms/extension-form-opc.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import 'brace/ext/language_tools';
import 'brace/mode/json';
import 'brace/theme/github';
diff --git a/ui/src/app/extension/extensions-forms/extension-form-opc.tpl.html b/ui/src/app/extension/extensions-forms/extension-form-opc.tpl.html
index 6d74cc5..501eeeb 100644
--- a/ui/src/app/extension/extensions-forms/extension-form-opc.tpl.html
+++ b/ui/src/app/extension/extensions-forms/extension-form-opc.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -63,10 +63,7 @@
<md-input-container flex="50" class="md-block" md-is-error="theForm['applicationUri_' + serverIndex].$touched && theForm['applicationUri_' + serverIndex].$invalid">
<label translate>extension.opc-application-uri</label>
- <input required name="applicationUri_{{serverIndex}}" ng-model="server.applicationUri">
- <div ng-messages="theForm['applicationUri_' + serverIndex].$error">
- <div translate ng-message="required">extension.field-required</div>
- </div>
+ <input name="applicationUri_{{serverIndex}}" ng-model="server.applicationUri">
</md-input-container>
</div>
diff --git a/ui/src/app/extension/extension-table.directive.js b/ui/src/app/extension/extension-table.directive.js
index 24e9842..ecd3865 100644
--- a/ui/src/app/extension/extension-table.directive.js
+++ b/ui/src/app/extension/extension-table.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import 'angular-material-data-table/dist/md-data-table.min.css';
import './extension-table.scss';
diff --git a/ui/src/app/extension/extension-table.scss b/ui/src/app/extension/extension-table.scss
index 7c0a0d8..c8946df 100644
--- a/ui/src/app/extension/extension-table.scss
+++ b/ui/src/app/extension/extension-table.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/extension/extension-table.tpl.html b/ui/src/app/extension/extension-table.tpl.html
index b86061c..0ad2f4d 100644
--- a/ui/src/app/extension/extension-table.tpl.html
+++ b/ui/src/app/extension/extension-table.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<md-content flex class="md-padding tb-absolute-fill tb-data-table extension-table" layout="column">
<div layout="column" class="md-whiteframe-z1" ng-class="{'tb-absolute-fill' : vm.inWidget}">
<md-toolbar ng-if="!vm.inWidget" class="md-table-toolbar md-default" ng-show="!vm.selectedExtensions.length
ui/src/app/extension/index.js 3(+1 -2)
diff --git a/ui/src/app/extension/index.js b/ui/src/app/extension/index.js
index acb97be..f04880c 100644
--- a/ui/src/app/extension/index.js
+++ b/ui/src/app/extension/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import ExtensionTableDirective from './extension-table.directive';
import ExtensionFormHttpDirective from './extensions-forms/extension-form-http.directive';
import ExtensionFormMqttDirective from './extensions-forms/extension-form-mqtt.directive'
diff --git a/ui/src/app/global-interceptor.service.js b/ui/src/app/global-interceptor.service.js
index 57bbcd3..ba4d117 100644
--- a/ui/src/app/global-interceptor.service.js
+++ b/ui/src/app/global-interceptor.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/help/help.directive.js 2(+1 -1)
diff --git a/ui/src/app/help/help.directive.js b/ui/src/app/help/help.directive.js
index 9cce2b7..bc7e84f 100644
--- a/ui/src/app/help/help.directive.js
+++ b/ui/src/app/help/help.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/help/help.scss 2(+1 -1)
diff --git a/ui/src/app/help/help.scss b/ui/src/app/help/help.scss
index d535d13..b37dc31 100644
--- a/ui/src/app/help/help.scss
+++ b/ui/src/app/help/help.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/help/help-links.constant.js b/ui/src/app/help/help-links.constant.js
index faed304..9b1f84f 100644
--- a/ui/src/app/help/help-links.constant.js
+++ b/ui/src/app/help/help-links.constant.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/home/home-links.controller.js b/ui/src/app/home/home-links.controller.js
index b2b9366..779958c 100644
--- a/ui/src/app/home/home-links.controller.js
+++ b/ui/src/app/home/home-links.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './home-links.scss';
/*@ngInject*/
ui/src/app/home/home-links.routes.js 2(+1 -1)
diff --git a/ui/src/app/home/home-links.routes.js b/ui/src/app/home/home-links.routes.js
index 62afe0b..d62f78c 100644
--- a/ui/src/app/home/home-links.routes.js
+++ b/ui/src/app/home/home-links.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/home/home-links.scss 3(+1 -2)
diff --git a/ui/src/app/home/home-links.scss b/ui/src/app/home/home-links.scss
index e210334..8476eb4 100644
--- a/ui/src/app/home/home-links.scss
+++ b/ui/src/app/home/home-links.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import "../../scss/constants";
.tb-home-links {
ui/src/app/home/home-links.tpl.html 2(+1 -1)
diff --git a/ui/src/app/home/home-links.tpl.html b/ui/src/app/home/home-links.tpl.html
index f0e5582..b96568d 100644
--- a/ui/src/app/home/home-links.tpl.html
+++ b/ui/src/app/home/home-links.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/home/index.js 2(+1 -1)
diff --git a/ui/src/app/home/index.js b/ui/src/app/home/index.js
index 079b5ef..92ac6ac 100644
--- a/ui/src/app/home/index.js
+++ b/ui/src/app/home/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/ie.support.js 3(+1 -2)
diff --git a/ui/src/app/ie.support.js b/ui/src/app/ie.support.js
index da5c1a0..7f78459 100644
--- a/ui/src/app/ie.support.js
+++ b/ui/src/app/ie.support.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
(function () {
if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
diff --git a/ui/src/app/import-export/import-dialog.controller.js b/ui/src/app/import-export/import-dialog.controller.js
index 86901c2..3db7bb1 100644
--- a/ui/src/app/import-export/import-dialog.controller.js
+++ b/ui/src/app/import-export/import-dialog.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/import-export/import-dialog.scss b/ui/src/app/import-export/import-dialog.scss
index f2d0cfb..c1561f3 100644
--- a/ui/src/app/import-export/import-dialog.scss
+++ b/ui/src/app/import-export/import-dialog.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/import-export/import-dialog.tpl.html b/ui/src/app/import-export/import-dialog.tpl.html
index 8e0b32f..cdea1a0 100644
--- a/ui/src/app/import-export/import-dialog.tpl.html
+++ b/ui/src/app/import-export/import-dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/import-export/import-export.service.js b/ui/src/app/import-export/import-export.service.js
index 62e1bb3..6071fd2 100644
--- a/ui/src/app/import-export/import-export.service.js
+++ b/ui/src/app/import-export/import-export.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -540,7 +540,7 @@ export default function ImportExport($log, $translate, $q, $mdDialog, $document,
function success(dashboard) {
var name = dashboard.title;
name = name.toLowerCase().replace(/\W/g,"_");
- exportToPc(prepareExport(dashboard), name + '.json');
+ exportToPc(prepareDashboardExport(dashboard), name + '.json');
},
function fail(rejection) {
var message = rejection;
@@ -552,6 +552,15 @@ export default function ImportExport($log, $translate, $q, $mdDialog, $document,
);
}
+ function prepareDashboardExport(dashboard) {
+ dashboard = prepareExport(dashboard);
+ delete dashboard.assignedCustomers;
+ delete dashboard.publicCustomerId;
+ delete dashboard.assignedCustomersText;
+ delete dashboard.assignedCustomersIds;
+ return dashboard;
+ }
+
function importDashboard($event) {
var deferred = $q.defer();
openImportDialog($event, 'dashboard.import', 'dashboard.dashboard-file').then(
ui/src/app/import-export/index.js 2(+1 -1)
diff --git a/ui/src/app/import-export/index.js b/ui/src/app/import-export/index.js
index 20cbf73..3d07f58 100644
--- a/ui/src/app/import-export/index.js
+++ b/ui/src/app/import-export/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/jsonform/index.js 2(+1 -1)
diff --git a/ui/src/app/jsonform/index.js b/ui/src/app/jsonform/index.js
index 24d7582..c68d8e2 100644
--- a/ui/src/app/jsonform/index.js
+++ b/ui/src/app/jsonform/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/jsonform/jsonform.controller.js b/ui/src/app/jsonform/jsonform.controller.js
index f8ff7e0..439a22c 100644
--- a/ui/src/app/jsonform/jsonform.controller.js
+++ b/ui/src/app/jsonform/jsonform.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/jsonform/jsonform.routes.js b/ui/src/app/jsonform/jsonform.routes.js
index d493cd0..037d93a 100644
--- a/ui/src/app/jsonform/jsonform.routes.js
+++ b/ui/src/app/jsonform/jsonform.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/jsonform/jsonform.scss 2(+1 -1)
diff --git a/ui/src/app/jsonform/jsonform.scss b/ui/src/app/jsonform/jsonform.scss
index 825acd6..8205fa4 100644
--- a/ui/src/app/jsonform/jsonform.scss
+++ b/ui/src/app/jsonform/jsonform.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/jsonform/jsonform.tpl.html b/ui/src/app/jsonform/jsonform.tpl.html
index 6861f33..895a72e 100644
--- a/ui/src/app/jsonform/jsonform.tpl.html
+++ b/ui/src/app/jsonform/jsonform.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/layout/breadcrumb.tpl.html b/ui/src/app/layout/breadcrumb.tpl.html
index 8f25f9b..400b05b 100644
--- a/ui/src/app/layout/breadcrumb.tpl.html
+++ b/ui/src/app/layout/breadcrumb.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/layout/breadcrumb-icon.filter.js b/ui/src/app/layout/breadcrumb-icon.filter.js
index 104e54b..5da97ae 100644
--- a/ui/src/app/layout/breadcrumb-icon.filter.js
+++ b/ui/src/app/layout/breadcrumb-icon.filter.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/layout/breadcrumb-label.filter.js b/ui/src/app/layout/breadcrumb-label.filter.js
index 0294810..5a64331 100644
--- a/ui/src/app/layout/breadcrumb-label.filter.js
+++ b/ui/src/app/layout/breadcrumb-label.filter.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/layout/home.controller.js 3(+1 -2)
diff --git a/ui/src/app/layout/home.controller.js b/ui/src/app/layout/home.controller.js
index 520cfb5..5ea3791 100644
--- a/ui/src/app/layout/home.controller.js
+++ b/ui/src/app/layout/home.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import $ from 'jquery';
/* eslint-disable import/no-unresolved, import/default */
ui/src/app/layout/home.routes.js 2(+1 -1)
diff --git a/ui/src/app/layout/home.routes.js b/ui/src/app/layout/home.routes.js
index 54ab39b..4a0fb77 100644
--- a/ui/src/app/layout/home.routes.js
+++ b/ui/src/app/layout/home.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/layout/home.scss 2(+1 -1)
diff --git a/ui/src/app/layout/home.scss b/ui/src/app/layout/home.scss
index 07611bb..b1bb554 100644
--- a/ui/src/app/layout/home.scss
+++ b/ui/src/app/layout/home.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/layout/home.tpl.html 2(+1 -1)
diff --git a/ui/src/app/layout/home.tpl.html b/ui/src/app/layout/home.tpl.html
index b9d2c0a..37b8e2f 100644
--- a/ui/src/app/layout/home.tpl.html
+++ b/ui/src/app/layout/home.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/layout/index.js 4(+3 -1)
diff --git a/ui/src/app/layout/index.js b/ui/src/app/layout/index.js
index c23b008..e5ca958 100644
--- a/ui/src/app/layout/index.js
+++ b/ui/src/app/layout/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -35,6 +35,7 @@ import thingsboardUserMenu from './user-menu.directive';
import thingsboardEntity from '../entity';
import thingsboardEvent from '../event';
import thingsboardAlarm from '../alarm';
+import thingsboardAuditLog from '../audit';
import thingsboardExtension from '../extension';
import thingsboardTenant from '../tenant';
import thingsboardCustomer from '../customer';
@@ -67,6 +68,7 @@ export default angular.module('thingsboard.home', [
thingsboardEntity,
thingsboardEvent,
thingsboardAlarm,
+ thingsboardAuditLog,
thingsboardExtension,
thingsboardTenant,
thingsboardCustomer,
diff --git a/ui/src/app/layout/user-menu.directive.js b/ui/src/app/layout/user-menu.directive.js
index 53e8c45..a2b7200 100644
--- a/ui/src/app/layout/user-menu.directive.js
+++ b/ui/src/app/layout/user-menu.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './user-menu.scss';
/* eslint-disable import/no-unresolved, import/default */
ui/src/app/layout/user-menu.scss 3(+1 -2)
diff --git a/ui/src/app/layout/user-menu.scss b/ui/src/app/layout/user-menu.scss
index b90c8ee..9512bca 100644
--- a/ui/src/app/layout/user-menu.scss
+++ b/ui/src/app/layout/user-menu.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
div.tb-user-info {
line-height: 1.5;
span {
ui/src/app/layout/user-menu.tpl.html 2(+1 -1)
diff --git a/ui/src/app/layout/user-menu.tpl.html b/ui/src/app/layout/user-menu.tpl.html
index f0762d4..f466193 100644
--- a/ui/src/app/layout/user-menu.tpl.html
+++ b/ui/src/app/layout/user-menu.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/locale/locale.constant.js 54(+49 -5)
diff --git a/ui/src/app/locale/locale.constant.js b/ui/src/app/locale/locale.constant.js
index b9977f6..252884d 100644
--- a/ui/src/app/locale/locale.constant.js
+++ b/ui/src/app/locale/locale.constant.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import ThingsboardMissingTranslateHandler from './translate-handler';
export default angular.module('thingsboard.locale', [])
@@ -286,6 +285,38 @@ export default angular.module('thingsboard.locale', [])
"selected-attributes": "{ count, select, 1 {1 attribute} other {# attributes} } selected",
"selected-telemetry": "{ count, select, 1 {1 telemetry unit} other {# telemetry units} } selected"
},
+ "audit-log": {
+ "audit": "Audit",
+ "audit-logs": "Audit Logs",
+ "timestamp": "Timestamp",
+ "entity-type": "Entity Type",
+ "entity-name": "Entity Name",
+ "user": "User",
+ "type": "Type",
+ "status": "Status",
+ "details": "Details",
+ "type-added": "Added",
+ "type-deleted": "Deleted",
+ "type-updated": "Updated",
+ "type-attributes-updated": "Attributes updated",
+ "type-attributes-deleted": "Attributes deleted",
+ "type-rpc-call": "RPC call",
+ "type-credentials-updated": "Credentials updated",
+ "type-assigned-to-customer": "Assigned to Customer",
+ "type-unassigned-from-customer": "Unassigned from Customer",
+ "type-activated": "Activated",
+ "type-suspended": "Suspended",
+ "type-credentials-read": "Credentials read",
+ "type-attributes-read": "Attributes read",
+ "status-success": "Success",
+ "status-failure": "Failure",
+ "audit-log-details": "Audit log details",
+ "no-audit-logs-prompt": "No logs found",
+ "action-data": "Action data",
+ "failure-details": "Failure details",
+ "search": "Search audit logs",
+ "clear-search": "Clear search"
+ },
"confirm-on-exit": {
"message": "You have unsaved changes. Are you sure you want to leave this page?",
"html-message": "You have unsaved changes.<br/>Are you sure you want to leave this page?",
@@ -351,7 +382,10 @@ export default angular.module('thingsboard.locale', [])
"idCopiedMessage": "Customer Id has been copied to clipboard",
"select-customer": "Select customer",
"no-customers-matching": "No customers matching '{{entity}}' were found.",
- "customer-required": "Customer is required"
+ "customer-required": "Customer is required",
+ "select-default-customer": "Select default customer",
+ "default-customer": "Default customer",
+ "default-customer-required": "Default customer is required in order to debug dashboard on Tenant level"
},
"datetime": {
"date-from": "Date from",
@@ -372,6 +406,12 @@ export default angular.module('thingsboard.locale', [])
"unassign-from-customer": "Unassign from customer",
"make-public": "Make dashboard public",
"make-private": "Make dashboard private",
+ "manage-assigned-customers": "Manage assigned customers",
+ "assigned-customers": "Assigned customers",
+ "assign-to-customers": "Assign Dashboard(s) To Customers",
+ "assign-to-customers-text": "Please select the customers to assign the dashboard(s)",
+ "unassign-from-customers": "Unassign Dashboard(s) From Customers",
+ "unassign-from-customers-text": "Please select the customers to unassign from the dashboard(s)",
"no-dashboards-text": "No dashboards found",
"no-widgets": "No widgets configured",
"add-widget": "Add new widget",
@@ -386,7 +426,8 @@ export default angular.module('thingsboard.locale', [])
"add-dashboard-text": "Add new dashboard",
"assign-dashboards": "Assign dashboards",
"assign-new-dashboard": "Assign new dashboard",
- "assign-dashboards-text": "Assign { count, select, 1 {1 dashboard} other {# dashboards} } to customer",
+ "assign-dashboards-text": "Assign { count, select, 1 {1 dashboard} other {# dashboards} } to customers",
+ "unassign-dashboards-action-text": "Unassign { count, select, 1 {1 dashboard} other {# dashboards} } from customers",
"delete-dashboards": "Delete dashboards",
"unassign-dashboards": "Unassign dashboards",
"unassign-dashboards-action-title": "Unassign { count, select, 1 {1 dashboard} other {# dashboards} } from customer",
@@ -468,6 +509,7 @@ export default angular.module('thingsboard.locale', [])
"Please contact your administrator in order to resolve this issue.",
"select-devices": "Select devices",
"assignedToCustomer": "Assigned to customer",
+ "assignedToCustomers": "Assigned to customers",
"public": "Public",
"public-link": "Public link",
"copy-public-link": "Copy public link",
@@ -703,6 +745,7 @@ export default angular.module('thingsboard.locale', [])
"type-alarms": "Alarms",
"list-of-alarms": "{ count, select, 1 {One alarms} other {List of # alarms} }",
"alarm-name-starts-with": "Alarms whose names start with '{{prefix}}'",
+ "type-current-customer": "Current Customer",
"search": "Search entities",
"selected-entities": "{ count, select, 1 {1 entity} other {# entities} } selected",
"entity-name": "Entity name",
@@ -1183,7 +1226,8 @@ export default angular.module('thingsboard.locale', [])
"activation-link": "User activation link",
"activation-link-text": "In order to activate user use the following <a href='{{activationLink}}' target='_blank'>activation link</a> :",
"copy-activation-link": "Copy activation link",
- "activation-link-copied-message": "User activation link has been copied to clipboard"
+ "activation-link-copied-message": "User activation link has been copied to clipboard",
+ "details": "Details"
},
"value": {
"type": "Value type",
diff --git a/ui/src/app/locale/locale.constant-es.js b/ui/src/app/locale/locale.constant-es.js
index b9076ba..af8b5b1 100644
--- a/ui/src/app/locale/locale.constant-es.js
+++ b/ui/src/app/locale/locale.constant-es.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default function addLocaleSpanish(locales) {
var es_ES = {
"access": {
diff --git a/ui/src/app/locale/locale.constant-ko.js b/ui/src/app/locale/locale.constant-ko.js
index 0caeab8..9273037 100644
--- a/ui/src/app/locale/locale.constant-ko.js
+++ b/ui/src/app/locale/locale.constant-ko.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default function addLocaleKorean(locales) {
var ko_KR = {
"access": {
diff --git a/ui/src/app/locale/locale.constant-ru.js b/ui/src/app/locale/locale.constant-ru.js
index cded7a6..db66834 100644
--- a/ui/src/app/locale/locale.constant-ru.js
+++ b/ui/src/app/locale/locale.constant-ru.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default function addLocaleRussian(locales) {
var ru_RU = {
"access": {
diff --git a/ui/src/app/locale/locale.constant-zh.js b/ui/src/app/locale/locale.constant-zh.js
index 0684fdc..d94141c 100644
--- a/ui/src/app/locale/locale.constant-zh.js
+++ b/ui/src/app/locale/locale.constant-zh.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default function addLocaleChinese(locales) {
var zh_CN = {
"access": {
diff --git a/ui/src/app/locale/translate-handler.js b/ui/src/app/locale/translate-handler.js
index 7410062..11feb00 100644
--- a/ui/src/app/locale/translate-handler.js
+++ b/ui/src/app/locale/translate-handler.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function ThingsboardMissingTranslateHandler($log, types) {
diff --git a/ui/src/app/login/create-password.controller.js b/ui/src/app/login/create-password.controller.js
index 9d8cf42..5bf1bda 100644
--- a/ui/src/app/login/create-password.controller.js
+++ b/ui/src/app/login/create-password.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/login/create-password.tpl.html b/ui/src/app/login/create-password.tpl.html
index 96dd8e6..4d6d122 100644
--- a/ui/src/app/login/create-password.tpl.html
+++ b/ui/src/app/login/create-password.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/login/index.js 2(+1 -1)
diff --git a/ui/src/app/login/index.js b/ui/src/app/login/index.js
index 6e6ffc9..881e878 100644
--- a/ui/src/app/login/index.js
+++ b/ui/src/app/login/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/login/login.controller.js 10(+9 -1)
diff --git a/ui/src/app/login/login.controller.js b/ui/src/app/login/login.controller.js
index 3dfb2d8..3f378ac 100644
--- a/ui/src/app/login/login.controller.js
+++ b/ui/src/app/login/login.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,10 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+/* eslint-disable import/no-unresolved, import/default */
+
+import logoSvg from '../../svg/logo_title_white.svg';
+
+/* eslint-enable import/no-unresolved, import/default */
+
/*@ngInject*/
export default function LoginController(toast, loginService, userService/*, $rootScope, $log, $translate*/) {
var vm = this;
+ vm.logoSvg = logoSvg;
+
vm.user = {
name: '',
password: ''
ui/src/app/login/login.routes.js 2(+1 -1)
diff --git a/ui/src/app/login/login.routes.js b/ui/src/app/login/login.routes.js
index 8fbfde9..0c6a545 100644
--- a/ui/src/app/login/login.routes.js
+++ b/ui/src/app/login/login.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/login/login.scss 10(+9 -1)
diff --git a/ui/src/app/login/login.scss b/ui/src/app/login/login.scss
index 0dbf8ad..373a68f 100644
--- a/ui/src/app/login/login.scss
+++ b/ui/src/app/login/login.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -20,4 +20,12 @@ md-card.tb-login-card {
@media (min-width: $layout-breakpoint-sm) {
width: 450px !important;
}
+ md-card-title {
+ img.tb-login-logo {
+ height: 50px;
+ }
+ }
+ md-card-content {
+ margin-top: -50px;
+ }
}
ui/src/app/login/login.tpl.html 8(+3 -5)
diff --git a/ui/src/app/login/login.tpl.html b/ui/src/app/login/login.tpl.html
index 05f9c89..82735ef 100644
--- a/ui/src/app/login/login.tpl.html
+++ b/ui/src/app/login/login.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -18,11 +18,9 @@
<md-content layout="row" layout-align="center center" style="width: 100%;">
<md-card flex="initial" class="tb-login-card" md-theme="tb-dark">
<md-card-title>
- <md-card-title-text>
- <span translate class="md-headline">login.sign-in</span>
- </md-card-title-text>
+ <img src="{{vm.logoSvg}}" aria-label="logo" class="tb-login-logo"/>
</md-card-title>
- <md-progress-linear class="md-warn" style="z-index: 1; max-height: 5px; width: inherit; position: absolute"
+ <md-progress-linear class="md-warn" style="z-index: 1; max-height: 0px; width: inherit;"
md-mode="indeterminate" ng-disabled="!$root.loading" ng-show="$root.loading"></md-progress-linear>
<md-card-content>
<form class="login-form" ng-submit="vm.login()">
diff --git a/ui/src/app/login/reset-password.controller.js b/ui/src/app/login/reset-password.controller.js
index 08e1d0d..71a964a 100644
--- a/ui/src/app/login/reset-password.controller.js
+++ b/ui/src/app/login/reset-password.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/login/reset-password.tpl.html b/ui/src/app/login/reset-password.tpl.html
index 52788dd..51df8b2 100644
--- a/ui/src/app/login/reset-password.tpl.html
+++ b/ui/src/app/login/reset-password.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/login/reset-password-request.controller.js b/ui/src/app/login/reset-password-request.controller.js
index 353d31f..cf21dc9 100644
--- a/ui/src/app/login/reset-password-request.controller.js
+++ b/ui/src/app/login/reset-password-request.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/login/reset-password-request.tpl.html b/ui/src/app/login/reset-password-request.tpl.html
index 51afe88..fffa392 100644
--- a/ui/src/app/login/reset-password-request.tpl.html
+++ b/ui/src/app/login/reset-password-request.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/plugin/add-plugin.tpl.html b/ui/src/app/plugin/add-plugin.tpl.html
index 4060a62..b50679d 100644
--- a/ui/src/app/plugin/add-plugin.tpl.html
+++ b/ui/src/app/plugin/add-plugin.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/plugin/index.js 2(+1 -1)
diff --git a/ui/src/app/plugin/index.js b/ui/src/app/plugin/index.js
index 6173d62..716f22b 100644
--- a/ui/src/app/plugin/index.js
+++ b/ui/src/app/plugin/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/plugin/plugin.controller.js b/ui/src/app/plugin/plugin.controller.js
index c83dc38..b1e11fb 100644
--- a/ui/src/app/plugin/plugin.controller.js
+++ b/ui/src/app/plugin/plugin.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/plugin/plugin.directive.js b/ui/src/app/plugin/plugin.directive.js
index caaa7fa..0b09bc8 100644
--- a/ui/src/app/plugin/plugin.directive.js
+++ b/ui/src/app/plugin/plugin.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/plugin/plugin.routes.js 2(+1 -1)
diff --git a/ui/src/app/plugin/plugin.routes.js b/ui/src/app/plugin/plugin.routes.js
index f45680f..fd51fe6 100644
--- a/ui/src/app/plugin/plugin.routes.js
+++ b/ui/src/app/plugin/plugin.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/plugin/plugin.scss 2(+1 -1)
diff --git a/ui/src/app/plugin/plugin.scss b/ui/src/app/plugin/plugin.scss
index 525a239..2cd4a6a 100644
--- a/ui/src/app/plugin/plugin.scss
+++ b/ui/src/app/plugin/plugin.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/plugin/plugin-card.tpl.html b/ui/src/app/plugin/plugin-card.tpl.html
index 825064b..38c6dd3 100644
--- a/ui/src/app/plugin/plugin-card.tpl.html
+++ b/ui/src/app/plugin/plugin-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/plugin/plugin-fieldset.tpl.html b/ui/src/app/plugin/plugin-fieldset.tpl.html
index 987040c..85f7e1d 100644
--- a/ui/src/app/plugin/plugin-fieldset.tpl.html
+++ b/ui/src/app/plugin/plugin-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/plugin/plugins.tpl.html 9(+8 -1)
diff --git a/ui/src/app/plugin/plugins.tpl.html b/ui/src/app/plugin/plugins.tpl.html
index b3563e9..e036ae4 100644
--- a/ui/src/app/plugin/plugins.tpl.html
+++ b/ui/src/app/plugin/plugins.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -66,5 +66,12 @@
entity-type="{{vm.types.entityType.plugin}}">
</tb-relation-table>
</md-tab>
+ <md-tab ng-if="!vm.grid.detailsConfig.isDetailsEditMode && vm.isPluginEditable(vm.grid.operatingItem()) && vm.grid.isTenantAdmin()"
+ md-on-select="vm.grid.triggerResize()" label="{{ 'audit-log.audit-logs' | translate }}">
+ <tb-audit-log-table flex entity-type="vm.types.entityType.plugin"
+ entity-id="vm.grid.operatingItem().id.id"
+ audit-log-mode="{{vm.types.auditLogMode.entity}}">
+ </tb-audit-log-table>
+ </md-tab>
</md-tabs>
</tb-grid>
diff --git a/ui/src/app/profile/change-password.controller.js b/ui/src/app/profile/change-password.controller.js
index 70e0870..6118915 100644
--- a/ui/src/app/profile/change-password.controller.js
+++ b/ui/src/app/profile/change-password.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/profile/change-password.tpl.html b/ui/src/app/profile/change-password.tpl.html
index dd1c577..93cd563 100644
--- a/ui/src/app/profile/change-password.tpl.html
+++ b/ui/src/app/profile/change-password.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/profile/index.js 2(+1 -1)
diff --git a/ui/src/app/profile/index.js b/ui/src/app/profile/index.js
index 5410f91..0c4482a 100644
--- a/ui/src/app/profile/index.js
+++ b/ui/src/app/profile/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/profile/profile.controller.js b/ui/src/app/profile/profile.controller.js
index 2fec403..d17a65a 100644
--- a/ui/src/app/profile/profile.controller.js
+++ b/ui/src/app/profile/profile.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/profile/profile.routes.js 2(+1 -1)
diff --git a/ui/src/app/profile/profile.routes.js b/ui/src/app/profile/profile.routes.js
index e5a7d76..c73ddea 100644
--- a/ui/src/app/profile/profile.routes.js
+++ b/ui/src/app/profile/profile.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/profile/profile.tpl.html 2(+1 -1)
diff --git a/ui/src/app/profile/profile.tpl.html b/ui/src/app/profile/profile.tpl.html
index 3849f9b..a0358c1 100644
--- a/ui/src/app/profile/profile.tpl.html
+++ b/ui/src/app/profile/profile.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/rule/add-rule.tpl.html 2(+1 -1)
diff --git a/ui/src/app/rule/add-rule.tpl.html b/ui/src/app/rule/add-rule.tpl.html
index cfb1f62..b1fe9a0 100644
--- a/ui/src/app/rule/add-rule.tpl.html
+++ b/ui/src/app/rule/add-rule.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/rule/index.js 2(+1 -1)
diff --git a/ui/src/app/rule/index.js b/ui/src/app/rule/index.js
index 2700ec7..66e14fe 100644
--- a/ui/src/app/rule/index.js
+++ b/ui/src/app/rule/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/rule/rule.controller.js 2(+1 -1)
diff --git a/ui/src/app/rule/rule.controller.js b/ui/src/app/rule/rule.controller.js
index 9cc90cf..8ac2513 100644
--- a/ui/src/app/rule/rule.controller.js
+++ b/ui/src/app/rule/rule.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/rule/rule.directive.js 2(+1 -1)
diff --git a/ui/src/app/rule/rule.directive.js b/ui/src/app/rule/rule.directive.js
index 64502f9..adaed67 100644
--- a/ui/src/app/rule/rule.directive.js
+++ b/ui/src/app/rule/rule.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/rule/rule.routes.js 2(+1 -1)
diff --git a/ui/src/app/rule/rule.routes.js b/ui/src/app/rule/rule.routes.js
index 064428c..00a87c4 100644
--- a/ui/src/app/rule/rule.routes.js
+++ b/ui/src/app/rule/rule.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/rule/rule.scss 2(+1 -1)
diff --git a/ui/src/app/rule/rule.scss b/ui/src/app/rule/rule.scss
index a9ad5b5..f7995f4 100644
--- a/ui/src/app/rule/rule.scss
+++ b/ui/src/app/rule/rule.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/rule/rule-card.tpl.html 2(+1 -1)
diff --git a/ui/src/app/rule/rule-card.tpl.html b/ui/src/app/rule/rule-card.tpl.html
index 4cfc007..5d10d6f 100644
--- a/ui/src/app/rule/rule-card.tpl.html
+++ b/ui/src/app/rule/rule-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/rule/rule-fieldset.tpl.html b/ui/src/app/rule/rule-fieldset.tpl.html
index ca63203..c3ef1f5 100644
--- a/ui/src/app/rule/rule-fieldset.tpl.html
+++ b/ui/src/app/rule/rule-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/rule/rules.tpl.html 9(+8 -1)
diff --git a/ui/src/app/rule/rules.tpl.html b/ui/src/app/rule/rules.tpl.html
index 064728b..f8020cc 100644
--- a/ui/src/app/rule/rules.tpl.html
+++ b/ui/src/app/rule/rules.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -66,5 +66,12 @@
entity-type="{{vm.types.entityType.rule}}">
</tb-relation-table>
</md-tab>
+ <md-tab ng-if="!vm.grid.detailsConfig.isDetailsEditMode && vm.isRuleEditable(vm.grid.operatingItem()) && vm.grid.isTenantAdmin()"
+ md-on-select="vm.grid.triggerResize()" label="{{ 'audit-log.audit-logs' | translate }}">
+ <tb-audit-log-table flex entity-type="vm.types.entityType.rule"
+ entity-id="vm.grid.operatingItem().id.id"
+ audit-log-mode="{{vm.types.auditLogMode.entity}}">
+ </tb-audit-log-table>
+ </md-tab>
</md-tabs>
</tb-grid>
ui/src/app/services/clipboard.service.js 128(+128 -0)
diff --git a/ui/src/app/services/clipboard.service.js b/ui/src/app/services/clipboard.service.js
new file mode 100644
index 0000000..ad14aa9
--- /dev/null
+++ b/ui/src/app/services/clipboard.service.js
@@ -0,0 +1,128 @@
+/*
+ * Copyright © 2016-2018 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.
+ */
+export default angular.module('thingsboard.clipboard', [])
+ .factory('clipboardService', ClipboardService)
+ .name;
+
+/*@ngInject*/
+function ClipboardService($q) {
+
+ var fakeHandler, fakeHandlerCallback, fakeElem;
+
+ var service = {
+ copyToClipboard: copyToClipboard
+ };
+
+ return service;
+
+ /* eslint-disable */
+ function copyToClipboard(trigger, text) {
+ var deferred = $q.defer();
+ const isRTL = document.documentElement.getAttribute('dir') == 'rtl';
+ removeFake();
+ fakeHandlerCallback = () => removeFake();
+ fakeHandler = document.body.addEventListener('click', fakeHandlerCallback) || true;
+ fakeElem = document.createElement('textarea');
+ fakeElem.style.fontSize = '12pt';
+ fakeElem.style.border = '0';
+ fakeElem.style.padding = '0';
+ fakeElem.style.margin = '0';
+ fakeElem.style.position = 'absolute';
+ fakeElem.style[ isRTL ? 'right' : 'left' ] = '-9999px';
+ let yPosition = window.pageYOffset || document.documentElement.scrollTop;
+ fakeElem.style.top = `${yPosition}px`;
+ fakeElem.setAttribute('readonly', '');
+ fakeElem.value = text;
+ document.body.appendChild(fakeElem);
+ var selectedText = select(fakeElem);
+
+ let succeeded;
+ try {
+ succeeded = document.execCommand('copy');
+ }
+ catch (err) {
+ succeeded = false;
+ }
+ if (trigger) {
+ trigger.focus();
+ }
+ window.getSelection().removeAllRanges();
+ removeFake();
+ if (succeeded) {
+ deferred.resolve(selectedText);
+ } else {
+ deferred.reject();
+ }
+ return deferred.promise;
+ }
+
+ function removeFake() {
+ if (fakeHandler) {
+ document.body.removeEventListener('click', fakeHandlerCallback);
+ fakeHandler = null;
+ fakeHandlerCallback = null;
+ }
+ if (fakeElem) {
+ document.body.removeChild(fakeElem);
+ fakeElem = null;
+ }
+ }
+
+ function select(element) {
+ var selectedText;
+
+ if (element.nodeName === 'SELECT') {
+ element.focus();
+
+ selectedText = element.value;
+ }
+ else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
+ var isReadOnly = element.hasAttribute('readonly');
+
+ if (!isReadOnly) {
+ element.setAttribute('readonly', '');
+ }
+
+ element.select();
+ element.setSelectionRange(0, element.value.length);
+
+ if (!isReadOnly) {
+ element.removeAttribute('readonly');
+ }
+
+ selectedText = element.value;
+ }
+ else {
+ if (element.hasAttribute('contenteditable')) {
+ element.focus();
+ }
+
+ var selection = window.getSelection();
+ var range = document.createRange();
+
+ range.selectNodeContents(element);
+ selection.removeAllRanges();
+ selection.addRange(range);
+
+ selectedText = selection.toString();
+ }
+
+ return selectedText;
+ }
+
+ /* eslint-enable */
+
+}
\ No newline at end of file
diff --git a/ui/src/app/services/error-toast.tpl.html b/ui/src/app/services/error-toast.tpl.html
index b82d2de..605a014 100644
--- a/ui/src/app/services/error-toast.tpl.html
+++ b/ui/src/app/services/error-toast.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/services/info-toast.tpl.html b/ui/src/app/services/info-toast.tpl.html
index 7a1f29d..e35d3e7 100644
--- a/ui/src/app/services/info-toast.tpl.html
+++ b/ui/src/app/services/info-toast.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/services/item-buffer.service.js b/ui/src/app/services/item-buffer.service.js
index d29ad18..9fce811 100644
--- a/ui/src/app/services/item-buffer.service.js
+++ b/ui/src/app/services/item-buffer.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/services/menu.service.js 18(+17 -1)
diff --git a/ui/src/app/services/menu.service.js b/ui/src/app/services/menu.service.js
index 24db768..9dbddd9 100644
--- a/ui/src/app/services/menu.service.js
+++ b/ui/src/app/services/menu.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -211,6 +211,12 @@ function Menu(userService, $state, $rootScope) {
type: 'link',
state: 'home.dashboards',
icon: 'dashboards'
+ },
+ {
+ name: 'audit-log.audit-logs',
+ type: 'link',
+ state: 'home.auditLogs',
+ icon: 'track_changes'
}];
homeSections =
@@ -273,6 +279,16 @@ function Menu(userService, $state, $rootScope) {
state: 'home.dashboards'
}
]
+ },
+ {
+ name: 'audit-log.audit',
+ places: [
+ {
+ name: 'audit-log.audit-logs',
+ icon: 'track_changes',
+ state: 'home.auditLogs'
+ }
+ ]
}];
} else if (authority === 'CUSTOMER_USER') {
diff --git a/ui/src/app/services/success-toast.tpl.html b/ui/src/app/services/success-toast.tpl.html
index 7f3ffcd..1b58f55 100644
--- a/ui/src/app/services/success-toast.tpl.html
+++ b/ui/src/app/services/success-toast.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/services/toast.controller.js b/ui/src/app/services/toast.controller.js
index 87ddd89..77e8901 100644
--- a/ui/src/app/services/toast.controller.js
+++ b/ui/src/app/services/toast.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/services/toast.js 2(+1 -1)
diff --git a/ui/src/app/services/toast.js b/ui/src/app/services/toast.js
index 7339b78..1168dbb 100644
--- a/ui/src/app/services/toast.js
+++ b/ui/src/app/services/toast.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/services/toast.scss 3(+1 -2)
diff --git a/ui/src/app/services/toast.scss b/ui/src/app/services/toast.scss
index 5730d88..428e94e 100644
--- a/ui/src/app/services/toast.scss
+++ b/ui/src/app/services/toast.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
md-toast.tb-info-toast .md-toast-content {
font-size: 18px;
padding: 18px;
ui/src/app/services/toast.service.js 2(+1 -1)
diff --git a/ui/src/app/services/toast.service.js b/ui/src/app/services/toast.service.js
index b18abda..958d420 100644
--- a/ui/src/app/services/toast.service.js
+++ b/ui/src/app/services/toast.service.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/tenant/add-tenant.tpl.html b/ui/src/app/tenant/add-tenant.tpl.html
index d7ee48e..cf0d390 100644
--- a/ui/src/app/tenant/add-tenant.tpl.html
+++ b/ui/src/app/tenant/add-tenant.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/tenant/index.js 2(+1 -1)
diff --git a/ui/src/app/tenant/index.js b/ui/src/app/tenant/index.js
index 0e35aff..bb523f9 100644
--- a/ui/src/app/tenant/index.js
+++ b/ui/src/app/tenant/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/tenant/tenant.controller.js b/ui/src/app/tenant/tenant.controller.js
index 93fc982..c302ffd 100644
--- a/ui/src/app/tenant/tenant.controller.js
+++ b/ui/src/app/tenant/tenant.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/tenant/tenant.directive.js b/ui/src/app/tenant/tenant.directive.js
index 7876061..a6adc48 100644
--- a/ui/src/app/tenant/tenant.directive.js
+++ b/ui/src/app/tenant/tenant.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/tenant/tenant.routes.js 2(+1 -1)
diff --git a/ui/src/app/tenant/tenant.routes.js b/ui/src/app/tenant/tenant.routes.js
index 6c39532..a242e8b 100644
--- a/ui/src/app/tenant/tenant.routes.js
+++ b/ui/src/app/tenant/tenant.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/tenant/tenant-card.tpl.html b/ui/src/app/tenant/tenant-card.tpl.html
index 8c96313..12f601c 100644
--- a/ui/src/app/tenant/tenant-card.tpl.html
+++ b/ui/src/app/tenant/tenant-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/tenant/tenant-fieldset.tpl.html b/ui/src/app/tenant/tenant-fieldset.tpl.html
index 41e371b..a175a54 100644
--- a/ui/src/app/tenant/tenant-fieldset.tpl.html
+++ b/ui/src/app/tenant/tenant-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/tenant/tenants.tpl.html 3(+1 -2)
diff --git a/ui/src/app/tenant/tenants.tpl.html b/ui/src/app/tenant/tenants.tpl.html
index 94a827f..4b5142b 100644
--- a/ui/src/app/tenant/tenants.tpl.html
+++ b/ui/src/app/tenant/tenants.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<tb-grid grid-configuration="vm.tenantGridConfig">
<details-buttons tb-help="'tenants'" help-container-id="help-container">
<div id="help-container"></div>
ui/src/app/url.handler.js 3(+1 -2)
diff --git a/ui/src/app/url.handler.js b/ui/src/app/url.handler.js
index cc443ff..bf6dfb6 100644
--- a/ui/src/app/url.handler.js
+++ b/ui/src/app/url.handler.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
export default function UrlHandler($injector, $location) {
var userService = $injector.get('userService');
if (userService.isUserLoaded() === true) {
diff --git a/ui/src/app/user/activation-link.controller.js b/ui/src/app/user/activation-link.controller.js
index 9fb76c5..ac0fb79 100644
--- a/ui/src/app/user/activation-link.controller.js
+++ b/ui/src/app/user/activation-link.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/*@ngInject*/
export default function ActivationLinkDialogController($mdDialog, $translate, toast, activationLink) {
diff --git a/ui/src/app/user/activation-link.dialog.tpl.html b/ui/src/app/user/activation-link.dialog.tpl.html
index 3f55d1d..c63d74c 100644
--- a/ui/src/app/user/activation-link.dialog.tpl.html
+++ b/ui/src/app/user/activation-link.dialog.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/user/add-user.controller.js b/ui/src/app/user/add-user.controller.js
index 07d4751..20ad0be 100644
--- a/ui/src/app/user/add-user.controller.js
+++ b/ui/src/app/user/add-user.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
/* eslint-disable import/no-unresolved, import/default */
import activationLinkDialogTemplate from './activation-link.dialog.tpl.html';
ui/src/app/user/add-user.tpl.html 2(+1 -1)
diff --git a/ui/src/app/user/add-user.tpl.html b/ui/src/app/user/add-user.tpl.html
index a34f994..7e3158a 100644
--- a/ui/src/app/user/add-user.tpl.html
+++ b/ui/src/app/user/add-user.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/user/index.js 2(+1 -1)
diff --git a/ui/src/app/user/index.js b/ui/src/app/user/index.js
index ae7c13f..59b654c 100644
--- a/ui/src/app/user/index.js
+++ b/ui/src/app/user/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/user/user.controller.js 4(+3 -1)
diff --git a/ui/src/app/user/user.controller.js b/ui/src/app/user/user.controller.js
index a9f4ce3..4fd6b25 100644
--- a/ui/src/app/user/user.controller.js
+++ b/ui/src/app/user/user.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -42,6 +42,8 @@ export default function UserController(userService, toast, $scope, $mdDialog, $d
var vm = this;
+ vm.types = types;
+
vm.userGridConfig = {
deleteItemTitleFunc: deleteUserTitle,
deleteItemContentFunc: deleteUserText,
ui/src/app/user/user.directive.js 3(+1 -2)
diff --git a/ui/src/app/user/user.directive.js b/ui/src/app/user/user.directive.js
index bbb69a2..1c01c8f 100644
--- a/ui/src/app/user/user.directive.js
+++ b/ui/src/app/user/user.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './user-fieldset.scss';
/* eslint-disable import/no-unresolved, import/default */
ui/src/app/user/user.routes.js 2(+1 -1)
diff --git a/ui/src/app/user/user.routes.js b/ui/src/app/user/user.routes.js
index d336549..de6fefe 100644
--- a/ui/src/app/user/user.routes.js
+++ b/ui/src/app/user/user.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/user/user-card.tpl.html 2(+1 -1)
diff --git a/ui/src/app/user/user-card.tpl.html b/ui/src/app/user/user-card.tpl.html
index 8d91230..082e974 100644
--- a/ui/src/app/user/user-card.tpl.html
+++ b/ui/src/app/user/user-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/user/user-fieldset.scss 3(+1 -2)
diff --git a/ui/src/app/user/user-fieldset.scss b/ui/src/app/user/user-fieldset.scss
index f258892..cf21abc 100644
--- a/ui/src/app/user/user-fieldset.scss
+++ b/ui/src/app/user/user-fieldset.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import '../../scss/constants';
.tb-default-dashboard {
diff --git a/ui/src/app/user/user-fieldset.tpl.html b/ui/src/app/user/user-fieldset.tpl.html
index b804813..15b32ec 100644
--- a/ui/src/app/user/user-fieldset.tpl.html
+++ b/ui/src/app/user/user-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/user/users.tpl.html 24(+17 -7)
diff --git a/ui/src/app/user/users.tpl.html b/ui/src/app/user/users.tpl.html
index 72f67d2..b73b5a6 100644
--- a/ui/src/app/user/users.tpl.html
+++ b/ui/src/app/user/users.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -19,10 +19,20 @@
<details-buttons tb-help="'users'" help-container-id="help-container">
<div id="help-container"></div>
</details-buttons>
- <tb-user user="vm.grid.operatingItem()"
- is-edit="vm.grid.detailsConfig.isDetailsEditMode"
- the-form="vm.grid.detailsForm"
- on-display-activation-link="vm.displayActivationLink(event, vm.grid.detailsConfig.currentItem)"
- on-resend-activation="vm.resendActivation(vm.grid.detailsConfig.currentItem)"
- on-delete-user="vm.grid.deleteItem(event, vm.grid.detailsConfig.currentItem)"></tb-user>
+ <md-tabs ng-class="{'tb-headless': vm.grid.detailsConfig.isDetailsEditMode}"
+ id="tabs" md-border-bottom flex class="tb-absolute-fill">
+ <md-tab label="{{ 'user.details' | translate }}">
+ <tb-user user="vm.grid.operatingItem()"
+ is-edit="vm.grid.detailsConfig.isDetailsEditMode"
+ the-form="vm.grid.detailsForm"
+ on-display-activation-link="vm.displayActivationLink(event, vm.grid.detailsConfig.currentItem)"
+ on-resend-activation="vm.resendActivation(vm.grid.detailsConfig.currentItem)"
+ on-delete-user="vm.grid.deleteItem(event, vm.grid.detailsConfig.currentItem)"></tb-user>
+ </md-tab>
+ <md-tab ng-if="!vm.grid.detailsConfig.isDetailsEditMode && vm.grid.isTenantAdmin()" md-on-select="vm.grid.triggerResize()" label="{{ 'audit-log.audit-logs' | translate }}">
+ <tb-audit-log-table flex user-id="vm.grid.operatingItem().id.id"
+ audit-log-mode="{{vm.types.auditLogMode.user}}">
+ </tb-audit-log-table>
+ </md-tab>
+ </md-tabs>
</tb-grid>
diff --git a/ui/src/app/widget/add-widgets-bundle.tpl.html b/ui/src/app/widget/add-widgets-bundle.tpl.html
index fcd4582..d0c6682 100644
--- a/ui/src/app/widget/add-widgets-bundle.tpl.html
+++ b/ui/src/app/widget/add-widgets-bundle.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/widget/index.js 2(+1 -1)
diff --git a/ui/src/app/widget/index.js b/ui/src/app/widget/index.js
index 12c8aa0..0a8715e 100644
--- a/ui/src/app/widget/index.js
+++ b/ui/src/app/widget/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/alarms-table-widget.js b/ui/src/app/widget/lib/alarms-table-widget.js
index 00e4997..0a5bbce 100644
--- a/ui/src/app/widget/lib/alarms-table-widget.js
+++ b/ui/src/app/widget/lib/alarms-table-widget.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './alarms-table-widget.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/widget/lib/alarms-table-widget.scss b/ui/src/app/widget/lib/alarms-table-widget.scss
index 600be46..6a71ccd 100644
--- a/ui/src/app/widget/lib/alarms-table-widget.scss
+++ b/ui/src/app/widget/lib/alarms-table-widget.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-has-timewindow {
.tb-alarms-table {
md-toolbar {
diff --git a/ui/src/app/widget/lib/alarms-table-widget.tpl.html b/ui/src/app/widget/lib/alarms-table-widget.tpl.html
index 34c7c1b..1cca18b 100644
--- a/ui/src/app/widget/lib/alarms-table-widget.tpl.html
+++ b/ui/src/app/widget/lib/alarms-table-widget.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/analogue-compass.js b/ui/src/app/widget/lib/analogue-compass.js
index 85ec0a6..ecf99e2 100644
--- a/ui/src/app/widget/lib/analogue-compass.js
+++ b/ui/src/app/widget/lib/analogue-compass.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/analogue-linear-gauge.js b/ui/src/app/widget/lib/analogue-linear-gauge.js
index da4e386..e0e7c5e 100644
--- a/ui/src/app/widget/lib/analogue-linear-gauge.js
+++ b/ui/src/app/widget/lib/analogue-linear-gauge.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/analogue-radial-gauge.js b/ui/src/app/widget/lib/analogue-radial-gauge.js
index 7a5c0c7..9b909a9 100644
--- a/ui/src/app/widget/lib/analogue-radial-gauge.js
+++ b/ui/src/app/widget/lib/analogue-radial-gauge.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/canvas-digital-gauge.js b/ui/src/app/widget/lib/canvas-digital-gauge.js
index 231fb6f..8e6db04 100644
--- a/ui/src/app/widget/lib/canvas-digital-gauge.js
+++ b/ui/src/app/widget/lib/canvas-digital-gauge.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import $ from 'jquery';
import tinycolor from 'tinycolor2';
import canvasGauges from 'canvas-gauges';
diff --git a/ui/src/app/widget/lib/CanvasDigitalGauge.js b/ui/src/app/widget/lib/CanvasDigitalGauge.js
index 200430c..0166e91 100644
--- a/ui/src/app/widget/lib/CanvasDigitalGauge.js
+++ b/ui/src/app/widget/lib/CanvasDigitalGauge.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import $ from 'jquery';
import canvasGauges from 'canvas-gauges';
import tinycolor from 'tinycolor2';
diff --git a/ui/src/app/widget/lib/entities-table-widget.js b/ui/src/app/widget/lib/entities-table-widget.js
index 69cb485..1601e71 100644
--- a/ui/src/app/widget/lib/entities-table-widget.js
+++ b/ui/src/app/widget/lib/entities-table-widget.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './entities-table-widget.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/widget/lib/entities-table-widget.scss b/ui/src/app/widget/lib/entities-table-widget.scss
index 30c42cc..62a1f97 100644
--- a/ui/src/app/widget/lib/entities-table-widget.scss
+++ b/ui/src/app/widget/lib/entities-table-widget.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
.tb-has-timewindow {
.tb-entities-table {
md-toolbar {
diff --git a/ui/src/app/widget/lib/entities-table-widget.tpl.html b/ui/src/app/widget/lib/entities-table-widget.tpl.html
index 7ef8c54..97a8d69 100644
--- a/ui/src/app/widget/lib/entities-table-widget.tpl.html
+++ b/ui/src/app/widget/lib/entities-table-widget.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/extensions-table-widget.js b/ui/src/app/widget/lib/extensions-table-widget.js
index 3e5ac61..2914146 100644
--- a/ui/src/app/widget/lib/extensions-table-widget.js
+++ b/ui/src/app/widget/lib/extensions-table-widget.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './extensions-table-widget.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/widget/lib/extensions-table-widget.scss b/ui/src/app/widget/lib/extensions-table-widget.scss
index 26ab5d9..f5f228d 100644
--- a/ui/src/app/widget/lib/extensions-table-widget.scss
+++ b/ui/src/app/widget/lib/extensions-table-widget.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
tb-extension-table {
md-content {
background-color: #fff;
diff --git a/ui/src/app/widget/lib/extensions-table-widget.tpl.html b/ui/src/app/widget/lib/extensions-table-widget.tpl.html
index 0671938..23b56d0 100644
--- a/ui/src/app/widget/lib/extensions-table-widget.tpl.html
+++ b/ui/src/app/widget/lib/extensions-table-widget.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/app/widget/lib/flot-widget.js 84(+65 -19)
diff --git a/ui/src/app/widget/lib/flot-widget.js b/ui/src/app/widget/lib/flot-widget.js
index 59787cf..7ce5987 100644
--- a/ui/src/app/widget/lib/flot-widget.js
+++ b/ui/src/app/widget/lib/flot-widget.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import $ from 'jquery';
import tinycolor from 'tinycolor2';
import moment from 'moment';
@@ -238,6 +237,7 @@ export default class TbFlot {
if (this.ticksFormatterFunction) {
return this.ticksFormatterFunction(value);
}
+
var factor = this.tickDecimals ? Math.pow(10, this.tickDecimals) : 1,
formatted = "" + Math.round(value * factor) / factor;
if (this.tickDecimals != null) {
@@ -248,9 +248,12 @@ export default class TbFlot {
formatted = (precision ? formatted : formatted + ".") + ("" + factor).substr(1, this.tickDecimals - precision);
}
}
- formatted += ' ' + this.tickUnits;
+ if (this.tickUnits) {
+ formatted += ' ' + this.tickUnits;
+ }
+
return formatted;
- }
+ };
this.yaxis.tickFormatter = ctx.yAxisTickFormatter;
@@ -262,6 +265,16 @@ export default class TbFlot {
this.yaxis.labelFont.color = this.yaxis.font.color;
this.yaxis.labelFont.size = this.yaxis.font.size+2;
this.yaxis.labelFont.weight = "bold";
+ if (angular.isNumber(settings.yaxis.tickSize)) {
+ this.yaxis.tickSize = settings.yaxis.tickSize;
+ } else {
+ this.yaxis.tickSize = null;
+ }
+ if (angular.isNumber(settings.yaxis.tickDecimals)) {
+ this.yaxis.tickDecimals = settings.yaxis.tickDecimals
+ } else {
+ this.yaxis.tickDecimals = null;
+ }
if (settings.yaxis.ticksFormatter && settings.yaxis.ticksFormatter.length) {
try {
this.yaxis.ticksFormatterFunction = new Function('value', settings.yaxis.ticksFormatter);
@@ -405,9 +418,13 @@ export default class TbFlot {
}
}
series.lines = {
- fill: keySettings.fillLines === true,
- show: this.chartType === 'line' ? keySettings.showLines !== false : keySettings.showLines === true
+ fill: keySettings.fillLines === true
};
+ if (this.chartType === 'line' || this.chartType === 'state') {
+ series.lines.show = keySettings.showLines !== false
+ } else {
+ series.lines.show = keySettings.showLines === true;
+ }
if (angular.isDefined(keySettings.lineWidth)) {
series.lines.lineWidth = keySettings.lineWidth;
@@ -487,9 +504,19 @@ export default class TbFlot {
createYAxis(keySettings, units) {
var yaxis = angular.copy(this.yaxis);
+ var tickDecimals, tickSize;
var label = keySettings.axisTitle && keySettings.axisTitle.length ? keySettings.axisTitle : yaxis.label;
- var tickDecimals = angular.isDefined(keySettings.axisTickDecimals) ? keySettings.axisTickDecimals : 0;
+ if (angular.isNumber(keySettings.axisTickDecimals)) {
+ tickDecimals = keySettings.axisTickDecimals;
+ } else {
+ tickDecimals = yaxis.tickDecimals;
+ }
+ if (angular.isNumber(keySettings.axisTickSize)) {
+ tickSize = keySettings.axisTickSize;
+ } else {
+ tickSize = yaxis.tickSize;
+ }
var position = keySettings.axisPosition && keySettings.axisPosition.length ? keySettings.axisPosition : "left";
var min = angular.isDefined(keySettings.axisMin) ? keySettings.axisMin : yaxis.min;
@@ -500,6 +527,7 @@ export default class TbFlot {
yaxis.max = max;
yaxis.tickUnits = units;
yaxis.tickDecimals = tickDecimals;
+ yaxis.tickSize = tickSize;
yaxis.alignTicksWithAxis = position == "right" ? 1 : null;
yaxis.position = position;
@@ -545,7 +573,7 @@ export default class TbFlot {
}
}
yaxis.hidden = hidden;
- var newIndex = -1;
+ var newIndex = 1;
if (!yaxis.hidden) {
this.options.yaxes.push(yaxis);
newIndex = this.options.yaxes.length;
@@ -928,6 +956,16 @@ export default class TbFlot {
"title": "Ticks formatter function, f(value)",
"type": "string",
"default": ""
+ },
+ "tickDecimals": {
+ "title": "The number of decimals to display",
+ "type": "number",
+ "default": 0
+ },
+ "tickSize": {
+ "title": "Step size between ticks",
+ "type": "number",
+ "default": null
}
}
}
@@ -986,6 +1024,8 @@ export default class TbFlot {
"items": [
"yaxis.min",
"yaxis.max",
+ "yaxis.tickDecimals",
+ "yaxis.tickSize",
"yaxis.showLabels",
"yaxis.title",
"yaxis.titleAngle",
@@ -1010,24 +1050,24 @@ export default class TbFlot {
static datakeySettingsSchema(defaultShowLines) {
return {
- "schema": {
+ "schema": {
"type": "object",
- "title": "DataKeySettings",
- "properties": {
+ "title": "DataKeySettings",
+ "properties": {
"showLines": {
"title": "Show lines",
- "type": "boolean",
- "default": defaultShowLines
+ "type": "boolean",
+ "default": defaultShowLines
},
"fillLines": {
"title": "Fill lines",
- "type": "boolean",
- "default": false
+ "type": "boolean",
+ "default": false
},
"showPoints": {
"title": "Show points",
- "type": "boolean",
- "default": false
+ "type": "boolean",
+ "default": false
},
"tooltipValueFormatter": {
"title": "Tooltip value format function, f(value)",
@@ -1059,6 +1099,11 @@ export default class TbFlot {
"type": "number",
"default": 0
},
+ "axisTickSize": {
+ "title": "Axis step size between ticks",
+ "type": "number",
+ "default": null
+ },
"axisPosition": {
"title": "Axis position",
"type": "string",
@@ -1072,7 +1117,7 @@ export default class TbFlot {
},
"required": ["showLines", "fillLines", "showPoints"]
},
- "form": [
+ "form": [
"showLines",
"fillLines",
"showPoints",
@@ -1085,6 +1130,7 @@ export default class TbFlot {
"axisMax",
"axisTitle",
"axisTickDecimals",
+ "axisTickSize",
{
"key": "axisPosition",
"type": "rc-select",
@@ -1401,4 +1447,4 @@ export default class TbFlot {
}
}
-/* eslint-enable angular/angularelement */
\ No newline at end of file
+/* eslint-enable angular/angularelement */
ui/src/app/widget/lib/google-map.js 2(+1 -1)
diff --git a/ui/src/app/widget/lib/google-map.js b/ui/src/app/widget/lib/google-map.js
index af11ac3..25bf510 100644
--- a/ui/src/app/widget/lib/google-map.js
+++ b/ui/src/app/widget/lib/google-map.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/widget/lib/image-map.js 2(+1 -1)
diff --git a/ui/src/app/widget/lib/image-map.js b/ui/src/app/widget/lib/image-map.js
index c130539..18e6ed0 100644
--- a/ui/src/app/widget/lib/image-map.js
+++ b/ui/src/app/widget/lib/image-map.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/widget/lib/map-widget.js 4(+2 -2)
diff --git a/ui/src/app/widget/lib/map-widget.js b/ui/src/app/widget/lib/map-widget.js
index ef86381..0191034 100644
--- a/ui/src/app/widget/lib/map-widget.js
+++ b/ui/src/app/widget/lib/map-widget.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -276,7 +276,7 @@ export default class TbMapWidget {
this.locationsSettings[i].useMarkerImage = true;
var url = this.ctx.settings.markerImage;
var size = this.ctx.settings.markerImageSize || 34;
- this.locationSettings.currentImage = {
+ this.locationsSettings[i].currentImage = {
url: url,
size: size
};
ui/src/app/widget/lib/map-widget2.js 2(+1 -1)
diff --git a/ui/src/app/widget/lib/map-widget2.js b/ui/src/app/widget/lib/map-widget2.js
index 49a666f..00a9ea0 100644
--- a/ui/src/app/widget/lib/map-widget2.js
+++ b/ui/src/app/widget/lib/map-widget2.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/openstreet-map.js b/ui/src/app/widget/lib/openstreet-map.js
index 8aafe69..2d5f959 100644
--- a/ui/src/app/widget/lib/openstreet-map.js
+++ b/ui/src/app/widget/lib/openstreet-map.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/widget/lib/rpc/index.js 3(+1 -2)
diff --git a/ui/src/app/widget/lib/rpc/index.js b/ui/src/app/widget/lib/rpc/index.js
index d57878d..3ea654d 100644
--- a/ui/src/app/widget/lib/rpc/index.js
+++ b/ui/src/app/widget/lib/rpc/index.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import tbKnob from './knob.directive';
import tbSwitch from './switch.directive';
import tbRoundSwitch from './round-switch.directive';
diff --git a/ui/src/app/widget/lib/rpc/knob.directive.js b/ui/src/app/widget/lib/rpc/knob.directive.js
index f921854..6fda5ca 100644
--- a/ui/src/app/widget/lib/rpc/knob.directive.js
+++ b/ui/src/app/widget/lib/rpc/knob.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './knob.scss';
import CanvasDigitalGauge from './../CanvasDigitalGauge';
ui/src/app/widget/lib/rpc/knob.scss 3(+1 -2)
diff --git a/ui/src/app/widget/lib/rpc/knob.scss b/ui/src/app/widget/lib/rpc/knob.scss
index afd9077..c41db43 100644
--- a/ui/src/app/widget/lib/rpc/knob.scss
+++ b/ui/src/app/widget/lib/rpc/knob.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
$knob-img: url('./svg/knob.svg');
$bars-margin-pct: percentage(0.033);
diff --git a/ui/src/app/widget/lib/rpc/knob.tpl.html b/ui/src/app/widget/lib/rpc/knob.tpl.html
index ffd670f..ca18ec7 100644
--- a/ui/src/app/widget/lib/rpc/knob.tpl.html
+++ b/ui/src/app/widget/lib/rpc/knob.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<div class="tb-knob" layout="column" ng-style="{'pointerEvents': vm.ctx.isEdit ? 'none' : 'all'}">
<div id="knob-container" flex layout="column" layout-align="center center">
<div class="knob">
diff --git a/ui/src/app/widget/lib/rpc/led-indicator.directive.js b/ui/src/app/widget/lib/rpc/led-indicator.directive.js
index ac0658c..51ab2d3 100644
--- a/ui/src/app/widget/lib/rpc/led-indicator.directive.js
+++ b/ui/src/app/widget/lib/rpc/led-indicator.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './led-indicator.scss';
import tinycolor from 'tinycolor2';
diff --git a/ui/src/app/widget/lib/rpc/led-indicator.scss b/ui/src/app/widget/lib/rpc/led-indicator.scss
index d086a10..9b68c42 100644
--- a/ui/src/app/widget/lib/rpc/led-indicator.scss
+++ b/ui/src/app/widget/lib/rpc/led-indicator.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import "~compass-sass-mixins/lib/compass";
$error-height: 14px;
diff --git a/ui/src/app/widget/lib/rpc/led-indicator.tpl.html b/ui/src/app/widget/lib/rpc/led-indicator.tpl.html
index a092f42..383ca25 100644
--- a/ui/src/app/widget/lib/rpc/led-indicator.tpl.html
+++ b/ui/src/app/widget/lib/rpc/led-indicator.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/rpc/round-switch.directive.js b/ui/src/app/widget/lib/rpc/round-switch.directive.js
index 4f85ff2..377888a 100644
--- a/ui/src/app/widget/lib/rpc/round-switch.directive.js
+++ b/ui/src/app/widget/lib/rpc/round-switch.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './round-switch.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/widget/lib/rpc/round-switch.scss b/ui/src/app/widget/lib/rpc/round-switch.scss
index fa2399e..9396abc 100644
--- a/ui/src/app/widget/lib/rpc/round-switch.scss
+++ b/ui/src/app/widget/lib/rpc/round-switch.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
@import "~compass-sass-mixins/lib/compass";
$error-height: 14px;
diff --git a/ui/src/app/widget/lib/rpc/round-switch.tpl.html b/ui/src/app/widget/lib/rpc/round-switch.tpl.html
index ad8c1a6..129306c 100644
--- a/ui/src/app/widget/lib/rpc/round-switch.tpl.html
+++ b/ui/src/app/widget/lib/rpc/round-switch.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/lib/rpc/switch.directive.js b/ui/src/app/widget/lib/rpc/switch.directive.js
index 6256165..851f2ee 100644
--- a/ui/src/app/widget/lib/rpc/switch.directive.js
+++ b/ui/src/app/widget/lib/rpc/switch.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './switch.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/widget/lib/rpc/switch.scss b/ui/src/app/widget/lib/rpc/switch.scss
index 9d69632..dc0b8ee 100644
--- a/ui/src/app/widget/lib/rpc/switch.scss
+++ b/ui/src/app/widget/lib/rpc/switch.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
$thumb-img: url('./svg/thumb.svg');
$thumb-checked-img: url('./svg/thumb-checked.svg');
$thumb-bar-img: url('./svg/thumb-bar.svg');
diff --git a/ui/src/app/widget/lib/rpc/switch.tpl.html b/ui/src/app/widget/lib/rpc/switch.tpl.html
index 387b159..1cd7725 100644
--- a/ui/src/app/widget/lib/rpc/switch.tpl.html
+++ b/ui/src/app/widget/lib/rpc/switch.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -15,7 +15,6 @@
limitations under the License.
-->
-
<div class="tb-switch" layout="column" ng-style="{'pointerEvents': vm.ctx.isEdit ? 'none' : 'all'}">
<div class="error-container" ng-style="{'background': vm.error.length ? 'rgba(255,255,255,0.25)' : 'none'}"
layout="row" layout-align="center center">
ui/src/app/widget/lib/tencent-map.js 3(+1 -2)
diff --git a/ui/src/app/widget/lib/tencent-map.js b/ui/src/app/widget/lib/tencent-map.js
index 27a87ca..e0a9c5c 100644
--- a/ui/src/app/widget/lib/tencent-map.js
+++ b/ui/src/app/widget/lib/tencent-map.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
var tmGlobals = {
loadingTmId: null,
tmApiKeys: {}
diff --git a/ui/src/app/widget/lib/timeseries-table-widget.js b/ui/src/app/widget/lib/timeseries-table-widget.js
index 28ac811..684bbde 100644
--- a/ui/src/app/widget/lib/timeseries-table-widget.js
+++ b/ui/src/app/widget/lib/timeseries-table-widget.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import './timeseries-table-widget.scss';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/widget/lib/timeseries-table-widget.scss b/ui/src/app/widget/lib/timeseries-table-widget.scss
index da3ee81..cd8f8a9 100644
--- a/ui/src/app/widget/lib/timeseries-table-widget.scss
+++ b/ui/src/app/widget/lib/timeseries-table-widget.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
tb-timeseries-table-widget {
table.md-table thead.md-head>tr.md-row {
height: 40px;
diff --git a/ui/src/app/widget/lib/timeseries-table-widget.tpl.html b/ui/src/app/widget/lib/timeseries-table-widget.tpl.html
index 0913483..eb9b8ca 100644
--- a/ui/src/app/widget/lib/timeseries-table-widget.tpl.html
+++ b/ui/src/app/widget/lib/timeseries-table-widget.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
@@ -41,7 +41,7 @@
<md-tabs flex md-selected="vm.sourceIndex" ng-class="{'tb-headless': vm.sources.length === 1}"
id="tabs" md-border-bottom flex>
<md-tab ng-repeat="source in vm.sources" label="{{ source.datasource.name }}">
- <md-table-container class="tb-absolute-fill layout-column">
+ <md-table-container class="flex">
<table md-table>
<thead md-head md-order="source.query.order" md-on-reorder="vm.onReorder(source)">
<tr md-row>
diff --git a/ui/src/app/widget/lib/widget-utils.js b/ui/src/app/widget/lib/widget-utils.js
index 9d1c0f0..58316d1 100644
--- a/ui/src/app/widget/lib/widget-utils.js
+++ b/ui/src/app/widget/lib/widget-utils.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
const varsRegex = /\$\{([^\}]*)\}/g;
const linkActionRegex = /\<link-act name=['"]([^['"]*)['"]\>([^\<]*)\<\/link-act\>/g;
diff --git a/ui/src/app/widget/save-widget-type-as.controller.js b/ui/src/app/widget/save-widget-type-as.controller.js
index c8b6634..81e6e68 100644
--- a/ui/src/app/widget/save-widget-type-as.controller.js
+++ b/ui/src/app/widget/save-widget-type-as.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/save-widget-type-as.tpl.html b/ui/src/app/widget/save-widget-type-as.tpl.html
index 87fb0cf..d73224c 100644
--- a/ui/src/app/widget/save-widget-type-as.tpl.html
+++ b/ui/src/app/widget/save-widget-type-as.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/select-widget-type.controller.js b/ui/src/app/widget/select-widget-type.controller.js
index e4450bb..03e950e 100644
--- a/ui/src/app/widget/select-widget-type.controller.js
+++ b/ui/src/app/widget/select-widget-type.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/select-widget-type.tpl.html b/ui/src/app/widget/select-widget-type.tpl.html
index ccae912..12686ac 100644
--- a/ui/src/app/widget/select-widget-type.tpl.html
+++ b/ui/src/app/widget/select-widget-type.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widget-editor.controller.js b/ui/src/app/widget/widget-editor.controller.js
index 7eb6b98..301fc5a 100644
--- a/ui/src/app/widget/widget-editor.controller.js
+++ b/ui/src/app/widget/widget-editor.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/app/widget/widget-editor.scss 2(+1 -1)
diff --git a/ui/src/app/widget/widget-editor.scss b/ui/src/app/widget/widget-editor.scss
index afb3b56..077f68c 100644
--- a/ui/src/app/widget/widget-editor.scss
+++ b/ui/src/app/widget/widget-editor.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widget-editor.tpl.html b/ui/src/app/widget/widget-editor.tpl.html
index 9d10c05..ffa33f9 100644
--- a/ui/src/app/widget/widget-editor.tpl.html
+++ b/ui/src/app/widget/widget-editor.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widget-library.controller.js b/ui/src/app/widget/widget-library.controller.js
index 798227f..b81dce0 100644
--- a/ui/src/app/widget/widget-library.controller.js
+++ b/ui/src/app/widget/widget-library.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
import AliasController from '../api/alias-controller';
/* eslint-disable import/no-unresolved, import/default */
diff --git a/ui/src/app/widget/widget-library.routes.js b/ui/src/app/widget/widget-library.routes.js
index 7fa0a5d..1ee0381 100644
--- a/ui/src/app/widget/widget-library.routes.js
+++ b/ui/src/app/widget/widget-library.routes.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widget-library.tpl.html b/ui/src/app/widget/widget-library.tpl.html
index ad48131..ee3af4c 100644
--- a/ui/src/app/widget/widget-library.tpl.html
+++ b/ui/src/app/widget/widget-library.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widgets-bundle.controller.js b/ui/src/app/widget/widgets-bundle.controller.js
index 5cab916..3518b30 100644
--- a/ui/src/app/widget/widgets-bundle.controller.js
+++ b/ui/src/app/widget/widgets-bundle.controller.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widgets-bundle.directive.js b/ui/src/app/widget/widgets-bundle.directive.js
index 6b730d6..ba54448 100644
--- a/ui/src/app/widget/widgets-bundle.directive.js
+++ b/ui/src/app/widget/widgets-bundle.directive.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widgets-bundle-card.tpl.html b/ui/src/app/widget/widgets-bundle-card.tpl.html
index c94c404..4cf3812 100644
--- a/ui/src/app/widget/widgets-bundle-card.tpl.html
+++ b/ui/src/app/widget/widgets-bundle-card.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widgets-bundle-fieldset.tpl.html b/ui/src/app/widget/widgets-bundle-fieldset.tpl.html
index e4d8ea1..b3bc0b6 100644
--- a/ui/src/app/widget/widgets-bundle-fieldset.tpl.html
+++ b/ui/src/app/widget/widgets-bundle-fieldset.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
diff --git a/ui/src/app/widget/widgets-bundles.tpl.html b/ui/src/app/widget/widgets-bundles.tpl.html
index 808c4da..93fed5e 100644
--- a/ui/src/app/widget/widgets-bundles.tpl.html
+++ b/ui/src/app/widget/widgets-bundles.tpl.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/index.html 2(+1 -1)
diff --git a/ui/src/index.html b/ui/src/index.html
index 33702cc..ca05a4a 100644
--- a/ui/src/index.html
+++ b/ui/src/index.html
@@ -1,6 +1,6 @@
<!--
- Copyright © 2016-2017 The Thingsboard Authors
+ Copyright © 2016-2018 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.
ui/src/scss/animations.scss 2(+1 -1)
diff --git a/ui/src/scss/animations.scss b/ui/src/scss/animations.scss
index ab27252..719b6f9 100644
--- a/ui/src/scss/animations.scss
+++ b/ui/src/scss/animations.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/scss/constants.scss 2(+1 -1)
diff --git a/ui/src/scss/constants.scss b/ui/src/scss/constants.scss
index 0b31c43..5b6eab4 100644
--- a/ui/src/scss/constants.scss
+++ b/ui/src/scss/constants.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/scss/fonts.scss 2(+1 -1)
diff --git a/ui/src/scss/fonts.scss b/ui/src/scss/fonts.scss
index 9420a60..95089eb 100644
--- a/ui/src/scss/fonts.scss
+++ b/ui/src/scss/fonts.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/scss/main.scss 15(+14 -1)
diff --git a/ui/src/scss/main.scss b/ui/src/scss/main.scss
index 93418b2..93ff320 100644
--- a/ui/src/scss/main.scss
+++ b/ui/src/scss/main.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
@@ -203,6 +203,19 @@ md-sidenav {
* THINGSBOARD SPECIFIC
***********************/
+label {
+ &.tb-title {
+ pointer-events: none;
+ color: #666;
+ font-size: 13px;
+ font-weight: 400;
+ padding-bottom: 15px;
+ &.no-padding {
+ padding-bottom: 0px;
+ }
+ }
+}
+
.tb-noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
ui/src/scss/mixins.scss 2(+1 -1)
diff --git a/ui/src/scss/mixins.scss b/ui/src/scss/mixins.scss
index 9a24ecd..9e8b7df 100644
--- a/ui/src/scss/mixins.scss
+++ b/ui/src/scss/mixins.scss
@@ -1,5 +1,5 @@
/**
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/src/vendor/css.js/css.js 3(+2 -1)
diff --git a/ui/src/vendor/css.js/css.js b/ui/src/vendor/css.js/css.js
index 8c4160a..d8ee716 100644
--- a/ui/src/vendor/css.js/css.js
+++ b/ui/src/vendor/css.js/css.js
@@ -147,7 +147,8 @@ fi.prototype.parseRules = function (rules) {
rules = rules.split('\r\n').join('\n');
var ret = [];
- rules = rules.split(';');
+ // Split all rules but keep semicolon for base64 url data
+ rules = rules.split(/;(?![^\(]*\))/);
//proccess rules line by line
for (var i = 0; i < rules.length; i++) {
ui/webpack.config.dev.js 2(+1 -1)
diff --git a/ui/webpack.config.dev.js b/ui/webpack.config.dev.js
index 3af7d00..b1a1911 100644
--- a/ui/webpack.config.dev.js
+++ b/ui/webpack.config.dev.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/webpack.config.js 2(+1 -1)
diff --git a/ui/webpack.config.js b/ui/webpack.config.js
index d0f5731..bc12425 100644
--- a/ui/webpack.config.js
+++ b/ui/webpack.config.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.
ui/webpack.config.prod.js 2(+1 -1)
diff --git a/ui/webpack.config.prod.js b/ui/webpack.config.prod.js
index 987eec2..150638d 100644
--- a/ui/webpack.config.prod.js
+++ b/ui/webpack.config.prod.js
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 The Thingsboard Authors
+ * Copyright © 2016-2018 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.