1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.spdy.frames;
20
21 import java.util.HashMap;
22 import java.util.Map;
23
24 public enum ControlFrameType
25 {
26 SYN_STREAM((short)1),
27 SYN_REPLY((short)2),
28 RST_STREAM((short)3),
29 SETTINGS((short)4),
30 NOOP((short)5),
31 PING((short)6),
32 GO_AWAY((short)7),
33 HEADERS((short)8),
34 WINDOW_UPDATE((short)9),
35 CREDENTIAL((short)10);
36
37 public static ControlFrameType from(short code)
38 {
39 return Codes.codes.get(code);
40 }
41
42 private final short code;
43
44 private ControlFrameType(short code)
45 {
46 this.code = code;
47 Codes.codes.put(code, this);
48 }
49
50 public short getCode()
51 {
52 return code;
53 }
54
55 private static class Codes
56 {
57 private static final Map<Short, ControlFrameType> codes = new HashMap<>();
58 }
59 }