Browse Source
Make component annotations inheritable
pull/13739/head
Dmytro Skarzhynets
11 months ago
No known key found for this signature in database
GPG Key ID: 2B51652F224037DF
13 changed files with
39 additions and
26 deletions
-
common/coap-server/src/main/java/org/thingsboard/server/coapserver/TbCoapServerComponent.java
-
common/coap-server/src/main/java/org/thingsboard/server/coapserver/TbCoapTransportComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/edqs/EdqsComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/edqs/InMemoryEdqsComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/edqs/KafkaEdqsComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/util/TbCoreComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/util/TbLwM2mBootstrapTransportComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/util/TbLwM2mTransportComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/util/TbRuleEngineComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/util/TbSnmpTransportComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/util/TbTransportComponent.java
-
common/queue/src/main/java/org/thingsboard/server/queue/util/TbVersionControlComponent.java
-
common/transport/mqtt/src/main/java/org/thingsboard/server/transport/mqtt/TbMqttTransportComponent.java
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.coapserver; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${coap.server.enabled}'=='true')") |
|
|
|
public @interface TbCoapServerComponent { |
|
|
|
} |
|
|
|
public @interface TbCoapServerComponent {} |
|
|
|
|
|
|
|
@ -17,11 +17,12 @@ package org.thingsboard.server.coapserver; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || " + |
|
|
|
"('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${coap.server.enabled}'=='true' && '${transport.coap.enabled}'=='true')") |
|
|
|
public @interface TbCoapTransportComponent { |
|
|
|
} |
|
|
|
public @interface TbCoapTransportComponent {} |
|
|
|
|
|
|
|
@ -17,12 +17,13 @@ package org.thingsboard.server.queue.edqs; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${queue.edqs.sync.enabled:true}'=='true' && ('${service.type:null}'=='edqs' || " + |
|
|
|
"(('${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core') && " + |
|
|
|
"'${queue.edqs.mode:null}'=='local'))") |
|
|
|
public @interface EdqsComponent { |
|
|
|
} |
|
|
|
public @interface EdqsComponent {} |
|
|
|
|
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.queue.edqs; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${queue.edqs.sync.enabled:true}'=='true' && '${service.type:null}'=='monolith' && '${queue.edqs.mode:null}'=='local' && '${queue.type:null}'=='in-memory'") |
|
|
|
public @interface InMemoryEdqsComponent { |
|
|
|
} |
|
|
|
public @interface InMemoryEdqsComponent {} |
|
|
|
|
|
|
|
@ -17,12 +17,13 @@ package org.thingsboard.server.queue.edqs; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${queue.edqs.sync.enabled:true}'=='true' && ('${service.type:null}'=='edqs' || " + |
|
|
|
"(('${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core') && " + |
|
|
|
"'${queue.edqs.mode:null}'=='local' && '${queue.type:null}'=='kafka'))") |
|
|
|
public @interface KafkaEdqsComponent { |
|
|
|
} |
|
|
|
public @interface KafkaEdqsComponent {} |
|
|
|
|
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.queue.util; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='monolith' || '${service.type:null}'=='tb-core'") |
|
|
|
public @interface TbCoreComponent { |
|
|
|
} |
|
|
|
public @interface TbCoreComponent {} |
|
|
|
|
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.queue.util; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("('${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.lwm2m.enabled}'=='true')) && '${transport.lwm2m.bootstrap.enabled:false}'=='true'") |
|
|
|
public @interface TbLwM2mBootstrapTransportComponent { |
|
|
|
} |
|
|
|
public @interface TbLwM2mBootstrapTransportComponent {} |
|
|
|
|
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.queue.util; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.lwm2m.enabled}'=='true')") |
|
|
|
public @interface TbLwM2mTransportComponent { |
|
|
|
} |
|
|
|
public @interface TbLwM2mTransportComponent {} |
|
|
|
|
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.queue.util; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='monolith' || '${service.type:null}'=='tb-rule-engine'") |
|
|
|
public @interface TbRuleEngineComponent { |
|
|
|
} |
|
|
|
public @interface TbRuleEngineComponent {} |
|
|
|
|
|
|
|
@ -18,12 +18,13 @@ package org.thingsboard.server.queue.util; |
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.ElementType; |
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
import java.lang.annotation.Target; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.snmp.enabled}'=='true')") |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@Target({ElementType.TYPE, ElementType.METHOD}) |
|
|
|
public @interface TbSnmpTransportComponent { |
|
|
|
} |
|
|
|
public @interface TbSnmpTransportComponent {} |
|
|
|
|
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.queue.util; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true') || '${service.type:null}'=='tb-transport'") |
|
|
|
public @interface TbTransportComponent { |
|
|
|
} |
|
|
|
public @interface TbTransportComponent {} |
|
|
|
|
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.queue.util; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='monolith' || '${service.type:null}'=='tb-vc-executor'") |
|
|
|
public @interface TbVersionControlComponent { |
|
|
|
} |
|
|
|
public @interface TbVersionControlComponent {} |
|
|
|
|
|
|
|
@ -17,10 +17,11 @@ package org.thingsboard.server.transport.mqtt; |
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; |
|
|
|
|
|
|
|
import java.lang.annotation.Inherited; |
|
|
|
import java.lang.annotation.Retention; |
|
|
|
import java.lang.annotation.RetentionPolicy; |
|
|
|
|
|
|
|
@Inherited |
|
|
|
@Retention(RetentionPolicy.RUNTIME) |
|
|
|
@ConditionalOnExpression("'${service.type:null}'=='tb-transport' || ('${service.type:null}'=='monolith' && '${transport.api_enabled:true}'=='true' && '${transport.mqtt.enabled}'=='true')") |
|
|
|
public @interface TbMqttTransportComponent { |
|
|
|
} |
|
|
|
public @interface TbMqttTransportComponent {} |
|
|
|
|