From a20aba87ab37236f25f53957e4f75345697ededd Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 27 Dec 2012 22:53:42 +0100 Subject: [PATCH] Remove get prefix from Sctp methods to be more inline with the rest --- .../codec/sctp/SctpInboundByteStreamHandler.java | 4 ++-- .../codec/sctp/SctpMessageCompletionHandler.java | 6 +++--- .../main/java/io/netty/channel/socket/SctpMessage.java | 10 +++++----- .../io/netty/channel/socket/nio/NioSctpChannel.java | 8 ++++---- .../io/netty/channel/socket/oio/OioSctpChannel.java | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/codec/src/main/java/io/netty/handler/codec/sctp/SctpInboundByteStreamHandler.java b/codec/src/main/java/io/netty/handler/codec/sctp/SctpInboundByteStreamHandler.java index 10cfd897d3..921fd6c929 100644 --- a/codec/src/main/java/io/netty/handler/codec/sctp/SctpInboundByteStreamHandler.java +++ b/codec/src/main/java/io/netty/handler/codec/sctp/SctpInboundByteStreamHandler.java @@ -40,7 +40,7 @@ public class SctpInboundByteStreamHandler extends ChannelInboundMessageHandlerAd } protected boolean isDecodable(SctpMessage msg) { - return msg.getProtocolIdentifier() == protocolIdentifier && msg.getStreamIdentifier() == streamIdentifier; + return msg.protocolIdentifier() == protocolIdentifier && msg.streamIdentifier() == streamIdentifier; } @Override @@ -56,7 +56,7 @@ public class SctpInboundByteStreamHandler extends ChannelInboundMessageHandlerAd "pipeline before this handler", SctpMessageCompletionHandler.class.getSimpleName())); } - ctx.nextInboundByteBuffer().writeBytes(msg.getPayloadBuffer()); + ctx.nextInboundByteBuffer().writeBytes(msg.payloadBuffer()); ctx.fireInboundBufferUpdated(); } } diff --git a/codec/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java b/codec/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java index 334bf827c1..3f4f8fcf99 100644 --- a/codec/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java +++ b/codec/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java @@ -31,9 +31,9 @@ public class SctpMessageCompletionHandler extends ChannelInboundMessageHandlerAd @Override protected void messageReceived(ChannelHandlerContext ctx, SctpMessage msg) throws Exception { - final ByteBuf byteBuf = msg.getPayloadBuffer(); - final int protocolIdentifier = msg.getProtocolIdentifier(); - final int streamIdentifier = msg.getStreamIdentifier(); + final ByteBuf byteBuf = msg.payloadBuffer(); + final int protocolIdentifier = msg.protocolIdentifier(); + final int streamIdentifier = msg.streamIdentifier(); final boolean isComplete = msg.isComplete(); ByteBuf frag; diff --git a/transport/src/main/java/io/netty/channel/socket/SctpMessage.java b/transport/src/main/java/io/netty/channel/socket/SctpMessage.java index d8ad3d73d2..d38879b235 100644 --- a/transport/src/main/java/io/netty/channel/socket/SctpMessage.java +++ b/transport/src/main/java/io/netty/channel/socket/SctpMessage.java @@ -64,21 +64,21 @@ public final class SctpMessage { /** * Return the stream-identifier */ - public int getStreamIdentifier() { + public int streamIdentifier() { return streamIdentifier; } /** * Return the protocol-identifier */ - public int getProtocolIdentifier() { + public int protocolIdentifier() { return protocolIdentifier; } /** * Return a view of the readable bytes of the payload. */ - public ByteBuf getPayloadBuffer() { + public ByteBuf payloadBuffer() { if (payloadBuffer.readable()) { return payloadBuffer.slice(); } else { @@ -90,7 +90,7 @@ public final class SctpMessage { * Return the {@link MessageInfo} for inbound messages or {@code null} for * outbound messages. */ - public MessageInfo getMessageInfo() { + public MessageInfo messageInfo() { return msgInfo; } @@ -145,6 +145,6 @@ public final class SctpMessage { public String toString() { return "SctpFrame{" + "streamIdentifier=" + streamIdentifier + ", protocolIdentifier=" + protocolIdentifier + - ", payloadBuffer=" + ByteBufUtil.hexDump(getPayloadBuffer()) + '}'; + ", payloadBuffer=" + ByteBufUtil.hexDump(payloadBuffer()) + '}'; } } diff --git a/transport/src/main/java/io/netty/channel/socket/nio/NioSctpChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/NioSctpChannel.java index 5c7401dbb6..f931f5ced0 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/NioSctpChannel.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/NioSctpChannel.java @@ -260,7 +260,7 @@ public class NioSctpChannel extends AbstractNioMessageChannel implements io.nett @Override protected int doWriteMessages(MessageBuf buf, boolean lastSpin) throws Exception { SctpMessage packet = (SctpMessage) buf.peek(); - ByteBuf data = packet.getPayloadBuffer(); + ByteBuf data = packet.payloadBuffer(); int dataLen = data.readableBytes(); ByteBuffer nioData; if (data.nioBufferCount() == 1) { @@ -271,9 +271,9 @@ public class NioSctpChannel extends AbstractNioMessageChannel implements io.nett nioData.flip(); } - final MessageInfo mi = MessageInfo.createOutgoing(association(), null, packet.getStreamIdentifier()); - mi.payloadProtocolID(packet.getProtocolIdentifier()); - mi.streamNumber(packet.getStreamIdentifier()); + final MessageInfo mi = MessageInfo.createOutgoing(association(), null, packet.streamIdentifier()); + mi.payloadProtocolID(packet.protocolIdentifier()); + mi.streamNumber(packet.streamIdentifier()); final int writtenBytes = javaChannel().send(nioData, mi); diff --git a/transport/src/main/java/io/netty/channel/socket/oio/OioSctpChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioSctpChannel.java index d3f2bd4cc8..e50eccffb5 100755 --- a/transport/src/main/java/io/netty/channel/socket/oio/OioSctpChannel.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/OioSctpChannel.java @@ -199,7 +199,7 @@ public class OioSctpChannel extends AbstractOioMessageChannel if (packet == null) { return; } - ByteBuf data = packet.getPayloadBuffer(); + ByteBuf data = packet.payloadBuffer(); int dataLen = data.readableBytes(); ByteBuffer nioData; @@ -211,9 +211,9 @@ public class OioSctpChannel extends AbstractOioMessageChannel nioData.flip(); } - final MessageInfo mi = MessageInfo.createOutgoing(association(), null, packet.getStreamIdentifier()); - mi.payloadProtocolID(packet.getProtocolIdentifier()); - mi.streamNumber(packet.getStreamIdentifier()); + final MessageInfo mi = MessageInfo.createOutgoing(association(), null, packet.streamIdentifier()); + mi.payloadProtocolID(packet.protocolIdentifier()); + mi.streamNumber(packet.streamIdentifier()); ch.send(nioData, mi); }