Remove get prefix from Sctp methods to be more inline with the rest
This commit is contained in:
parent
6db7250ed9
commit
a20aba87ab
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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()) + '}';
|
||||
}
|
||||
}
|
||||
|
@ -260,7 +260,7 @@ public class NioSctpChannel extends AbstractNioMessageChannel implements io.nett
|
||||
@Override
|
||||
protected int doWriteMessages(MessageBuf<Object> 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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user