1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package io.netty.handler.codec.mqtt;
18
19 import io.netty.buffer.ByteBuf;
20 import io.netty.buffer.ByteBufHolder;
21
22
23
24
25 public class MqttPublishMessage extends MqttMessage implements ByteBufHolder {
26
27 public MqttPublishMessage(
28 MqttFixedHeader mqttFixedHeader,
29 MqttPublishVariableHeader variableHeader,
30 ByteBuf payload) {
31 super(mqttFixedHeader, variableHeader, payload);
32 }
33
34 @Override
35 public MqttPublishVariableHeader variableHeader() {
36 return (MqttPublishVariableHeader) super.variableHeader();
37 }
38
39 @Override
40 public ByteBuf payload() {
41 return content();
42 }
43
44 @Override
45 public ByteBuf content() {
46 return (ByteBuf) super.payload();
47 }
48
49 @Override
50 public MqttPublishMessage copy() {
51 return replace(content().copy());
52 }
53
54 @Override
55 public MqttPublishMessage duplicate() {
56 return replace(content().duplicate());
57 }
58
59 @Override
60 public MqttPublishMessage retainedDuplicate() {
61 return replace(content().retainedDuplicate());
62 }
63
64 @Override
65 public MqttPublishMessage replace(ByteBuf content) {
66 return new MqttPublishMessage(fixedHeader(), variableHeader(), content);
67 }
68
69 @Override
70 public int refCnt() {
71 return content().refCnt();
72 }
73
74 @Override
75 public MqttPublishMessage retain() {
76 content().retain();
77 return this;
78 }
79
80 @Override
81 public MqttPublishMessage retain(int increment) {
82 content().retain(increment);
83 return this;
84 }
85
86 @Override
87 public MqttPublishMessage touch() {
88 content().touch();
89 return this;
90 }
91
92 @Override
93 public MqttPublishMessage touch(Object hint) {
94 content().touch(hint);
95 return this;
96 }
97
98 @Override
99 public boolean release() {
100 return content().release();
101 }
102
103 @Override
104 public boolean release(int decrement) {
105 return content().release(decrement);
106 }
107
108 }