1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.codec.memcache.binary;
17
18 import io.netty.buffer.ByteBuf;
19 import io.netty.util.internal.UnstableApi;
20
21
22
23
24 @UnstableApi
25 public class DefaultBinaryMemcacheResponse extends AbstractBinaryMemcacheMessage implements BinaryMemcacheResponse {
26
27
28
29
30 public static final byte RESPONSE_MAGIC_BYTE = (byte) 0x81;
31
32 private short status;
33
34
35
36
37 public DefaultBinaryMemcacheResponse() {
38 this(null, null);
39 }
40
41
42
43
44
45
46 public DefaultBinaryMemcacheResponse(ByteBuf key) {
47 this(key, null);
48 }
49
50
51
52
53
54
55
56 public DefaultBinaryMemcacheResponse(ByteBuf key, ByteBuf extras) {
57 super(key, extras);
58 setMagic(RESPONSE_MAGIC_BYTE);
59 }
60
61 @Override
62 public short status() {
63 return status;
64 }
65
66 @Override
67 public BinaryMemcacheResponse setStatus(short status) {
68 this.status = status;
69 return this;
70 }
71
72 @Override
73 public BinaryMemcacheResponse retain() {
74 super.retain();
75 return this;
76 }
77
78 @Override
79 public BinaryMemcacheResponse retain(int increment) {
80 super.retain(increment);
81 return this;
82 }
83
84 @Override
85 public BinaryMemcacheResponse touch() {
86 super.touch();
87 return this;
88 }
89
90 @Override
91 public BinaryMemcacheResponse touch(Object hint) {
92 super.touch(hint);
93 return this;
94 }
95
96
97
98
99
100
101 void copyMeta(DefaultBinaryMemcacheResponse dst) {
102 super.copyMeta(dst);
103 dst.status = status;
104 }
105 }