1- package javasabr .mqtt .legacy .model .topic ;
2-
3- import static javasabr .mqtt .legacy .util .TopicUtils .MULTI_LEVEL_WILDCARD ;
4- import static javasabr .mqtt .legacy .util .TopicUtils .SINGLE_LEVEL_WILDCARD ;
5- import static javasabr .mqtt .legacy .util .TopicUtils .isShared ;
6-
7- import javasabr .mqtt .legacy .model .QoS ;
8- import javasabr .mqtt .legacy .model .SharedSubscriber ;
9- import javasabr .mqtt .legacy .model .SingleSubscriber ;
10- import javasabr .mqtt .legacy .model .SubscribeTopicFilter ;
11- import javasabr .mqtt .legacy .model .Subscriber ;
12- import javasabr .mqtt .legacy .network .client .MqttClient ;
13- import javasabr .mqtt .legacy .util .SubscriberUtils ;
1+ package javasabr .mqtt .model .topic ;
2+
3+ import javasabr .mqtt .model .QoS ;
144import java .util .Objects ;
155import java .util .function .Supplier ;
6+ import javasabr .mqtt .model .network .MqttClient ;
7+ import javasabr .mqtt .model .subscriber .SharedSubscriber ;
8+ import javasabr .mqtt .model .subscriber .SingleSubscriber ;
9+ import javasabr .mqtt .model .subscriber .SubscribeTopicFilter ;
10+ import javasabr .mqtt .model .subscriber .Subscriber ;
11+ import javasabr .mqtt .model .utils .SubscriberUtils ;
12+ import javasabr .mqtt .model .utils .TopicUtils ;
1613import javasabr .rlib .collections .array .Array ;
1714import javasabr .rlib .collections .array .ArrayFactory ;
1815import javasabr .rlib .collections .array .LockableArray ;
@@ -33,7 +30,7 @@ private static void addSubscriber(
3330 LockableArray <Subscriber > subscribers ,
3431 MqttClient client ,
3532 SubscribeTopicFilter subscribe ) {
36- if (isShared (subscribe .getTopicFilter ())) {
33+ if (TopicUtils . isShared (subscribe .getTopicFilter ())) {
3734 addSharedSubscriber (subscribers , client , subscribe );
3835 } else {
3936 addSingleSubscriber (subscribers , client , subscribe );
@@ -67,7 +64,7 @@ private static void addSharedSubscriber(
6764 }
6865
6966 private static boolean removeSubscriber (LockableArray <Subscriber > subscribers , TopicFilter topic , MqttClient client ) {
70- return isShared (topic )
67+ return TopicUtils . isShared (topic )
7168 ? removeSharedSubscriber (subscribers , ((SharedTopicFilter ) topic ).getGroup (), client )
7269 : removeSingleSubscriber (subscribers , client );
7370 }
@@ -239,8 +236,8 @@ public Array<SingleSubscriber> matches(TopicName topicName) {
239236 private void processLevel (int level , String segment , TopicName topicName , MutableArray <SingleSubscriber > result ) {
240237 var nextLevel = level + 1 ;
241238 processSegment (nextLevel , segment , topicName , result );
242- processSegment (nextLevel , SINGLE_LEVEL_WILDCARD , topicName , result );
243- processSegment (nextLevel , MULTI_LEVEL_WILDCARD , topicName , result );
239+ processSegment (nextLevel , TopicUtils . SINGLE_LEVEL_WILDCARD , topicName , result );
240+ processSegment (nextLevel , TopicUtils . MULTI_LEVEL_WILDCARD , topicName , result );
244241 }
245242
246243 private void processSegment (
0 commit comments