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 |
fileInformation |
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 byte |
way |
end, header, middle
Constructor and Description |
---|
RequestPacket(String rulename,
int mode,
String filename,
int blocksize,
int rank,
long specialId,
String fileInformation,
long originalSize,
String separator) |
Modifier and Type | Method and Description |
---|---|
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 |
getFileInformation() |
String |
getFilename() |
long |
getLimit() |
int |
getMode() |
static int |
getModeMD5(int mode) |
long |
getOriginalSize() |
int |
getRank() |
String |
getRulename() |
long |
getSpecialId() |
byte |
getType() |
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, 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 fileInformation
protected String separator
public static final int getModeMD5(int mode)
mode
- public static final boolean isRecvMode(int mode)
mode
- public static final boolean isSendThroughMode(int mode, boolean isRequested)
mode
- isRequested
- public static final boolean isSendThroughMode(int mode)
mode
- public static final boolean isRecvThroughMode(int mode, boolean isRequested)
mode
- isRequested
- public static final boolean isRecvThroughMode(int mode)
mode
- public static final boolean isSendMode(int mode)
public static final boolean isThroughMode(int mode)
mode
- public static final boolean isMD5Mode(int mode)
mode
- public static final 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 void createEnd(LocalChannelReference lcr) throws OpenR66ProtocolPacketException
AbstractLocalPacket
createEnd
in class AbstractLocalPacket
OpenR66ProtocolPacketException
public void createHeader(LocalChannelReference lcr) throws OpenR66ProtocolPacketException
AbstractLocalPacket
createHeader
in class AbstractLocalPacket
OpenR66ProtocolPacketException
public void createMiddle(LocalChannelReference lcr) throws OpenR66ProtocolPacketException
AbstractLocalPacket
createMiddle
in class AbstractLocalPacket
OpenR66ProtocolPacketException
public byte getType()
getType
in class AbstractLocalPacket
public String toString()
toString
in class AbstractLocalPacket
public String getRulename()
public String getFilename()
public int getMode()
public boolean isRetrieve()
public String getFileInformation()
public int getBlocksize()
public int getRank()
public void setRank(int rank)
rank
- the rank to setpublic long getOriginalSize()
public void setOriginalSize(long originalSize)
originalSize
- the originalSize to setpublic void setSpecialId(long specialId)
specialId
- the specialId to setpublic long getSpecialId()
public boolean isToValidate()
public void validate()
public void setFilename(String filename)
filename
- the filename to setpublic char getCode()
public void setCode(char code)
code
- the code to setpublic long getLimit()
public void setLimit(long limit)
Copyright © 2009–2020 Waarp. All rights reserved.