1 /* 2 * Copyright 2014 The Netty Project 3 * 4 * The Netty Project licenses this file to you under the Apache License, 5 * version 2.0 (the "License"); you may not use this file except in compliance 6 * with the License. You may obtain a copy of the License at: 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 13 * License for the specific language governing permissions and limitations 14 * under the License. 15 */ 16 package io.netty.handler.codec.spdy; 17 18 import io.netty.buffer.ByteBuf; 19 20 /** 21 * Callback interface for {@link SpdyFrameDecoder}. 22 */ 23 public interface SpdyFrameDecoderDelegate { 24 25 /** 26 * Called when a DATA frame is received. 27 */ 28 void readDataFrame(int streamId, boolean last, ByteBuf data); 29 30 /** 31 * Called when a SYN_STREAM frame is received. 32 * The Name/Value Header Block is not included. See readHeaderBlock(). 33 */ 34 void readSynStreamFrame( 35 int streamId, int associatedToStreamId, byte priority, boolean last, boolean unidirectional); 36 37 /** 38 * Called when a SYN_REPLY frame is received. 39 * The Name/Value Header Block is not included. See readHeaderBlock(). 40 */ 41 void readSynReplyFrame(int streamId, boolean last); 42 43 /** 44 * Called when a RST_STREAM frame is received. 45 */ 46 void readRstStreamFrame(int streamId, int statusCode); 47 48 /** 49 * Called when a SETTINGS frame is received. 50 * Settings are not included. See readSetting(). 51 */ 52 void readSettingsFrame(boolean clearPersisted); 53 54 /** 55 * Called when an individual setting within a SETTINGS frame is received. 56 */ 57 void readSetting(int id, int value, boolean persistValue, boolean persisted); 58 59 /** 60 * Called when the entire SETTINGS frame has been received. 61 */ 62 void readSettingsEnd(); 63 64 /** 65 * Called when a PING frame is received. 66 */ 67 void readPingFrame(int id); 68 69 /** 70 * Called when a GOAWAY frame is received. 71 */ 72 void readGoAwayFrame(int lastGoodStreamId, int statusCode); 73 74 /** 75 * Called when a HEADERS frame is received. 76 * The Name/Value Header Block is not included. See readHeaderBlock(). 77 */ 78 void readHeadersFrame(int streamId, boolean last); 79 80 /** 81 * Called when a WINDOW_UPDATE frame is received. 82 */ 83 void readWindowUpdateFrame(int streamId, int deltaWindowSize); 84 85 /** 86 * Called when the header block within a SYN_STREAM, SYN_REPLY, or HEADERS frame is received. 87 */ 88 void readHeaderBlock(ByteBuf headerBlock); 89 90 /** 91 * Called when an entire header block has been received. 92 */ 93 void readHeaderBlockEnd(); 94 95 /** 96 * Called when an unrecoverable session error has occurred. 97 */ 98 void readFrameError(String message); 99 }