SPDY: introduce SpdyControlFrame tag interface

This commit is contained in:
Jeff Pinner 2012-08-14 18:00:39 -07:00
parent a0d9bed8f9
commit d3d52edb31
11 changed files with 33 additions and 20 deletions

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

@ -75,17 +75,7 @@ public class SpdyFrameEncoder extends MessageToByteEncoder<Object> {
@Override @Override
public boolean isEncodable(Object msg) throws Exception { public boolean isEncodable(Object msg) throws Exception {
// FIXME: Introduce supertype return msg instanceof SpdyDataFrame || msg instanceof SpdyControlFrame;
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;
} }
@Override @Override

View File

@ -18,7 +18,7 @@ package io.netty.handler.codec.spdy;
/** /**
* A SPDY Protocol GOAWAY Control Frame * A SPDY Protocol GOAWAY Control Frame
*/ */
public interface SpdyGoAwayFrame { public interface SpdyGoAwayFrame extends SpdyControlFrame {
/** /**
* Returns the Last-good-stream-ID of this frame. * 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 * A SPDY Protocol HEADERS Control Frame
*/ */
public interface SpdyHeadersFrame extends SpdyHeaderBlock { public interface SpdyHeadersFrame extends SpdyHeaderBlock, SpdyControlFrame {
/** /**
* Returns the Stream-ID of this frame. * 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 * A SPDY Protocol NOOP Control Frame
*/ */
public interface SpdyNoOpFrame { public interface SpdyNoOpFrame extends SpdyControlFrame {
// Tag interface // Tag interface
} }

View File

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

View File

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

View File

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