1 //========================================================================
2 //Copyright 2011-2012 Mort Bay Consulting Pty. Ltd.
3 //------------------------------------------------------------------------
4 //All rights reserved. This program and the accompanying materials
5 //are made available under the terms of the Eclipse Public License v1.0
6 //and Apache License v2.0 which accompanies this distribution.
7 //The Eclipse Public License is available at
8 //http://www.eclipse.org/legal/epl-v10.html
9 //The Apache License v2.0 is available at
10 //http://www.opensource.org/licenses/apache2.0.php
11 //You may elect to redistribute this code under either of these licenses.
12 //========================================================================
13
14 package org.eclipse.jetty.spdy.api;
15
16 /**
17 * <p>A container for RST_STREAM frames data: the stream id and the stream status.</p>
18 */
19 public class RstInfo
20 {
21 private final int streamId;
22 private final StreamStatus streamStatus;
23
24 /**
25 * <p>Creates a new {@link RstInfo} with the given stream id and stream status</p>
26 *
27 * @param streamId the stream id
28 * @param streamStatus the stream status
29 */
30 public RstInfo(int streamId, StreamStatus streamStatus)
31 {
32 this.streamId = streamId;
33 this.streamStatus = streamStatus;
34 }
35
36 /**
37 * @return the stream id
38 */
39 public int getStreamId()
40 {
41 return streamId;
42 }
43
44 /**
45 * @return the stream status
46 */
47 public StreamStatus getStreamStatus()
48 {
49 return streamStatus;
50 }
51
52 @Override
53 public String toString()
54 {
55 return String.format("RST stream=%d %s", streamId, streamStatus);
56 }
57 }