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.
|
org.apache.activemq.artemis.api.core.ActiveMQBuffer |
copy() |
org.apache.activemq.artemis.api.core.ActiveMQBuffer |
copy(int index,
int length) |
void |
discardReadBytes() |
void |
discardUnusedPackets()
Discards packets unused by this buffer.
|
org.apache.activemq.artemis.api.core.ActiveMQBuffer |
duplicate() |
byte |
getByte(int index) |
void |
getBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer dst) |
void |
getBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer dst,
int length) |
void |
getBytes(int index,
org.apache.activemq.artemis.api.core.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(org.apache.activemq.artemis.api.core.ActiveMQBuffer dst) |
void |
readBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer dst,
int length) |
void |
readBytes(org.apache.activemq.artemis.api.core.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) |
org.apache.activemq.artemis.api.core.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() |
org.apache.activemq.artemis.api.core.SimpleString |
readNullableSimpleString() |
String |
readNullableString() |
short |
readShort() |
org.apache.activemq.artemis.api.core.SimpleString |
readSimpleString() |
org.apache.activemq.artemis.api.core.ActiveMQBuffer |
readSlice(int length) |
String |
readString() |
int |
readUnsignedByte() |
long |
readUnsignedInt() |
int |
readUnsignedMedium() |
int |
readUnsignedShort() |
String |
readUTF() |
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,
org.apache.activemq.artemis.api.core.ActiveMQBuffer src) |
void |
setBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer src,
int length) |
void |
setBytes(int index,
org.apache.activemq.artemis.api.core.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) |
org.apache.activemq.artemis.api.core.ActiveMQBuffer |
slice() |
org.apache.activemq.artemis.api.core.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(org.apache.activemq.artemis.api.core.ActiveMQBuffer src) |
void |
writeBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer src,
int length) |
void |
writeBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer src,
int srcIndex,
int length) |
void |
writeBytes(byte[] src) |
void |
writeBytes(byte[] src,
int srcIndex,
int length) |
void |
writeBytes(ByteBuffer src) |
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(org.apache.activemq.artemis.api.core.SimpleString val) |
void |
writeNullableString(String val) |
int |
writerIndex() |
void |
writerIndex(int writerIndex) |
void |
writeShort(short value) |
void |
writeSimpleString(org.apache.activemq.artemis.api.core.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()
LargeMessageControllerdiscardUnusedPackets in interface LargeMessageControllerpublic void addPacket(byte[] chunk,
int flowControlSize,
boolean isContinues)
addPacket in interface LargeMessageControllerpublic void cancel()
LargeMessageControllercancel in interface LargeMessageControllerpublic void close()
LargeMessageControllerclose in interface LargeMessageControllerpublic void setOutputStream(OutputStream output) throws org.apache.activemq.artemis.api.core.ActiveMQException
LargeMessageControllersetOutputStream in interface LargeMessageControllerorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic void saveBuffer(OutputStream output) throws org.apache.activemq.artemis.api.core.ActiveMQException
LargeMessageControllerLargeMessageController.setOutputStream(OutputStream).saveBuffer in interface LargeMessageControllerorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic boolean waitCompletion(long timeWait)
throws org.apache.activemq.artemis.api.core.ActiveMQException
LargeMessageControllerwaitCompletion in interface LargeMessageControllertimeWait - Milliseconds to Wait. 0 means foreverorg.apache.activemq.artemis.api.core.ActiveMQExceptionpublic int capacity()
capacity in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic byte readByte()
public byte getByte(int index)
getByte in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void getBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer dst,
int dstIndex,
int length)
getBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void getBytes(int index,
byte[] dst,
int dstIndex,
int length)
getBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void getBytes(long index,
byte[] dst,
int dstIndex,
int length)
public void getBytes(int index,
ByteBuffer dst)
getBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void getBytes(long index,
ByteBuffer dst)
public void getBytes(int index,
OutputStream out,
int length)
throws IOException
IOExceptionpublic void getBytes(long index,
OutputStream out,
int length)
throws IOException
IOExceptionpublic int getBytes(int index,
GatheringByteChannel out,
int length)
throws IOException
IOExceptionpublic int getInt(int index)
getInt in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int getInt(long index)
public long getLong(int index)
getLong in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic long getLong(long index)
public short getShort(int index)
getShort in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic short getShort(long index)
public int getUnsignedMedium(long index)
public void setByte(int index,
byte value)
setByte in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer src,
int srcIndex,
int length)
setBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setBytes(int index,
byte[] src,
int srcIndex,
int length)
setBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setBytes(int index,
ByteBuffer src)
setBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setInt(int index,
int value)
setInt in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setLong(int index,
long value)
setLong in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setShort(int index,
short value)
setShort in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic ByteBuffer toByteBuffer(int index, int length)
toByteBuffer in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int readerIndex()
readerIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void readerIndex(int readerIndex)
readerIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int writerIndex()
writerIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic long getSize()
LargeMessageControllergetSize in interface LargeMessageControllerpublic void writerIndex(int writerIndex)
writerIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setIndex(int readerIndex,
int writerIndex)
setIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void clear()
clear in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic boolean readable()
readable in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic boolean writable()
writable in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int readableBytes()
readableBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int writableBytes()
writableBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void markReaderIndex()
markReaderIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void resetReaderIndex()
resetReaderIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void markWriterIndex()
markWriterIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void resetWriterIndex()
resetWriterIndex in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void discardReadBytes()
discardReadBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic short getUnsignedByte(int index)
getUnsignedByte in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int getUnsignedShort(int index)
getUnsignedShort in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int getMedium(int index)
public long getUnsignedInt(int index)
getUnsignedInt in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void getBytes(int index,
byte[] dst)
getBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void getBytes(long index,
byte[] dst)
public void getBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer dst)
getBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void getBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer dst,
int length)
getBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setBytes(int index,
byte[] src)
setBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer src)
setBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setBytes(int index,
org.apache.activemq.artemis.api.core.ActiveMQBuffer src,
int length)
setBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setZero(int index,
int length)
public int readUnsignedByte()
readUnsignedByte in interface DataInputreadUnsignedByte in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic short readShort()
public int readUnsignedShort()
readUnsignedShort in interface DataInputreadUnsignedShort in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int readMedium()
public int readUnsignedMedium()
public int readInt()
public int readInt(int pos)
public long readUnsignedInt()
readUnsignedInt in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic long readLong()
public void readBytes(byte[] dst,
int dstIndex,
int length)
readBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void readBytes(byte[] dst)
readBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void readBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer dst)
readBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void readBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer dst,
int length)
readBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void readBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer dst,
int dstIndex,
int length)
readBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void readBytes(ByteBuffer dst)
readBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int readBytes(GatheringByteChannel out, int length) throws IOException
IOExceptionpublic void readBytes(OutputStream out, int length) throws IOException
IOExceptionpublic int skipBytes(int length)
public void writeByte(byte value)
writeByte in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeShort(short value)
writeShort in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeMedium(int value)
public void writeInt(int value)
writeInt in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeLong(long value)
writeLong in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeBytes(byte[] src,
int srcIndex,
int length)
writeBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeBytes(byte[] src)
writeBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer src)
public void writeBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer src,
int length)
writeBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeBytes(ByteBuffer src)
writeBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic int writeBytes(InputStream in, int length) throws IOException
IOExceptionpublic int writeBytes(ScatteringByteChannel in, int length) throws IOException
IOExceptionpublic void writeZero(int length)
public ByteBuffer toByteBuffer()
toByteBuffer in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic ByteBuffer[] toByteBuffers()
public ByteBuffer[] toByteBuffers(int index, int length)
public Object getUnderlyingBuffer()
public boolean readBoolean()
readBoolean in interface DataInputreadBoolean in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic char readChar()
public char getChar(int index)
getChar in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic double getDouble(int index)
getDouble in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic float getFloat(int index)
getFloat in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic org.apache.activemq.artemis.api.core.ActiveMQBuffer readBytes(int length)
readBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic double readDouble()
readDouble in interface DataInputreadDouble in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic float readFloat()
public org.apache.activemq.artemis.api.core.SimpleString readNullableSimpleString()
readNullableSimpleString in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic String readNullableString()
readNullableString in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic org.apache.activemq.artemis.api.core.SimpleString readSimpleString()
readSimpleString in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic String readString()
readString in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic String readUTF()
public void writeBoolean(boolean val)
writeBoolean in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeChar(char val)
writeChar in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeDouble(double val)
writeDouble in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeFloat(float val)
writeFloat in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeNullableSimpleString(org.apache.activemq.artemis.api.core.SimpleString val)
writeNullableSimpleString in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeNullableString(String val)
writeNullableString in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeSimpleString(org.apache.activemq.artemis.api.core.SimpleString val)
writeSimpleString in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeString(String val)
writeString in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeUTF(String utf)
writeUTF in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic org.apache.activemq.artemis.api.core.ActiveMQBuffer copy()
copy in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic org.apache.activemq.artemis.api.core.ActiveMQBuffer slice(int index,
int length)
slice in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void readFully(byte[] b)
throws IOException
DataInput interfacereadFully in interface DataInputIOExceptionpublic void readFully(byte[] b,
int off,
int len)
throws IOException
DataInput interfacereadFully in interface DataInputIOExceptionpublic String readLine() throws IOException
DataInput interfacereadLine in interface DataInputIOExceptionpublic io.netty.buffer.ByteBuf byteBuf()
byteBuf in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic org.apache.activemq.artemis.api.core.ActiveMQBuffer copy(int index,
int length)
copy in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic org.apache.activemq.artemis.api.core.ActiveMQBuffer duplicate()
duplicate in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic org.apache.activemq.artemis.api.core.ActiveMQBuffer readSlice(int length)
readSlice in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setChar(int index,
char value)
setChar in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setDouble(int index,
double value)
setDouble in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void setFloat(int index,
float value)
setFloat in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic org.apache.activemq.artemis.api.core.ActiveMQBuffer slice()
slice in interface org.apache.activemq.artemis.api.core.ActiveMQBufferpublic void writeBytes(org.apache.activemq.artemis.api.core.ActiveMQBuffer src,
int srcIndex,
int length)
writeBytes in interface org.apache.activemq.artemis.api.core.ActiveMQBufferCopyright © 2023 The Apache Software Foundation. All rights reserved.