1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.mina.protocol.codec;
20
21 import org.apache.mina.common.ByteBuffer;
22 import org.apache.mina.protocol.ProtocolDecoderOutput;
23 import org.apache.mina.protocol.ProtocolSession;
24
25 /***
26 * Represents results from {@link MessageDecoder}.
27 *
28 * @author The Apache Directory Project (dev@directory.apache.org)
29 * @author Trustin Lee (trustin@apache.org)
30 * @version $Rev: 210062 $, $Date: 2005-07-11 12:52:38 +0900 $
31 *
32 * @see MessageDecoder
33 */
34 public class MessageDecoderResult
35 {
36 /***
37 * Represents a result from {@link MessageDecoder#decodable(ProtocolSession, ByteBuffer)}
38 * and {@link MessageDecoder#decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)}.
39 * Please refer to each method's documentation for detailed explanation.
40 */
41 public static MessageDecoderResult OK = new MessageDecoderResult( "OK" );
42
43 /***
44 * Represents a result from {@link MessageDecoder#decodable(ProtocolSession, ByteBuffer)}
45 * and {@link MessageDecoder#decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)}.
46 * Please refer to each method's documentation for detailed explanation.
47 */
48 public static MessageDecoderResult NEED_DATA = new MessageDecoderResult( "NEED_DATA" );
49
50 /***
51 * Represents a result from {@link MessageDecoder#decodable(ProtocolSession, ByteBuffer)}
52 * and {@link MessageDecoder#decode(ProtocolSession, ByteBuffer, ProtocolDecoderOutput)}.
53 * Please refer to each method's documentation for detailed explanation.
54 */
55 public static MessageDecoderResult NOT_OK = new MessageDecoderResult( "NOT_OK" );
56
57 private final String name;
58
59 private MessageDecoderResult( String name )
60 {
61 this.name = name;
62 }
63
64 public String toString()
65 {
66 return name;
67 }
68 }