View Javadoc

1   package org.eclipse.jetty.spdy;
2   
3   import org.eclipse.jetty.spdy.api.SynInfo;
4   
5   /* ------------------------------------------------------------ */
6   /**
7    * <p>A subclass container of {@link SynInfo} for unidirectional streams</p>
8    */
9   public class PushSynInfo extends SynInfo
10  {
11      public static final byte FLAG_UNIDIRECTIONAL = 2;
12      
13      private int associatedStreamId;
14      
15      public PushSynInfo(int associatedStreamId, SynInfo synInfo){
16          super(synInfo.getHeaders(), synInfo.isClose(), synInfo.getPriority());
17          this.associatedStreamId = associatedStreamId;
18      }
19      
20      /**
21       * @return the close and unidirectional flags as integer
22       * @see #FLAG_CLOSE
23       * @see #FLAG_UNIDIRECTIONAL
24       */
25      @Override
26      public byte getFlags()
27      {
28          byte flags = super.getFlags();
29          flags += FLAG_UNIDIRECTIONAL;
30          return flags;
31      }
32      
33      /**
34       * @return the id of the associated stream
35       */
36      public int getAssociatedStreamId()
37      {
38          return associatedStreamId;
39      }
40  
41  }