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 DefaultBinaryMemcacheRequest extends AbstractBinaryMemcacheMessage implements BinaryMemcacheRequest {
26
27
28
29
30 public static final byte REQUEST_MAGIC_BYTE = (byte) 0x80;
31
32 private short reserved;
33
34
35
36
37 public DefaultBinaryMemcacheRequest() {
38 this(null, null);
39 }
40
41
42
43
44
45
46 public DefaultBinaryMemcacheRequest(ByteBuf key) {
47 this(key, null);
48 }
49
50
51
52
53
54
55
56 public DefaultBinaryMemcacheRequest(ByteBuf key, ByteBuf extras) {
57 super(key, extras);
58 setMagic(REQUEST_MAGIC_BYTE);
59 }
60
61 @Override
62 public short reserved() {
63 return reserved;
64 }
65
66 @Override
67 public BinaryMemcacheRequest setReserved(short reserved) {
68 this.reserved = reserved;
69 return this;
70 }
71
72 @Override
73 public BinaryMemcacheRequest retain() {
74 super.retain();
75 return this;
76 }
77
78 @Override
79 public BinaryMemcacheRequest retain(int increment) {
80 super.retain(increment);
81 return this;
82 }
83
84 @Override
85 public BinaryMemcacheRequest touch() {
86 super.touch();
87 return this;
88 }
89
90 @Override
91 public BinaryMemcacheRequest touch(Object hint) {
92 super.touch(hint);
93 return this;
94 }
95
96
97
98
99
100
101 void copyMeta(DefaultBinaryMemcacheRequest dst) {
102 super.copyMeta(dst);
103 dst.reserved = reserved;
104 }
105 }