Merge pull request #518 from jpinner/spdy_cleanup

SPDY: introduce SpdyControlFrame tag interface
This commit is contained in:
Jeff Pinner 2012-08-14 18:10:23 -07:00
commit 5787e2eac9
13 changed files with 33 additions and 47 deletions

View File

@ -26,7 +26,6 @@ public class DefaultSpdyDataFrame implements SpdyDataFrame {
private int streamId;
private boolean last;
private boolean compressed;
private ByteBuf data = Unpooled.EMPTY_BUFFER;
/**
@ -62,18 +61,6 @@ public class DefaultSpdyDataFrame implements SpdyDataFrame {
this.last = last;
}
@Override
@Deprecated
public boolean isCompressed() {
return compressed;
}
@Override
@Deprecated
public void setCompressed(boolean compressed) {
this.compressed = compressed;
}
@Override
public ByteBuf getData() {
return data;
@ -97,8 +84,6 @@ public class DefaultSpdyDataFrame implements SpdyDataFrame {
buf.append(getClass().getSimpleName());
buf.append("(last: ");
buf.append(isLast());
buf.append("; compressed: ");
buf.append(isCompressed());
buf.append(')');
buf.append(StringUtil.NEWLINE);
buf.append("--> Stream-ID = ");

View File

@ -0,0 +1,23 @@
/*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol Control Frame
*/
public interface SpdyControlFrame {
// Tag interface
}

View File

@ -44,18 +44,6 @@ public interface SpdyDataFrame {
*/
void setLast(boolean last);
/**
* @deprecated Removed from SPDY specification.
*/
@Deprecated
boolean isCompressed();
/**
* @deprecated Removed from SPDY specification.
*/
@Deprecated
void setCompressed(boolean compressed);
/**
* Returns the data payload of this frame. If there is no data payload
* {@link Unpooled#EMPTY_BUFFER} is returned.

View File

@ -75,17 +75,7 @@ public class SpdyFrameEncoder extends MessageToByteEncoder<Object> {
@Override
public boolean isEncodable(Object msg) throws Exception {
// FIXME: Introduce supertype
return msg instanceof SpdyDataFrame ||
msg instanceof SpdySynStreamFrame ||
msg instanceof SpdySynReplyFrame ||
msg instanceof SpdyRstStreamFrame ||
msg instanceof SpdySettingsFrame ||
msg instanceof SpdyNoOpFrame ||
msg instanceof SpdyPingFrame ||
msg instanceof SpdyGoAwayFrame ||
msg instanceof SpdyHeadersFrame ||
msg instanceof SpdyWindowUpdateFrame;
return msg instanceof SpdyDataFrame || msg instanceof SpdyControlFrame;
}
@Override

View File

@ -18,7 +18,7 @@ package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol GOAWAY Control Frame
*/
public interface SpdyGoAwayFrame {
public interface SpdyGoAwayFrame extends SpdyControlFrame {
/**
* Returns the Last-good-stream-ID of this frame.

View File

@ -18,7 +18,7 @@ package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol HEADERS Control Frame
*/
public interface SpdyHeadersFrame extends SpdyHeaderBlock {
public interface SpdyHeadersFrame extends SpdyHeaderBlock, SpdyControlFrame {
/**
* Returns the Stream-ID of this frame.

View File

@ -18,6 +18,6 @@ package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol NOOP Control Frame
*/
public interface SpdyNoOpFrame {
public interface SpdyNoOpFrame extends SpdyControlFrame {
// Tag interface
}

View File

@ -18,7 +18,7 @@ package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol PING Control Frame
*/
public interface SpdyPingFrame {
public interface SpdyPingFrame extends SpdyControlFrame {
/**
* Returns the ID of this frame.

View File

@ -18,7 +18,7 @@ package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol RST_STREAM Control Frame
*/
public interface SpdyRstStreamFrame {
public interface SpdyRstStreamFrame extends SpdyControlFrame {
/**
* Returns the Stream-ID of this frame.

View File

@ -20,7 +20,7 @@ import java.util.Set;
/**
* A SPDY Protocol SETTINGS Control Frame
*/
public interface SpdySettingsFrame {
public interface SpdySettingsFrame extends SpdyControlFrame {
int SETTINGS_UPLOAD_BANDWIDTH = 1;
int SETTINGS_DOWNLOAD_BANDWIDTH = 2;

View File

@ -18,7 +18,7 @@ package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol SYN_REPLY Control Frame
*/
public interface SpdySynReplyFrame extends SpdyHeaderBlock {
public interface SpdySynReplyFrame extends SpdyHeaderBlock, SpdyControlFrame {
/**
* Returns the Stream-ID of this frame.

View File

@ -18,7 +18,7 @@ package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol SYN_STREAM Control Frame
*/
public interface SpdySynStreamFrame extends SpdyHeaderBlock {
public interface SpdySynStreamFrame extends SpdyHeaderBlock, SpdyControlFrame {
/**
* Returns the Stream-ID of this frame.

View File

@ -18,7 +18,7 @@ package io.netty.handler.codec.spdy;
/**
* A SPDY Protocol WINDOW_UPDATE Control Frame
*/
public interface SpdyWindowUpdateFrame {
public interface SpdyWindowUpdateFrame extends SpdyControlFrame {
/**
* Returns the Stream-ID of this frame.