ID -> Id (#393 Ensure all fields follow our naming convention)
This commit is contained in:
parent
178d24a16d
commit
95d8e782e3
@ -22,49 +22,57 @@ import org.jboss.netty.util.internal.StringUtil;
|
||||
*/
|
||||
public class DefaultSpdyGoAwayFrame implements SpdyGoAwayFrame {
|
||||
|
||||
private int lastGoodStreamID;
|
||||
private int lastGoodStreamId;
|
||||
private SpdySessionStatus status;
|
||||
|
||||
/**
|
||||
* Creates a new instance.
|
||||
*
|
||||
* @param lastGoodStreamID the Last-good-stream-ID of this frame
|
||||
* @param lastGoodStreamId the Last-good-stream-ID of this frame
|
||||
*/
|
||||
public DefaultSpdyGoAwayFrame(int lastGoodStreamID) {
|
||||
this(lastGoodStreamID, 0);
|
||||
public DefaultSpdyGoAwayFrame(int lastGoodStreamId) {
|
||||
this(lastGoodStreamId, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance.
|
||||
*
|
||||
* @param lastGoodStreamID the Last-good-stream-ID of this frame
|
||||
* @param lastGoodStreamId the Last-good-stream-ID of this frame
|
||||
* @param statusCode the Status code of this frame
|
||||
*/
|
||||
public DefaultSpdyGoAwayFrame(int lastGoodStreamID, int statusCode) {
|
||||
this(lastGoodStreamID, SpdySessionStatus.valueOf(statusCode));
|
||||
public DefaultSpdyGoAwayFrame(int lastGoodStreamId, int statusCode) {
|
||||
this(lastGoodStreamId, SpdySessionStatus.valueOf(statusCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new instance.
|
||||
*
|
||||
* @param lastGoodStreamID the Last-good-stream-ID of this frame
|
||||
* @param lastGoodStreamId the Last-good-stream-ID of this frame
|
||||
* @param status the status of this frame
|
||||
*/
|
||||
public DefaultSpdyGoAwayFrame(int lastGoodStreamID, SpdySessionStatus status) {
|
||||
setLastGoodStreamID(lastGoodStreamID);
|
||||
public DefaultSpdyGoAwayFrame(int lastGoodStreamId, SpdySessionStatus status) {
|
||||
setLastGoodStreamId(lastGoodStreamId);
|
||||
setStatus(status);
|
||||
}
|
||||
|
||||
public int getLastGoodStreamID() {
|
||||
return lastGoodStreamID;
|
||||
return getLastGoodStreamId();
|
||||
}
|
||||
|
||||
public void setLastGoodStreamID(int lastGoodStreamID) {
|
||||
if (lastGoodStreamID < 0) {
|
||||
public int getLastGoodStreamId() {
|
||||
return lastGoodStreamId;
|
||||
}
|
||||
|
||||
public void setLastGoodStreamID(int lastGoodStreamId) {
|
||||
setLastGoodStreamId(lastGoodStreamId);
|
||||
}
|
||||
|
||||
public void setLastGoodStreamId(int lastGoodStreamId) {
|
||||
if (lastGoodStreamId < 0) {
|
||||
throw new IllegalArgumentException("Last-good-stream-ID"
|
||||
+ " cannot be negative: " + lastGoodStreamID);
|
||||
+ " cannot be negative: " + lastGoodStreamId);
|
||||
}
|
||||
this.lastGoodStreamID = lastGoodStreamID;
|
||||
this.lastGoodStreamId = lastGoodStreamId;
|
||||
}
|
||||
|
||||
public SpdySessionStatus getStatus() {
|
||||
@ -81,7 +89,7 @@ public class DefaultSpdyGoAwayFrame implements SpdyGoAwayFrame {
|
||||
buf.append(getClass().getSimpleName());
|
||||
buf.append(StringUtil.NEWLINE);
|
||||
buf.append("--> Last-good-stream-ID = ");
|
||||
buf.append(lastGoodStreamID);
|
||||
buf.append(lastGoodStreamId);
|
||||
buf.append(StringUtil.NEWLINE);
|
||||
buf.append("--> Status: ");
|
||||
buf.append(status.toString());
|
||||
|
@ -265,7 +265,7 @@ public class SpdyFrameEncoder extends OneToOneEncoder {
|
||||
frame.writeShort(version | 0x8000);
|
||||
frame.writeShort(SPDY_GOAWAY_FRAME);
|
||||
frame.writeInt(length);
|
||||
frame.writeInt(spdyGoAwayFrame.getLastGoodStreamID());
|
||||
frame.writeInt(spdyGoAwayFrame.getLastGoodStreamId());
|
||||
if (version >= 3) {
|
||||
frame.writeInt(spdyGoAwayFrame.getStatus().getCode());
|
||||
}
|
||||
|
@ -20,16 +20,28 @@ package org.jboss.netty.handler.codec.spdy;
|
||||
*/
|
||||
public interface SpdyGoAwayFrame {
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getLastGoodStreamId()} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
int getLastGoodStreamID();
|
||||
|
||||
/**
|
||||
* Returns the Last-good-stream-ID of this frame.
|
||||
*/
|
||||
int getLastGoodStreamID();
|
||||
int getLastGoodStreamId();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #setLastGoodStreamId(int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
void setLastGoodStreamID(int lastGoodStreamId);
|
||||
|
||||
/**
|
||||
* Sets the Last-good-stream-ID of this frame. The Last-good-stream-ID
|
||||
* cannot be negative.
|
||||
*/
|
||||
void setLastGoodStreamID(int lastGoodStreamID);
|
||||
void setLastGoodStreamId(int lastGoodStreamId);
|
||||
|
||||
/**
|
||||
* Returns the status of this frame.
|
||||
|
@ -86,7 +86,7 @@ public class SpdySessionHandlerTest {
|
||||
Assert.assertNotNull(msg);
|
||||
Assert.assertTrue(msg instanceof SpdyGoAwayFrame);
|
||||
SpdyGoAwayFrame spdyGoAwayFrame = (SpdyGoAwayFrame) msg;
|
||||
Assert.assertTrue(spdyGoAwayFrame.getLastGoodStreamID() == lastGoodStreamID);
|
||||
Assert.assertTrue(spdyGoAwayFrame.getLastGoodStreamId() == lastGoodStreamID);
|
||||
}
|
||||
|
||||
private static void assertHeaders(Object msg, int streamID, SpdyHeaderBlock headers) {
|
||||
|
Loading…
Reference in New Issue
Block a user