public abstract class FtpConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
protected long |
delayLimit
Delay in ms between two checks
|
static io.netty.util.AttributeKey<FtpSession> |
FTP_SESSION_ATTRIBUTE_KEY |
static String |
FTP_SESSION_ATTRIBUTE_KEY_NAME |
static Object |
ftpConfiguration
Global Accessor
|
protected long |
serverChannelReadLimit
Limit in Read byte/s to apply by session to the FTP Server
|
protected long |
serverChannelWriteLimit
Limit in Write byte/s to apply by session to the FTP Server
|
protected long |
serverGlobalReadLimit
Limit in Read byte/s to apply globally to the FTP Server
|
protected long |
serverGlobalWriteLimit
Limit in Write byte/s to apply globally to the FTP Server
|
Modifier | Constructor and Description |
---|---|
protected |
FtpConfiguration(Class<?> classtype,
Class<? extends BusinessHandler> businessHandler,
Class<? extends DataBusinessHandler> dataBusinessHandler,
FileParameterInterface fileParameter)
Simple constructor
|
Modifier and Type | Method and Description |
---|---|
void |
bindLock()
In bind/unbind operation, lock
|
void |
bindUnlock()
In bind/unbind operation, unlock
|
void |
changeNetworkLimit(long writeLimit,
long readLimit)
Reset the global monitor for bandwidth limitation and change future
channel
monitors with values divided by
10 (channel = global / 10)
|
boolean |
checkPassword(String password)
Check the password for Shutdown
|
void |
computeNbThreads()
Compute number of threads for both client and server from the real number
of available processors (double +
1) if the value is less than 64 threads.
|
void |
delFtpSession(InetAddress ipOnly,
InetSocketAddress fullIp)
Remove the FtpSession
|
int |
getActivePassiveMode() |
String |
getBaseDirectory() |
int |
getBlocksize() |
int |
getClientThread() |
Class<? extends DataBusinessHandler> |
getDataBusinessHandler() |
static long |
getDataTimeoutCon() |
long |
getDelayLimit() |
FileParameterInterface |
getFileParameter() |
File |
getFileProperty(String key) |
FtpInternalConfiguration |
getFtpInternalConfiguration() |
FtpSession |
getFtpSession(io.netty.channel.Channel channel,
boolean active)
Return and remove the FtpSession
|
int |
getIntProperty(String key) |
int |
getMaxGlobalMemory() |
abstract int |
getNextRangePort()
Return the next available port for passive connections.
|
Object |
getProperty(String key) |
String |
getServerAddress() |
long |
getServerChannelReadLimit() |
long |
getServerChannelWriteLimit() |
long |
getServerGlobalReadLimit() |
long |
getServerGlobalWriteLimit() |
int |
getServerPort() |
int |
getServerThread() |
WaarpShutdownHook.ShutdownConfiguration |
getShutdownConfiguration() |
String |
getStringProperty(String key) |
long |
getTimeoutCon() |
String |
getUniqueExtension() |
abstract void |
inShutdownProcess()
Shutdown process is on going
|
boolean |
isDeleteOnAbort() |
boolean |
isShutdown() |
void |
releaseResources()
To use if any external resources are to be released when shutting down
|
void |
serverStartup()
Init internal configuration
|
void |
setActivePassiveMode(int activePassiveModeArg) |
void |
setBaseDirectory(String dir) |
void |
setBlocksize(int bLOCKSIZE) |
void |
setClientThread(int clientThread0) |
static void |
setDataTimeoutCon(long dATATIMEOUTCON) |
void |
setDeleteOnAbort(boolean deleteOnAbort) |
void |
setFileProperty(String key,
File f) |
void |
setIntProperty(String key,
int i) |
void |
setMaxGlobalMemory(int maxGlobalMemory) |
void |
setNewFtpSession(InetAddress ipOnly,
InetSocketAddress fullIp,
FtpSession session)
Add a session from a couple of addresses
|
void |
setPassword(String password) |
void |
setProperty(String key,
Object o) |
void |
setServerAddress(String address) |
void |
setServerPort(int port) |
void |
setServerThread(int serverThread0) |
void |
setShutdown(boolean isShutdown) |
void |
setStringProperty(String key,
String s) |
void |
setTimeoutCon(long tIMEOUTCON) |
public static final String FTP_SESSION_ATTRIBUTE_KEY_NAME
public static final io.netty.util.AttributeKey<FtpSession> FTP_SESSION_ATTRIBUTE_KEY
public static Object ftpConfiguration
protected long serverGlobalWriteLimit
protected long serverGlobalReadLimit
protected long serverChannelWriteLimit
protected long serverChannelReadLimit
protected long delayLimit
protected FtpConfiguration(Class<?> classtype, Class<? extends BusinessHandler> businessHandler, Class<? extends DataBusinessHandler> dataBusinessHandler, FileParameterInterface fileParameter)
classtype
- OwnerbusinessHandler
- class that will be used for
BusinessHandlerdataBusinessHandler
- class that will be used for
DataBusinessHandlerfileParameter
- the FileParameterInterface to usedpublic final String getStringProperty(String key) throws FtpUnknownFieldException
key
- FtpUnknownFieldException
public final int getIntProperty(String key) throws FtpUnknownFieldException
key
- FtpUnknownFieldException
public final File getFileProperty(String key) throws FtpUnknownFieldException
key
- FtpUnknownFieldException
public final Object getProperty(String key) throws FtpUnknownFieldException
key
- FtpUnknownFieldException
public final int getServerPort()
public final String getServerAddress()
public final long getServerGlobalWriteLimit()
public final long getServerChannelWriteLimit()
public final long getServerGlobalReadLimit()
public final long getServerChannelReadLimit()
public final long getDelayLimit()
public boolean checkPassword(String password)
password
- public abstract int getNextRangePort()
public final String getBaseDirectory()
public final void setIntProperty(String key, int i)
key
- i
- public final void setServerPort(int port)
port
- the new portpublic final void setServerAddress(String address)
address
- the address to use while answering for addresspublic final void setBaseDirectory(String dir)
dir
- the new base directorypublic final void setPassword(String password)
password
- the new password for shutdownpublic final Class<? extends DataBusinessHandler> getDataBusinessHandler()
public final void serverStartup() throws FtpNoConnectionException
FtpNoConnectionException
public final void changeNetworkLimit(long writeLimit, long readLimit)
writeLimit
- readLimit
- public final void computeNbThreads()
public final void bindLock()
public final void bindUnlock()
public final FtpInternalConfiguration getFtpInternalConfiguration()
public final void setNewFtpSession(InetAddress ipOnly, InetSocketAddress fullIp, FtpSession session)
ipOnly
- fullIp
- session
- public final FtpSession getFtpSession(io.netty.channel.Channel channel, boolean active)
channel
- active
- public final void delFtpSession(InetAddress ipOnly, InetSocketAddress fullIp)
ipOnly
- fullIp
- public final FileParameterInterface getFileParameter()
public final String getUniqueExtension()
public void releaseResources()
public abstract void inShutdownProcess()
public final boolean isShutdown()
public final void setShutdown(boolean isShutdown)
isShutdown
- the isShutdown to setpublic final int getServerThread()
public final void setServerThread(int serverThread0)
serverThread0
- the sERVER_THREAD to setpublic final int getClientThread()
public final void setClientThread(int clientThread0)
clientThread0
- the cLIENT_THREAD to setpublic final long getTimeoutCon()
public final void setTimeoutCon(long tIMEOUTCON)
tIMEOUTCON
- the tIMEOUTCON to setpublic final int getBlocksize()
public final void setBlocksize(int bLOCKSIZE)
bLOCKSIZE
- the bLOCKSIZE to setpublic final boolean isDeleteOnAbort()
public final void setDeleteOnAbort(boolean deleteOnAbort)
deleteOnAbort
- the deleteOnAbort to setpublic static long getDataTimeoutCon()
public static void setDataTimeoutCon(long dATATIMEOUTCON)
dATATIMEOUTCON
- the dATATIMEOUTCON to setpublic final int getActivePassiveMode()
public final void setActivePassiveMode(int activePassiveModeArg)
activePassiveModeArg
- the mode to set (1 = Active, -1 = Passive, 0 = Both - default -)public final int getMaxGlobalMemory()
public final void setMaxGlobalMemory(int maxGlobalMemory)
maxGlobalMemory
- the maxGlobalMemory to setpublic final WaarpShutdownHook.ShutdownConfiguration getShutdownConfiguration()
Copyright © 2009–2022 Waarp. All rights reserved.