public class LargeMessageControllerImpl extends Object implements LargeMessageController
SessionReceiveContinuationMessage
as it was being handled
by a single buffer. This buffer can be consumed as messages are arriving, and it will hold the
packets until they are read using the ChannelBuffer interface, or the setOutputStream or
saveStream are called.Constructor and Description |
---|
LargeMessageControllerImpl(ClientConsumerInternal consumerInternal,
long totalSize,
long readTimeout) |
LargeMessageControllerImpl(ClientConsumerInternal consumerInternal,
long totalSize,
long readTimeout,
File cachedFile) |
LargeMessageControllerImpl(ClientConsumerInternal consumerInternal,
long totalSize,
long readTimeout,
File cachedFile,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
void |
addPacket(byte[] chunk,
int flowControlSize,
boolean isContinues)
TODO: move this to ConsumerContext as large message is a protocol specific thing
Add a buff to the List, or save it to the OutputStream if set
|
io.netty.buffer.ByteBuf |
byteBuf() |
void |
cancel()
Cancels this buffer.
|
int |
capacity() |
void |
clear() |
void |
close()
Closes this buffer.
|
ActiveMQBuffer |
copy() |
ActiveMQBuffer |
copy(int index,
int length) |
void |
discardReadBytes() |
void |
discardUnusedPackets()
Discards packets unused by this buffer.
|
ActiveMQBuffer |
duplicate() |
byte |
getByte(int index) |
void |
getBytes(int index,
ActiveMQBuffer dst) |
void |
getBytes(int index,
ActiveMQBuffer dst,
int length) |
void |
getBytes(int index,
ActiveMQBuffer dst,
int dstIndex,
int length) |
void |
getBytes(int index,
byte[] dst) |
void |
getBytes(int index,
byte[] dst,
int dstIndex,
int length) |
void |
getBytes(int index,
ByteBuffer dst) |
int |
getBytes(int index,
GatheringByteChannel out,
int length) |
void |
getBytes(int index,
OutputStream out,
int length) |
void |
getBytes(long index,
byte[] dst) |
void |
getBytes(long index,
byte[] dst,
int dstIndex,
int length) |
void |
getBytes(long index,
ByteBuffer dst) |
void |
getBytes(long index,
OutputStream out,
int length) |
char |
getChar(int index) |
double |
getDouble(int index) |
float |
getFloat(int index) |
int |
getInt(int index) |
int |
getInt(long index) |
long |
getLong(int index) |
long |
getLong(long index) |
int |
getMedium(int index) |
short |
getShort(int index) |
short |
getShort(long index) |
long |
getSize()
Returns the size of this buffer.
|
Object |
getUnderlyingBuffer() |
short |
getUnsignedByte(int index) |
long |
getUnsignedInt(int index) |
int |
getUnsignedMedium(long index) |
int |
getUnsignedShort(int index) |
void |
markReaderIndex() |
void |
markWriterIndex() |
boolean |
readable() |
int |
readableBytes() |
boolean |
readBoolean() |
byte |
readByte() |
void |
readBytes(ActiveMQBuffer dst) |
void |
readBytes(ActiveMQBuffer dst,
int length) |
void |
readBytes(ActiveMQBuffer dst,
int dstIndex,
int length) |
void |
readBytes(byte[] dst) |
void |
readBytes(byte[] dst,
int dstIndex,
int length) |
void |
readBytes(ByteBuffer dst) |
int |
readBytes(GatheringByteChannel out,
int length) |
ActiveMQBuffer |
readBytes(int length) |
void |
readBytes(OutputStream out,
int length) |
char |
readChar() |
double |
readDouble() |
int |
readerIndex() |
void |
readerIndex(int readerIndex) |
float |
readFloat() |
void |
readFully(byte[] b)
from
DataInput interface |
void |
readFully(byte[] b,
int off,
int len)
from
DataInput interface |
int |
readInt() |
int |
readInt(int pos) |
String |
readLine()
from
DataInput interface |
long |
readLong() |
int |
readMedium() |
SimpleString |
readNullableSimpleString() |
String |
readNullableString() |
short |
readShort() |
SimpleString |
readSimpleString() |
ActiveMQBuffer |
readSlice(int length) |
String |
readString() |
int |
readUnsignedByte() |
long |
readUnsignedInt() |
int |
readUnsignedMedium() |
int |
readUnsignedShort() |
String |
readUTF() |
void |
release() |
void |
resetReaderIndex() |
void |
resetWriterIndex() |
void |
saveBuffer(OutputStream output)
Saves this buffer to the specified output.
|
void |
setByte(int index,
byte value) |
void |
setBytes(int index,
ActiveMQBuffer src) |
void |
setBytes(int index,
ActiveMQBuffer src,
int length) |
void |
setBytes(int index,
ActiveMQBuffer src,
int srcIndex,
int length) |
void |
setBytes(int index,
byte[] src) |
void |
setBytes(int index,
byte[] src,
int srcIndex,
int length) |
void |
setBytes(int index,
ByteBuffer src) |
void |
setChar(int index,
char value) |
void |
setDouble(int index,
double value) |
void |
setFloat(int index,
float value) |
void |
setIndex(int readerIndex,
int writerIndex) |
void |
setInt(int index,
int value) |
void |
setLocal(boolean local) |
void |
setLong(int index,
long value) |
void |
setOutputStream(OutputStream output)
Sets the OutputStream of this buffer to the specified output.
|
void |
setShort(int index,
short value) |
void |
setZero(int index,
int length) |
int |
skipBytes(int length) |
ActiveMQBuffer |
slice() |
ActiveMQBuffer |
slice(int index,
int length) |
ByteBuffer |
toByteBuffer() |
ByteBuffer |
toByteBuffer(int index,
int length) |
ByteBuffer[] |
toByteBuffers() |
ByteBuffer[] |
toByteBuffers(int index,
int length) |
String |
toString(String charsetName) |
boolean |
waitCompletion(long timeWait)
Waits for the completion for the specified waiting time (in milliseconds).
|
boolean |
writable() |
int |
writableBytes() |
void |
writeBoolean(boolean val) |
void |
writeByte(byte value) |
void |
writeBytes(ActiveMQBuffer src) |
void |
writeBytes(ActiveMQBuffer src,
int length) |
void |
writeBytes(ActiveMQBuffer src,
int srcIndex,
int length) |
void |
writeBytes(byte[] src) |
void |
writeBytes(byte[] src,
int srcIndex,
int length) |
void |
writeBytes(ByteBuffer src) |
void |
writeBytes(io.netty.buffer.ByteBuf src,
int srcIndex,
int length)
Transfers the specified source buffer's data to this buffer starting at
the current
writerIndex until the source buffer's position
reaches its limit, and increases the writerIndex by the
number of the transferred bytes. |
int |
writeBytes(InputStream in,
int length) |
int |
writeBytes(ScatteringByteChannel in,
int length) |
void |
writeChar(char val) |
void |
writeDouble(double val) |
void |
writeFloat(float val) |
void |
writeInt(int value) |
void |
writeLong(long value) |
void |
writeMedium(int value) |
void |
writeNullableSimpleString(SimpleString val) |
void |
writeNullableString(String val) |
int |
writerIndex() |
void |
writerIndex(int writerIndex) |
void |
writeShort(short value) |
void |
writeSimpleString(SimpleString val) |
void |
writeString(String val) |
void |
writeUTF(String utf) |
void |
writeZero(int length) |
public LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout)
public LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout, File cachedFile)
public LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout, File cachedFile, int bufferSize)
public void setLocal(boolean local)
public void discardUnusedPackets()
LargeMessageController
discardUnusedPackets
in interface LargeMessageController
public void addPacket(byte[] chunk, int flowControlSize, boolean isContinues)
addPacket
in interface LargeMessageController
public void cancel()
LargeMessageController
cancel
in interface LargeMessageController
public void close()
LargeMessageController
close
in interface LargeMessageController
public void setOutputStream(OutputStream output) throws ActiveMQException
LargeMessageController
setOutputStream
in interface LargeMessageController
ActiveMQException
public void saveBuffer(OutputStream output) throws ActiveMQException
LargeMessageController
LargeMessageController.setOutputStream(OutputStream)
.saveBuffer
in interface LargeMessageController
ActiveMQException
public boolean waitCompletion(long timeWait) throws ActiveMQException
LargeMessageController
waitCompletion
in interface LargeMessageController
timeWait
- Milliseconds to Wait. 0 means foreverActiveMQException
public int capacity()
capacity
in interface ActiveMQBuffer
public byte readByte()
readByte
in interface DataInput
readByte
in interface ActiveMQBuffer
public byte getByte(int index)
getByte
in interface ActiveMQBuffer
public void getBytes(int index, ActiveMQBuffer dst, int dstIndex, int length)
getBytes
in interface ActiveMQBuffer
public void getBytes(int index, byte[] dst, int dstIndex, int length)
getBytes
in interface ActiveMQBuffer
public void getBytes(long index, byte[] dst, int dstIndex, int length)
public void getBytes(int index, ByteBuffer dst)
getBytes
in interface ActiveMQBuffer
public void getBytes(long index, ByteBuffer dst)
public void getBytes(int index, OutputStream out, int length) throws IOException
IOException
public void getBytes(long index, OutputStream out, int length) throws IOException
IOException
public int getBytes(int index, GatheringByteChannel out, int length) throws IOException
IOException
public int getInt(int index)
getInt
in interface ActiveMQBuffer
public int getInt(long index)
public long getLong(int index)
getLong
in interface ActiveMQBuffer
public long getLong(long index)
public short getShort(int index)
getShort
in interface ActiveMQBuffer
public short getShort(long index)
public int getUnsignedMedium(long index)
public void setByte(int index, byte value)
setByte
in interface ActiveMQBuffer
public void setBytes(int index, ActiveMQBuffer src, int srcIndex, int length)
setBytes
in interface ActiveMQBuffer
public void setBytes(int index, byte[] src, int srcIndex, int length)
setBytes
in interface ActiveMQBuffer
public void setBytes(int index, ByteBuffer src)
setBytes
in interface ActiveMQBuffer
public void setInt(int index, int value)
setInt
in interface ActiveMQBuffer
public void setLong(int index, long value)
setLong
in interface ActiveMQBuffer
public void setShort(int index, short value)
setShort
in interface ActiveMQBuffer
public ByteBuffer toByteBuffer(int index, int length)
toByteBuffer
in interface ActiveMQBuffer
public void release()
release
in interface ActiveMQBuffer
public int readerIndex()
readerIndex
in interface ActiveMQBuffer
public void readerIndex(int readerIndex)
readerIndex
in interface ActiveMQBuffer
public int writerIndex()
writerIndex
in interface ActiveMQBuffer
public long getSize()
LargeMessageController
getSize
in interface LargeMessageController
public void writerIndex(int writerIndex)
writerIndex
in interface ActiveMQBuffer
public void setIndex(int readerIndex, int writerIndex)
setIndex
in interface ActiveMQBuffer
public void clear()
clear
in interface ActiveMQBuffer
public boolean readable()
readable
in interface ActiveMQBuffer
public boolean writable()
writable
in interface ActiveMQBuffer
public int readableBytes()
readableBytes
in interface ActiveMQBuffer
public int writableBytes()
writableBytes
in interface ActiveMQBuffer
public void markReaderIndex()
markReaderIndex
in interface ActiveMQBuffer
public void resetReaderIndex()
resetReaderIndex
in interface ActiveMQBuffer
public void markWriterIndex()
markWriterIndex
in interface ActiveMQBuffer
public void resetWriterIndex()
resetWriterIndex
in interface ActiveMQBuffer
public void discardReadBytes()
discardReadBytes
in interface ActiveMQBuffer
public short getUnsignedByte(int index)
getUnsignedByte
in interface ActiveMQBuffer
public int getUnsignedShort(int index)
getUnsignedShort
in interface ActiveMQBuffer
public int getMedium(int index)
public long getUnsignedInt(int index)
getUnsignedInt
in interface ActiveMQBuffer
public void getBytes(int index, byte[] dst)
getBytes
in interface ActiveMQBuffer
public void getBytes(long index, byte[] dst)
public void getBytes(int index, ActiveMQBuffer dst)
getBytes
in interface ActiveMQBuffer
public void getBytes(int index, ActiveMQBuffer dst, int length)
getBytes
in interface ActiveMQBuffer
public void setBytes(int index, byte[] src)
setBytes
in interface ActiveMQBuffer
public void setBytes(int index, ActiveMQBuffer src)
setBytes
in interface ActiveMQBuffer
public void setBytes(int index, ActiveMQBuffer src, int length)
setBytes
in interface ActiveMQBuffer
public void setZero(int index, int length)
public int readUnsignedByte()
readUnsignedByte
in interface DataInput
readUnsignedByte
in interface ActiveMQBuffer
public short readShort()
readShort
in interface DataInput
readShort
in interface ActiveMQBuffer
public int readUnsignedShort()
readUnsignedShort
in interface DataInput
readUnsignedShort
in interface ActiveMQBuffer
public int readMedium()
public int readUnsignedMedium()
public int readInt()
readInt
in interface DataInput
readInt
in interface ActiveMQBuffer
public int readInt(int pos)
public long readUnsignedInt()
readUnsignedInt
in interface ActiveMQBuffer
public long readLong()
readLong
in interface DataInput
readLong
in interface ActiveMQBuffer
public void readBytes(byte[] dst, int dstIndex, int length)
readBytes
in interface ActiveMQBuffer
public void readBytes(byte[] dst)
readBytes
in interface ActiveMQBuffer
public void readBytes(ActiveMQBuffer dst)
readBytes
in interface ActiveMQBuffer
public void readBytes(ActiveMQBuffer dst, int length)
readBytes
in interface ActiveMQBuffer
public void readBytes(ActiveMQBuffer dst, int dstIndex, int length)
readBytes
in interface ActiveMQBuffer
public void readBytes(ByteBuffer dst)
readBytes
in interface ActiveMQBuffer
public int readBytes(GatheringByteChannel out, int length) throws IOException
IOException
public void readBytes(OutputStream out, int length) throws IOException
IOException
public int skipBytes(int length)
skipBytes
in interface DataInput
skipBytes
in interface ActiveMQBuffer
public void writeByte(byte value)
writeByte
in interface ActiveMQBuffer
public void writeShort(short value)
writeShort
in interface ActiveMQBuffer
public void writeMedium(int value)
public void writeInt(int value)
writeInt
in interface ActiveMQBuffer
public void writeLong(long value)
writeLong
in interface ActiveMQBuffer
public void writeBytes(byte[] src, int srcIndex, int length)
writeBytes
in interface ActiveMQBuffer
public void writeBytes(byte[] src)
writeBytes
in interface ActiveMQBuffer
public void writeBytes(ActiveMQBuffer src)
public void writeBytes(ActiveMQBuffer src, int length)
writeBytes
in interface ActiveMQBuffer
public void writeBytes(ByteBuffer src)
writeBytes
in interface ActiveMQBuffer
public void writeBytes(io.netty.buffer.ByteBuf src, int srcIndex, int length)
writerIndex
until the source buffer's position
reaches its limit, and increases the writerIndex
by the
number of the transferred bytes.writeBytes
in interface ActiveMQBuffer
src
- The source bufferIndexOutOfBoundsException
- if src.remaining()
is greater than
this.writableBytes
public int writeBytes(InputStream in, int length) throws IOException
IOException
public int writeBytes(ScatteringByteChannel in, int length) throws IOException
IOException
public void writeZero(int length)
public ByteBuffer toByteBuffer()
toByteBuffer
in interface ActiveMQBuffer
public ByteBuffer[] toByteBuffers()
public ByteBuffer[] toByteBuffers(int index, int length)
public Object getUnderlyingBuffer()
public boolean readBoolean()
readBoolean
in interface DataInput
readBoolean
in interface ActiveMQBuffer
public char readChar()
readChar
in interface DataInput
readChar
in interface ActiveMQBuffer
public char getChar(int index)
getChar
in interface ActiveMQBuffer
public double getDouble(int index)
getDouble
in interface ActiveMQBuffer
public float getFloat(int index)
getFloat
in interface ActiveMQBuffer
public ActiveMQBuffer readBytes(int length)
readBytes
in interface ActiveMQBuffer
public double readDouble()
readDouble
in interface DataInput
readDouble
in interface ActiveMQBuffer
public float readFloat()
readFloat
in interface DataInput
readFloat
in interface ActiveMQBuffer
public SimpleString readNullableSimpleString()
readNullableSimpleString
in interface ActiveMQBuffer
public String readNullableString()
readNullableString
in interface ActiveMQBuffer
public SimpleString readSimpleString()
readSimpleString
in interface ActiveMQBuffer
public String readString()
readString
in interface ActiveMQBuffer
public String readUTF()
readUTF
in interface DataInput
readUTF
in interface ActiveMQBuffer
public void writeBoolean(boolean val)
writeBoolean
in interface ActiveMQBuffer
public void writeChar(char val)
writeChar
in interface ActiveMQBuffer
public void writeDouble(double val)
writeDouble
in interface ActiveMQBuffer
public void writeFloat(float val)
writeFloat
in interface ActiveMQBuffer
public void writeNullableSimpleString(SimpleString val)
writeNullableSimpleString
in interface ActiveMQBuffer
public void writeNullableString(String val)
writeNullableString
in interface ActiveMQBuffer
public void writeSimpleString(SimpleString val)
writeSimpleString
in interface ActiveMQBuffer
public void writeString(String val)
writeString
in interface ActiveMQBuffer
public void writeUTF(String utf)
writeUTF
in interface ActiveMQBuffer
public ActiveMQBuffer copy()
copy
in interface ActiveMQBuffer
public ActiveMQBuffer slice(int index, int length)
slice
in interface ActiveMQBuffer
public void readFully(byte[] b) throws IOException
DataInput
interfacereadFully
in interface DataInput
IOException
public void readFully(byte[] b, int off, int len) throws IOException
DataInput
interfacereadFully
in interface DataInput
IOException
public String readLine() throws IOException
DataInput
interfacereadLine
in interface DataInput
IOException
public io.netty.buffer.ByteBuf byteBuf()
byteBuf
in interface ActiveMQBuffer
public ActiveMQBuffer copy(int index, int length)
copy
in interface ActiveMQBuffer
public ActiveMQBuffer duplicate()
duplicate
in interface ActiveMQBuffer
public ActiveMQBuffer readSlice(int length)
readSlice
in interface ActiveMQBuffer
public void setChar(int index, char value)
setChar
in interface ActiveMQBuffer
public void setDouble(int index, double value)
setDouble
in interface ActiveMQBuffer
public void setFloat(int index, float value)
setFloat
in interface ActiveMQBuffer
public ActiveMQBuffer slice()
slice
in interface ActiveMQBuffer
public void writeBytes(ActiveMQBuffer src, int srcIndex, int length)
writeBytes
in interface ActiveMQBuffer
Copyright © 2018 The Apache Software Foundation. All Rights Reserved.