File tree Expand file tree Collapse file tree 4 files changed +23
-38
lines changed
src/main/java/com/ss/mqtt/broker/handler/packet/in Expand file tree Collapse file tree 4 files changed +23
-38
lines changed Original file line number Diff line number Diff line change 1+ package com .ss .mqtt .broker .handler .packet .in ;
2+
3+ import com .ss .mqtt .broker .network .client .MqttClient .UnsafeMqttClient ;
4+ import com .ss .mqtt .broker .network .packet .HasPacketId ;
5+ import com .ss .mqtt .broker .network .packet .in .MqttReadablePacket ;
6+ import lombok .RequiredArgsConstructor ;
7+ import org .jetbrains .annotations .NotNull ;
8+
9+ @ RequiredArgsConstructor
10+ public class PendingOutResponseInPacketHandler <R extends MqttReadablePacket & HasPacketId > extends
11+ AbstractPacketHandler <UnsafeMqttClient , R > {
12+
13+ @ Override
14+ protected void handleImpl (@ NotNull UnsafeMqttClient client , @ NotNull R packet ) {
15+ var session = client .getSession ();
16+ if (session != null ) {
17+ session .updateOutPendingPacket (client , packet );
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 11package com .ss .mqtt .broker .handler .packet .in ;
22
3- import com .ss .mqtt .broker .network .client .MqttClient .UnsafeMqttClient ;
43import com .ss .mqtt .broker .network .packet .in .PublishAckInPacket ;
54import lombok .RequiredArgsConstructor ;
6- import org .jetbrains .annotations .NotNull ;
75
86@ RequiredArgsConstructor
9- public class PublishAckInPacketHandler extends AbstractPacketHandler <UnsafeMqttClient , PublishAckInPacket > {
10-
11- @ Override
12- protected void handleImpl (@ NotNull UnsafeMqttClient client , @ NotNull PublishAckInPacket packet ) {
13- var session = client .getSession ();
14- if (session != null ) {
15- session .updateOutPendingPacket (client , packet );
16- }
17- }
18- }
7+ public class PublishAckInPacketHandler extends PendingOutResponseInPacketHandler <PublishAckInPacket > {}
Original file line number Diff line number Diff line change 11package com .ss .mqtt .broker .handler .packet .in ;
22
3- import com .ss .mqtt .broker .network .client .MqttClient .UnsafeMqttClient ;
4- import com .ss .mqtt .broker .network .packet .in .PublishAckInPacket ;
53import com .ss .mqtt .broker .network .packet .in .PublishCompleteInPacket ;
64import lombok .RequiredArgsConstructor ;
7- import org .jetbrains .annotations .NotNull ;
85
96@ RequiredArgsConstructor
10- public class PublishCompleteInPacketHandler extends AbstractPacketHandler <UnsafeMqttClient , PublishCompleteInPacket > {
11-
12- @ Override
13- protected void handleImpl (@ NotNull UnsafeMqttClient client , @ NotNull PublishCompleteInPacket packet ) {
14- var session = client .getSession ();
15- if (session != null ) {
16- session .updateOutPendingPacket (client , packet );
17- }
18- }
19- }
7+ public class PublishCompleteInPacketHandler extends PendingOutResponseInPacketHandler <PublishCompleteInPacket > {}
Original file line number Diff line number Diff line change 11package com .ss .mqtt .broker .handler .packet .in ;
22
3- import com .ss .mqtt .broker .network .client .MqttClient .UnsafeMqttClient ;
4- import com .ss .mqtt .broker .network .packet .in .PublishAckInPacket ;
53import com .ss .mqtt .broker .network .packet .in .PublishReceivedInPacket ;
64import lombok .RequiredArgsConstructor ;
7- import org .jetbrains .annotations .NotNull ;
85
96@ RequiredArgsConstructor
10- public class PublishReceiveInPacketHandler extends AbstractPacketHandler <UnsafeMqttClient , PublishReceivedInPacket > {
11-
12- @ Override
13- protected void handleImpl (@ NotNull UnsafeMqttClient client , @ NotNull PublishReceivedInPacket packet ) {
14- var session = client .getSession ();
15- if (session != null ) {
16- session .updateOutPendingPacket (client , packet );
17- }
18- }
19- }
7+ public class PublishReceiveInPacketHandler extends PendingOutResponseInPacketHandler <PublishReceivedInPacket > {}
You can’t perform that action at this time.
0 commit comments