Skip to content

Commit

Permalink
Merge pull request netty#518 from jpinner/spdy_cleanup
Browse files Browse the repository at this point in the history
SPDY: introduce SpdyControlFrame tag interface
  • Loading branch information
Jeff Pinner committed Aug 15, 2012
2 parents 8b66e65 + d3d52ed commit 5787e2e
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public class DefaultSpdyDataFrame implements SpdyDataFrame {

private int streamId;
private boolean last;
private boolean compressed;
private ByteBuf data = Unpooled.EMPTY_BUFFER;

/**
Expand Down Expand Up @@ -62,18 +61,6 @@ public void setLast(boolean last) {
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;
Expand All @@ -97,8 +84,6 @@ public String toString() {
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 = ");
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,7 @@ public void operationComplete(ChannelFuture future) throws Exception {

@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* A SPDY Protocol GOAWAY Control Frame
*/
public interface SpdyGoAwayFrame {
public interface SpdyGoAwayFrame extends SpdyControlFrame {

/**
* Returns the Last-good-stream-ID of this frame.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* A SPDY Protocol HEADERS Control Frame
*/
public interface SpdyHeadersFrame extends SpdyHeaderBlock {
public interface SpdyHeadersFrame extends SpdyHeaderBlock, SpdyControlFrame {

/**
* Returns the Stream-ID of this frame.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
/**
* A SPDY Protocol NOOP Control Frame
*/
public interface SpdyNoOpFrame {
public interface SpdyNoOpFrame extends SpdyControlFrame {
// Tag interface
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* A SPDY Protocol PING Control Frame
*/
public interface SpdyPingFrame {
public interface SpdyPingFrame extends SpdyControlFrame {

/**
* Returns the ID of this frame.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* A SPDY Protocol RST_STREAM Control Frame
*/
public interface SpdyRstStreamFrame {
public interface SpdyRstStreamFrame extends SpdyControlFrame {

/**
* Returns the Stream-ID of this frame.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* A SPDY Protocol SETTINGS Control Frame
*/
public interface SpdySettingsFrame {
public interface SpdySettingsFrame extends SpdyControlFrame {

int SETTINGS_UPLOAD_BANDWIDTH = 1;
int SETTINGS_DOWNLOAD_BANDWIDTH = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* A SPDY Protocol WINDOW_UPDATE Control Frame
*/
public interface SpdyWindowUpdateFrame {
public interface SpdyWindowUpdateFrame extends SpdyControlFrame {

/**
* Returns the Stream-ID of this frame.
Expand Down

0 comments on commit 5787e2e

Please sign in to comment.