1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.eclipse.jetty.http2.frames;
20
21 public class PriorityFrame extends Frame
22 {
23 public static final int PRIORITY_LENGTH = 5;
24
25 private final int streamId;
26 private final int parentStreamId;
27 private final int weight;
28 private final boolean exclusive;
29
30 public PriorityFrame(int parentStreamId, int weight, boolean exclusive)
31 {
32 this(0, parentStreamId, weight, exclusive);
33 }
34
35 public PriorityFrame(int streamId, int parentStreamId, int weight, boolean exclusive)
36 {
37 super(FrameType.PRIORITY);
38 this.streamId = streamId;
39 this.parentStreamId = parentStreamId;
40 this.weight = weight;
41 this.exclusive = exclusive;
42 }
43
44 public int getStreamId()
45 {
46 return streamId;
47 }
48
49
50
51
52 @Deprecated
53 public int getDependentStreamId()
54 {
55 return getParentStreamId();
56 }
57
58 public int getParentStreamId()
59 {
60 return parentStreamId;
61 }
62
63 public int getWeight()
64 {
65 return weight;
66 }
67
68 public boolean isExclusive()
69 {
70 return exclusive;
71 }
72
73 @Override
74 public String toString()
75 {
76 return String.format("%s#%d/#%d{weight=%d,exclusive=%b}", super.toString(), streamId, parentStreamId, weight, exclusive);
77 }
78 }