public class RequestPacket extends AbstractLocalPacket
header = "rulename MODETRANS" middle = way+"FILENAME BLOCKSIZE RANK specialId code (optional length)" end = "fileInformation"
or
header = "{rule:rulename, mode:MODETRANS}" middle = way{filename:FILENAME, block:BLOCKSIZE, rank:RANK, id:specialId, code:code, length:length}" end = "fileInformation"
Modifier and Type | Class and Description |
---|---|
protected static class |
RequestPacket.FIELDS |
static class |
RequestPacket.TRANSFERMODE |
Modifier and Type | Field and Description |
---|---|
protected int |
blocksize |
protected char |
code |
protected String |
filename |
protected long |
limit |
protected int |
mode |
protected long |
originalSize |
protected int |
rank |
protected static byte |
REQANSWERVALIDATE |
protected static byte |
REQVALIDATE |
protected String |
rulename |
protected String |
separator |
protected long |
specialId |
protected String |
transferInformation |
protected byte |
way |
EMPTY_ARRAY, end, global, header, LOCAL_HEADER_SIZE, middle
Constructor and Description |
---|
RequestPacket(String rulename,
int mode,
String filename,
int blocksize,
int rank,
long specialId,
String transferInformation,
long originalSize,
String separator) |
Modifier and Type | Method and Description |
---|---|
void |
createAllBuffers(LocalChannelReference lcr,
int networkHeader)
Prepare the 3 buffers Header, Middle and End
|
void |
createEnd(LocalChannelReference lcr)
Prepare the End buffer
|
static RequestPacket |
createFromBuffer(int headerLength,
int middleLength,
int endLength,
io.netty.buffer.ByteBuf buf) |
void |
createHeader(LocalChannelReference lcr)
Prepare the Header buffer
|
void |
createMiddle(LocalChannelReference lcr)
Prepare the Middle buffer
|
int |
getBlocksize() |
char |
getCode() |
String |
getFilename() |
long |
getLimit() |
int |
getMode() |
static int |
getModeMD5(int mode) |
long |
getOriginalSize() |
int |
getRank() |
String |
getRulename() |
long |
getSpecialId() |
String |
getTransferInformation() |
byte |
getType() |
boolean |
hasGlobalBuffer() |
static boolean |
isCompatibleMode(int mode1,
int mode2) |
static boolean |
isMD5Mode(int mode) |
static boolean |
isRecvMode(int mode) |
static boolean |
isRecvThroughMode(int mode) |
static boolean |
isRecvThroughMode(int mode,
boolean isRequested) |
boolean |
isRetrieve() |
static boolean |
isSendMode(int mode) |
static boolean |
isSendThroughMode(int mode) |
static boolean |
isSendThroughMode(int mode,
boolean isRequested) |
static boolean |
isThroughMode(int mode) |
boolean |
isToValidate() |
void |
setCode(char code) |
void |
setFilename(String filename) |
void |
setLimit(long limit) |
void |
setOriginalSize(long originalSize) |
void |
setRank(int rank) |
void |
setSpecialId(long specialId) |
String |
toString() |
void |
validate()
Validate the request
|
clear, getLocalPacket, getLocalPacketForNetworkPacket, retain
protected static final byte REQVALIDATE
protected static final byte REQANSWERVALIDATE
protected final String rulename
protected final int mode
protected String filename
protected final int blocksize
protected int rank
protected long specialId
protected byte way
protected char code
protected long originalSize
protected long limit
protected final String transferInformation
protected String separator
public static int getModeMD5(int mode)
mode
- public static boolean isRecvMode(int mode)
mode
- public static boolean isSendThroughMode(int mode, boolean isRequested)
mode
- isRequested
- public static boolean isSendThroughMode(int mode)
mode
- public static boolean isRecvThroughMode(int mode, boolean isRequested)
mode
- isRequested
- public static boolean isRecvThroughMode(int mode)
mode
- public static boolean isSendMode(int mode)
public static boolean isThroughMode(int mode)
mode
- public static boolean isMD5Mode(int mode)
mode
- public static boolean isCompatibleMode(int mode1, int mode2)
mode1
- mode2
- public static RequestPacket createFromBuffer(int headerLength, int middleLength, int endLength, io.netty.buffer.ByteBuf buf) throws OpenR66ProtocolPacketException
headerLength
- middleLength
- endLength
- buf
- OpenR66ProtocolPacketException
public final boolean hasGlobalBuffer()
hasGlobalBuffer
in class AbstractLocalPacket
public final void createAllBuffers(LocalChannelReference lcr, int networkHeader)
AbstractLocalPacket
createAllBuffers
in class AbstractLocalPacket
public final void createEnd(LocalChannelReference lcr)
AbstractLocalPacket
createEnd
in class AbstractLocalPacket
public final void createHeader(LocalChannelReference lcr) throws OpenR66ProtocolPacketException
AbstractLocalPacket
createHeader
in class AbstractLocalPacket
OpenR66ProtocolPacketException
public final void createMiddle(LocalChannelReference lcr) throws OpenR66ProtocolPacketException
AbstractLocalPacket
createMiddle
in class AbstractLocalPacket
OpenR66ProtocolPacketException
public final byte getType()
getType
in class AbstractLocalPacket
public final String toString()
toString
in class AbstractLocalPacket
public final String getRulename()
public final String getFilename()
public final int getMode()
public final boolean isRetrieve()
public final String getTransferInformation()
public final int getBlocksize()
public final int getRank()
public final void setRank(int rank)
rank
- the rank to setpublic final long getOriginalSize()
public final void setOriginalSize(long originalSize)
originalSize
- the originalSize to setpublic final void setSpecialId(long specialId)
specialId
- the specialId to setpublic final long getSpecialId()
public final boolean isToValidate()
public final void validate()
public void setFilename(String filename)
filename
- the filename to setpublic final char getCode()
public final void setCode(char code)
code
- the code to setpublic final long getLimit()
public final void setLimit(long limit)
Copyright © 2009–2022 Waarp. All rights reserved.